Merge vscode source through 1.62 release (#19981)

* Build breaks 1

* Build breaks

* Build breaks

* Build breaks

* More build breaks

* Build breaks (#2512)

* Runtime breaks

* Build breaks

* Fix dialog location break

* Update typescript

* Fix ASAR break issue

* Unit test breaks

* Update distro

* Fix breaks in ADO builds (#2513)

* Bump to node 16

* Fix hygiene errors

* Bump distro

* Remove reference to node type

* Delete vscode specific extension

* Bump to node 16 in CI yaml

* Skip integration tests in CI builds (while fixing)

* yarn.lock update

* Bump moment dependency in remote yarn

* Fix drop-down chevron style

* Bump to node 16

* Remove playwrite from ci.yaml

* Skip building build scripts in hygine check
This commit is contained in:
Karl Burtram
2022-07-11 14:09:32 -07:00
committed by GitHub
parent fa0fcef303
commit 26455e9113
1876 changed files with 72050 additions and 37997 deletions

View File

@@ -7,7 +7,7 @@
import * as path from 'path';
import * as es from 'event-stream';
const pickle = require('chromium-pickle-js');
const pickle = require('chromium-pickle-js');
const Filesystem = <typeof AsarFilesystem>require('asar/lib/filesystem');
import * as VinylFile from 'vinyl';
import * as minimatch from 'minimatch';

View File

@@ -37,17 +37,9 @@ function createCompile(src, build, emitError) {
const sourcemaps = require('gulp-sourcemaps');
const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json');
const overrideOptions = Object.assign(Object.assign({}, getTypeScriptCompilerOptions(src)), { inlineSources: Boolean(build) });
if (!build && !process.env['SQL_NO_INLINE_SOURCEMAP']) {
if (!build) {
overrideOptions.inlineSourceMap = true;
}
else if (!build) {
console.warn('********************************************************************************************');
console.warn('* Inlining of source maps is DISABLED, which will prevent debugging from working properly, *');
console.warn('* but is required to generate code coverage reports. *');
console.warn('* To re-enable inlining of source maps clear the SQL_NO_INLINE_SOURCEMAP environment var *');
console.warn('* and re-run the build/watch task *');
console.warn('********************************************************************************************');
}
const compilation = tsb.create(projectPath, overrideOptions, false, err => reporter(err));
function pipeline(token) {
const bom = require('gulp-bom');

View File

@@ -44,15 +44,8 @@ function createCompile(src: string, build: boolean, emitError?: boolean) {
const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json');
const overrideOptions = { ...getTypeScriptCompilerOptions(src), inlineSources: Boolean(build) };
if (!build && !process.env['SQL_NO_INLINE_SOURCEMAP']) {
if (!build) {
overrideOptions.inlineSourceMap = true;
} else if (!build) {
console.warn('********************************************************************************************');
console.warn('* Inlining of source maps is DISABLED, which will prevent debugging from working properly, *');
console.warn('* but is required to generate code coverage reports. *');
console.warn('* To re-enable inlining of source maps clear the SQL_NO_INLINE_SOURCEMAP environment var *');
console.warn('* and re-run the build/watch task *');
console.warn('********************************************************************************************');
}
const compilation = tsb.create(projectPath, overrideOptions, false, err => reporter(err));
@@ -94,6 +87,7 @@ function createCompile(src: string, build: boolean, emitError?: boolean) {
export function compileTask(src: string, out: string, build: boolean): () => NodeJS.ReadWriteStream {
return function () {
if (os.totalmem() < 4_000_000_000) {
throw new Error('compilation requires 4GB of RAM');
}

View File

@@ -12,15 +12,13 @@ module.exports = new class ApiLiteralOrTypes {
}
create(context) {
return {
['TSTypeAnnotation TSUnionType TSLiteralType']: (node) => {
var _a;
if (((_a = node.literal) === null || _a === void 0 ? void 0 : _a.type) === 'TSNullKeyword') {
return;
['TSTypeAnnotation TSUnionType']: (node) => {
if (node.types.every(value => value.type === 'TSLiteralType')) {
context.report({
node: node,
messageId: 'useEnum'
});
}
context.report({
node: node,
messageId: 'useEnum'
});
}
};
}

View File

@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as eslint from 'eslint';
import { TSESTree } from '@typescript-eslint/experimental-utils';
export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule {
@@ -14,14 +15,13 @@ export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule {
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
return {
['TSTypeAnnotation TSUnionType TSLiteralType']: (node: any) => {
if (node.literal?.type === 'TSNullKeyword') {
return;
['TSTypeAnnotation TSUnionType']: (node: any) => {
if ((<TSESTree.TSUnionType>node).types.every(value => value.type === 'TSLiteralType')) {
context.report({
node: node,
messageId: 'useEnum'
});
}
context.report({
node: node,
messageId: 'useEnum'
});
}
};
}

View File

@@ -102,6 +102,10 @@
"name": "vs/workbench/contrib/interactive",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/languageStatus",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/keybindings",
"project": "vscode-workbench"

View File

@@ -49,7 +49,8 @@ const CORE_TYPES = [
'decode',
'self',
'trimLeft',
'trimRight'
'trimRight',
'queueMicrotask'
];
// Types that are defined in a common layer but are known to be only
// available in native environments should not be allowed in browser

View File

@@ -50,7 +50,8 @@ const CORE_TYPES = [
'decode',
'self',
'trimLeft',
'trimRight'
'trimRight',
'queueMicrotask'
];
// Types that are defined in a common layer but are known to be only

View File

@@ -149,26 +149,6 @@ function getMassagedTopLevelDeclarationText(ts, sourceFile, declaration, importN
}
});
}
else if (declaration.kind === ts.SyntaxKind.VariableStatement) {
const jsDoc = result.substr(0, declaration.getLeadingTriviaWidth(sourceFile));
if (jsDoc.indexOf('@monacodtsreplace') >= 0) {
const jsDocLines = jsDoc.split(/\r\n|\r|\n/);
let directives = [];
for (const jsDocLine of jsDocLines) {
const m = jsDocLine.match(/^\s*\* \/([^/]+)\/([^/]+)\/$/);
if (m) {
directives.push([new RegExp(m[1], 'g'), m[2]]);
}
}
// remove the jsdoc
result = result.substr(jsDoc.length);
if (directives.length > 0) {
// apply replace directives
const replacer = createReplacerFromDirectives(directives);
result = replacer(result);
}
}
}
result = result.replace(/export default /g, 'export ');
result = result.replace(/export declare /g, 'export ');
result = result.replace(/declare /g, '');

View File

@@ -178,25 +178,6 @@ function getMassagedTopLevelDeclarationText(ts: typeof import('typescript'), sou
// life..
}
});
} else if (declaration.kind === ts.SyntaxKind.VariableStatement) {
const jsDoc = result.substr(0, declaration.getLeadingTriviaWidth(sourceFile));
if (jsDoc.indexOf('@monacodtsreplace') >= 0) {
const jsDocLines = jsDoc.split(/\r\n|\r|\n/);
let directives: [RegExp, string][] = [];
for (const jsDocLine of jsDocLines) {
const m = jsDocLine.match(/^\s*\* \/([^/]+)\/([^/]+)\/$/);
if (m) {
directives.push([new RegExp(m[1], 'g'), m[2]]);
}
}
// remove the jsdoc
result = result.substr(jsDoc.length);
if (directives.length > 0) {
// apply replace directives
const replacer = createReplacerFromDirectives(directives);
result = replacer(result);
}
}
}
result = result.replace(/export default /g, 'export ');
result = result.replace(/export declare /g, 'export ');

View File

@@ -37,7 +37,7 @@ function loaderConfig() {
}
exports.loaderConfig = loaderConfig;
const IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i;
function loader(src, bundledFileHeader, bundleLoader) {
function loader(src, bundledFileHeader, bundleLoader, externalLoaderInfo) {
let sources = [
`${src}/vs/loader.js`
];
@@ -63,6 +63,15 @@ function loader(src, bundledFileHeader, bundleLoader) {
else {
this.emit('data', data);
}
}, function () {
if (externalLoaderInfo !== undefined) {
this.emit('data', new VinylFile({
path: 'fake2',
base: '.',
contents: Buffer.from(`require.config(${JSON.stringify(externalLoaderInfo, undefined, 2)});`)
}));
}
this.emit('end');
}))
.pipe(concat('vs/loader.js')));
}
@@ -148,7 +157,7 @@ function optimizeTask(opts) {
}
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
});
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
const result = es.merge(loader(src, bundledFileHeader, bundleLoader, opts.externalLoaderInfo), bundlesStream, resourcesStream, bundleInfoStream);
return result
.pipe(sourcemaps.write('./', {
sourceRoot: undefined,

View File

@@ -43,7 +43,7 @@ export function loaderConfig() {
const IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i;
function loader(src: string, bundledFileHeader: string, bundleLoader: boolean): NodeJS.ReadWriteStream {
function loader(src: string, bundledFileHeader: string, bundleLoader: boolean, externalLoaderInfo?: any): NodeJS.ReadWriteStream {
let sources = [
`${src}/vs/loader.js`
];
@@ -70,6 +70,15 @@ function loader(src: string, bundledFileHeader: string, bundleLoader: boolean):
} else {
this.emit('data', data);
}
}, function () {
if (externalLoaderInfo !== undefined) {
this.emit('data', new VinylFile({
path: 'fake2',
base: '.',
contents: Buffer.from(`require.config(${JSON.stringify(externalLoaderInfo, undefined, 2)});`)
}));
}
this.emit('end');
}))
.pipe(concat('vs/loader.js'))
);
@@ -135,6 +144,10 @@ export interface IOptimizeTaskOpts {
*/
resources: string[];
loaderConfig: any;
/**
* Additional info we append to the end of the loader
*/
externalLoaderInfo?: any;
/**
* (true by default - append css and nls to loader)
*/
@@ -213,7 +226,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
});
const result = es.merge(
loader(src, bundledFileHeader, bundleLoader),
loader(src, bundledFileHeader, bundleLoader, opts.externalLoaderInfo),
bundlesStream,
resourcesStream,
bundleInfoStream

View File

@@ -47,6 +47,29 @@ declare module "vinyl" {
* Used for relative pathing. Typically where a glob starts.
*/
public base: string;
/**
* Gets and sets the basename of `file.path`.
*
* Throws when `file.path` is not set.
*
* Example:
*
* ```js
* var file = new File({
* cwd: '/',
* base: '/test/',
* path: '/test/file.js'
* });
*
* console.log(file.basename); // file.js
*
* file.basename = 'file.txt';
*
* console.log(file.basename); // file.txt
* console.log(file.path); // /test/file.txt
* ```
*/
basename: string;
/**
* Full path to the file.
*/
@@ -105,7 +128,7 @@ declare module "vinyl" {
* This is required as per:
* https://github.com/microsoft/TypeScript/issues/5073
*/
namespace File {}
namespace File { }
export = File;

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildWebNodePaths = exports.acquireWebNodePaths = exports.getElectronVersion = exports.streamToPromise = exports.versionStringToNumber = exports.filter = exports.rebase = exports.getVersion = exports.ensureDir = exports.rreddir = exports.rimraf = exports.rewriteSourceMappingURL = exports.stripSourceMappingURL = exports.loadSourcemaps = exports.cleanNodeModules = exports.skipDirectories = exports.toFileUri = exports.setExecutableBit = exports.fixWin32DirectoryPermissions = exports.incremental = void 0;
exports.buildWebNodePaths = exports.createExternalLoaderConfig = exports.acquireWebNodePaths = exports.getElectronVersion = exports.streamToPromise = exports.versionStringToNumber = exports.filter = exports.rebase = exports.getVersion = exports.ensureDir = exports.rreddir = exports.rimraf = exports.rewriteSourceMappingURL = exports.stripSourceMappingURL = exports.loadSourcemaps = exports.cleanNodeModules = exports.skipDirectories = exports.toFileUri = exports.setExecutableBit = exports.fixWin32DirectoryPermissions = exports.incremental = void 0;
const es = require("event-stream");
const debounce = require("debounce");
const _filter = require("gulp-filter");
@@ -301,6 +301,23 @@ function acquireWebNodePaths() {
return nodePaths;
}
exports.acquireWebNodePaths = acquireWebNodePaths;
function createExternalLoaderConfig(webEndpoint, commit, quality) {
if (!webEndpoint || !commit || !quality) {
return undefined;
}
webEndpoint = webEndpoint + `/${quality}/${commit}`;
let nodePaths = acquireWebNodePaths();
Object.keys(nodePaths).map(function (key, _) {
nodePaths[key] = `${webEndpoint}/node_modules/${key}/${nodePaths[key]}`;
});
const externalLoaderConfig = {
baseUrl: `${webEndpoint}/out`,
recordStats: true,
paths: nodePaths
};
return externalLoaderConfig;
}
exports.createExternalLoaderConfig = createExternalLoaderConfig;
function buildWebNodePaths(outDir) {
const result = () => new Promise((resolve, _) => {
const root = path.join(__dirname, '..', '..');

View File

@@ -345,7 +345,7 @@ export function acquireWebNodePaths() {
const root = path.join(__dirname, '..', '..');
const webPackageJSON = path.join(root, '/remote/web', 'package.json');
const webPackages = JSON.parse(fs.readFileSync(webPackageJSON, 'utf8')).dependencies;
const nodePaths: { [key: string]: string } = {};
const nodePaths: { [key: string]: string } = { };
for (const key of Object.keys(webPackages)) {
const packageJSON = path.join(root, 'node_modules', key, 'package.json');
const packageData = JSON.parse(fs.readFileSync(packageJSON, 'utf8'));
@@ -366,6 +366,23 @@ export function acquireWebNodePaths() {
return nodePaths;
}
export function createExternalLoaderConfig(webEndpoint?: string, commit?: string, quality?: string) {
if (!webEndpoint || !commit || !quality) {
return undefined;
}
webEndpoint = webEndpoint + `/${quality}/${commit}`;
let nodePaths = acquireWebNodePaths();
Object.keys(nodePaths).map(function (key, _) {
nodePaths[key] = `${webEndpoint}/node_modules/${key}/${nodePaths[key]}`;
});
const externalLoaderConfig = {
baseUrl: `${webEndpoint}/out`,
recordStats: true,
paths: nodePaths
};
return externalLoaderConfig;
}
export function buildWebNodePaths(outDir: string) {
const result = () => new Promise<void>((resolve, _) => {
const root = path.join(__dirname, '..', '..');