Skip to content

Commit ec32db7

Browse files
committed
fix(scripts): use module in scripts
1 parent af987f4 commit ec32db7

21 files changed

+46
-46
lines changed

scripts/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fsp from 'fs/promises';
22

33
import { hashElement } from 'folder-hash';
44

5-
import { exists } from './common';
5+
import { exists } from './common.js';
66

77
export class Cache {
88
folder: string;

scripts/ci/codegen/createGitHubReleases.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { ensureGitHubToken, getOctokit, OWNER, run, setVerbose, toAbsolutePath } from '../../common';
2-
import { isPreRelease } from '../../release/versionsHistory';
3-
import type { Language } from '../../types';
4-
import { cloneRepository } from '../utils';
1+
import { ensureGitHubToken, getOctokit, OWNER, run, setVerbose, toAbsolutePath } from '../../common.js';
2+
import { isPreRelease } from '../../release/versionsHistory.js';
3+
import type { Language } from '../../types.js';
4+
import { cloneRepository } from '../utils.js';
55

6-
import { commitStartRelease } from './text';
6+
import { commitStartRelease } from './text.js';
77

88
async function createGitHubRelease(lang: Language): Promise<void> {
99
// **Full Changelog**:

scripts/ci/codegen/waitForAllReleases.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { components } from '@octokit/openapi-types';
22

3-
import { exists, getOctokit, run, setVerbose, toAbsolutePath } from '../../common';
4-
import { getClientsConfigField, getLanguageFolder } from '../../config';
5-
import { getTargetBranch } from '../../release/common';
6-
import type { Language } from '../../types';
3+
import { exists, getOctokit, run, setVerbose, toAbsolutePath } from '../../common.js';
4+
import { getClientsConfigField, getLanguageFolder } from '../../config.js';
5+
import { getTargetBranch } from '../../release/common.js';
6+
import type { Language } from '../../types.js';
77

8-
import { commitStartRelease } from './text';
8+
import { commitStartRelease } from './text.js';
99

1010
type Run = {
1111
language: Language;

scripts/cli/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import { CI, CLIENTS, LANGUAGES, run, setVerbose, toAbsolutePath } from '../comm
66
import { getLanguageFolder } from '../config.js';
77
import { ctsGenerateMany } from '../cts/generate.js';
88
import { runCts } from '../cts/runCts.js';
9-
import { startTestServer } from '../cts/testServer';
9+
import { startTestServer } from '../cts/testServer/index.js';
1010
import { docsGenerateMany } from '../docs/generate.js';
1111
import { formatter } from '../formatter.js';
1212
import { generate } from '../generate.js';
1313
import { playground } from '../playground.js';
1414
import { createReleasePR } from '../release/createReleasePR.js';
1515
import { generateVersionsHistory } from '../release/versionsHistory.js';
16-
import { buildSpecs } from '../specs';
16+
import { buildSpecs } from '../specs/index.js';
1717
import type { Language } from '../types.js';
1818

1919
import { existsSync } from 'node:fs';

scripts/common.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { remove } from 'fs-extra';
99
import clientsConfig from '../config/clients.config.json' assert { type: 'json' };
1010
import releaseConfig from '../config/release.config.json' assert { type: 'json' };
1111

12-
import { Cache } from './cache';
13-
import { getDockerImage } from './config';
14-
import { generateOpenapitools } from './pre-gen';
12+
import { Cache } from './cache.js';
13+
import { getDockerImage } from './config.js';
14+
import { generateOpenapitools } from './pre-gen/index.js';
1515
import { getGitAuthor } from './release/common.js';
16-
import { buildSpecs } from './specs';
16+
import { buildSpecs } from './specs/index.js';
1717
import { createSpinner } from './spinners.js';
1818
import type { Generator, GeneratorMode, Language, RunOptions } from './types.js';
1919

scripts/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import clientsConfig from '../config/clients.config.json' assert { type: 'json' };
22

3-
import { CI } from './common';
3+
import { CI } from './common.js';
44
import type { Language, LanguageConfig } from './types.js';
55

66
export function getClientsConfigField(

scripts/cts/runCts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { getTestOutputFolder } from '../config.js';
55
import { createSpinner } from '../spinners.js';
66
import type { Language } from '../types.js';
77

8-
import { startTestServer } from './testServer';
98
import { printBenchmarkReport } from './testServer/benchmark.js';
109
import { assertChunkWrapperValid } from './testServer/chunkWrapper.js';
10+
import { startTestServer } from './testServer/index.js';
1111
import { assertValidReplaceAllObjects } from './testServer/replaceAllObjects.js';
1212
import { assertValidTimeouts } from './testServer/timeout.js';
1313
import { assertValidWaitForApiKey } from './testServer/waitFor.js';

scripts/cts/testServer/apiKey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Server } from 'http';
33
import { expect } from 'chai';
44
import type { Express, Request, Response } from 'express';
55

6-
import { setupServer } from '.';
6+
import { setupServer } from './index.js';
77

88
// Checks that the client sends a different API key after the first request.
99
function addRoutes(app: Express): void {

scripts/cts/testServer/benchmark.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import chalk from 'chalk';
66
import type { Express } from 'express';
77
import express from 'express';
88

9-
import { CI, toAbsolutePath } from '../../common';
9+
import { CI, toAbsolutePath } from '../../common.js';
1010

11-
import { setupServer } from '.';
11+
import { setupServer } from './index.js';
1212

1313
const benchmarkStatus: Record<
1414
string,

scripts/cts/testServer/chunkWrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { expect } from 'chai';
44
import type { Express } from 'express';
55
import express from 'express';
66

7-
import { setupServer } from '.';
7+
import { setupServer } from './index.js';
88

99
const chunkWrapperState: Record<string, any> = {};
1010

0 commit comments

Comments
 (0)