@vscode/test-web 0.0.35 → 0.0.37
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/CHANGELOG.md +4 -0
- package/README.md +1 -0
- package/fs-provider/package.json +2 -2
- package/out/index.d.ts +4 -0
- package/out/index.js +9 -4
- package/out/server/download.js +2 -4
- package/out/server/extensions.js +1 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ CLI options:
|
|
|
83
83
|
| --open-devtools | If set, opens the dev tools in the browser. |
|
|
84
84
|
| --verbose | If set, prints out more information when running the server. |
|
|
85
85
|
| --printServerLog | If set, prints the server access log. |
|
|
86
|
+
| --testRunnerDataDir | If set, the temporary folder for storing the VS Code builds used for running the tests |
|
|
86
87
|
| folderPath | A local folder to open VS Code on. The folder content will be available as a virtual file system and opened as workspace. |
|
|
87
88
|
|
|
88
89
|
Corresponding options are available in the API.
|
package/fs-provider/package.json
CHANGED
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"@types/vscode": "^1.72.0",
|
|
39
39
|
"@types/webpack-env": "^1.18.0",
|
|
40
40
|
"ts-loader": "^9.4.2",
|
|
41
|
-
"webpack": "^5.
|
|
41
|
+
"webpack": "^5.76.3",
|
|
42
42
|
"webpack-cli": "^5.0.1",
|
|
43
43
|
"process": "^0.11.10",
|
|
44
44
|
"path-browserify": "^1.0.1",
|
|
45
|
-
"request-light": "^0.
|
|
45
|
+
"request-light": "^0.7.0",
|
|
46
46
|
"vscode-uri": "^3.0.7"
|
|
47
47
|
}
|
|
48
48
|
}
|
package/out/index.d.ts
CHANGED
|
@@ -111,6 +111,10 @@ export interface Options {
|
|
|
111
111
|
* The host name to start the server on. Defaults to `localhost`
|
|
112
112
|
*/
|
|
113
113
|
host?: string;
|
|
114
|
+
/**
|
|
115
|
+
* The temporary folder for storing the VS Code builds used for running the tests. Defaults to `$CURRENT_WORKING_DIR/.vscode-test-web`.
|
|
116
|
+
*/
|
|
117
|
+
testRunnerDataDir?: string;
|
|
114
118
|
}
|
|
115
119
|
export interface Disposable {
|
|
116
120
|
dispose(): void;
|
package/out/index.js
CHANGED
|
@@ -73,7 +73,8 @@ async function getBuild(options) {
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
const quality = options.quality || options.version;
|
|
76
|
-
|
|
76
|
+
const testRunnerDataDir = options.testRunnerDataDir ?? path.resolve(process.cwd(), '.vscode-test-web');
|
|
77
|
+
return await (0, download_1.downloadAndUnzipVSCode)(quality === 'stable' ? 'stable' : 'insider', testRunnerDataDir);
|
|
77
78
|
}
|
|
78
79
|
async function open(options) {
|
|
79
80
|
const config = {
|
|
@@ -334,6 +335,7 @@ function showHelp() {
|
|
|
334
335
|
console.log(` --open-devtools: If set, opens the dev tools. [Optional]`);
|
|
335
336
|
console.log(` --verbose: If set, prints out more information when running the server. [Optional]`);
|
|
336
337
|
console.log(` --printServerLog: If set, prints the server access log. [Optional]`);
|
|
338
|
+
console.log(` --testRunnerDataDir: If set, the temporary folder for storing the VS Code builds used for running the tests. [Optional, defaults to '$CURRENT_WORKING_DIR/.vscode-test-web']`);
|
|
337
339
|
console.log(` folderPath. A local folder to open VS Code on. The folder content will be available as a virtual file system. [Optional]`);
|
|
338
340
|
}
|
|
339
341
|
async function cliMain() {
|
|
@@ -347,7 +349,7 @@ async function cliMain() {
|
|
|
347
349
|
const manifest = require('../package.json');
|
|
348
350
|
console.log(`${manifest.name}: ${manifest.version}`);
|
|
349
351
|
const options = {
|
|
350
|
-
string: ['extensionDevelopmentPath', 'extensionTestsPath', 'browser', 'browserType', 'quality', 'version', 'waitForDebugger', 'folder-uri', 'permission', 'extensionPath', 'extensionId', 'sourcesPath', 'host', 'port'],
|
|
352
|
+
string: ['extensionDevelopmentPath', 'extensionTestsPath', 'browser', 'browserType', 'quality', 'version', 'waitForDebugger', 'folder-uri', 'permission', 'extensionPath', 'extensionId', 'sourcesPath', 'host', 'port', 'testRunnerDataDir'],
|
|
351
353
|
boolean: ['open-devtools', 'headless', 'hideServerLog', 'printServerLog', 'help', 'verbose', 'coi', 'esm'],
|
|
352
354
|
unknown: arg => {
|
|
353
355
|
if (arg.startsWith('-')) {
|
|
@@ -379,6 +381,7 @@ async function cliMain() {
|
|
|
379
381
|
const host = validateStringOrUndefined(args, 'host');
|
|
380
382
|
const coi = validateBooleanOrUndefined(args, 'coi');
|
|
381
383
|
const esm = validateBooleanOrUndefined(args, 'esm');
|
|
384
|
+
const testRunnerDataDir = validateStringOrUndefined(args, 'testRunnerDataDir');
|
|
382
385
|
const waitForDebugger = validatePortNumber(args.waitForDebugger);
|
|
383
386
|
let folderUri = validateStringOrUndefined(args, 'folder-uri');
|
|
384
387
|
let folderPath;
|
|
@@ -413,7 +416,8 @@ async function cliMain() {
|
|
|
413
416
|
esm,
|
|
414
417
|
coi,
|
|
415
418
|
host,
|
|
416
|
-
port
|
|
419
|
+
port,
|
|
420
|
+
testRunnerDataDir
|
|
417
421
|
}).catch(e => {
|
|
418
422
|
console.log('Error running tests:', e);
|
|
419
423
|
process.exit(1);
|
|
@@ -438,7 +442,8 @@ async function cliMain() {
|
|
|
438
442
|
esm,
|
|
439
443
|
coi,
|
|
440
444
|
host,
|
|
441
|
-
port
|
|
445
|
+
port,
|
|
446
|
+
testRunnerDataDir
|
|
442
447
|
});
|
|
443
448
|
}
|
|
444
449
|
}
|
package/out/server/download.js
CHANGED
|
@@ -14,8 +14,6 @@ const createHttpProxyAgent = require("http-proxy-agent");
|
|
|
14
14
|
const url_1 = require("url");
|
|
15
15
|
const decompress = require("decompress");
|
|
16
16
|
const decompressTargz = require("decompress-targz");
|
|
17
|
-
const extensionRoot = process.cwd();
|
|
18
|
-
const vscodeTestDir = path.resolve(extensionRoot, '.vscode-test-web');
|
|
19
17
|
async function getLatestVersion(quality) {
|
|
20
18
|
const update = await fetchJSON(`https://update.code.visualstudio.com/api/update/web-standalone/${quality}/latest`);
|
|
21
19
|
return update;
|
|
@@ -65,7 +63,7 @@ async function unzip(source, destination, message) {
|
|
|
65
63
|
});
|
|
66
64
|
process.stdout.write(`${reset}${message}: complete\n`);
|
|
67
65
|
}
|
|
68
|
-
async function downloadAndUnzipVSCode(quality) {
|
|
66
|
+
async function downloadAndUnzipVSCode(quality, vscodeTestDir) {
|
|
69
67
|
const info = await getLatestVersion(quality);
|
|
70
68
|
const folderName = `vscode-web-${quality}-${info.version}`;
|
|
71
69
|
const downloadedPath = path.resolve(vscodeTestDir, folderName);
|
|
@@ -77,7 +75,7 @@ async function downloadAndUnzipVSCode(quality) {
|
|
|
77
75
|
}
|
|
78
76
|
await fs_1.promises.mkdir(vscodeTestDir, { recursive: true });
|
|
79
77
|
const productName = `VS Code ${quality === 'stable' ? 'Stable' : 'Insiders'}`;
|
|
80
|
-
const tmpArchiveName = `vscode-web-${quality}-${info.version}-tmp
|
|
78
|
+
const tmpArchiveName = path.join(vscodeTestDir, `vscode-web-${quality}-${info.version}-tmp`);
|
|
81
79
|
try {
|
|
82
80
|
await download(info.url, tmpArchiveName, `Downloading ${productName}`);
|
|
83
81
|
await unzip(tmpArchiveName, downloadedPath, `Unpacking ${productName}`);
|
package/out/server/extensions.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
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;
|
|
7
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
7
|
exports.getScannedBuiltinExtensions = exports.prebuiltExtensionsLocation = exports.scanForExtensions = void 0;
|
|
9
8
|
const fs_1 = require("fs");
|
|
@@ -48,7 +47,7 @@ exports.scanForExtensions = scanForExtensions;
|
|
|
48
47
|
exports.prebuiltExtensionsLocation = '.build/builtInExtensions';
|
|
49
48
|
async function getScannedBuiltinExtensions(vsCodeDevLocation) {
|
|
50
49
|
// use the build utility as to not duplicate the code
|
|
51
|
-
const extensionsUtil = await (
|
|
50
|
+
const extensionsUtil = await Promise.resolve(`${path.join(vsCodeDevLocation, 'build', 'lib', 'extensions.js')}`).then(s => require(s));
|
|
52
51
|
const localExtensions = extensionsUtil.scanBuiltinExtensions(path.join(vsCodeDevLocation, 'extensions'));
|
|
53
52
|
const prebuiltExtensions = extensionsUtil.scanBuiltinExtensions(path.join(vsCodeDevLocation, exports.prebuiltExtensionsLocation));
|
|
54
53
|
for (const ext of localExtensions) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vscode/test-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"install-extensions": "yarn --cwd=fs-provider && yarn --cwd=sample",
|
|
6
6
|
"compile": "tsc -p ./ && yarn compile-fs-provider",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"koa-mount": "^4.0.0",
|
|
31
31
|
"koa-static": "^5.0.0",
|
|
32
32
|
"minimist": "^1.2.8",
|
|
33
|
-
"playwright": "^1.
|
|
33
|
+
"playwright": "^1.32.1",
|
|
34
34
|
"vscode-uri": "^3.0.7",
|
|
35
35
|
"http-proxy-agent": "^5.0.0",
|
|
36
36
|
"https-proxy-agent": "^5.0.1",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"get-stream": "6.0.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/koa": "^2.13.
|
|
42
|
+
"@types/koa": "^2.13.6",
|
|
43
43
|
"@types/koa-morgan": "^1.0.5",
|
|
44
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
48
|
"@types/node": "16.x",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
50
|
-
"@typescript-eslint/parser": "^5.
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.57.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.57.0",
|
|
51
51
|
"@types/decompress": "^4.2.4",
|
|
52
|
-
"eslint": "^8.
|
|
52
|
+
"eslint": "^8.37.0",
|
|
53
53
|
"eslint-plugin-header": "^3.1.1",
|
|
54
|
-
"typescript": "^
|
|
54
|
+
"typescript": "^5.0.2"
|
|
55
55
|
},
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"author": "Visual Studio Code Team",
|