From bd939c3dadf9570672feb07f65eb774b3092b49c Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 4 Sep 2024 21:09:09 +0200 Subject: [PATCH] prepare 0.0.58 (#138) * cleanup & prepare 0.0.58 * update extensions --- fs-provider/package-lock.json | 18 +++---- fs-provider/package.nls.json | 2 + fs-provider/tsconfig.json | 4 +- package-lock.json | 94 +++++++++++++++++------------------ package.json | 6 +-- sample/package-lock.json | 22 ++++---- sample/package.json | 2 +- sample/package.nls.json | 2 + sample/tsconfig.json | 4 +- sample/tsconfig.runTest.json | 4 +- src/browser/main.ts | 12 ++--- src/server/download.ts | 61 +++++++++++++---------- src/server/workbench.ts | 1 - views/workbench-esm.html | 3 -- views/workbench.html | 3 -- 15 files changed, 121 insertions(+), 117 deletions(-) create mode 100644 fs-provider/package.nls.json create mode 100644 sample/package.nls.json diff --git a/fs-provider/package-lock.json b/fs-provider/package-lock.json index 775b510..70b9ca8 100644 --- a/fs-provider/package-lock.json +++ b/fs-provider/package-lock.json @@ -936,14 +936,13 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, - "license": "MIT", "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -1080,11 +1079,10 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.6" }, diff --git a/fs-provider/package.nls.json b/fs-provider/package.nls.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/fs-provider/package.nls.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/fs-provider/tsconfig.json b/fs-provider/tsconfig.json index 98b103e..1032986 100644 --- a/fs-provider/tsconfig.json +++ b/fs-provider/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "module": "commonjs", - "target": "ES2020", + "target": "ES2022", "outDir": "dist", "lib": [ - "ES2020", "WebWorker" + "ES2022", "WebWorker" ], "sourceMap": true, "rootDir": "src", diff --git a/package-lock.json b/package-lock.json index e03fdbb..4f06c45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vscode/test-web", - "version": "0.0.57", + "version": "0.0.58", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@vscode/test-web", - "version": "0.0.57", + "version": "0.0.58", "license": "MIT", "dependencies": { "@koa/cors": "^5.0.0", @@ -26,7 +26,7 @@ "vscode-uri": "^3.0.8" }, "bin": { - "vscode-test-web": "out/index.js" + "vscode-test-web": "out/server/index.js" }, "devDependencies": { "@eslint/eslintrc": "^3.1.0", @@ -41,8 +41,8 @@ "@types/minimist": "^1.2.5", "@types/node": "^20.14.9", "@types/tar-fs": "^2.0.4", - "@typescript-eslint/eslint-plugin": "^8.3.0", - "@typescript-eslint/parser": "^8.3.0", + "@typescript-eslint/eslint-plugin": "^8.4.0", + "@typescript-eslint/parser": "^8.4.0", "eslint": "^9.9.1", "typescript": "^5.5.4" }, @@ -583,16 +583,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.3.0.tgz", - "integrity": "sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.4.0.tgz", + "integrity": "sha512-rg8LGdv7ri3oAlenMACk9e+AR4wUV0yrrG+XKsGKOK0EVgeEDqurkXMPILG2836fW4ibokTB5v4b6Z9+GYQDEw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/type-utils": "8.3.0", - "@typescript-eslint/utils": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/type-utils": "8.4.0", + "@typescript-eslint/utils": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -616,15 +616,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.3.0.tgz", - "integrity": "sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.4.0.tgz", + "integrity": "sha512-NHgWmKSgJk5K9N16GIhQ4jSobBoJwrmURaLErad0qlLjrpP5bECYg+wxVTGlGZmJbU03jj/dfnb6V9bw+5icsA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/typescript-estree": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/typescript-estree": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "debug": "^4.3.4" }, "engines": { @@ -644,13 +644,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.3.0.tgz", - "integrity": "sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.4.0.tgz", + "integrity": "sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0" + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -661,13 +661,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.3.0.tgz", - "integrity": "sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.4.0.tgz", + "integrity": "sha512-pu2PAmNrl9KX6TtirVOrbLPLwDmASpZhK/XU7WvoKoCUkdtq9zF7qQ7gna0GBZFN0hci0vHaSusiL2WpsQk37A==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.3.0", - "@typescript-eslint/utils": "8.3.0", + "@typescript-eslint/typescript-estree": "8.4.0", + "@typescript-eslint/utils": "8.4.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -685,9 +685,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.3.0.tgz", - "integrity": "sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.4.0.tgz", + "integrity": "sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -698,13 +698,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.3.0.tgz", - "integrity": "sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.4.0.tgz", + "integrity": "sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/visitor-keys": "8.4.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -726,15 +726,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.3.0.tgz", - "integrity": "sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.4.0.tgz", + "integrity": "sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/typescript-estree": "8.3.0" + "@typescript-eslint/scope-manager": "8.4.0", + "@typescript-eslint/types": "8.4.0", + "@typescript-eslint/typescript-estree": "8.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -748,12 +748,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.3.0.tgz", - "integrity": "sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.4.0.tgz", + "integrity": "sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/types": "8.4.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { diff --git a/package.json b/package.json index 80f4e91..a377b37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vscode/test-web", - "version": "0.0.57", + "version": "0.0.58", "scripts": { "install-extensions": "npm i --prefix=fs-provider && npm i --prefix=sample", "compile": "tsc -b ./ && npm run compile-fs-provider", @@ -51,8 +51,8 @@ "@types/minimist": "^1.2.5", "@types/node": "^20.14.9", "@types/tar-fs": "^2.0.4", - "@typescript-eslint/eslint-plugin": "^8.3.0", - "@typescript-eslint/parser": "^8.3.0", + "@typescript-eslint/eslint-plugin": "^8.4.0", + "@typescript-eslint/parser": "^8.4.0", "eslint": "^9.9.1", "@tony.ganchev/eslint-plugin-header": "^3.1.2", "typescript": "^5.5.4" diff --git a/sample/package-lock.json b/sample/package-lock.json index 3256946..9d176b4 100644 --- a/sample/package-lock.json +++ b/sample/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "devDependencies": { "@types/mocha": "10.0.7", - "@types/vscode": "^1.90.0", + "@types/vscode": "^1.92.0", "@types/webpack-env": "^1.18.5", "assert": "^2.1.0", "mocha": "^10.7.3", @@ -117,9 +117,9 @@ } }, "node_modules/@types/vscode": { - "version": "1.90.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.90.0.tgz", - "integrity": "sha512-oT+ZJL7qHS9Z8bs0+WKf/kQ27qWYR3trsXpq46YDjFqBsMLG4ygGGjPaJ2tyrH0wJzjOEmDyg9PDJBBhWg9pkQ==", + "version": "1.92.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.92.0.tgz", + "integrity": "sha512-DcZoCj17RXlzB4XJ7IfKdPTcTGDLYvTOcTNkvtjXWF+K2TlKzHHkBEXNWQRpBIXixNEUgx39cQeTFunY0E2msw==", "dev": true }, "node_modules/@types/webpack-env": { @@ -1602,12 +1602,13 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.4", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, - "license": "MIT", "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" @@ -1851,9 +1852,10 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.2.3", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, - "license": "MIT", "engines": { "node": ">=8.6" }, diff --git a/sample/package.json b/sample/package.json index 7d9ef44..230c76d 100644 --- a/sample/package.json +++ b/sample/package.json @@ -35,7 +35,7 @@ "package-web": "webpack --mode production --devtool hidden-source-map" }, "devDependencies": { - "@types/vscode": "^1.90.0", + "@types/vscode": "^1.92.0", "@types/mocha": "10.0.7", "mocha": "^10.7.3", "typescript": "^5.5.4", diff --git a/sample/package.nls.json b/sample/package.nls.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/sample/package.nls.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/sample/tsconfig.json b/sample/tsconfig.json index 1e5a273..ee4f9c5 100644 --- a/sample/tsconfig.json +++ b/sample/tsconfig.json @@ -1,9 +1,9 @@ { "compilerOptions": { "module": "commonjs", - "target": "ES2020", + "target": "ES2022", "lib": [ - "ES2020", "WebWorker" + "ES2022", "WebWorker" ], "rootDir": "src", "strict": true /* enable all strict type-checking options */ diff --git a/sample/tsconfig.runTest.json b/sample/tsconfig.runTest.json index fcfa366..8715a07 100644 --- a/sample/tsconfig.runTest.json +++ b/sample/tsconfig.runTest.json @@ -1,10 +1,10 @@ { "compilerOptions": { "module": "commonjs", - "target": "ES2019", + "target": "ES2022", "outDir": "dist", "lib": [ - "ES2019" + "ES2022" ], "rootDir": "src", "strict": true diff --git a/src/browser/main.ts b/src/browser/main.ts index b8f9493..27f0fc0 100644 --- a/src/browser/main.ts +++ b/src/browser/main.ts @@ -124,16 +124,20 @@ class WorkspaceProvider implements IWorkspaceProvider { } if ('folderUri' in workspaceA && 'folderUri' in workspaceB) { - return isEqual(workspaceA.folderUri, workspaceB.folderUri); // same workspace + return this.isEqualURI(workspaceA.folderUri, workspaceB.folderUri); // same workspace } if ('workspaceUri' in workspaceA && 'workspaceUri' in workspaceB) { - return isEqual(workspaceA.workspaceUri, workspaceB.workspaceUri); // same workspace + return this.isEqualURI(workspaceA.workspaceUri, workspaceB.workspaceUri); // same workspace } return false; } + private isEqualURI(a: UriComponents, b: UriComponents): boolean { + return a.scheme === b.scheme && a.authority === b.authority && a.path === b.path; + } + } class LocalStorageURLCallbackProvider implements IURLCallbackProvider, IDisposable { @@ -251,10 +255,6 @@ class LocalStorageURLCallbackProvider implements IURLCallbackProvider, IDisposab } } -function isEqual(a: UriComponents, b: UriComponents): boolean { - return a.scheme === b.scheme && a.authority === b.authority && a.path === b.path; -} - (function () { const configElement = window.document.getElementById('vscode-workbench-web-configuration'); const configElementAttribute = configElement ? configElement.getAttribute('data-settings') : undefined; diff --git a/src/server/download.ts b/src/server/download.ts index 14923fa..31c50ea 100644 --- a/src/server/download.ts +++ b/src/server/download.ts @@ -19,17 +19,25 @@ interface DownloadInfo { version: string; } -async function getDownloadInfo(quality: 'stable' | 'insider', commit: string | undefined): Promise { - if (commit) { - const url = await getRedirect(`https://update.code.visualstudio.com/commit:${commit}/web-standalone/${quality}`); - if (!url) { - throw new Error('Failed to download URL for commit ' + commit + '. Is it valid?'); - } - return { url, version: commit }; - } +async function getLatestBuild(quality: 'stable' | 'insider'): Promise { return await fetchJSON(`https://update.code.visualstudio.com/api/update/web-standalone/${quality}/latest`); } +export async function getDownloadURL(quality: 'stable' | 'insider', commit: string): Promise { + return new Promise((resolve, reject) => { + const url = `https://update.code.visualstudio.com/commit:${commit}/web-standalone/${quality}`; + const httpLibrary = url.startsWith('https') ? https : http; + httpLibrary.get(url, { method: 'HEAD', ...getAgent(url) }, res => { + console.log(res.statusCode, res.headers.location); + if ((res.statusCode === 301 || res.statusCode === 302 || res.statusCode === 307) && res.headers.location) { + resolve(res.headers.location); + } else { + resolve(undefined); + } + }); + }); +} + const reset = '\x1b[G\x1b[0K'; async function downloadAndUntar(downloadUrl: string, destination: string, message: string): Promise { @@ -80,13 +88,24 @@ async function downloadAndUntar(downloadUrl: string, destination: string, messag export async function downloadAndUnzipVSCode(vscodeTestDir: string, quality: 'stable' | 'insider', commit: string | undefined): Promise { - const info = await getDownloadInfo(quality, commit); - - const folderName = `vscode-web-${quality}-${info.version}`; + let downloadURL: string | undefined; + if (!commit) { + const info = await getLatestBuild(quality); + commit = info.version; + downloadURL = info.url; + } + const folderName = `vscode-web-${quality}-${commit}`; const downloadedPath = path.resolve(vscodeTestDir, folderName); if (existsSync(downloadedPath) && existsSync(path.join(downloadedPath, 'version'))) { - return { type: 'static', location: downloadedPath, quality, version: info.version }; + return { type: 'static', location: downloadedPath, quality, version: commit }; + } + + if (!downloadURL) { + downloadURL = await getDownloadURL(quality, commit); + if (!downloadURL) { + throw Error(`Failed to find a download for ${quality} and ${commit}`); + } } if (existsSync(vscodeTestDir)) { @@ -98,13 +117,13 @@ export async function downloadAndUnzipVSCode(vscodeTestDir: string, quality: 'st const productName = `VS Code ${quality === 'stable' ? 'Stable' : 'Insiders'}`; try { - await downloadAndUntar(info.url, downloadedPath, `Downloading ${productName}`); + await downloadAndUntar(downloadURL, downloadedPath, `Downloading ${productName}`); await fs.writeFile(path.join(downloadedPath, 'version'), folderName); } catch (err) { console.error(err); throw Error(`Failed to download and unpack ${productName}.${commit ? ' Did you specify a valid commit?' : ''}`); } - return { type: 'static', location: downloadedPath, quality, version: info.version }; + return { type: 'static', location: downloadedPath, quality, version: commit }; } export async function fetch(api: string): Promise { @@ -131,19 +150,7 @@ export async function fetch(api: string): Promise { }); }); } -export async function getRedirect(api: string): Promise { - return new Promise((resolve, reject) => { - const httpLibrary = api.startsWith('https') ? https : http; - httpLibrary.get(api, { method: 'HEAD', ...getAgent(api) }, res => { - console.log(res.statusCode, res.headers.location); - if (res.statusCode === 301 || res.statusCode === 302 || res.statusCode === 307) { - resolve(res.headers.location); - } else { - resolve(undefined); - } - }); - }); -} + export async function fetchJSON(api: string): Promise { const data = await fetch(api); diff --git a/src/server/workbench.ts b/src/server/workbench.ts index bc89c76..2bc4b10 100644 --- a/src/server/workbench.ts +++ b/src/server/workbench.ts @@ -41,7 +41,6 @@ class Workbench { } const values: { [key: string]: string } = { WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration), - WORKBENCH_AUTH_SESSION: '', WORKBENCH_WEB_BASE_URL: this.baseUrl, WORKBENCH_BUILTIN_EXTENSIONS: asJSON(this.builtInExtensions), WORKBENCH_MAIN: await this.getMain() diff --git a/views/workbench-esm.html b/views/workbench-esm.html index cca0a85..1b2de88 100644 --- a/views/workbench-esm.html +++ b/views/workbench-esm.html @@ -19,9 +19,6 @@ - - - diff --git a/views/workbench.html b/views/workbench.html index 119fda6..e5dac05 100644 --- a/views/workbench.html +++ b/views/workbench.html @@ -19,9 +19,6 @@ - - -