@vscode/test-web 0.0.76 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@
19
19
  "request-light": "^0.8.0",
20
20
  "ts-loader": "^9.5.4",
21
21
  "vscode-uri": "^3.1.0",
22
- "webpack": "^5.102.1",
22
+ "webpack": "^5.103.0",
23
23
  "webpack-cli": "^6.0.1"
24
24
  },
25
25
  "engines": {
@@ -28,12 +28,12 @@
28
28
  },
29
29
  "..": {
30
30
  "name": "@vscode/test-web",
31
- "version": "0.0.75",
31
+ "version": "0.0.77",
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
34
  "@koa/cors": "^5.0.0",
35
- "@koa/router": "^14.0.0",
36
- "@playwright/browser-chromium": "^1.56.1",
35
+ "@koa/router": "^15.0.0",
36
+ "@playwright/browser-chromium": "^1.57.0",
37
37
  "gunzip-maybe": "^1.4.2",
38
38
  "http-proxy-agent": "^7.0.2",
39
39
  "https-proxy-agent": "^7.0.6",
@@ -42,7 +42,7 @@
42
42
  "koa-mount": "^4.2.0",
43
43
  "koa-static": "^5.0.0",
44
44
  "minimist": "^1.2.8",
45
- "playwright": "^1.56.1",
45
+ "playwright": "^1.57.0",
46
46
  "tar-fs": "^3.1.1",
47
47
  "tinyglobby": "^0.2.15",
48
48
  "vscode-uri": "^3.1.0"
@@ -51,9 +51,9 @@
51
51
  "vscode-test-web": "out/server/index.js"
52
52
  },
53
53
  "devDependencies": {
54
- "@eslint/eslintrc": "^3.3.1",
54
+ "@eslint/eslintrc": "^3.3.3",
55
55
  "@eslint/js": "^9.39.1",
56
- "@tony.ganchev/eslint-plugin-header": "^3.1.8",
56
+ "@tony.ganchev/eslint-plugin-header": "^3.1.11",
57
57
  "@types/gunzip-maybe": "^1.4.3",
58
58
  "@types/koa": "^3.0.1",
59
59
  "@types/koa__router": "^12.0.5",
@@ -63,8 +63,8 @@
63
63
  "@types/minimist": "^1.2.5",
64
64
  "@types/node": "^20.16.13",
65
65
  "@types/tar-fs": "^2.0.4",
66
- "@typescript-eslint/eslint-plugin": "^8.46.3",
67
- "@typescript-eslint/parser": "^8.46.3",
66
+ "@typescript-eslint/eslint-plugin": "^8.48.1",
67
+ "@typescript-eslint/parser": "^8.48.1",
68
68
  "eslint": "^9.39.1",
69
69
  "typescript": "^5.9.3"
70
70
  },
@@ -1068,13 +1068,17 @@
1068
1068
  }
1069
1069
  },
1070
1070
  "node_modules/loader-runner": {
1071
- "version": "4.2.0",
1072
- "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz",
1073
- "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==",
1071
+ "version": "4.3.1",
1072
+ "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.1.tgz",
1073
+ "integrity": "sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q==",
1074
1074
  "dev": true,
1075
1075
  "license": "MIT",
1076
1076
  "engines": {
1077
1077
  "node": ">=6.11.5"
1078
+ },
1079
+ "funding": {
1080
+ "type": "opencollective",
1081
+ "url": "https://opencollective.com/webpack"
1078
1082
  }
1079
1083
  },
1080
1084
  "node_modules/locate-path": {
@@ -1712,9 +1716,9 @@
1712
1716
  }
1713
1717
  },
