@vscode/test-web 0.0.55 → 0.0.57

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.
@@ -0,0 +1,49 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ *--------------------------------------------------------------------------------------------*/
5
+
6
+ import header from "@tony.ganchev/eslint-plugin-header";
7
+ import tsParser from "@typescript-eslint/parser";
8
+ import path from "node:path";
9
+ import { fileURLToPath } from "node:url";
10
+ import js from "@eslint/js";
11
+ import { FlatCompat } from "@eslint/eslintrc";
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = path.dirname(__filename);
15
+ const compat = new FlatCompat({
16
+ baseDirectory: __dirname,
17
+ recommendedConfig: js.configs.recommended,
18
+ allConfig: js.configs.all
19
+ });
20
+
21
+ export default [{
22
+ ignores: ["**/*.d.ts", "**/*.test.ts", "**/*.js", "sample/**/*.*"],
23
+ }, ...compat.extends("plugin:@typescript-eslint/recommended"), {
24
+ plugins: {
25
+ header,
26
+ },
27
+
28
+ languageOptions: {
29
+ parser: tsParser,
30
+ ecmaVersion: 2018,
31
+ sourceType: "module",
32
+ },
33
+
34
+ rules: {
35
+ "@typescript-eslint/no-use-before-define": "off",
36
+ "@typescript-eslint/explicit-function-return-type": "off",
37
+ "@typescript-eslint/no-explicit-any": "off",
38
+ "@typescript-eslint/no-non-null-assertion": "off",
39
+ "@typescript-eslint/explicit-module-boundary-types": "off",
40
+ "@typescript-eslint/no-unused-vars": "off",
41
+ "@typescript-eslint/no-var-requires": "error",
42
+
43
+ "header/header": [
44
+ 2,
45
+ "block",
46
+ ["---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------"],
47
+ ],
48
+ },
49
+ }];
@@ -4,7 +4,7 @@
4
4
  /* 1 */
