Skip to content

Commit 68ec3ef

Browse files
authored
Merge pull request #1 from microsoft/main
Adding the `VSCode-sessionId` header to extension query request
2 parents 334795d + ebaa253 commit 68ec3ef

File tree

285 files changed

+6024
-2456
lines changed

Some content is hidden

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

285 files changed

+6024
-2456
lines changed

.github/workflows/no-yarn-lock-changes.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
run: |
1919
echo "user: ${{ github.event.pull_request.user.login }}"
2020
echo "role: ${{ fromJson(steps.get_permissions.outputs.data).permission }}"
21+
echo "is dependabot: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}"
2122
echo "should_run: ${{ !contains(fromJson('["admin", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) }}"
22-
echo "::set-output name=should_run::${{ !contains(fromJson('["admin", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) }}"
23+
echo "::set-output name=should_run::${{ !contains(fromJson('["admin", "write"]'), fromJson(steps.get_permissions.outputs.data).permission) && github.event.pull_request.user.login != 'dependabot[bot]' }}"
2324
- name: Get file changes
2425
uses: trilom/file-changes-action@ce38c8ce2459ca3c303415eec8cb0409857b4272
2526
if: ${{ steps.control.outputs.should_run == 'true' }}

.yarnrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
disturl "https://electronjs.org/headers"
2-
target "18.3.4"
2+
target "18.3.5"
33
runtime "electron"
44
build_from_source "true"

build/azure-pipelines/upload-nlsmetadata.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const vfs = require("vinyl-fs");
99
const merge = require("gulp-merge-json");
1010
const gzip = require("gulp-gzip");
1111
const identity_1 = require("@azure/identity");
12+
const path = require("path");
13+
const fs_1 = require("fs");
1214
const azure = require('gulp-azure-storage');
1315
const commit = process.env['VSCODE_DISTRO_COMMIT'] || process.env['BUILD_SOURCEVERSION'];
1416
const credential = new identity_1.ClientSecretCredential(process.env['AZURE_TENANT_ID'], process.env['AZURE_CLIENT_ID'], process.env['AZURE_CLIENT_SECRET']);
@@ -62,7 +64,11 @@ function main() {
6264
break;
6365
}
6466
}
65-
const key = 'vscode.' + file.relative.split('/')[0];
67+
// Get extension id and use that as the key
68+
const folderPath = path.join(file.base, file.relative.split('/')[0]);
69+
const manifest = (0, fs_1.readFileSync)(path.join(folderPath, 'package.json'), 'utf-8');
70+
const manifestJson = JSON.parse(manifest);
71+
const key = manifestJson.publisher + '.' + manifestJson.name;
6672
return { [key]: parsedJson };
6773
},
6874
}))

build/azure-pipelines/upload-nlsmetadata.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import * as vfs from 'vinyl-fs';
99
import * as merge from 'gulp-merge-json';
1010
import * as gzip from 'gulp-gzip';
1111
import { ClientSecretCredential } from '@azure/identity';
12+
import path = require('path');
13+
import { readFileSync } from 'fs';
1214
const azure = require('gulp-azure-storage');
1315

1416
const commit = process.env['VSCODE_DISTRO_COMMIT'] || process.env['BUILD_SOURCEVERSION'];
@@ -79,7 +81,12 @@ function main(): Promise<void> {
7981
break;
8082
}
8183
}
82-
const key = 'vscode.' + file.relative.split('/')[0];
84+
85+
// Get extension id and use that as the key
86+
const folderPath = path.join(file.base, file.relative.split('/')[0]);
87+
const manifest = readFileSync(path.join(folderPath, 'package.json'), 'utf-8');
88+
const manifestJson = JSON.parse(manifest);
89+
const key = manifestJson.publisher + '.' + manifestJson.name;
8390
return { [key]: parsedJson };
8491
},
8592
}))

