Skip to content

Commit 976cfe3

Browse files
committed
Merge branch 'master' into isidorn/cgmanifest
2 parents ff15cad + 0232d04 commit 976cfe3

246 files changed

Lines changed: 2806 additions & 7133 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/launch.json

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@
99
"stopOnEntry": true,
1010
"args": [
1111
"hygiene"
12-
],
13-
"cwd": "${workspaceFolder}"
12+
]
1413
},
1514
{
1615
"type": "node",
1716
"request": "attach",
1817
"name": "Attach to Extension Host",
19-
"protocol": "inspector",
2018
"port": 5870,
2119
"restart": true,
22-
"smartStep": true,
2320
"outFiles": [
2421
"${workspaceFolder}/out/**/*.js"
2522
]
@@ -28,20 +25,16 @@
2825
"type": "node",
2926
"request": "attach",
3027
"name": "Attach to Shared Process",
31-
"protocol": "inspector",
3228
"port": 5871,
33-
"smartStep": true,
3429
"outFiles": [
3530
"${workspaceFolder}/out/**/*.js"
3631
]
3732
},
3833
{
3934
"type": "node",
4035
"request": "attach",
41-
"protocol": "inspector",
4236
"name": "Attach to Search Process",
4337
"port": 5876,
44-
"smartStep": true,
4538
"outFiles": [
4639
"${workspaceFolder}/out/**/*.js"
4740
]
@@ -50,9 +43,7 @@
5043
"type": "node",
5144
"request": "attach",
5245
"name": "Attach to CLI Process",
53-
"protocol": "inspector",
5446
"port": 5874,
55-
"smartStep": true,
5647
"outFiles": [
5748
"${workspaceFolder}/out/**/*.js"
5849
]
@@ -61,9 +52,7 @@
6152
"type": "node",
6253
"request": "attach",
6354
"name": "Attach to Main Process",
64-
"protocol": "inspector",
6555
"port": 5875,
66-
"smartStep": true,
6756
"outFiles": [
6857
"${workspaceFolder}/out/**/*.js"
6958
]
@@ -129,7 +118,6 @@
129118
"type": "chrome",
130119
"request": "attach",
131120
"name": "Attach to VS Code",
132-
"smartStep": true,
133121
"port": 9222
134122
},
135123
{
@@ -149,7 +137,6 @@
149137
"runtimeArgs": [
150138
"--inspect=5875", "--no-cached-data"
151139
],
152-
"smartStep": true,
153140
"skipFiles": [
154141
"**/winjs*.js"
155142
],
@@ -163,7 +150,6 @@
163150
"runtimeArgs": [
164151
"--no-cached-data"
165152
],
166-
"smartStep": true,
167153
"outFiles": [
168154
"${workspaceFolder}/out/**/*.js"
169155
]
@@ -172,7 +158,6 @@
172158
"type": "node",
173159
"request": "launch",
174160
"name": "Git Unit Tests",
175-
"protocol": "inspector",
176161
"program": "${workspaceFolder}/extensions/git/node_modules/mocha/bin/_mocha",
177162
"stopOnEntry": false,
178163
"cwd": "${workspaceFolder}/extensions/git",
@@ -212,7 +197,6 @@
212197
"type": "node",
213198
"request": "launch",
214199
"name": "Unit Tests",
215-
"protocol": "inspector",
216200
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
217201
"runtimeExecutable": "${workspaceFolder}/.build/electron/Code - OSS.app/Contents/MacOS/Electron",
218202
"windows": {
@@ -289,4 +273,4 @@
289273
]
290274
}
291275
]
292-
}
276+
}

build/builtInExtensions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"name": "ms-vscode.node-debug",
4-
"version": "1.29.2",
4+
"version": "1.30.1",
55
"repo": "https://github.com/Microsoft/vscode-node-debug",
66
"metadata": {
77
"id": "b6ded8fb-a0a0-4c1c-acbd-ab2a3bc995a6",
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"name": "ms-vscode.node-debug2",
19-
"version": "1.30.0",
19+
"version": "1.30.1",
2020
"repo": "https://github.com/Microsoft/vscode-node-debug2",
2121
"metadata": {
2222
"id": "36d19e17-7569-4841-a001-947eb18602b2",
@@ -31,10 +31,10 @@
3131
},
3232
{
3333
"name": "ms-vscode.references-view",
34-
"version": "0.0.8",
34+
"version": "0.0.9",
3535
"repo": "https://github.com/Microsoft/vscode-reference-view",
3636
"metadata": {
37-
"id": "36d19e17-7569-4841-a001-947eb18602b2",
37+
"id": "dc489f46-520d-4556-ae85-1f9eab3c412d",
3838
"publisherId": {
3939
"publisherId": "5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee",
4040
"publisherName": "ms-vscode",

build/gulpfile.editor.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,19 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'ext
152152
});
153153
});
154154
gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () {
155-
const result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
156-
cwd: path.join(__dirname, '../out-editor-esm')
157-
});
158-
console.log(result.stdout.toString());
155+
if (process.platform === 'win32') {
156+
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
157+
cwd: path.join(__dirname, '../out-editor-esm')
158+
});
159+
console.log(result.stdout.toString());
160+
console.log(result.stderr.toString());
161+
} else {
162+
const result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
163+
cwd: path.join(__dirname, '../out-editor-esm')
164+
});
165+
console.log(result.stdout.toString());
166+
console.log(result.stderr.toString());
167+
}
159168
});
160169