1714
1718
  "node_modules/webpack": {
1715
- "version": "5.102.1",
1716
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.102.1.tgz",
1717
- "integrity": "sha512-7h/weGm9d/ywQ6qzJ+Xy+r9n/3qgp/thalBbpOi5i223dPXKi04IBtqPN9nTd+jBc7QKfvDbaBnFipYp4sJAUQ==",
1719
+ "version": "5.103.0",
1720
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.103.0.tgz",
1721
+ "integrity": "sha512-HU1JOuV1OavsZ+mfigY0j8d1TgQgbZ6M+J75zDkpEAwYeXjWSqrGJtgnPblJjd/mAyTNQ7ygw0MiKOn6etz8yw==",
1718
1722
  "dev": true,
1719
1723
  "license": "MIT",
1720
1724
  "dependencies": {
@@ -1735,7 +1739,7 @@
1735
1739
  "glob-to-regexp": "^0.4.1",
1736
1740
  "graceful-fs": "^4.2.11",
1737
1741
  "json-parse-even-better-errors": "^2.3.1",
1738
- "loader-runner": "^4.2.0",
1742
+ "loader-runner": "^4.3.1",
1739
1743
  "mime-types": "^2.1.27",
1740
1744
  "neo-async": "^2.6.2",
1741
1745
  "schema-utils": "^4.3.3",
@@ -47,7 +47,7 @@
47
47
  "request-light": "^0.8.0",
48
48
  "ts-loader": "^9.5.4",
49
49
  "vscode-uri": "^3.1.0",
50
- "webpack": "^5.102.1",
50
+ "webpack": "^5.103.0",
51
51
  "webpack-cli": "^6.0.1"
52
52
  },
53
53
  "dependencies": {
@@ -65,7 +65,7 @@ export interface Options {
65
65
  */
66
66
  coi?: boolean;
67
67
  /**
68
- * If set, serves the page with ESM usage.
68
+ * If set to true, serves the page with ESM usage, if set to false, serves the page with AMD usage. If not set, ESM is used if the build supports it.
69
69
  */
70
70
  esm?: boolean;
71
71
  /**
@@ -29,7 +29,7 @@ async function runTests(options) {
29
29
  extensionPaths: options.extensionPaths,
30
30
  extensionIds: options.extensionIds,
31
31
  coi: !!options.coi,
32
- esm: !!options.esm,
32
+ esm: options.esm,
33
33
  };
34
34
  const host = options.host ?? 'localhost';
35
35
  const port = options.port ?? 3000;
@@ -95,7 +95,7 @@ async function open(options) {
95
95
  extensionPaths: options.extensionPaths,
96
96
  extensionIds: options.extensionIds,
97
97
  coi: !!options.coi,
98
- esm: !!options.esm,
98
+ esm: options.esm,
99
99
  };
100
100
  const host = options.host ?? 'localhost';
101
101
  const port = options.port ?? 3000;
@@ -179,6 +179,9 @@ function validateBooleanOrUndefined(options, name) {
179
179
  if (value === undefined || typeof value === 'boolean') {
180
180
  return value;
181
181
  }
182
+ if (value === null) {
183
+ return undefined;
184
+ }
182
185
  console.log(`'${name}' needs to be a boolean value.`);
183
186
  showHelp();
184
187
  process.exit(-1);
@@ -372,7 +375,7 @@ function showHelp() {
372
375
  console.log(` --headless: Whether to hide the browser. Defaults to true when an extensionTestsPath is provided, otherwise false. [Optional]`);
373
376
  console.log(` --permission: Permission granted in the opened browser: e.g. 'clipboard-read', 'clipboard-write'. [Optional, Multiple]`);
374
377
  console.log(` --coi: Enables cross origin isolation [Optional]`);
375
- console.log(` --esm: Serve the ESM variant of VS Code [Optional]`);
378
+ console.log(` --esm: If set to true, serves the page with ESM loader, if set to false, serves the page with AMD loader. If not set, ESM is used if the build supports it. [Optional]`);
376
379
  console.log(` --folder-uri: workspace to open VS Code on. Ignored when folderPath is provided. [Optional]`);
377
380
  console.log(` --extensionPath: A path pointing to a folder containing additional extensions to include [Optional, Multiple]`);
378
381
  console.log(` --extensionId: The id of an extension include. The format is '\${publisher}.\${name}'. Append '@prerelease' to use a prerelease version [Optional, Multiple]`);
@@ -396,6 +399,9 @@ async function cliMain() {
396
399
  const options = {
397
400
  string: ['extensionDevelopmentPath', 'extensionTestsPath', 'browser', 'browserOption', 'browserType', 'quality', 'version', 'commit', 'waitForDebugger', 'folder-uri', 'permission', 'extensionPath', 'extensionId', 'sourcesPath', 'host', 'port', 'testRunnerDataDir'],
398
401
  boolean: ['open-devtools', 'headless', 'hideServerLog', 'printServerLog', 'help', 'verbose', 'coi', 'esm'],
402
+ default: {
403
+ esm: null
404
+ },
399
405
  unknown: arg => {
400
406
  if (arg.startsWith('-')) {
401
407
  console.log(`Unknown argument ${arg}`);
@@ -8,7 +8,7 @@ exports.fsProviderFolderUri = exports.fsProviderExtensionPrefix = void 0;
8
8
  exports.configureMounts = configureMounts;
9
9
  const kstatic = require("koa-static");
10
10
  const kmount = require("koa-mount");
11
- const Router = require("@koa/router");
11
+ const router_1 = require("@koa/router");
12
12
  const fs_1 = require("fs");
13
13
  const path = require("path");
14
14
  const mountPrefix = '/static/mount';
@@ -24,7 +24,7 @@ function configureMounts(config, app) {
24
24
  }
25
25
  }
26
26
  function fileOps(mountPrefix, folderMountPath) {
27
- const router = new Router();
27
+ const router = new router_1.default();
28
28
  router.get(`${mountPrefix}{/*path}`, async (ctx, next) => {
29
29
  if (ctx.query.stat !== undefined) {
30
30
  const p = path.join(folderMountPath, decodeURIComponent(ctx.path.substring(mountPrefix.length)));
@@ -8,7 +8,7 @@ exports.default = default_1;
8
8
  const path = require("path");
9
9
  const fs_1 = require("fs");
10
10
  const vscode_uri_1 = require("vscode-uri");
11
- const Router = require("@koa/router");
11
+ const router_1 = require("@koa/router");
12
12
  const extensions_1 = require("./extensions");
13
13
  const mounts_1 = require("./mounts");
14
14
  const download_1 = require("./download");
@@ -139,12 +139,12 @@ async function getWorkbenchOptions(ctx, config) {
139
139
  return options;
140
140
  }
141
141
  function default_1(config) {
142
- const router = new Router();
142
+ const router = new router_1.default();
143
143
  router.use(async (ctx, next) => {
144
144
  if (config.build.type === 'sources') {
145
145
  const builtInExtensions = await (0, extensions_1.getScannedBuiltinExtensions)(config.build.location);
146
146
  const productOverrides = await getProductOverrides(config.build.location);
147
- const esm = config.esm || await isESM(config.build.location);
147
+ const esm = config.esm ?? await isESM(config.build.location);
148
148
  console.log('Using ESM loader:', esm);
149
149
  const devCSSModules = esm ? await getDevCssModules(config.build.location) : [];
150
150
  ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, esm, devCSSModules, builtInExtensions, {
@@ -155,13 +155,17 @@ function default_1(config) {
155
155
  }
156
156
  else if (config.build.type === 'static') {
157
157
  const baseUrl = `${ctx.protocol}://${ctx.host}/static/build`;
158
- ctx.state.workbench = new Workbench(baseUrl, false, config.esm, [], [], {
158
+ const esm = config.esm ?? await isESM(config.build.location);
159
+ console.log('Using ESM loader:', esm);
160
+ ctx.state.workbench = new Workbench(baseUrl, false, esm, [], [], {
159
161
  webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build`,
160
162
  webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build/out/vs/workbench/contrib/webview/browser/pre/`
161
163
  });
162
164
  }
163
165
  else if (config.build.type === 'cdn') {
164
- ctx.state.workbench = new Workbench(config.build.uri, false, config.esm, []);
166
+ const esm = config.esm ?? true;
167
+ console.log('Using ESM loader:', esm);
168
+ ctx.state.workbench = new Workbench(config.build.uri, false, esm, []);
165
169
  }
166
170
  await next();
167
171
  });
@@ -191,13 +195,6 @@ async function getDevCssModules(vsCodeDevLocation) {
191
195
  return glob.glob('**/*.css', { cwd: path.join(vsCodeDevLocation, 'out') });
192
196
  }
193
197
  async function isESM(vsCodeDevLocation) {
194
- try {
195
- const packageJSON = await fs_1.promises.readFile(path.join(vsCodeDevLocation, 'out', 'package.json'));
196
- return JSON.parse(packageJSON.toString()).type === 'module';
197
- }
198
- catch (e) {
199
- // ignore
200
- }
201
198
  try {
202
199
  const packageJSON = await fs_1.promises.readFile(path.join(vsCodeDevLocation, 'package.json'));
203
200
  return JSON.parse(packageJSON.toString()).type === 'module';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/test-web",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "scripts": {
5
5
  "install-extensions": "npm i --prefix=fs-provider && npm i --prefix=sample",
6
6
  "compile": "tsc -b ./ && npm run compile-fs-provider",
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@koa/cors": "^5.0.0",
27
- "@koa/router": "^14.0.0",
28
- "@playwright/browser-chromium": "^1.56.1",
27
+ "@koa/router": "^15.2.0",
28
+ "@playwright/browser-chromium": "^1.57.0",
29
29
  "tinyglobby": "^0.2.15",
30
30
  "gunzip-maybe": "^1.4.2",
31
31
  "http-proxy-agent": "^7.0.2",
@@ -35,13 +35,13 @@
35
35
  "koa-mount": "^4.2.0",
36
36
  "koa-static": "^5.0.0",
37
37
  "minimist": "^1.2.8",
38
- "playwright": "^1.56.1",
38
+ "playwright": "^1.57.0",
39
39
  "tar-fs": "^3.1.1",
40
40
  "vscode-uri": "^3.1.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@eslint/eslintrc": "^3.3.1",
44
- "@eslint/js": "^9.39.1",
43
+ "@eslint/eslintrc": "^3.3.3",
44
+ "@eslint/js": "^9.39.2",
45
45
  "@types/gunzip-maybe": "^1.4.3",
46
46
  "@types/koa": "^3.0.1",
47
47
  "@types/koa__router": "^12.0.5",
@@ -51,10 +51,10 @@
51
51
  "@types/minimist": "^1.2.5",
52
52
  "@types/node": "^20.16.13",
53
53
  "@types/tar-fs": "^2.0.4",
54
- "@typescript-eslint/eslint-plugin": "^8.46.3",
55
- "@typescript-eslint/parser": "^8.46.3",
56
- "eslint": "^9.39.1",
57
- "@tony.ganchev/eslint-plugin-header": "^3.1.8",
54
+ "@typescript-eslint/eslint-plugin": "^8.52.0",
55
+ "@typescript-eslint/parser": "^8.52.0",
56
+ "eslint": "^9.39.2",
57
+ "@tony.ganchev/eslint-plugin-header": "^3.1.11",
58
58
  "typescript": "^5.9.3"
59
59
  },
60
60
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/favicon.ico" type="image/x-icon" />
27
27
  <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/manifest.json">
28
28
 
29
- <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css" />
29
+ <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.internal.css" />
30
30
  <style id="vscode-css-modules" type="text/css" media="screen"></style>
31
31
  </head>
32
32