@vscode/test-web 0.0.46 → 0.0.48

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.
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/vscode": "^1.81.0",
39
- "@types/webpack-env": "^1.18.2",
40
- "ts-loader": "^9.4.4",
41
- "webpack": "^5.88.2",
39
+ "@types/webpack-env": "^1.18.3",
40
+ "ts-loader": "^9.5.0",
41
+ "webpack": "^5.89.0",
42
42
  "webpack-cli": "^5.1.4",
43
43
  "process": "^0.11.10",
44
44
  "path-browserify": "^1.0.1",
45
45
  "request-light": "^0.7.0",
46
- "vscode-uri": "^3.0.7"
46
+ "vscode-uri": "^3.0.8"
47
47
  }
48
48
  }
package/out/server/app.js CHANGED
@@ -22,14 +22,17 @@ async function createApp(config) {
22
22
  allowMethods: ['GET'],
23
23
  credentials: true,
24
24
  origin: (ctx) => {
25
- if (/^https:\/\/[^.]+\.vscode-cdn\.net$/.test(ctx.get('Origin')) || // needed for the webviewContent
26
- /^https:\/\/[^.]+\.vscode-webview\.net$/.test(ctx.get('Origin'))) {
27
- return ctx.get('Origin');
25
+ const origin = ctx.get('Origin');
26
+ if (/^https:\/\/[^.]+\.vscode-cdn\.net$/.test(origin) || // needed for the webviewContent
27
+ /^https:\/\/[^.]+\.vscode-webview\.net$/.test(origin) ||
28
+ new RegExp(`^${ctx.protocol}://[^.]+\\.${ctx.host}$`).test(origin) // match subdomains of localhost
29
+ ) {
30
+ return origin;
28
31
  }
29
32
  return undefined;
30
33
  },
31
34
  }));
32
- if (config.build.type !== 'sources') {
35
+ if (config.build.type !== 'sources' && config.build.type !== 'static') {
33
36
  // CSP: frame-ancestors
34
37
  app.use((ctx, next) => {
35
38
  ctx.set('Content-Security-Policy', `frame-ancestors 'none'`);
@@ -111,10 +111,18 @@ function default_1(config) {
111
111
  if (config.build.type === 'sources') {
112
112
  const builtInExtensions = await (0, extensions_1.getScannedBuiltinExtensions)(config.build.location);
113
113
  const productOverrides = await getProductOverrides(config.build.location);
114
- ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, builtInExtensions, productOverrides);
114
+ ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/sources`, true, config.esm, builtInExtensions, {
115
+ ...productOverrides,
116
+ webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources`,
117
+ webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/sources/out/vs/workbench/contrib/webview/browser/pre/`
118
+ });
115
119
  }
116
120
  else if (config.build.type === 'static') {
117
- ctx.state.workbench = new Workbench(`${ctx.protocol}://${ctx.host}/static/build`, false, config.esm);
121
+ const baseUrl = `${ctx.protocol}://${ctx.host}/static/build`;
122
+ ctx.state.workbench = new Workbench(baseUrl, false, config.esm, [], {
123
+ webEndpointUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build`,
124
+ webviewContentExternalBaseUrlTemplate: `${ctx.protocol}://{{uuid}}.${ctx.host}/static/build/out/vs/workbench/contrib/webview/browser/pre/`
125
+ });
118
126
  }
119
127
  else if (config.build.type === 'cdn') {
120
128
  ctx.state.workbench = new Workbench(config.build.uri, false, config.esm);
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@vscode/test-web",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "scripts": {
5
- "install-extensions": "yarn --cwd=fs-provider && yarn --cwd=sample",
6
- "compile": "tsc -p ./ && yarn compile-fs-provider",
5
+ "install-extensions": "npm i --prefix=fs-provider && npm i --prefix=sample",
6
+ "compile": "tsc -p ./ && npm run compile-fs-provider",
7
7
  "watch": "tsc -w -p ./",
8
- "prepack": "yarn compile",
8
+ "prepack": "npm run compile",
9
9
  "test": "eslint src --ext ts && tsc --noEmit",
10
10
  "preversion": "npm test",
11
11
  "postversion": "git push && git push --tags",
12
- "compile-fs-provider": "yarn --cwd=fs-provider compile-web",
13
- "compile-sample": "yarn --cwd=sample compile-web",
12
+ "compile-fs-provider": "npm run --prefix=fs-provider compile-web",
13
+ "compile-sample": "npm run --prefix=sample compile-web",
14
14
  "sample": "npm run compile && npm run compile-sample && node . --extensionDevelopmentPath=sample sample/test-workspace",
15
15
  "sample-tests": "npm run compile && npm run compile-sample && node . --extensionDevelopmentPath=sample --extensionTestsPath=sample/dist/web/test/suite/index.js --headless=true sample/test-workspace",
16
16
  "empty": "npm run compile && node ."
@@ -23,34 +23,34 @@
23
23
  "node": ">=16"
24
24
  },
25
25
  "dependencies": {
26
- "@koa/router": "^12.0.0",
26
+ "@koa/router": "^12.0.1",
27
27
  "@koa/cors": "^4.0.0",
28
28
  "koa": "^2.14.2",
29
29
  "koa-morgan": "^1.0.1",
30
30
  "koa-mount": "^4.0.0",
31
31
  "koa-static": "^5.0.0",
32
32
  "minimist": "^1.2.8",
33
- "playwright": "^1.38.1",
34
- "@playwright/browser-chromium": "^1.38.1",
35
- "vscode-uri": "^3.0.7",
33
+ "playwright": "^1.39.0",
34
+ "@playwright/browser-chromium": "^1.39.0",
35
+ "vscode-uri": "^3.0.8",
36
36
  "http-proxy-agent": "^7.0.0",
37
37
  "https-proxy-agent": "^7.0.2",
38
38
  "tar-fs": "^3.0.4",
39
39
  "gunzip-maybe": "^1.4.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/koa": "^2.13.9",
43
- "@types/koa-morgan": "^1.0.6",
44
- "@types/koa-mount": "^4.0.3",
45
- "@types/koa-static": "^4.0.2",
46
- "@types/koa__router": "^12.0.1",
47
- "@types/minimist": "^1.2.3",
48
- "@types/node": "16.x",
49
- "@types/gunzip-maybe": "^1.4.0",
50
- "@types/tar-fs": "^2.0.2",
51
- "@typescript-eslint/eslint-plugin": "^6.7.3",
52
- "@typescript-eslint/parser": "^6.7.3",
53
- "eslint": "^8.50.0",
42
+ "@types/koa": "^2.13.10",
43
+ "@types/koa-morgan": "^1.0.7",
44
+ "@types/koa-mount": "^4.0.4",
45
+ "@types/koa-static": "^4.0.3",
46
+ "@types/koa__router": "^12.0.3",
47
+ "@types/minimist": "^1.2.4",
48
+ "@types/node": "^20.8.9",
49
+ "@types/gunzip-maybe": "^1.4.1",
50
+ "@types/tar-fs": "^2.0.3",
51
+ "@typescript-eslint/eslint-plugin": "^6.9.0",
52
+ "@typescript-eslint/parser": "^6.9.0",
53
+ "eslint": "^8.52.0",
54
54
  "eslint-plugin-header": "^3.1.1",
55
55
  "typescript": "^5.2.2"
56
56
  },