Skip to content

Commit

Permalink
Merge branch 'master' into tyriar/webgl2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Nov 15, 2019
2 parents 2f65216 + abb01b1 commit 5f471ce
Show file tree
Hide file tree
Showing 577 changed files with 9,820 additions and 6,995 deletions.
10 changes: 9 additions & 1 deletion .github/commands.yml
Expand Up @@ -96,7 +96,7 @@
{
type: 'comment',
name: 'confirmationPending',
allowUsers: ['cleidigh', 'usernamehw'],
allowUsers: ['cleidigh', 'usernamehw', 'gjsjohnmurray', 'IllusionMH'],
action: 'updateLabels',
addLabel: 'confirmation-pending',
removeLabel: 'confirmed'
Expand All @@ -116,6 +116,14 @@
addLabel: 'needs more info',
comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
},
{
type: 'label',
name: '~needs more info',
action: 'updateLabels',
addLabel: 'needs more info',
removeLabel: '~needs more info',
comment: "Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines. Please take the time to review these and update the issue.\n\nHappy Coding!"
},
{
type: 'comment',
name: 'a11ymas',
Expand Down
6 changes: 3 additions & 3 deletions .vscode/tasks.json
Expand Up @@ -33,15 +33,15 @@
},
{
"type": "npm",
"script": "strict-initialization-watch",
"label": "TS - Strict Initialization",
"script": "strict-function-types-watch",
"label": "TS - Strict Function Types",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"problemMatcher": {
"base": "$tsc-watch",
"owner": "typescript-strict-initialization",
"owner": "typescript-function-types",
"applyTo": "allDocuments"
}
},
Expand Down
6 changes: 3 additions & 3 deletions build/builtInExtensions.json
@@ -1,7 +1,7 @@
[
{
"name": "ms-vscode.node-debug",
"version": "1.40.1",
"version": "1.41.0",
"repo": "https://github.com/Microsoft/vscode-node-debug",
"metadata": {
"id": "b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6",
Expand All @@ -16,7 +16,7 @@
},
{
"name": "ms-vscode.node-debug2",
"version": "1.39.3",
"version": "1.41.0",
"repo": "https://github.com/Microsoft/vscode-node-debug2",
"metadata": {
"id": "36d19e17-7569-4841-a001-947eb18602b2",
Expand All @@ -31,7 +31,7 @@
},
{
"name": "ms-vscode.references-view",
"version": "0.0.34",
"version": "0.0.37",
"repo": "https://github.com/Microsoft/vscode-reference-view",
"metadata": {
"id": "dc489f46-520d-4556-ae85-1f9eab3c412d",
Expand Down
73 changes: 58 additions & 15 deletions build/gulpfile.editor.js
Expand Up @@ -57,7 +57,6 @@ var BUNDLED_FILE_HEADER = [
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);

const extractEditorSrcTask = task.define('extract-editor-src', () => {
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
const apiusages = monacoapi.execute().usageContent;
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
standalone.extractEditor({
Expand All @@ -71,14 +70,6 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
apiusages,
extrausages
],
typings: [
'typings/lib.ie11_safe_es6.d.ts',
'typings/thenable.d.ts',
'typings/es6-promise.d.ts',
'typings/require-monaco.d.ts',
"typings/lib.es2018.promise.d.ts",
'vs/monaco.d.ts'
],
libs: [
`lib.es5.d.ts`,
`lib.dom.d.ts`,
Expand Down Expand Up @@ -138,18 +129,70 @@ const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () =>
});

const compileEditorESMTask = task.define('compile-editor-esm', () => {
console.log(`Launching the TS compiler at ${path.join(__dirname, '../out-editor-esm')}...`);
let result;
if (process.platform === 'win32') {
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
cwd: path.join(__dirname, '../out-editor-esm')
});
console.log(result.stdout.toString());
console.log(result.stderr.toString());
} else {
const result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
cwd: path.join(__dirname, '../out-editor-esm')
});
console.log(result.stdout.toString());
console.log(result.stderr.toString());
}

console.log(result.stdout.toString());
console.log(result.stderr.toString());

if (result.status !== 0) {
console.log(`The TS Compilation failed, preparing analysis folder...`);
const destPath = path.join(__dirname, '../../vscode-monaco-editor-esm-analysis');
return util.rimraf(destPath)().then(() => {
fs.mkdirSync(destPath);

// initialize a new repository
cp.spawnSync(`git`, [`init`], {
cwd: destPath
});

// build a list of files to copy
const files = util.rreddir(path.join(__dirname, '../out-editor-esm'));

// copy files from src
for (const file of files) {
const srcFilePath = path.join(__dirname, '../src', file);
const dstFilePath = path.join(destPath, file);
if (fs.existsSync(srcFilePath)) {
util.ensureDir(path.dirname(dstFilePath));
const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n');
fs.writeFileSync(dstFilePath, contents);
}
}

// create an initial commit to diff against
cp.spawnSync(`git`, [`add`, `.`], {
cwd: destPath
});

// create the commit
cp.spawnSync(`git`, [`commit`, `-m`, `"original sources"`, `--no-gpg-sign`], {
cwd: destPath
});

// copy files from esm
for (const file of files) {
const srcFilePath = path.join(__dirname, '../out-editor-esm', file);
const dstFilePath = path.join(destPath, file);
if (fs.existsSync(srcFilePath)) {
util.ensureDir(path.dirname(dstFilePath));
const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n');
fs.writeFileSync(dstFilePath, contents);
}
}

console.log(`Open in VS Code the folder at '${destPath}' and you can alayze the compilation error`);
throw new Error('Standalone Editor compilation failed. If this is the build machine, simply launch `yarn run gulp editor-distro` on your machine to further analyze the compilation problem.');
});
}
});

Expand Down
2 changes: 1 addition & 1 deletion build/lib/compilation.js
Expand Up @@ -44,7 +44,7 @@ function createCompile(src, build, emitError) {
const input = es.through();
const output = input
.pipe(utf8Filter)
.pipe(bom())
.pipe(bom()) // this is required to preserve BOM in test files that loose it otherwise
.pipe(utf8Filter.restore)
.pipe(tsFilter)
.pipe(util.loadSourcemaps())
Expand Down
2 changes: 1 addition & 1 deletion build/lib/compilation.ts
Expand Up @@ -54,7 +54,7 @@ function createCompile(src: string, build: boolean, emitError?: boolean) {
const input = es.through();
const output = input
.pipe(utf8Filter)
.pipe(bom())
.pipe(bom()) // this is required to preserve BOM in test files that loose it otherwise
.pipe(utf8Filter.restore)
.pipe(tsFilter)
.pipe(util.loadSourcemaps())
Expand Down
6 changes: 5 additions & 1 deletion build/lib/i18n.resources.json
Expand Up @@ -143,7 +143,7 @@
"project": "vscode-workbench"
},
{
"name": "vs/workbench/contrib/stats",
"name": "vs/workbench/contrib/tags",
"project": "vscode-workbench"
},
{
Expand Down Expand Up @@ -202,6 +202,10 @@
"name": "vs/workbench/services/actions",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/authToken",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/bulkEdit",
"project": "vscode-workbench"
Expand Down
4 changes: 3 additions & 1 deletion build/lib/standalone.js
Expand Up @@ -43,7 +43,9 @@ function extractEditor(options) {
compilerOptions.declaration = false;
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
options.compilerOptions = compilerOptions;
console.log(`Running with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
console.log(`Running tree shaker with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
// Take the extra included .d.ts files from `tsconfig.monaco.json`
options.typings = tsConfig.include.filter(includedFile => /\.d\.ts$/.test(includedFile));
let result = tss.shake(options);
for (let fileName in result) {
if (result.hasOwnProperty(fileName)) {
Expand Down
5 changes: 4 additions & 1 deletion build/lib/standalone.ts
Expand Up @@ -50,7 +50,10 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str

options.compilerOptions = compilerOptions;

console.log(`Running with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);
console.log(`Running tree shaker with shakeLevel ${tss.toStringShakeLevel(options.shakeLevel)}`);

// Take the extra included .d.ts files from `tsconfig.monaco.json`
options.typings = (<string[]>tsConfig.include).filter(includedFile => /\.d\.ts$/.test(includedFile));

let result = tss.shake(options);
for (let fileName in result) {
Expand Down
16 changes: 8 additions & 8 deletions build/lib/treeshaking.js
Expand Up @@ -25,17 +25,17 @@ function toStringShakeLevel(shakeLevel) {
}
}
exports.toStringShakeLevel = toStringShakeLevel;
function printDiagnostics(diagnostics) {
function printDiagnostics(options, diagnostics) {
for (const diag of diagnostics) {
let result = '';
if (diag.file) {
result += `${diag.file.fileName}: `;
result += `${path.join(options.sourcesRoot, diag.file.fileName)}`;
}
if (diag.file && diag.start) {
let location = diag.file.getLineAndCharacterOfPosition(diag.start);
result += `- ${location.line + 1},${location.character} - `;
result += `:${location.line + 1}:${location.character}`;
}
result += JSON.stringify(diag.messageText);
result += ` - ` + JSON.stringify(diag.messageText);
console.log(result);
}
}
Expand All @@ -44,17 +44,17 @@ function shake(options) {
const program = languageService.getProgram();
const globalDiagnostics = program.getGlobalDiagnostics();
if (globalDiagnostics.length > 0) {
printDiagnostics(globalDiagnostics);
printDiagnostics(options, globalDiagnostics);
throw new Error(`Compilation Errors encountered.`);
}
const syntacticDiagnostics = program.getSyntacticDiagnostics();
if (syntacticDiagnostics.length > 0) {
printDiagnostics(syntacticDiagnostics);
printDiagnostics(options, syntacticDiagnostics);
throw new Error(`Compilation Errors encountered.`);
}
const semanticDiagnostics = program.getSemanticDiagnostics();
if (semanticDiagnostics.length > 0) {
printDiagnostics(semanticDiagnostics);
printDiagnostics(options, semanticDiagnostics);
throw new Error(`Compilation Errors encountered.`);
}
markNodes(languageService, options);
Expand Down Expand Up @@ -358,7 +358,7 @@ function markNodes(languageService, options) {
++step;
let node;
if (step % 100 === 0) {
console.log(`${step}/${step + black_queue.length + gray_queue.length} (${black_queue.length}, ${gray_queue.length})`);
console.log(`Treeshaking - ${Math.floor(100 * step / (step + black_queue.length + gray_queue.length))}% - ${step}/${step + black_queue.length + gray_queue.length} (${black_queue.length}, ${gray_queue.length})`);
}
if (black_queue.length === 0) {
for (let i = 0; i < gray_queue.length; i++) {
Expand Down
16 changes: 8 additions & 8 deletions build/lib/treeshaking.ts
Expand Up @@ -71,17 +71,17 @@ export interface ITreeShakingResult {
[file: string]: string;
}

function printDiagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>): void {
function printDiagnostics(options: ITreeShakingOptions, diagnostics: ReadonlyArray<ts.Diagnostic>): void {
for (const diag of diagnostics) {
let result = '';
if (diag.file) {
result += `${diag.file.fileName}: `;
result += `${path.join(options.sourcesRoot, diag.file.fileName)}`;
}
if (diag.file && diag.start) {
let location = diag.file.getLineAndCharacterOfPosition(diag.start);
result += `- ${location.line + 1},${location.character} - `;
result += `:${location.line + 1}:${location.character}`;
}
result += JSON.stringify(diag.messageText);
result += ` - ` + JSON.stringify(diag.messageText);
console.log(result);
}
}
Expand All @@ -92,19 +92,19 @@ export function shake(options: ITreeShakingOptions): ITreeShakingResult {

const globalDiagnostics = program.getGlobalDiagnostics();
if (globalDiagnostics.length > 0) {
printDiagnostics(globalDiagnostics);
printDiagnostics(options, globalDiagnostics);
throw new Error(`Compilation Errors encountered.`);
}

const syntacticDiagnostics = program.getSyntacticDiagnostics();
if (syntacticDiagnostics.length > 0) {
printDiagnostics(syntacticDiagnostics);
printDiagnostics(options, syntacticDiagnostics);
throw new Error(`Compilation Errors encountered.`);
}

const semanticDiagnostics = program.getSemanticDiagnostics();
if (semanticDiagnostics.length > 0) {
printDiagnostics(semanticDiagnostics);
printDiagnostics(options, semanticDiagnostics);
throw new Error(`Compilation Errors encountered.`);
}

Expand Down Expand Up @@ -471,7 +471,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
let node: ts.Node;

if (step % 100 === 0) {
console.log(`${step}/${step + black_queue.length + gray_queue.length} (${black_queue.length}, ${gray_queue.length})`);
console.log(`Treeshaking - ${Math.floor(100 * step / (step + black_queue.length + gray_queue.length))}% - ${step}/${step + black_queue.length + gray_queue.length} (${black_queue.length}, ${gray_queue.length})`);
}

if (black_queue.length === 0) {
Expand Down
25 changes: 25 additions & 0 deletions build/lib/util.js
Expand Up @@ -185,6 +185,31 @@ function rimraf(dir) {
return result;
}
exports.rimraf = rimraf;
function _rreaddir(dirPath, prepend, result) {
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
for (const entry of entries) {
if (entry.isDirectory()) {
_rreaddir(path.join(dirPath, entry.name), `${prepend}/${entry.name}`, result);
}
else {
result.push(`${prepend}/${entry.name}`);
}
}
}
function rreddir(dirPath) {
let result = [];
_rreaddir(dirPath, '', result);
return result;
}
exports.rreddir = rreddir;
function ensureDir(dirPath) {
if (fs.existsSync(dirPath)) {
return;
}
ensureDir(path.dirname(dirPath));
fs.mkdirSync(dirPath);
}
exports.ensureDir = ensureDir;
function getVersion(root) {
let version = process.env['BUILD_SOURCEVERSION'];
if (!version || !/^[0-9a-f]{40}$/i.test(version)) {
Expand Down

0 comments on commit 5f471ce

Please sign in to comment.