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:
51
lib/vscode/build/npm/dirs.js
Normal file
51
lib/vscode/build/npm/dirs.js
Normal file
@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// Complete list of directories where yarn should be executed to install node modules
|
||||
exports.dirs = [
|
||||
'',
|
||||
'build',
|
||||
'build/lib/watch',
|
||||
'extensions',
|
||||
'extensions/configuration-editing',
|
||||
'extensions/css-language-features',
|
||||
'extensions/css-language-features/server',
|
||||
'extensions/debug-auto-launch',
|
||||
'extensions/debug-server-ready',
|
||||
'extensions/emmet',
|
||||
'extensions/extension-editing',
|
||||
'extensions/git',
|
||||
'extensions/git-ui',
|
||||
'extensions/github',
|
||||
'extensions/github-authentication',
|
||||
'extensions/grunt',
|
||||
'extensions/gulp',
|
||||
'extensions/html-language-features',
|
||||
'extensions/html-language-features/server',
|
||||
'extensions/image-preview',
|
||||
'extensions/jake',
|
||||
'extensions/json-language-features',
|
||||
'extensions/json-language-features/server',
|
||||
'extensions/markdown-language-features',
|
||||
'extensions/merge-conflict',
|
||||
'extensions/microsoft-authentication',
|
||||
'extensions/npm',
|
||||
'extensions/php-language-features',
|
||||
'extensions/search-result',
|
||||
'extensions/simple-browser',
|
||||
'extensions/testing-editor-contributions',
|
||||
'extensions/typescript-language-features',
|
||||
'extensions/vscode-api-tests',
|
||||
'extensions/vscode-colorize-tests',
|
||||
'extensions/vscode-custom-editor-tests',
|
||||
'extensions/vscode-notebook-tests',
|
||||
'extensions/vscode-test-resolver',
|
||||
'remote',
|
||||
'remote/web',
|
||||
'test/automation',
|
||||
'test/integration/browser',
|
||||
'test/monaco',
|
||||
'test/smoke',
|
||||
];
|
@ -6,6 +6,7 @@
|
||||
const cp = require('child_process');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { dirs } = require('./dirs');
|
||||
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
||||
|
||||
/**
|
||||
@ -21,6 +22,10 @@ function yarnInstall(location, opts) {
|
||||
const argv = JSON.parse(raw);
|
||||
const original = argv.original || [];
|
||||
const args = original.filter(arg => arg === '--ignore-optional' || arg === '--frozen-lockfile');
|
||||
if (opts.ignoreEngines) {
|
||||
args.push('--ignore-engines');
|
||||
delete opts.ignoreEngines;
|
||||
}
|
||||
|
||||
console.log(`Installing dependencies in ${location}...`);
|
||||
console.log(`$ yarn ${args.join(' ')}`);
|
||||
@ -31,25 +36,47 @@ function yarnInstall(location, opts) {
|
||||
}
|
||||
}
|
||||
|
||||
yarnInstall('extensions'); // node modules shared by all extensions
|
||||
for (let dir of dirs) {
|
||||
|
||||
<<<<<<< HEAD
|
||||
// NOTE@coder: Skip these dependencies since we don't use them.
|
||||
// if (!(process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64'))) {
|
||||
// yarnInstall('remote'); // node modules used by vscode server
|
||||
// yarnInstall('remote/web'); // node modules used by vscode web
|
||||
// }
|
||||
|
||||
const allExtensionFolders = fs.readdirSync('extensions');
|
||||
const extensions = allExtensionFolders.filter(e => {
|
||||
try {
|
||||
let packageJSON = JSON.parse(fs.readFileSync(path.join('extensions', e, 'package.json')).toString());
|
||||
return packageJSON && (packageJSON.dependencies || packageJSON.devDependencies);
|
||||
} catch (e) {
|
||||
return false;
|
||||
=======
|
||||
if (dir === '') {
|
||||
// `yarn` already executed in root
|
||||
continue;
|
||||
}
|
||||
});
|
||||
|
||||
extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
|
||||
if (/^remote/.test(dir) && process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64')) {
|
||||
// windows arm: do not execute `yarn` on remote folder
|
||||
continue;
|
||||
}
|
||||
>>>>>>> 89b6e0164fa770333755b11504e19a4232b1a2d4
|
||||
|
||||
if (dir === 'build/lib/watch') {
|
||||
// node modules for watching, specific to host node version, not electron
|
||||
yarnInstallBuildDependencies();
|
||||
continue;
|
||||
}
|
||||
|
||||
let opts;
|
||||
|
||||
if (dir === 'remote') {
|
||||
// node modules used by vscode server
|
||||
const env = { ...process.env };
|
||||
if (process.env['VSCODE_REMOTE_CC']) { env['CC'] = process.env['VSCODE_REMOTE_CC']; }
|
||||
if (process.env['VSCODE_REMOTE_CXX']) { env['CXX'] = process.env['VSCODE_REMOTE_CXX']; }
|
||||
if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; }
|
||||
opts = { env };
|
||||
} else if (/^extensions\//.test(dir)) {
|
||||
opts = { ignoreEngines: true };
|
||||
}
|
||||
|
||||
yarnInstall(dir, opts);
|
||||
}
|
||||
|
||||
function yarnInstallBuildDependencies() {
|
||||
// make sure we install the deps of build/lib/watch for the system installed
|
||||
@ -69,10 +96,13 @@ runtime "${runtime}"`;
|
||||
yarnInstall(watchPath);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
yarnInstall(`build`); // node modules required for build
|
||||
// yarnInstall('test/automation'); // node modules required for smoketest
|
||||
// yarnInstall('test/smoke'); // node modules required for smoketest
|
||||
// yarnInstall('test/integration/browser'); // node modules required for integration
|
||||
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
|
||||
|
||||
=======
|
||||
>>>>>>> 89b6e0164fa770333755b11504e19a4232b1a2d4
|
||||
cp.execSync('git config pull.rebase true');
|
||||
|
@ -28,7 +28,41 @@ if (!/yarn[\w-.]*\.js$|yarnpkg$/.test(process.env['npm_execpath'])) {
|
||||
err = true;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
if (!hasSupportedVisualStudioVersion()) {
|
||||
console.error('\033[1;31m*** Invalid C/C++ Compiler Toolchain. Please check https://github.com/microsoft/vscode/wiki/How-to-Contribute.\033[0;0m');
|
||||
err = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (err) {
|
||||
console.error('');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function hasSupportedVisualStudioVersion() {
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
// Translated over from
|
||||
// https://source.chromium.org/chromium/chromium/src/+/master:build/vs_toolchain.py;l=140-175
|
||||
const supportedVersions = ['2019', '2017'];
|
||||
|
||||
const availableVersions = [];
|
||||
for (const version of supportedVersions) {
|
||||
let vsPath = process.env[`vs${version}_install`];
|
||||
if (vsPath && fs.existsSync(vsPath)) {
|
||||
availableVersions.push(version);
|
||||
break;
|
||||
}
|
||||
const programFiles86Path = process.env['ProgramFiles(x86)'];
|
||||
if (programFiles86Path) {
|
||||
vsPath = `${programFiles86Path}/Microsoft Visual Studio/${version}`;
|
||||
const vsTypes = ['Enterprise', 'Professional', 'Community', 'Preview', 'BuildTools'];
|
||||
if (vsTypes.some(vsType => fs.existsSync(path.join(vsPath, vsType)))) {
|
||||
availableVersions.push(version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return availableVersions.length;
|
||||
}
|
||||
|
@ -1,82 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var plist = require('fast-plist');
|
||||
|
||||
var mappings = {
|
||||
"background": ["editor.background"],
|
||||
"foreground": ["editor.foreground"],
|
||||
"hoverHighlight": ["editor.hoverHighlightBackground"],
|
||||
"linkForeground": ["editorLink.foreground"],
|
||||
"selection": ["editor.selectionBackground"],
|
||||
"inactiveSelection": ["editor.inactiveSelectionBackground"],
|
||||
"selectionHighlightColor": ["editor.selectionHighlightBackground"],
|
||||
"wordHighlight": ["editor.wordHighlightBackground"],
|
||||
"wordHighlightStrong": ["editor.wordHighlightStrongBackground"],
|
||||
"findMatchHighlight": ["editor.findMatchHighlightBackground", "peekViewResult.matchHighlightBackground"],
|
||||
"currentFindMatchHighlight": ["editor.findMatchBackground"],
|
||||
"findRangeHighlight": ["editor.findRangeHighlightBackground"],
|
||||
"referenceHighlight": ["peekViewEditor.matchHighlightBackground"],
|
||||
"lineHighlight": ["editor.lineHighlightBackground"],
|
||||
"rangeHighlight": ["editor.rangeHighlightBackground"],
|
||||
"caret": ["editorCursor.foreground"],
|
||||
"invisibles": ["editorWhitespace.foreground"],
|
||||
"guide": ["editorIndentGuide.background"],
|
||||
"ansiBlack": ["terminal.ansiBlack"], "ansiRed": ["terminal.ansiRed"], "ansiGreen": ["terminal.ansiGreen"], "ansiYellow": ["terminal.ansiYellow"],
|
||||
"ansiBlue": ["terminal.ansiBlue"], "ansiMagenta": ["terminal.ansiMagenta"], "ansiCyan": ["terminal.ansiCyan"], "ansiWhite": ["terminal.ansiWhite"],
|
||||
"ansiBrightBlack": ["terminal.ansiBrightBlack"], "ansiBrightRed": ["terminal.ansiBrightRed"], "ansiBrightGreen": ["terminal.ansiBrightGreen"],
|
||||
"ansiBrightYellow": ["terminal.ansiBrightYellow"], "ansiBrightBlue": ["terminal.ansiBrightBlue"], "ansiBrightMagenta": ["terminal.ansiBrightMagenta"],
|
||||
"ansiBrightCyan": ["terminal.ansiBrightCyan"], "ansiBrightWhite": ["terminal.ansiBrightWhite"]
|
||||
};
|
||||
|
||||
exports.update = function (srcName, destName) {
|
||||
try {
|
||||
console.log('reading ', srcName);
|
||||
let result = {};
|
||||
let plistContent = fs.readFileSync(srcName).toString();
|
||||
let theme = plist.parse(plistContent);
|
||||
let settings = theme.settings;
|
||||
if (Array.isArray(settings)) {
|
||||
let colorMap = {};
|
||||
for (let entry of settings) {
|
||||
let scope = entry.scope;
|
||||
if (scope) {
|
||||
let parts = scope.split(',').map(p => p.trim());
|
||||
if (parts.length > 1) {
|
||||
entry.scope = parts;
|
||||
}
|
||||
} else {
|
||||
var entrySettings = entry.settings;
|
||||
for (let entry in entrySettings) {
|
||||
let mapping = mappings[entry];
|
||||
if (mapping) {
|
||||
for (let newKey of mapping) {
|
||||
colorMap[newKey] = entrySettings[entry];
|
||||
}
|
||||
if (entry !== 'foreground' && entry !== 'background') {
|
||||
delete entrySettings[entry];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
result.name = theme.name;
|
||||
result.tokenColors = settings;
|
||||
result.colors = colorMap;
|
||||
}
|
||||
fs.writeFileSync(destName, JSON.stringify(result, null, '\t'));
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
if (path.basename(process.argv[1]) === 'update-theme.js') {
|
||||
exports.update(process.argv[2], process.argv[3]);
|
||||
}
|
Reference in New Issue
Block a user