chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
@ -17,8 +17,8 @@ arguments=(
|
||||
'--telemetry[show all telemetry events which VS code collects]'
|
||||
'--extensions-dir[set the root path for extensions]:root path:_directories'
|
||||
'--list-extensions[list the installed extensions]'
|
||||
'--category[filters installed extension list by category, when using --list-extension]'
|
||||
'--show-versions[show versions of installed extensions, when using --list-extension]'
|
||||
'--category[filters installed extension list by category, when using --list-extensions]'
|
||||
'--show-versions[show versions of installed extensions, when using --list-extensions]'
|
||||
'--install-extension[install an extension]:id or path:_files -g "*.vsix(-.)"'
|
||||
'--uninstall-extension[uninstall an extension]:id or path:_files -g "*.vsix(-.)"'
|
||||
'--enable-proposed-api[enables proposed API features for extensions]::extension id: '
|
||||
|
@ -66,13 +66,16 @@ NdCFTW7wY0Fb1fWJ+/KTsC4=
|
||||
if [ ! -f $CODE_SOURCE_PART ]; then
|
||||
# Write source list if it does not exist
|
||||
WRITE_SOURCE=1
|
||||
elif grep -q "# disabled on upgrade to" /etc/apt/sources.list.d/vscode.list; then
|
||||
elif grep -Eq "http:\/\/packages\.microsoft\.com\/repos\/vscode" $CODE_SOURCE_PART; then
|
||||
# Migrate from old repository
|
||||
WRITE_SOURCE=1
|
||||
elif grep -q "# disabled on upgrade to" $CODE_SOURCE_PART; then
|
||||
# Write source list if it was disabled by OS upgrade
|
||||
WRITE_SOURCE=1
|
||||
fi
|
||||
if [ "$WRITE_SOURCE" -eq "1" ]; then
|
||||
echo "### THIS FILE IS AUTOMATICALLY CONFIGURED ###
|
||||
# You may comment out this entry, but any other modifications may be lost.
|
||||
deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/@@REPOSITORY_NAME@@ stable main" > $CODE_SOURCE_PART
|
||||
deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main" > $CODE_SOURCE_PART
|
||||
fi
|
||||
fi
|
||||
|
@ -21,6 +21,7 @@ const vfs = require('vinyl-fs');
|
||||
const uuid = require('uuid');
|
||||
|
||||
const extensions = require('../../build/lib/extensions');
|
||||
const { getBuiltInExtensions } = require('../../build/lib/builtInExtensions');
|
||||
|
||||
const APP_ROOT = path.join(__dirname, '..', '..');
|
||||
const BUILTIN_EXTENSIONS_ROOT = path.join(APP_ROOT, 'extensions');
|
||||
@ -28,6 +29,14 @@ const BUILTIN_MARKETPLACE_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'built
|
||||
const WEB_DEV_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInWebDevExtensions');
|
||||
const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html');
|
||||
|
||||
// This is useful to simulate real world CORS
|
||||
const ALLOWED_CORS_ORIGINS = [
|
||||
'http://localhost:8081',
|
||||
'http://127.0.0.1:8081',
|
||||
'http://localhost:8080',
|
||||
'http://127.0.0.1:8080',
|
||||
];
|
||||
|
||||
const WEB_PLAYGROUND_VERSION = '0.0.10';
|
||||
|
||||
const args = minimist(process.argv, {
|
||||
@ -37,7 +46,6 @@ const args = minimist(process.argv, {
|
||||
'verbose',
|
||||
'wrap-iframe',
|
||||
'enable-sync',
|
||||
'trusted-types'
|
||||
],
|
||||
string: [
|
||||
'scheme',
|
||||
@ -54,7 +62,6 @@ if (args.help) {
|
||||
'yarn web [options]\n' +
|
||||
' --no-launch Do not open VSCode web in the browser\n' +
|
||||
' --wrap-iframe Wrap the Web Worker Extension Host in an iframe\n' +
|
||||
' --trusted-types Enable trusted types (report only)\n' +
|
||||
' --enable-sync Enable sync by default\n' +
|
||||
' --scheme Protocol (https or http)\n' +
|
||||
' --host Remote host\n' +
|
||||
@ -82,6 +89,8 @@ const exists = (path) => util.promisify(fs.exists)(path);
|
||||
const readFile = (path) => util.promisify(fs.readFile)(path);
|
||||
|
||||
async function getBuiltInExtensionInfos() {
|
||||
await getBuiltInExtensions();
|
||||
|
||||
const allExtensions = [];
|
||||
/** @type {Object.<string, string>} */
|
||||
const locations = {};
|
||||
@ -281,6 +290,17 @@ secondaryServer.on('error', err => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
/**
|
||||
* @param {import('http').IncomingMessage} req
|
||||
*/
|
||||
function addCORSReplyHeader(req) {
|
||||
if (typeof req.headers['origin'] !== 'string') {
|
||||
// not a CORS request
|
||||
return false;
|
||||
}
|
||||
return (ALLOWED_CORS_ORIGINS.indexOf(req.headers['origin']) >= 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import('http').IncomingMessage} req
|
||||
* @param {import('http').ServerResponse} res
|
||||
@ -291,9 +311,10 @@ async function handleStatic(req, res, parsedUrl) {
|
||||
if (/^\/static\/extensions\//.test(parsedUrl.pathname)) {
|
||||
const relativePath = decodeURIComponent(parsedUrl.pathname.substr('/static/extensions/'.length));
|
||||
const filePath = getExtensionFilePath(relativePath, (await builtInExtensionsPromise).locations);
|
||||
const responseHeaders = {
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
};
|
||||
const responseHeaders = {};
|
||||
if (addCORSReplyHeader(req)) {
|
||||
responseHeaders['Access-Control-Allow-Origin'] = '*';
|
||||
}
|
||||
if (!filePath) {
|
||||
return serveError(req, res, 400, `Bad request.`, responseHeaders);
|
||||
}
|
||||
@ -315,9 +336,10 @@ async function handleExtension(req, res, parsedUrl) {
|
||||
// Strip `/extension/` from the path
|
||||
const relativePath = decodeURIComponent(parsedUrl.pathname.substr('/extension/'.length));
|
||||
const filePath = getExtensionFilePath(relativePath, (await commandlineProvidedExtensionsPromise).locations);
|
||||
const responseHeaders = {
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
};
|
||||
const responseHeaders = {};
|
||||
if (addCORSReplyHeader(req)) {
|
||||
responseHeaders['Access-Control-Allow-Origin'] = '*';
|
||||
}
|
||||
if (!filePath) {
|
||||
return serveError(req, res, 400, `Bad request.`, responseHeaders);
|
||||
}
|
||||
@ -377,11 +399,18 @@ async function handleRoot(req, res) {
|
||||
fancyLog(`${ansiColors.magenta('Additional extensions')}: ${staticExtensions.map(e => path.basename(e.extensionLocation.path)).join(', ') || 'None'}`);
|
||||
}
|
||||
|
||||
const secondaryHost = (
|
||||
req.headers['host']
|
||||
? req.headers['host'].replace(':' + PORT, ':' + SECONDARY_PORT)
|
||||
: `${HOST}:${SECONDARY_PORT}`
|
||||
);
|
||||
const webConfigJSON = {
|
||||
folderUri: folderUri,
|
||||
staticExtensions,
|
||||
enableSyncByDefault: args['enable-sync'],
|
||||
webWorkerExtensionHostIframeSrc: `${SCHEME}://${HOST}:${SECONDARY_PORT}/static/out/vs/workbench/services/extensions/worker/httpWebWorkerExtensionHostIframe.html`
|
||||
settingsSyncOptions: {
|
||||
enabled: args['enable-sync']
|
||||
},
|
||||
webWorkerExtensionHostIframeSrc: `${SCHEME}://${secondaryHost}/static/out/vs/workbench/services/extensions/worker/httpWebWorkerExtensionHostIframe.html`
|
||||
};
|
||||
if (args['wrap-iframe']) {
|
||||
webConfigJSON._wrapWebWorkerExtHostInIframe = true;
|
||||
@ -404,12 +433,10 @@ async function handleRoot(req, res) {
|
||||
.replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
|
||||
.replace('{{WEBVIEW_ENDPOINT}}', '');
|
||||
|
||||
|
||||
const headers = { 'Content-Type': 'text/html' };
|
||||
if (args['trusted-types']) {
|
||||
headers['Content-Security-Policy-Report-Only'] = 'require-trusted-types-for \'script\';';
|
||||
}
|
||||
|
||||
const headers = {
|
||||
'Content-Type': 'text/html',
|
||||
'Content-Security-Policy': 'require-trusted-types-for \'script\';'
|
||||
};
|
||||
res.writeHead(200, headers);
|
||||
return res.end(data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user