Skip to content

Commit 3734527

Browse files
committed
fix: fix import type keywords and package subpath exports
- Copy browser-logs source from fix/node24 for correct `import type` - Add ./test-helpers.js to dev-server-core exports map for nodenext - Remove erroneous .js from bare package specifiers (@web/foo.js -> @web/foo) Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 183f4e7 commit 3734527

23 files changed

Lines changed: 41 additions & 39 deletions

File tree

packages/browser-logs/src/browserScript.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ import path from 'path';
44
const REGEXP_SOURCE_MAP = /\/\/# sourceMappingURL=.*/;
55

66
const serializeScript = fs
7-
.readFileSync(path.resolve(__dirname, 'serialize.js'), 'utf-8')
7+
.readFileSync(path.resolve(import.meta.dirname, 'serialize.js'), 'utf-8')
88
.replace(REGEXP_SOURCE_MAP, '');
99
const logUncaughtErrorsScript = fs
10-
.readFileSync(path.resolve(__dirname, 'logUncaughtErrors.js'), 'utf-8')
10+
.readFileSync(path.resolve(import.meta.dirname, 'logUncaughtErrors.js'), 'utf-8')
1111
.replace(REGEXP_SOURCE_MAP, '');
1212

1313
/**
14-
* Create the browser script. This project is compiled as CJS because it also needs to run in node, so
15-
* we create a small wrapper.
16-
*
17-
* It can't be ESM anyway, because it should work on older browsers as well.
14+
* Create the browser script as an IIFE wrapper.
15+
* It can't be ESM because it should work on older browsers as well.
1816
*/
1917
export const browserScript =
2018
'(function () { var module={};var exports={};\n' +

packages/browser-logs/src/deserialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ParseStackTraceOptions, parseStackTrace } from './parseStackTrace.ts';
1+
import { type ParseStackTraceOptions, parseStackTrace } from './parseStackTrace.ts';
22

33
const KEY_WTR_TYPE = '__WTR_TYPE__';
44
const KEY_CONSTRUCTOR_NAME = '__WTR_CONSTRUCTOR_NAME__';

packages/browser-logs/src/serialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function createReplacer() {
103103
}
104104

105105
if (type === 'symbol') {
106-
return (value as Symbol).toString();
106+
return (value as symbol).toString();
107107
}
108108

109109
if (type === 'object') {

packages/dev-server-core/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
"./test-helpers": {
2828
"types": "./test-helpers.d.ts",
2929
"default": "./dist/test-helpers.js"
30+
},
31+
"./test-helpers.js": {
32+
"types": "./test-helpers.d.ts",
33+
"default": "./dist/test-helpers.js"
3034
}
3135
},
3236
"engines": {

packages/dev-server-esbuild/test/ts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'path';
22
import { createTestServer } from '@web/dev-server-core/test-helpers.js';
33
import { expectIncludes, expectNotIncludes } from '@web/dev-server-core/test-helpers.js';
44
import type { Plugin as RollupPlugin } from 'rollup';
5-
import { fromRollup } from '@web/dev-server-rollup.js';
5+
import { fromRollup } from '@web/dev-server-rollup';
66

77
import { esbuildPlugin } from '../src/index.js';
88

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { describe, it } from 'node:test';
22
import rollupCommonjs from '@rollup/plugin-commonjs.ts';
33
import { runTests } from '@web/test-runner-core/test-helpers.js';
44
import { resolve } from 'path';
5-
import { chromeLauncher } from '@web/test-runner-chrome.js';
5+
import { chromeLauncher } from '@web/test-runner-chrome';
66

77
import * as path from 'path';
88
import { createTestServer, fetchText, expectIncludes } from '../test-helpers.ts';
99
import { fromRollup } from '../../../src/index.ts';
10-
import { nodeResolvePlugin } from '@web/dev-server.js';
10+
import { nodeResolvePlugin } from '@web/dev-server';
1111

1212
const commonjs = fromRollup(rollupCommonjs);
1313

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="../../../types/rollup-plugin-postcss" />
22
import rollupPostcss from 'rollup-plugin-postcss';
3-
import { chromeLauncher } from '@web/test-runner-chrome.js';
3+
import { chromeLauncher } from '@web/test-runner-chrome';
44
import { runTests } from '@web/test-runner-core/test-helpers.js';
55
import { resolve } from 'path';
66

packages/dev-server-rollup/test/node/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
} from '@web/dev-server-core/test-helpers';
8-
import type { DevServerCoreConfig, Logger } from '@web/dev-server-core.js';
8+
import type { DevServerCoreConfig, Logger } from '@web/dev-server-core';
99

1010
const __dirname = import.meta.dirname;
1111

packages/rollup-plugin-polyfills-loader/test/src/rollupPluginPolyfillsLoader.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { OutputChunk, rollup, OutputAsset, RollupOptions, OutputOptions } from '
33
import { expect } from 'chai';
44
import fs from 'fs';
55
import path from 'path';
6-
import { rollupPluginHTML as html } from '@web/rollup-plugin-html.js';
6+
import { rollupPluginHTML as html } from '@web/rollup-plugin-html';
77
import polyfillsLoader from '../../src/index.ts';
88

99
type Output = (OutputChunk | OutputAsset)[];

packages/rollup-plugin-polyfills-loader/test/src/utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, it } from 'node:test';
22
import assert from 'node:assert/strict';
3-
import { fileTypes } from '@web/polyfills-loader.js';
3+
import { fileTypes } from '@web/polyfills-loader';
44
import { shouldInjectLoader } from '../../src/utils.ts';
55

66
describe('shouldInjectLoader', () => {

0 commit comments

Comments
 (0)