5
5
  /***/ ((__unused_webpack_module, exports) => {
6
6
 
7
- (()=>{"use strict";var e={};(()=>{var r=e;Object.defineProperty(r,"__esModule",{value:!0}),r.getErrorStatusDescription=r.xhr=r.configure=void 0,r.configure=(e,r)=>{},r.xhr=async e=>{const r=new Headers;if(e.headers)for(const t in e.headers){const o=e.headers[t];Array.isArray(o)?o.forEach((e=>r.set(t,e))):r.set(t,o)}e.user&&e.password&&r.set("Authorization","Basic "+btoa(e.user+":"+e.password));const t={method:e.type,redirect:e.followRedirects>0?"follow":"manual",mode:"cors",headers:r};if(e.data&&(t.body=e.data),e.token){const r=new AbortController;e.token.isCancellationRequested&&r.abort(),e.token.onCancellationRequested((()=>{r.abort()})),t.signal=r.signal}const o=new Request(e.url,t),s=await fetch(o),a={};s.headers.forEach(((e,r)=>{a[r]=e}));const n=await s.arrayBuffer();return new class{constructor(){this.status=s.status,this.headers=a}get responseText(){return(new TextDecoder).decode(n)}get body(){return new Uint8Array(n)}}},r.getErrorStatusDescription=function(e){return String(e)}})();var r=exports;for(var t in e)r[t]=e[t];e.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
7
+ (()=>{"use strict";var e={};(()=>{var r=e;Object.defineProperty(r,"__esModule",{value:!0}),r.xhr=r.configure=void 0,r.getErrorStatusDescription=function(e){return String(e)},r.configure=(e,r)=>{},r.xhr=async e=>{const r=new Headers;if(e.headers)for(const t in e.headers){const o=e.headers[t];Array.isArray(o)?o.forEach((e=>r.set(t,e))):r.set(t,o)}e.user&&e.password&&r.set("Authorization","Basic "+btoa(e.user+":"+e.password));const t={method:e.type,redirect:e.followRedirects>0?"follow":"manual",mode:"cors",headers:r};if(e.data&&(t.body=e.data),e.token){const r=new AbortController;e.token.isCancellationRequested&&r.abort(),e.token.onCancellationRequested((()=>{r.abort()})),t.signal=r.signal}const o=new Request(e.url,t),s=await fetch(o),a={};s.headers.forEach(((e,r)=>{a[r]=e}));const n=await s.arrayBuffer();return new class{constructor(){this.status=s.status,this.headers=a}get responseText(){return(new TextDecoder).decode(n)}get body(){return new Uint8Array(n)}}}})();var r=exports;for(var t in e)r[t]=e[t];e.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
8
8
 
9
9
  /***/ }),
10
10
  /* 2 */
@@ -9,14 +9,14 @@
9
9
  "version": "0.0.1",
10
10
  "license": "MIT",
11
11
  "devDependencies": {
12
- "@types/vscode": "^1.90.0",
13
- "minimatch": "9.0.5",
12
+ "@types/vscode": "^1.92.0",
13
+ "minimatch": "10.0.1",
14
14
  "path-browserify": "^1.0.1",
15
15
  "process": "^0.11.10",
16
- "request-light": "^0.7.0",
16
+ "request-light": "^0.8.0",
17
17
  "ts-loader": "^9.5.1",
18
18
  "vscode-uri": "^3.0.8",
19
- "webpack": "^5.92.1",
19
+ "webpack": "^5.94.0",
20
20
  "webpack-cli": "^5.1.4"
21
21
  },
22
22
  "engines": {
@@ -91,28 +91,6 @@
91
91
  "@jridgewell/sourcemap-codec": "^1.4.14"
92
92
  }
93
93
  },
94
- "node_modules/@types/eslint": {
95
- "version": "7.28.0",
96
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz",
97
- "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==",
98
- "dev": true,
99
- "license": "MIT",
100
- "dependencies": {
101
- "@types/estree": "*",
102
- "@types/json-schema": "*"
103
- }
104
- },
105
- "node_modules/@types/eslint-scope": {
106
- "version": "3.7.3",
107
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz",
108
- "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==",
109
- "dev": true,
110
- "license": "MIT",
111
- "dependencies": {
112
- "@types/eslint": "*",
113
- "@types/estree": "*"
114
- }
115
- },
116
94
  "node_modules/@types/estree": {
117
95
  "version": "1.0.5",
118
96
  "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
@@ -136,9 +114,9 @@
136
114
  }
137
115
  },
138
116
  "node_modules/@types/vscode": {
139
- "version": "1.90.0",
140
- "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.90.0.tgz",
141
- "integrity": "sha512-oT+ZJL7qHS9Z8bs0+WKf/kQ27qWYR3trsXpq46YDjFqBsMLG4ygGGjPaJ2tyrH0wJzjOEmDyg9PDJBBhWg9pkQ==",
117
+ "version": "1.92.0",
118
+ "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.92.0.tgz",
119
+ "integrity": "sha512-DcZoCj17RXlzB4XJ7IfKdPTcTGDLYvTOcTNkvtjXWF+K2TlKzHHkBEXNWQRpBIXixNEUgx39cQeTFunY0E2msw==",
142
120
  "dev": true
143
121
  },
144
122
  "node_modules/@webassemblyjs/ast": {
@@ -596,9 +574,9 @@
596
574
  "dev": true
597
575
  },
598
576
  "node_modules/enhanced-resolve": {
599
- "version": "5.17.0",
600
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
601
- "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
577
+ "version": "5.17.1",
578
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz",
579
+ "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==",
602
580
  "dev": true,
603
581
  "dependencies": {
604
582
  "graceful-fs": "^4.2.4",
@@ -995,15 +973,15 @@
995
973
  }
996
974
  },
997
975
  "node_modules/minimatch": {
998
- "version": "9.0.5",
999
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
1000
- "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
976
+ "version": "10.0.1",
977
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
978
+ "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
1001
979
  "dev": true,
1002
980
  "dependencies": {
1003
981
  "brace-expansion": "^2.0.1"
1004
982
  },
1005
983
  "engines": {
1006
- "node": ">=16 || 14 >=14.17"
984
+ "node": "20 || >=22"
1007
985
  },
1008
986
  "funding": {
1009
987
  "url": "https://github.com/sponsors/isaacs"
@@ -1170,11 +1148,10 @@
1170
1148
  }
1171
1149
  },
1172
1150
  "node_modules/request-light": {
1173
- "version": "0.7.0",
1174
- "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.7.0.tgz",
1175
- "integrity": "sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==",
1176
- "dev": true,
1177
- "license": "MIT"
1151
+ "version": "0.8.0",
1152
+ "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.8.0.tgz",
1153
+ "integrity": "sha512-bH6E4PMmsEXYrLX6Kr1vu+xI3HproB1vECAwaPSJeroLE1kpWE3HR27uB4icx+6YORu1ajqBJXxuedv8ZQg5Lw==",
1154
+ "dev": true
1178
1155
  },
1179
1156
  "node_modules/resolve": {
1180
1157
  "version": "1.22.1",
@@ -1550,12 +1527,11 @@
1550
1527
  }
1551
1528
  },
1552
1529
  "node_modules/webpack": {
1553
- "version": "5.92.1",
1554
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz",
1555
- "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==",
1530
+ "version": "5.94.0",
1531
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
1532
+ "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
1556
1533
  "dev": true,
1557
1534
  "dependencies": {
1558
- "@types/eslint-scope": "^3.7.3",
1559
1535
  "@types/estree": "^1.0.5",
1560
1536
  "@webassemblyjs/ast": "^1.12.1",
1561
1537
  "@webassemblyjs/wasm-edit": "^1.12.1",
@@ -1564,7 +1540,7 @@
1564
1540
  "acorn-import-attributes": "^1.9.5",
1565
1541
  "browserslist": "^4.21.10",
1566
1542
  "chrome-trace-event": "^1.0.2",
1567
- "enhanced-resolve": "^5.17.0",
1543
+ "enhanced-resolve": "^5.17.1",
1568
1544
  "es-module-lexer": "^1.2.1",
1569
1545
  "eslint-scope": "5.1.1",
1570
1546
  "events": "^3.2.0",
@@ -39,14 +39,14 @@
39
39
  "package-web": "webpack --mode production --devtool hidden-source-map"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/vscode": "^1.90.0",
43
- "minimatch": "9.0.5",
42
+ "@types/vscode": "^1.92.0",
43
+ "minimatch": "10.0.1",
44
44
  "ts-loader": "^9.5.1",
45
- "webpack": "^5.92.1",
45
+ "webpack": "^5.94.0",
46
46
  "webpack-cli": "^5.1.4",
47
47
  "process": "^0.11.10",
48
48
  "path-browserify": "^1.0.1",
49
- "request-light": "^0.7.0",
49
+ "request-light": "^0.8.0",
50
50
  "vscode-uri": "^3.0.8"
51
51
  }
52
52
  }
package/out/index.js CHANGED
@@ -2,7 +2,8 @@
2
2
  "use strict";
3
3
  /* eslint-disable header/header */
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.open = exports.runTests = void 0;
5
+ exports.runTests = runTests;
6
+ exports.open = open;
6
7
  /*---------------------------------------------------------------------------------------------
7
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
9
  * Licensed under the MIT License. See License.txt in the project root for license information.
@@ -71,7 +72,6 @@ async function runTests(options) {
71
72
  }
72
73
  });
73
74
  }
74
- exports.runTests = runTests;
75
75
  async function getBuild(options) {
76
76
  if (options.vsCodeDevPath) {
77
77
  return {
@@ -109,7 +109,6 @@ async function open(options) {
109
109
  },
110
110
  };
111
111
  }
112
- exports.open = open;
113
112
  async function openBrowser(endpoint, options, configPage) {
114
113
  if (options.browserType === 'none') {
115
114
  return undefined;
@@ -376,7 +375,8 @@ async function cliMain() {
376
375
  process.on('uncaughtException', (e) => {
377
376
  console.error('uncaughtException', e);
378
377
  });
379
- // eslint-disable-next-line @typescript-eslint/no-var-requires
378
+ /* eslint-disable @typescript-eslint/no-var-requires */
379
+ /* eslint-disable @typescript-eslint/no-require-imports */
380
380
  const manifest = require('../package.json');
381
381
  console.log(`${manifest.name}: ${manifest.version}`);
382
382
  const options = {
package/out/server/app.js CHANGED
@@ -4,6 +4,7 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = createApp;
7
8
  const fs_1 = require("fs");
8
9
  const Koa = require("koa");
9
10
  const morgan = require("koa-morgan");
@@ -95,4 +96,3 @@ async function createApp(config) {
95
96
  app.use((0, workbench_1.default)(config));
96
97
  return app;
97
98
  }
98
- exports.default = createApp;
@@ -4,7 +4,11 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.fileExists = exports.directoryExists = exports.fetchJSON = exports.fetch = exports.downloadAndUnzipVSCode = void 0;
7
+ exports.downloadAndUnzipVSCode = downloadAndUnzipVSCode;
8
+ exports.fetch = fetch;
9
+ exports.fetchJSON = fetchJSON;
10
+ exports.directoryExists = directoryExists;
11
+ exports.fileExists = fileExists;
8
12
  const fs_1 = require("fs");
9
13
  const path = require("path");
10
14
  const https = require("https");
@@ -76,7 +80,6 @@ async function downloadAndUnzipVSCode(quality, vscodeTestDir) {
76
80
  }
77
81
  return { type: 'static', location: downloadedPath, quality, version: info.version };
78
82
  }
79
- exports.downloadAndUnzipVSCode = downloadAndUnzipVSCode;
80
83
  async function fetch(api) {
81
84
  return new Promise((resolve, reject) => {
82
85
  const httpLibrary = api.startsWith('https') ? https : http;
@@ -97,7 +100,6 @@ async function fetch(api) {
97
100
  });
98
101
  });
99
102
  }