161170
function toExternalDTS(contents) {

build/lib/extensions.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
3636
const result = es.through();
3737
const packagedDependencies = [];
3838
const packageJsonConfig = require(path.join(extensionPath, 'package.json'));
39-
if (Array.isArray(packageJsonConfig.dependencies)) {
39+
if (packageJsonConfig.dependencies) {
4040
const webpackRootConfig = require(path.join(extensionPath, 'extension.webpack.config.js'));
4141
for (const key in webpackRootConfig.externals) {
4242
if (key in packageJsonConfig.dependencies) {
@@ -77,7 +77,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
7777
return data;
7878
}))
7979
.pipe(packageJsonFilter.restore);
80-
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => {
80+
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
8181
const webpackDone = (err, stats) => {
8282
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
8383
if (err) {
@@ -118,7 +118,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
118118
this.emit('data', data);
119119
}));
120120
});
121-
es.merge(...webpackStreams, patchFilesStream)
121+
es.merge(sequence(webpackStreams), patchFilesStream)
122122
// .pipe(es.through(function (data) {
123123
// // debug
124124
// console.log('out', data.path, data.contents.length);
@@ -216,10 +216,10 @@ function packageExtensionsStream(optsIn) {
216216
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
217217
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
218218
.filter(({ name }) => builtInExtensions.every(b => b.name !== name));
219-
const localExtensions = () => es.merge(...localExtensionDescriptions.map(extension => {
220-
return fromLocal(extension.path, opts.sourceMappingURLBase)
221-
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
222-
}));
219+
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
220+
return fromLocal(extension.path, opts.sourceMappingURLBase)
221+
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
222+
})]);
223223
const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
224224
const marketplaceExtensions = () => es.merge(...builtInExtensions
225225
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)

build/lib/extensions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
3939

4040
const packagedDependencies: string[] = [];
4141
const packageJsonConfig = require(path.join(extensionPath, 'package.json'));
42-
if (Array.isArray(packageJsonConfig.dependencies)) {
42+
if (packageJsonConfig.dependencies) {
4343
const webpackRootConfig = require(path.join(extensionPath, 'extension.webpack.config.js'));
4444
for (const key in webpackRootConfig.externals) {
4545
if (key in packageJsonConfig.dependencies) {
@@ -90,7 +90,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
9090
.pipe(packageJsonFilter.restore);
9191

9292

93-
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => {
93+
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
9494

9595
const webpackDone = (err: any, stats: any) => {
9696
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
@@ -139,7 +139,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
139139
}));
140140
});
141141

142-
es.merge(...webpackStreams, patchFilesStream)
142+
es.merge(sequence(webpackStreams), patchFilesStream)
143143
// .pipe(es.through(function (data) {
144144
// // debug
145145
// console.log('out', data.path, data.contents.length);
@@ -270,10 +270,10 @@ export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): Nod
270270
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
271271
.filter(({ name }) => builtInExtensions.every(b => b.name !== name));
272272

273-
const localExtensions = () => es.merge(...localExtensionDescriptions.map(extension => {
273+
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
274274
return fromLocal(extension.path, opts.sourceMappingURLBase)
275275
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
276-
}));
276+
})]);
277277

278278
const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
279279

