Skip to content

Commit bb0f892

Browse files
committed
fix: rewrite remaining .js imports on multi-line from clauses
The previous sed only matched lines starting with import/export, missing multi-line imports where 'from' is on a continuation line. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a0a0ea0 commit bb0f892

11 files changed

Lines changed: 14 additions & 15 deletions

File tree

packages/dev-server-core/test/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
fetchText,
66
expectIncludes,
77
virtualFilesPlugin,
8-
} from '../src/test-helpers.js';
8+
} from '../src/test-helpers.ts';
99
import { DevServerCoreConfig } from '../src/server/DevServerCoreConfig.ts';
1010

1111
export function createTestServer(config: Partial<DevServerCoreConfig> = {}) {

packages/dev-server-import-maps/src/importMapsPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
shouldInject,
1818
mergeImportMaps,
1919
getDocumentBaseUrl,
20-
} from './utils.js';
20+
} from './utils.ts';
2121
import { ImportMap } from '@import-maps/resolve';
2222
import {
2323
createElement,

packages/dev-server-rollup/test/node/plugins/alias.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('@rollup/plugin-alias', () => {
1919

2020
try {
2121
const text = await fetchText(`${host}/app.js`);
22-
expectIncludes(text, "import moduleA from './module-a-stub.js'");
22+
expectIncludes(text, "import moduleA from './module-a-stub.ts'");
2323
} finally {
2424
server.stop();
2525
}

packages/dev-server-rollup/test/node/plugins/node-resolve.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('@rollup/plugin-node-resolve', () => {
1717

1818
try {
1919
const text = await fetchText(`${host}/app.js`);
20-
expectIncludes(text, "import moduleA from './node_modules/module-a/index.js'");
20+
expectIncludes(text, "import moduleA from './node_modules/module-a/index.ts'");
2121
} finally {
2222
server.stop();
2323
}

packages/dev-server-rollup/test/node/plugins/postcss.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ html {
4949
expectIncludes(text, 'export default');
5050
expectIncludes(
5151
text,
52-
"import styleInject from './node_modules/style-inject/dist/style-inject.es.js';",
52+
"import styleInject from './node_modules/style-inject/dist/style-inject.es.ts';",
5353
);
5454
expectIncludes(text, 'styleInject(css_248z);');
5555
} finally {

packages/dev-server-rollup/test/node/rollupBundlePlugin.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ describe('rollupBundlePlugin', () => {
4747

4848
try {
4949
const textA1 = await fetchText(`${host}/a1.js`);
50-
expectIncludes(textA1, "import { b as bc, d } from './__rollup-generated__d.js';");
50+
expectIncludes(textA1, "import { b as bc, d } from './__rollup-generated__d.ts';");
5151
expectIncludes(textA1, 'var a1 = `a ${bc} ${d}`;');
5252
expectIncludes(textA1, 'export { a1 as default };');
5353

5454
const textA2 = await fetchText(`${host}/a2.js`);
55-
expectIncludes(textA2, "import { b as bc, d } from './__rollup-generated__d.js';");
55+
expectIncludes(textA2, "import { b as bc, d } from './__rollup-generated__d.ts';");
5656
expectIncludes(textA2, 'var a2 = `a ${bc} ${d}`;');
5757
expectIncludes(textA2, 'export { a2 as default };');
5858

5959
const textA3 = await fetchText(`${host}/a3.js`);
60-
expectIncludes(textA3, "import { b as bc, d } from './__rollup-generated__d.js';");
60+
expectIncludes(textA3, "import { b as bc, d } from './__rollup-generated__d.ts';");
6161
expectIncludes(textA3, 'var a3 = `a ${bc} ${d}`;');
6262
expectIncludes(textA3, 'export { a3 as default };');
6363

@@ -85,7 +85,7 @@ describe('rollupBundlePlugin', () => {
8585

8686
try {
8787
const text = await fetchText(`${host}/not-bundled.js`);
88-
expectIncludes(text, "import a from './a.js';");
88+
expectIncludes(text, "import a from './a.ts';");
8989
expectIncludes(text, 'export default `not bundled ${a}`;');
9090
} finally {
9191
server.stop();

packages/dev-server-rollup/test/node/unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('@web/dev-server-rollup', () => {
7777

7878
try {
7979
const text = await fetchText(`${host}/app.js`);
80-
expectIncludes(text, "import moduleA from './src/foo.js'");
80+
expectIncludes(text, "import moduleA from './src/foo.ts'");
8181
} finally {
8282
server.stop();
8383
}

packages/rollup-plugin-html/src/input/extract/extractAssets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { type InputAsset } from '../InputData.ts';import {
77
isHashedAsset,
88
resolveAssetFilePath,
99
createAssetPicomatchMatcher,
10-
} from '../../assets/utils.js';
10+
} from '../../assets/utils.ts';
1111

1212
export interface ExtractAssetsParams {
1313
document: Document;

packages/rollup-plugin-html/src/output/injectedUpdatedAssetPaths.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import {
1111
createAssetPicomatchMatcher,
1212
} from '../assets/utils.ts';
1313
import { type InputData } from '../input/InputData.ts';import { createError } from '../utils.ts';
14-
import { type EmittedAssets } from './emitAssets.ts';
15-
import { toBrowserPath } from './utils.ts';
14+
import { type EmittedAssets } from './emitAssets.ts';import { toBrowserPath } from './utils.ts';
1615
export interface InjectUpdatedAssetPathsArgs {
1716
document: Document;
1817
input: InputData;

packages/rollup-plugin-html/test/src/output/getEntrypointBundles.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from 'chai';
22
import {
33
getEntrypointBundles,
44
createImportPath,
5-
} from '../../../src/output/getEntrypointBundles.js';
5+
} from '../../../src/output/getEntrypointBundles.ts';
66
import { GeneratedBundle, ScriptModuleTag } from '../../../src/RollupPluginHTMLOptions.ts';
77

88
describe('createImportPath()', () => {

0 commit comments

Comments
 (0)