build/gulpfile.compile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const compileBuildTask = task.define('compile-build',
1515
task.series(
1616
util.rimraf('out-build'),
1717
util.buildWebNodePaths('out-build'),
18-
compilation.compileTask('src', 'out-build', true, false)
18+
compilation.compileTask('src', 'out-build', true)
1919
)
2020
);
2121
gulp.task(compileBuildTask);

build/gulpfile.editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
8484
});
8585
});
8686

87-
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true, false));
87+
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
8888

8989
const optimizeEditorAMDTask = task.define('optimize-editor-amd', common.optimizeTask({
9090
src: 'out-editor-build',

build/gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require('events').EventEmitter.defaultMaxListeners = 100;
1111
const gulp = require('gulp');
1212
const util = require('./lib/util');
1313
const task = require('./lib/task');
14-
const { compileTask, watchTask, compileApiProposalNamesTask, watchApiProposalNamesTask } = require('./lib/compilation');
14+
const { transpileTask, compileTask, watchTask, compileApiProposalNamesTask, watchApiProposalNamesTask } = require('./lib/compilation');
1515
const { monacoTypecheckTask/* , monacoTypecheckWatchTask */ } = require('./gulpfile.editor');
1616
const { compileExtensionsTask, watchExtensionsTask, compileExtensionMediaTask } = require('./gulpfile.extensions');
1717

@@ -20,11 +20,11 @@ gulp.task(compileApiProposalNamesTask);
2020
gulp.task(watchApiProposalNamesTask);
2121

2222
// Transpile only
23-
const transpileClientTask = task.define('transpile-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compileTask('src', 'out', false, true)));
23+
const transpileClientTask = task.define('transpile-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), transpileTask('src', 'out')));
2424
gulp.task(transpileClientTask);
2525

2626
// Fast compile for development time
27-
const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compileApiProposalNamesTask, compileTask('src', 'out', false, false)));
27+
const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), compileApiProposalNamesTask, compileTask('src', 'out', false)));
2828
gulp.task(compileClientTask);
2929