100
- exports.fetch = fetch;
101
103
  async function fetchJSON(api) {
102
104
  const data = await fetch(api);
103
105
  try {
@@ -107,7 +109,6 @@ async function fetchJSON(api) {
107
109
  throw new Error(`Failed to parse response from ${api}`);
108
110
  }
109
111
  }
110
- exports.fetchJSON = fetchJSON;
111
112
  let PROXY_AGENT = undefined;
112
113
  let HTTPS_PROXY_AGENT = undefined;
113
114
  if (process.env.npm_config_proxy) {
@@ -137,7 +138,6 @@ async function directoryExists(path) {
137
138
  return false;
138
139
  }
139
140
  }
140
- exports.directoryExists = directoryExists;
141
141
  async function fileExists(path) {
142
142
  try {
143
143
  const stats = await fs_1.promises.stat(path);
@@ -147,4 +147,3 @@ async function fileExists(path) {
147
147
  return false;
148
148
  }
149
149
  }
150
- exports.fileExists = fileExists;
@@ -4,7 +4,9 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getScannedBuiltinExtensions = exports.prebuiltExtensionsLocation = exports.scanForExtensions = void 0;
7
+ exports.prebuiltExtensionsLocation = void 0;
8
+ exports.scanForExtensions = scanForExtensions;
9
+ exports.getScannedBuiltinExtensions = getScannedBuiltinExtensions;
8
10
  const fs_1 = require("fs");
9
11
  const path = require("path");
10
12
  const download_1 = require("./download");
@@ -43,7 +45,6 @@ async function scanForExtensions(rootPath, serverURI) {
43
45
  await processFolder('');
44
46
  return result;
45
47
  }
46
- exports.scanForExtensions = scanForExtensions;
47
48
  exports.prebuiltExtensionsLocation = '.build/builtInExtensions';
48
49
  async function getScannedBuiltinExtensions(vsCodeDevLocation) {
49
50
  // use the build utility as to not duplicate the code
@@ -64,4 +65,3 @@ async function getScannedBuiltinExtensions(vsCodeDevLocation) {
64
65
  }
65
66
  return localExtensions.concat(prebuiltExtensions);
66
67
  }
67
- exports.getScannedBuiltinExtensions = getScannedBuiltinExtensions;
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.runServer = void 0;
7
+ exports.runServer = runServer;
8
8
  const app_1 = require("./app");
9
9
  async function runServer(host, port, config) {
10
10
  const app = await (0, app_1.default)(config);
@@ -18,4 +18,3 @@ async function runServer(host, port, config) {
18
18
  throw e;
19
19
  }
20
20
  }
21
- exports.runServer = runServer;
@@ -4,7 +4,8 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.configureMounts = exports.fsProviderFolderUri = exports.fsProviderExtensionPrefix = void 0;
7
+ exports.fsProviderFolderUri = exports.fsProviderExtensionPrefix = void 0;
8
+ exports.configureMounts = configureMounts;
8
9
  const kstatic = require("koa-static");
9
10
  const kmount = require("koa-mount");
10
11
  const Router = require("@koa/router");
@@ -22,7 +23,6 @@ function configureMounts(config, app) {
22
23
  app.use(kmount(exports.fsProviderExtensionPrefix, kstatic(path.join(__dirname, '../../fs-provider'), { hidden: true })));
23
24
  }
24
25
  }
25
- exports.configureMounts = configureMounts;
26
26
  function fileOps(mountPrefix, folderMountPath) {
27
27
  const router = new Router();
28
28
  router.get(`${mountPrefix}(/.*)?`, async (ctx, next) => {
@@ -4,6 +4,7 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.default = default_1;
7
8
  const path = require("path");
8
9
  const fs_1 = require("fs");
9
10
  const vscode_uri_1 = require("vscode-uri");
@@ -15,10 +16,11 @@ function asJSON(value) {
15
16
  return JSON.stringify(value).replace(/"/g, '"');
16
17
  }
17
18
  class Workbench {
18
- constructor(baseUrl, dev, esm, builtInExtensions = [], productOverrides) {
19
+ constructor(baseUrl, dev, esm, devCSSModules, builtInExtensions = [], productOverrides) {
19
20
  this.baseUrl = baseUrl;
20
21
  this.dev = dev;
21
22
  this.esm = esm;
23
+ this.devCSSModules = devCSSModules;
22
24
  this.builtInExtensions = builtInExtensions;
23
25
  this.productOverrides = productOverrides;
24
26
  }
@@ -32,6 +34,7 @@ class Workbench {
32
34
  WORKBENCH_WEB_BASE_URL: this.baseUrl,
33
35
  WORKBENCH_BUILTIN_EXTENSIONS: asJSON(this.builtInExtensions),
34
36
  WORKBENCH_MAIN: this.getMain(),
37
+ WORKBENCH_DEV_CSS_MODULES: JSON.stringify(this.devCSSModules)
35
38
  };
36
39
  try {
37
40
  const workbenchTemplate = (await fs_1.promises.readFile(path.resolve(__dirname, `../../views/workbench${this.esm ? '-esm' : ''}.html`))).toString();
@@ -112,7 +115,8 @@ function default_1(config) {
112
115
  if (config.build.type === 'sources') {
113
116
  const builtInExtensions = await (0, extensions_1.getScannedBuiltinExtensions)(config.build.location);
114
117
  const productOverrides = await getProductOverrides(config.build.location);
115
- ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, builtInExtensions, {
118
+ const devCSSModules = config.esm ? await getDevCssModules(config.build.location) : [];
119
+ ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, devCSSModules, builtInExtensions, {
116
120
  ...productOverrides,
117
121
  webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources`,
118
122
  webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources/out/vs/workbench/contrib/webview/browser/pre/`
@@ -120,13 +124,13 @@ function default_1(config) {
120
124
  }
121
125
  else if (config.build.type === 'static') {
122
126
  const baseUrl = `${ctx.protocol}://${ctx.host}/static/build`;
123
- ctx.state.workbench = new Workbench(baseUrl, false, config.esm, [], {
127
+ ctx.state.workbench = new Workbench(baseUrl, false, config.esm, [], [], {
124
128
  webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build`,
125
129
  webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build/out/vs/workbench/contrib/webview/browser/pre/`
126
130
  });
127
131
  }
128
132
  else if (config.build.type === 'cdn') {
129
- ctx.state.workbench = new Workbench(config.build.uri, false, config.esm);
133
+ ctx.state.workbench = new Workbench(config.build.uri, false, config.esm, []);
130
134
  }
131
135
  await next();
132
136
  });
@@ -143,7 +147,6 @@ function default_1(config) {
143
147
  });
144
148
  return router.routes();
145
149
  }
146
- exports.default = default_1;
147
150
  async function getProductOverrides(vsCodeDevLocation) {
148
151
  try {
149
152
  return JSON.parse((await fs_1.promises.readFile(path.join(vsCodeDevLocation, 'product.overrides.json'))).toString());
@@ -152,3 +155,7 @@ async function getProductOverrides(vsCodeDevLocation) {
152
155
  return undefined;
153
156
  }
154
157
  }
158
+ async function getDevCssModules(vsCodeDevLocation) {
159
+ const glob = await Promise.resolve().then(() => require('glob'));
160
+ return glob.glob('**/*.css', { cwd: path.join(vsCodeDevLocation, 'out') });
161
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@vscode/test-web",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "scripts": {
5
5
  "install-extensions": "npm i --prefix=fs-provider && npm i --prefix=sample",
6
6
  "compile": "tsc -p ./ && npm run compile-fs-provider",
7
7
  "watch": "tsc -w -p ./",
8
8
  "prepack": "npm run compile",
9
- "test": "eslint src --ext ts && tsc --noEmit",
9
+ "test": "eslint src && tsc --noEmit",
10
10
  "preversion": "npm test",
11
11
  "postversion": "git push && git push --tags",
12
12
  "compile-fs-provider": "npm run --prefix=fs-provider compile-web",
@@ -23,36 +23,39 @@
23
23
  "node": ">=16"
24
24
  },
25
25
  "dependencies": {
26
- "@koa/router": "^12.0.1",
27
26
  "@koa/cors": "^5.0.0",
27
+ "@koa/router": "^13.0.0",
28
+ "@playwright/browser-chromium": "^1.46.1",
29
+ "glob": "^11.0.0",
30
+ "gunzip-maybe": "^1.4.2",
31
+ "http-proxy-agent": "^7.0.2",
32
+ "https-proxy-agent": "^7.0.5",
28
33
  "koa": "^2.15.3",
29
34
  "koa-morgan": "^1.0.1",
30
35
  "koa-mount": "^4.0.0",
31
36
  "koa-static": "^5.0.0",
32
37
  "minimist": "^1.2.8",
33
- "playwright": "^1.45.0",
34
- "@playwright/browser-chromium": "^1.45.0",
35
- "vscode-uri": "^3.0.8",
36
- "http-proxy-agent": "^7.0.2",
37
- "https-proxy-agent": "^7.0.4",
38
+ "playwright": "^1.46.1",
38
39
  "tar-fs": "^3.0.6",
39
- "gunzip-maybe": "^1.4.2"
40
+ "vscode-uri": "^3.0.8"
40
41
  },
41
42
  "devDependencies": {
43
+ "@eslint/eslintrc": "^3.1.0",
44
+ "@eslint/js": "^9.9.1",
45
+ "@types/gunzip-maybe": "^1.4.2",
42
46
  "@types/koa": "^2.15.0",
47
+ "@types/koa__router": "^12.0.4",
43
48
  "@types/koa-morgan": "^1.0.8",
44
49
  "@types/koa-mount": "^4.0.5",
45
50
  "@types/koa-static": "^4.0.4",
46
- "@types/koa__router": "^12.0.4",
47
51
  "@types/minimist": "^1.2.5",
48
52
  "@types/node": "^20.14.9",
49
- "@types/gunzip-maybe": "^1.4.2",
50
53
  "@types/tar-fs": "^2.0.4",
51
- "@typescript-eslint/eslint-plugin": "^7.14.1",
52
- "@typescript-eslint/parser": "^7.14.1",
53
- "eslint": "^8.57.0",
54
- "eslint-plugin-header": "^3.1.1",
55
- "typescript": "^5.4.5"
54
+ "@typescript-eslint/eslint-plugin": "^8.3.0",
55
+ "@typescript-eslint/parser": "^8.3.0",
56
+ "eslint": "^9.9.1",
57
+ "@tony.ganchev/eslint-plugin-header": "^3.1.2",
58
+ "typescript": "^5.5.4"
56
59
  },
57
60
  "license": "MIT",
58
61
  "author": "Visual Studio Code Team",
@@ -63,4 +66,4 @@
63
66
  "bugs": {
64
67
  "url": "https://github.com/microsoft/vscode-test-web/issues"
65
68
  }
66
- }
69
+ }
@@ -28,6 +28,8 @@
28
28
  <!-- Workbench Icon/Manifest/CSS -->
29
29
  <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/favicon.ico" type="image/x-icon" />
30
30
  <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/manifest.json">
31
+
32
+ <style id="vscode-css-modules" type="text/css" media="screen"></style>
31
33
  </head>
32
34
 
33
35
  <body aria-label="">
@@ -39,6 +41,26 @@
39
41
  const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
40
42
  globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
41
43
  </script>
44
+ <script>
45
+ const sheet = document.getElementById('vscode-css-modules').sheet;
46
+ globalThis._VSCODE_CSS_LOAD = function (url) {
47
+ sheet.insertRule(`@import url(${url});`);
48
+ };
49
+
50
+ const importMap = { imports: {} };
51
+ const cssModules = JSON.parse('{{WORKBENCH_DEV_CSS_MODULES}}');
52
+ for (const cssModule of cssModules) {
53
+ const cssUrl = new URL(cssModule, globalThis._VSCODE_FILE_ROOT).href;
54
+ const jsSrc = `globalThis._VSCODE_CSS_LOAD('${cssUrl}');\n`;
55
+ const blob = new Blob([jsSrc], { type: 'application/javascript' });
56
+ importMap.imports[cssUrl] = URL.createObjectURL(blob);
57
+ }
58
+ const importMapElement = document.createElement('script');
59
+ importMapElement.type = 'importmap';
60
+ importMapElement.setAttribute('nonce', '1nline-m4p')
61
+ importMapElement.textContent = JSON.stringify(importMap, undefined, 2);
62
+ document.head.appendChild(importMapElement);
63
+ </script>
42
64
  <script>
43
65
  performance.mark('code/willLoadWorkbenchMain');
44
66
  </script>