build/lib/standalone.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function extractEditor(options) {
9090
}
9191
}
9292
}
93+
delete tsConfig.compilerOptions.moduleResolution;
9394
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
9495
[
9596
'vs/css.build.js',
@@ -126,7 +127,7 @@ function createESMSourcesAndResources2(options) {
126127
if (file === 'tsconfig.json') {
127128
const tsConfig = JSON.parse(fs.readFileSync(path.join(SRC_FOLDER, file)).toString());
128129
tsConfig.compilerOptions.module = 'es6';
129-
tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs');
130+
tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs').replace(/\\/g, '/');
130131
write(getDestAbsoluteFilePath(file), JSON.stringify(tsConfig, null, '\t'));
131132
continue;
132133
}
@@ -154,15 +155,16 @@ function createESMSourcesAndResources2(options) {
154155
importedFilepath = path.join(path.dirname(file), importedFilepath);
155156
}
156157
let relativePath;
157-
if (importedFilepath === path.dirname(file)) {
158+
if (importedFilepath === path.dirname(file).replace(/\\/g, '/')) {
158159
relativePath = '../' + path.basename(path.dirname(file));
159160
}
160-
else if (importedFilepath === path.dirname(path.dirname(file))) {
161+
else if (importedFilepath === path.dirname(path.dirname(file)).replace(/\\/g, '/')) {
161162
relativePath = '../../' + path.basename(path.dirname(path.dirname(file)));
162163
}
163164
else {
164165
relativePath = path.relative(path.dirname(file), importedFilepath);
165166
}
167+
relativePath = relativePath.replace(/\\/g, '/');
166168
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
167169
relativePath = './' + relativePath;
168170
}

build/lib/standalone.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
9999
}
100100
}
101101

102+
delete tsConfig.compilerOptions.moduleResolution;
102103
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
103104

104105
[
@@ -148,7 +149,7 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
148149
if (file === 'tsconfig.json') {
149150
const tsConfig = JSON.parse(fs.readFileSync(path.join(SRC_FOLDER, file)).toString());
150151
tsConfig.compilerOptions.module = 'es6';
151-
tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs');
152+
tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs').replace(/\\/g, '/');
152153
write(getDestAbsoluteFilePath(file), JSON.stringify(tsConfig, null, '\t'));
153154
continue;
154155
}
@@ -181,13 +182,14 @@ export function createESMSourcesAndResources2(options: IOptions2): void {
181182
}
182183

183184
let relativePath: string;
184-
if (importedFilepath === path.dirname(file)) {
185+
if (importedFilepath === path.dirname(file).replace(/\\/g, '/')) {
185186
relativePath = '../' + path.basename(path.dirname(file));
186-
} else if (importedFilepath === path.dirname(path.dirname(file))) {
187+
} else if (importedFilepath === path.dirname(path.dirname(file)).replace(/\\/g, '/')) {
187188
relativePath = '../../' + path.basename(path.dirname(path.dirname(file)));
188189
} else {
189190
relativePath = path.relative(path.dirname(file), importedFilepath);
190191
}
192+
relativePath = relativePath.replace(/\\/g, '/');
191193
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
192194
relativePath = './' + relativePath;
193195
}

build/lib/treeshaking.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function createTypeScriptLanguageService(options) {
5757
const FILES = discoverAndReadFiles(options);
5858
// Add fake usage files
5959
options.inlineEntryPoints.forEach((inlineEntryPoint, index) => {
60-
FILES[`inlineEntryPoint:${index}.ts`] = inlineEntryPoint;
60+
FILES[`inlineEntryPoint.${index}.ts`] = inlineEntryPoint;
6161
});
6262
// Add additional typings
6363
options.typings.forEach((typing) => {
@@ -336,7 +336,7 @@ function markNodes(languageService, options) {
336336
}
337337
options.entryPoints.forEach(moduleId => enqueueFile(moduleId + '.ts'));
338338
// Add fake usage files
339-
options.inlineEntryPoints.forEach((_, index) => enqueueFile(`inlineEntryPoint:${index}.ts`));
339+
options.inlineEntryPoints.forEach((_, index) => enqueueFile(`inlineEntryPoint.${index}.ts`));
340340
let step = 0;
341341
const checker = program.getTypeChecker();
342342
while (black_queue.length > 0 || gray_queue.length > 0) {

build/lib/treeshaking.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function createTypeScriptLanguageService(options: ITreeShakingOptions): ts.Langu
110110

111111
// Add fake usage files
112112
options.inlineEntryPoints.forEach((inlineEntryPoint, index) => {
113-
FILES[`inlineEntryPoint:${index}.ts`] = inlineEntryPoint;
113+
FILES[`inlineEntryPoint.${index}.ts`] = inlineEntryPoint;
114114
});
115115

116116
// Add additional typings
@@ -445,7 +445,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
445445

446446
options.entryPoints.forEach(moduleId => enqueueFile(moduleId + '.ts'));
447447
// Add fake usage files
448-
options.inlineEntryPoints.forEach((_, index) => enqueueFile(`inlineEntryPoint:${index}.ts`));
448+
options.inlineEntryPoints.forEach((_, index) => enqueueFile(`inlineEntryPoint.${index}.ts`));
449449

450450
let step = 0;
451451

0 commit comments

Comments
 (0)