3030
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), util.buildWebNodePaths('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask)));

build/lib/compilation.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Licensed under the MIT License. See License.txt in the project root for license information.
55
*--------------------------------------------------------------------------------------------*/
66
Object.defineProperty(exports, "__esModule", { value: true });
7-
exports.watchApiProposalNamesTask = exports.compileApiProposalNamesTask = exports.watchTask = exports.compileTask = void 0;
7+
exports.watchApiProposalNamesTask = exports.compileApiProposalNamesTask = exports.watchTask = exports.compileTask = exports.transpileTask = void 0;
88
const es = require("event-stream");
99
const fs = require("fs");
1010
const gulp = require("gulp");
@@ -18,7 +18,6 @@ const ansiColors = require("ansi-colors");
1818
const os = require("os");
1919
const File = require("vinyl");
2020
const task = require("./task");
21-
const tsb = require("./tsb");
2221
const watch = require('./watch');
2322
const reporter = (0, reporter_1.createReporter)();
2423
function getTypeScriptCompilerOptions(src) {
@@ -36,7 +35,7 @@ function getTypeScriptCompilerOptions(src) {
3635
return options;
3736
}
3837
function createCompile(src, build, emitError, transpileOnly) {
39-
// const tsb = require('./tsb') as typeof import('./tsb');
38+
const tsb = require('./tsb');
4039
const sourcemaps = require('gulp-sourcemaps');
4140
const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json');
4241
const overrideOptions = { ...getTypeScriptCompilerOptions(src), inlineSources: Boolean(build) };
@@ -60,7 +59,7 @@ function createCompile(src, build, emitError, transpileOnly) {
6059
.pipe(noDeclarationsFilter)
6160
.pipe(build ? nls.nls() : es.through())
6261
.pipe(noDeclarationsFilter.restore)
63-
.pipe(sourcemaps.write('.', {
62+
.pipe(transpileOnly ? es.through() : sourcemaps.write('.', {
6463
addComment: false,
6564
includeContent: !!build,
6665
sourceRoot: overrideOptions.sourceRoot
@@ -74,12 +73,22 @@ function createCompile(src, build, emitError, transpileOnly) {
7473
};
7574
return pipeline;
7675
}
77-
function compileTask(src, out, build, transpileOnly) {
76+
function transpileTask(src, out) {
77+
return function () {
78+
const transpile = createCompile(src, false, true, true);
79+
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
80+
return srcPipe
81+
.pipe(transpile())
82+
.pipe(gulp.dest(out));
83+
};
84+
}
85+
exports.transpileTask = transpileTask;
86+
function compileTask(src, out, build) {
7887
return function () {
7988
if (os.totalmem() < 4000000000) {
8089
throw new Error('compilation requires 4GB of RAM');
8190
}
82-
const compile = createCompile(src, build, true, transpileOnly);
91+
const compile = createCompile(src, build, true, false);
8392
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
8493
const generator = new MonacoGenerator(false);
8594
if (src === 'src') {

build/lib/compilation.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import * as os from 'os';
1717
import ts = require('typescript');
1818
import * as File from 'vinyl';
1919
import * as task from './task';
20-
import * as tsb from './tsb';
2120

2221
const watch = require('./watch');
2322

@@ -39,7 +38,7 @@ function getTypeScriptCompilerOptions(src: string): ts.CompilerOptions {
3938
}
4039

4140
function createCompile(src: string, build: boolean, emitError: boolean, transpileOnly: boolean) {
42-
// const tsb = require('./tsb') as typeof import('./tsb');
41+
const tsb = require('./tsb') as typeof import('./tsb');
4342
const sourcemaps = require('gulp-sourcemaps') as typeof import('gulp-sourcemaps');
4443

4544

@@ -69,7 +68,7 @@ function createCompile(src: string, build: boolean, emitError: boolean, transpil
6968
.pipe(noDeclarationsFilter)
7069
.pipe(build ? nls.nls() : es.through())
7170
.pipe(noDeclarationsFilter.restore)
72-
.pipe(sourcemaps.write('.', {
71+
.pipe(transpileOnly ? es.through() : sourcemaps.write('.', {
7372
addComment: false,
7473
includeContent: !!build,
7574
sourceRoot: overrideOptions.sourceRoot
@@ -85,15 +84,28 @@ function createCompile(src: string, build: boolean, emitError: boolean, transpil
8584
return pipeline;
8685
}
8786

88-
export function compileTask(src: string, out: string, build: boolean, transpileOnly: boolean): () => NodeJS.ReadWriteStream {
87+
export function transpileTask(src: string, out: string): () => NodeJS.ReadWriteStream {
88+
89+
return function () {
90+
91+
const transpile = createCompile(src, false, true, true);
92+
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
93+
94+
return srcPipe
95+
.pipe(transpile())
96+
.pipe(gulp.dest(out));
97+
};
98+
}
99+
100+
export function compileTask(src: string, out: string, build: boolean): () => NodeJS.ReadWriteStream {
89101

90102
return function () {
91103

92104
if (os.totalmem() < 4_000_000_000) {
93105
throw new Error('compilation requires 4GB of RAM');
94106
}
95107

96-
const compile = createCompile(src, build, true, transpileOnly);
108+
const compile = createCompile(src, build, true, false);
97109
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
98110
const generator = new MonacoGenerator(false);
99111
if (src === 'src') {

build/lib/tsb/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function create(projectPath, existingOptions, config, onError = _defaultOnError)
9292
}
9393
let result;
9494
if (config.transpileOnly) {
95-
const transpiler = new transpiler_1.Transpiler(logFn, printDiagnostic, cmdLine);
95+
const transpiler = new transpiler_1.Transpiler(logFn, printDiagnostic, projectPath, cmdLine);
9696
result = (() => createTranspileStream(transpiler));
9797
}
9898
else {

0 commit comments

Comments
 (0)