@vscode/test-web 0.0.32 → 0.0.33
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.
- package/fs-provider/dist/fsExtensionMain.js +3 -3
- package/fs-provider/package.json +5 -5
- package/out/index.d.ts +3 -3
- package/out/index.js +11 -16
- package/out/server/extensions.js +2 -1
- package/out/server/workbench.js +1 -1
- package/package.json +10 -10
|
@@ -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
|
|
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})})();
|
|
8
8
|
|
|
9
9
|
/***/ }),
|
|
10
10
|
/* 2 */
|
|
@@ -31,7 +31,7 @@ function newFileStat(type, size) {
|
|
|
31
31
|
return Promise.resolve({ type, ctime: Date.now(), mtime: Date.now(), size });
|
|
32
32
|
}
|
|
33
33
|
function modifiedFileStat(stats, size) {
|
|
34
|
-
return Promise.resolve({ type: stats.type, ctime: stats.ctime, mtime: Date.now(), size: size
|
|
34
|
+
return Promise.resolve({ type: stats.type, ctime: stats.ctime, mtime: Date.now(), size: size ?? stats.size });
|
|
35
35
|
}
|
|
36
36
|
class MemFileSystemProvider {
|
|
37
37
|
constructor(scheme, root) {
|
|
@@ -156,7 +156,7 @@ class MemFileSystemProvider {
|
|
|
156
156
|
}
|
|
157
157
|
async _lookupAsDirectory(uri, silent) {
|
|
158
158
|
const entry = await this._lookup(uri, silent);
|
|
159
|
-
if (
|
|
159
|
+
if (entry?.type === vscode_1.FileType.Directory) {
|
|
160
160
|
return entry;
|
|
161
161
|
}
|
|
162
162
|
throw vscode_1.FileSystemError.FileNotADirectory(uri);
|
package/fs-provider/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"version": "0.0.1",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"engines": {
|
|
10
|
-
"vscode": "^1.
|
|
10
|
+
"vscode": "^1.72.0"
|
|
11
11
|
},
|
|
12
12
|
"categories": [
|
|
13
13
|
"Other"
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/vscode": "^1.72.0",
|
|
39
39
|
"@types/webpack-env": "^1.18.0",
|
|
40
|
-
"ts-loader": "^9.4.
|
|
41
|
-
"webpack": "^5.
|
|
42
|
-
"webpack-cli": "^
|
|
40
|
+
"ts-loader": "^9.4.2",
|
|
41
|
+
"webpack": "^5.75.0",
|
|
42
|
+
"webpack-cli": "^5.0.0",
|
|
43
43
|
"process": "^0.11.10",
|
|
44
44
|
"path-browserify": "^1.0.1",
|
|
45
|
-
"request-light": "^0.
|
|
45
|
+
"request-light": "^0.6.0",
|
|
46
46
|
"vscode-uri": "^3.0.6"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/out/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type BrowserType = 'chromium' | 'firefox' | 'webkit' | 'none';
|
|
3
|
+
export type VSCodeQuality = 'insiders' | 'stable';
|
|
4
|
+
export type GalleryExtension = {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly preRelease?: boolean;
|
|
7
7
|
};
|
package/out/index.js
CHANGED
|
@@ -18,20 +18,19 @@ const path = require("path");
|
|
|
18
18
|
* @param options The options defining browser type, extension and test location.
|
|
19
19
|
*/
|
|
20
20
|
async function runTests(options) {
|
|
21
|
-
var _a, _b, _c;
|
|
22
21
|
const config = {
|
|
23
22
|
extensionDevelopmentPath: options.extensionDevelopmentPath,
|
|
24
23
|
extensionTestsPath: options.extensionTestsPath,
|
|
25
24
|
build: await getBuild(options),
|
|
26
25
|
folderUri: options.folderUri,
|
|
27
26
|
folderMountPath: options.folderPath,
|
|
28
|
-
printServerLog:
|
|
27
|
+
printServerLog: options.printServerLog ?? options.hideServerLog === false,
|
|
29
28
|
extensionPaths: options.extensionPaths,
|
|
30
29
|
extensionIds: options.extensionIds,
|
|
31
30
|
coi: !!options.coi
|
|
32
31
|
};
|
|
33
|
-
const host =
|
|
34
|
-
const port =
|
|
32
|
+
const host = options.host ?? 'localhost';
|
|
33
|
+
const port = options.port ?? 3000;
|
|
35
34
|
const server = await (0, main_1.runServer)(host, port, config);
|
|
36
35
|
return new Promise(async (s, e) => {
|
|
37
36
|
const endpoint = `http://${host}:${port}`;
|
|
@@ -43,9 +42,8 @@ async function runTests(options) {
|
|
|
43
42
|
console[type](...args);
|
|
44
43
|
});
|
|
45
44
|
await context.exposeFunction('codeAutomationExit', async (code) => {
|
|
46
|
-
var _a;
|
|
47
45
|
try {
|
|
48
|
-
await
|
|
46
|
+
await context.browser()?.close();
|
|
49
47
|
}
|
|
50
48
|
catch (error) {
|
|
51
49
|
console.error(`Error when closing browser: ${error}`);
|
|
@@ -77,35 +75,32 @@ async function getBuild(options) {
|
|
|
77
75
|
return await (0, download_1.downloadAndUnzipVSCode)(quality === 'stable' ? 'stable' : 'insider');
|
|
78
76
|
}
|
|
79
77
|
async function open(options) {
|
|
80
|
-
var _a, _b, _c;
|
|
81
78
|
const config = {
|
|
82
79
|
extensionDevelopmentPath: options.extensionDevelopmentPath,
|
|
83
80
|
extensionTestsPath: options.extensionTestsPath,
|
|
84
81
|
build: await getBuild(options),
|
|
85
82
|
folderUri: options.folderUri,
|
|
86
83
|
folderMountPath: options.folderPath,
|
|
87
|
-
printServerLog:
|
|
84
|
+
printServerLog: options.printServerLog ?? options.hideServerLog === false,
|
|
88
85
|
extensionPaths: options.extensionPaths,
|
|
89
86
|
extensionIds: options.extensionIds,
|
|
90
87
|
coi: !!options.coi
|
|
91
88
|
};
|
|
92
|
-
const host =
|
|
93
|
-
const port =
|
|
89
|
+
const host = options.host ?? 'localhost';
|
|
90
|
+
const port = options.port ?? 3000;
|
|
94
91
|
const server = await (0, main_1.runServer)(host, port, config);
|
|
95
92
|
const endpoint = `http://${host}:${port}`;
|
|
96
93
|
const context = await openBrowser(endpoint, options);
|
|
97
|
-
context
|
|
94
|
+
context?.once('close', () => server.close());
|
|
98
95
|
return {
|
|
99
96
|
dispose: () => {
|
|
100
|
-
var _a;
|
|
101
97
|
server.close();
|
|
102
|
-
|
|
98
|
+
context?.browser()?.close();
|
|
103
99
|
}
|
|
104
100
|
};
|
|
105
101
|
}
|
|
106
102
|
exports.open = open;
|
|
107
103
|
async function openBrowser(endpoint, options) {
|
|
108
|
-
var _a, _b;
|
|
109
104
|
if (options.browserType === 'none') {
|
|
110
105
|
return undefined;
|
|
111
106
|
}
|
|
@@ -121,7 +116,7 @@ async function openBrowser(endpoint, options) {
|
|
|
121
116
|
if (options.waitForDebugger) {
|
|
122
117
|
args.push(`--remote-debugging-port=${options.waitForDebugger}`);
|
|
123
118
|
}
|
|
124
|
-
const headless =
|
|
119
|
+
const headless = options.headless ?? options.extensionTestsPath !== undefined;
|
|
125
120
|
const browser = await browserType.launch({ headless, args, devtools: options.devTools });
|
|
126
121
|
const context = await browser.newContext({ viewport: null });
|
|
127
122
|
if (options.permissions) {
|
|
@@ -138,7 +133,7 @@ async function openBrowser(endpoint, options) {
|
|
|
138
133
|
}
|
|
139
134
|
});
|
|
140
135
|
});
|
|
141
|
-
const page =
|
|
136
|
+
const page = context.pages()[0] ?? await context.newPage();
|
|
142
137
|
if (options.waitForDebugger) {
|
|
143
138
|
await page.waitForFunction(() => '__jsDebugIsReady' in globalThis);
|
|
144
139
|
}
|
package/out/server/extensions.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var _a;
|
|
6
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
8
|
exports.getScannedBuiltinExtensions = exports.prebuiltExtensionsLocation = exports.scanForExtensions = void 0;
|
|
8
9
|
const fs_1 = require("fs");
|
|
@@ -47,7 +48,7 @@ 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
|
|
50
|
-
const extensionsUtil = await
|
|
51
|
+
const extensionsUtil = await (_a = path.join(vsCodeDevLocation, 'build', 'lib', 'extensions.js'), Promise.resolve().then(() => require(_a)));
|
|
51
52
|
const localExtensions = extensionsUtil.scanBuiltinExtensions(path.join(vsCodeDevLocation, 'extensions'));
|
|
52
53
|
const prebuiltExtensions = extensionsUtil.scanBuiltinExtensions(path.join(vsCodeDevLocation, exports.prebuiltExtensionsLocation));
|
|
53
54
|
for (const ext of localExtensions) {
|
package/out/server/workbench.js
CHANGED
|
@@ -30,7 +30,7 @@ class Workbench {
|
|
|
30
30
|
};
|
|
31
31
|
try {
|
|
32
32
|
const workbenchTemplate = (await fs_1.promises.readFile(path.resolve(__dirname, '../../views/workbench.html'))).toString();
|
|
33
|
-
return workbenchTemplate.replace(/\{\{([^}]+)\}\}/g, (_, key) =>
|
|
33
|
+
return workbenchTemplate.replace(/\{\{([^}]+)\}\}/g, (_, key) => values[key] ?? 'undefined');
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
36
36
|
return String(e);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vscode/test-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"install-extensions": "yarn --cwd=fs-provider && yarn --cwd=sample",
|
|
6
6
|
"compile": "tsc -p ./ && yarn compile-fs-provider",
|
|
7
7
|
"watch": "tsc -w -p ./",
|
|
8
|
-
"
|
|
8
|
+
"prepack": "yarn compile",
|
|
9
9
|
"test": "eslint src --ext ts && tsc --noEmit",
|
|
10
10
|
"preversion": "npm test",
|
|
11
11
|
"postversion": "git push && git push --tags",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vscode-test-web": "./out/index.js"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
23
|
+
"node": ">=16"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@koa/router": "^12.0.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"koa-mount": "^4.0.0",
|
|
31
31
|
"koa-static": "^5.0.0",
|
|
32
32
|
"minimist": "^1.2.7",
|
|
33
|
-
"playwright": "^1.
|
|
33
|
+
"playwright": "^1.28.1",
|
|
34
34
|
"vscode-uri": "^3.0.6",
|
|
35
35
|
"http-proxy-agent": "^5.0.0",
|
|
36
36
|
"https-proxy-agent": "^5.0.1",
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/koa": "^2.13.5",
|
|
43
43
|
"@types/koa-morgan": "^1.0.5",
|
|
44
|
-
"@types/koa-mount": "^4.0.
|
|
44
|
+
"@types/koa-mount": "^4.0.2",
|
|
45
45
|
"@types/koa-static": "^4.0.2",
|
|
46
46
|
"@types/koa__router": "^12.0.0",
|
|
47
47
|
"@types/minimist": "^1.2.2",
|
|
48
|
-
"@types/node": "
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
50
|
-
"@typescript-eslint/parser": "^5.
|
|
48
|
+
"@types/node": "16.x",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
51
51
|
"@types/decompress": "^4.2.4",
|
|
52
|
-
"eslint": "^8.
|
|
52
|
+
"eslint": "^8.28.0",
|
|
53
53
|
"eslint-plugin-header": "^3.1.1",
|
|
54
|
-
"typescript": "^4.
|
|
54
|
+
"typescript": "^4.9.3"
|
|
55
55
|
},
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"author": "Visual Studio Code Team",
|