@vscode/test-web 0.0.54 → 0.0.56

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.
@@ -962,10 +962,11 @@ class Minimatch {
962
962
  for (let i = 0; i < globParts.length - 1; i++) {
963
963
  for (let j = i + 1; j < globParts.length; j++) {
964
964
  const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
965
- if (!matched)
966
- continue;
967
- globParts[i] = matched;
968
- globParts[j] = [];
965
+ if (matched) {
966
+ globParts[i] = [];
967
+ globParts[j] = matched;
968
+ break;
969
+ }
969
970
  }
970
971
  }
971
972
  return globParts.filter(gs => gs.length);
@@ -9,14 +9,14 @@
9
9
  "version": "0.0.1",
10
10
  "license": "MIT",
11
11
  "devDependencies": {
12
- "@types/vscode": "^1.81.0",
13
- "minimatch": "9.0.4",
12
+ "@types/vscode": "^1.90.0",
13
+ "minimatch": "9.0.5",
14
14
  "path-browserify": "^1.0.1",
15
15
  "process": "^0.11.10",
16
16
  "request-light": "^0.7.0",
17
17
  "ts-loader": "^9.5.1",
18
18
  "vscode-uri": "^3.0.8",
19
- "webpack": "^5.91.0",
19
+ "webpack": "^5.92.1",
20
20
  "webpack-cli": "^5.1.4"
21
21
  },
22
22
  "engines": {
@@ -136,11 +136,10 @@
136
136
  }
137
137
  },
138
138
  "node_modules/@types/vscode": {
139
- "version": "1.81.0",
140
- "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.81.0.tgz",
141
- "integrity": "sha512-YIaCwpT+O2E7WOMq0eCgBEABE++SX3Yl/O02GoMIF2DO3qAtvw7m6BXFYsxnc6XyzwZgh6/s/UG78LSSombl2w==",
142
- "dev": true,
143
- "license": "MIT"
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==",
142
+ "dev": true
144
143
  },
145
144
  "node_modules/@webassemblyjs/ast": {
146
145
  "version": "1.12.1",
@@ -359,12 +358,11 @@
359
358
  "node": ">=0.4.0"
360
359
  }
361
360
  },
362
- "node_modules/acorn-import-assertions": {
363
- "version": "1.9.0",
364
- "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz",
365
- "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==",
361
+ "node_modules/acorn-import-attributes": {
362
+ "version": "1.9.5",
363
+ "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz",
364
+ "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==",
366
365
  "dev": true,
367
- "license": "MIT",
368
366
  "peerDependencies": {
369
367
  "acorn": "^8"
370
368
  }
@@ -428,13 +426,12 @@
428
426
  }
429
427
  },
430
428
  "node_modules/braces": {
431
- "version": "3.0.2",
432
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
433
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
429
+ "version": "3.0.3",
430
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
431
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
434
432
  "dev": true,
435
- "license": "MIT",
436
433
  "dependencies": {
437
- "fill-range": "^7.0.1"
434
+ "fill-range": "^7.1.1"
438
435
  },
439
436
  "engines": {
440
437
  "node": ">=8"
@@ -599,9 +596,9 @@
599
596
  "dev": true
600
597
  },
601
598
  "node_modules/enhanced-resolve": {
602
- "version": "5.16.0",
603
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.0.tgz",
604
- "integrity": "sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==",
599
+ "version": "5.17.0",
600
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz",
601
+ "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==",
605
602
  "dev": true,
606
603
  "dependencies": {
607
604
  "graceful-fs": "^4.2.4",
@@ -719,11 +716,10 @@
719
716
  "license": "MIT"
720
717
  },
721
718
  "node_modules/fill-range": {
722
- "version": "7.0.1",
723
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
724
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
719
+ "version": "7.1.1",
720
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
721
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
725
722
  "dev": true,
726
- "license": "MIT",
727
723
  "dependencies": {
728
724
  "to-regex-range": "^5.0.1"
729
725
  },
@@ -832,7 +828,6 @@
832
828
  "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
833
829
  "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
834
830
  "dev": true,
835
- "license": "MIT",
836
831
  "engines": {
837
832
  "node": ">=0.12.0"
838
833
  }
@@ -1000,9 +995,9 @@
1000
995
  }
1001
996
  },
1002
997
  "node_modules/minimatch": {
1003
- "version": "9.0.4",
1004
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
1005
- "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
998
+ "version": "9.0.5",
999
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
1000
+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
1006
1001
  "dev": true,
1007
1002
  "dependencies": {
1008
1003
  "brace-expansion": "^2.0.1"
@@ -1440,7 +1435,6 @@
1440
1435
  "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
1441
1436
  "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
1442
1437
  "dev": true,
1443
- "license": "MIT",
1444
1438
  "dependencies": {
1445
1439
  "is-number": "^7.0.0"
1446
1440
  },
@@ -1556,9 +1550,9 @@
1556
1550
  }
1557
1551
  },
1558
1552
  "node_modules/webpack": {
1559
- "version": "5.91.0",
1560
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz",
1561
- "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==",
1553
+ "version": "5.92.1",
1554
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz",
1555
+ "integrity": "sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==",
1562
1556
  "dev": true,
1563
1557
  "dependencies": {
1564
1558
  "@types/eslint-scope": "^3.7.3",
@@ -1567,10 +1561,10 @@
1567
1561
  "@webassemblyjs/wasm-edit": "^1.12.1",
1568
1562
  "@webassemblyjs/wasm-parser": "^1.12.1",
1569
1563
  "acorn": "^8.7.1",
1570
- "acorn-import-assertions": "^1.9.0",
1564
+ "acorn-import-attributes": "^1.9.5",
1571
1565
  "browserslist": "^4.21.10",
1572
1566
  "chrome-trace-event": "^1.0.2",
1573
- "enhanced-resolve": "^5.16.0",
1567
+ "enhanced-resolve": "^5.17.0",
1574
1568
  "es-module-lexer": "^1.2.1",
1575
1569
  "eslint-scope": "5.1.1",
1576
1570
  "events": "^3.2.0",
@@ -39,10 +39,10 @@
39
39
  "package-web": "webpack --mode production --devtool hidden-source-map"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/vscode": "^1.81.0",
43
- "minimatch": "9.0.4",
42
+ "@types/vscode": "^1.90.0",
43
+ "minimatch": "9.0.5",
44
44
  "ts-loader": "^9.5.1",
45
- "webpack": "^5.91.0",
45
+ "webpack": "^5.92.1",
46
46
  "webpack-cli": "^5.1.4",
47
47
  "process": "^0.11.10",
48
48
  "path-browserify": "^1.0.1",
@@ -15,10 +15,11 @@ function asJSON(value) {
15
15
  return JSON.stringify(value).replace(/"/g, '&quot;');
16
16
  }
17
17
  class Workbench {
18
- constructor(baseUrl, dev, esm, builtInExtensions = [], productOverrides) {
18
+ constructor(baseUrl, dev, esm, devCSSModules, builtInExtensions = [], productOverrides) {
19
19
  this.baseUrl = baseUrl;
20
20
  this.dev = dev;
21
21
  this.esm = esm;
22
+ this.devCSSModules = devCSSModules;
22
23
  this.builtInExtensions = builtInExtensions;
23
24
  this.productOverrides = productOverrides;
24
25
  }
@@ -32,6 +33,7 @@ class Workbench {
32
33
  WORKBENCH_WEB_BASE_URL: this.baseUrl,
33
34
  WORKBENCH_BUILTIN_EXTENSIONS: asJSON(this.builtInExtensions),
34
35
  WORKBENCH_MAIN: this.getMain(),
36
+ WORKBENCH_DEV_CSS_MODULES: JSON.stringify(this.devCSSModules)
35
37
  };
36
38
  try {
37
39
  const workbenchTemplate = (await fs_1.promises.readFile(path.resolve(__dirname, `../../views/workbench${this.esm ? '-esm' : ''}.html`))).toString();
@@ -48,7 +50,8 @@ class Workbench {
48
50
  if (this.dev) {
49
51
  return `<script> require(['vs/code/browser/workbench/workbench'], function() {}); </script>`;
50
52
  }
51
- return `<script src="${this.baseUrl}/out/vs/workbench/workbench.web.main.nls.js"></script>`
53
+ return `<script src="${this.baseUrl}/out/nls.messages.js"></script>`
54
+ + `<script src="${this.baseUrl}/out/vs/workbench/workbench.web.main.nls.js"></script>`
52
55
  + `<script src="${this.baseUrl}/out/vs/workbench/workbench.web.main.js"></script>`
53
56
  + `<script src="${this.baseUrl}/out/vs/code/browser/workbench/workbench.js"></script>`;
54
57
  }
@@ -111,7 +114,8 @@ function default_1(config) {
111
114
  if (config.build.type === 'sources') {
112
115
  const builtInExtensions = await (0, extensions_1.getScannedBuiltinExtensions)(config.build.location);
113
116
  const productOverrides = await getProductOverrides(config.build.location);
114
- ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, builtInExtensions, {
117
+ const devCSSModules = config.esm ? await getDevCssModules(config.build.location) : [];
118
+ ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, devCSSModules, builtInExtensions, {
115
119
  ...productOverrides,
116
120
  webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources`,
117
121
  webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources/out/vs/workbench/contrib/webview/browser/pre/`
@@ -119,13 +123,13 @@ function default_1(config) {
119
123
  }
120
124
  else if (config.build.type === 'static') {
121
125
  const baseUrl = `${ctx.protocol}://${ctx.host}/static/build`;
122
- ctx.state.workbench = new Workbench(baseUrl, false, config.esm, [], {
126
+ ctx.state.workbench = new Workbench(baseUrl, false, config.esm, [], [], {
123
127
  webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build`,
124
128
  webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build/out/vs/workbench/contrib/webview/browser/pre/`
125
129
  });
126
130
  }
127
131
  else if (config.build.type === 'cdn') {
128
- ctx.state.workbench = new Workbench(config.build.uri, false, config.esm);
132
+ ctx.state.workbench = new Workbench(config.build.uri, false, config.esm, []);
129
133
  }
130
134
  await next();
131
135
  });
@@ -151,3 +155,7 @@ async function getProductOverrides(vsCodeDevLocation) {
151
155
  return undefined;
152
156
  }
153
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode/test-web",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
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",
@@ -23,33 +23,34 @@
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": "^12.0.1",
28
+ "@playwright/browser-chromium": "^1.45.0",
29
+ "glob": "^10.4.2",
30
+ "gunzip-maybe": "^1.4.2",
31
+ "http-proxy-agent": "^7.0.2",
32
+ "https-proxy-agent": "^7.0.4",
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.43.1",
34
- "@playwright/browser-chromium": "^1.43.1",
35
- "vscode-uri": "^3.0.8",
36
- "http-proxy-agent": "^7.0.2",
37
- "https-proxy-agent": "^7.0.4",
38
- "tar-fs": "^3.0.5",
39
- "gunzip-maybe": "^1.4.2"
38
+ "playwright": "^1.45.0",
39
+ "tar-fs": "^3.0.6",
40
+ "vscode-uri": "^3.0.8"
40
41
  },
41
42
  "devDependencies": {
43
+ "@types/gunzip-maybe": "^1.4.2",
42
44
  "@types/koa": "^2.15.0",
45
+ "@types/koa__router": "^12.0.4",
43
46
  "@types/koa-morgan": "^1.0.8",
44
47
  "@types/koa-mount": "^4.0.5",
45
48
  "@types/koa-static": "^4.0.4",
46
- "@types/koa__router": "^12.0.4",
47
49
  "@types/minimist": "^1.2.5",
48
- "@types/node": "^20.12.7",
49
- "@types/gunzip-maybe": "^1.4.2",
50
+ "@types/node": "^20.14.9",
50
51
  "@types/tar-fs": "^2.0.4",
51
- "@typescript-eslint/eslint-plugin": "^7.7.1",
52
- "@typescript-eslint/parser": "^7.7.1",
52
+ "@typescript-eslint/eslint-plugin": "^7.14.1",
53
+ "@typescript-eslint/parser": "^7.14.1",
53
54
  "eslint": "^8.57.0",
54
55
  "eslint-plugin-header": "^3.1.1",
55
56
  "typescript": "^5.4.5"
@@ -63,4 +64,4 @@
63
64
  "bugs": {
64
65
  "url": "https://github.com/microsoft/vscode-test-web/issues"
65
66
  }
66
- }
67
+ }
@@ -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>