Merge from vscode merge-base (#22780)

* Revert "Revert "Merge from vscode merge-base (#22769)" (#22779)"

This reverts commit 47a1745180.

* Fix notebook download task

* Remove done call from extensions-ci
This commit is contained in:
Karl Burtram
2023-04-19 21:48:46 -07:00
committed by GitHub
parent decbe8dded
commit e7d3d047ec
2389 changed files with 92155 additions and 42602 deletions

View File

@@ -26,7 +26,7 @@ const reporter = createReporter();
function getTypeScriptCompilerOptions(src: string): ts.CompilerOptions {
const rootDir = path.join(__dirname, `../../${src}`);
let options: ts.CompilerOptions = {};
const options: ts.CompilerOptions = {};
options.verbose = false;
options.sourceMap = true;
if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
@@ -39,8 +39,8 @@ function getTypeScriptCompilerOptions(src: string): ts.CompilerOptions {
return options;
}
function createCompile(src: string, build: boolean, emitError?: boolean) {
const tsb = require('gulp-tsb') as typeof import('gulp-tsb');
function createCompile(src: string, build: boolean, emitError: boolean, transpileOnly: boolean) {
const tsb = require('./tsb') as typeof import('./tsb');
const sourcemaps = require('gulp-sourcemaps') as typeof import('gulp-sourcemaps');
@@ -80,7 +80,7 @@ function createCompile(src: string, build: boolean, emitError?: boolean) {
.pipe(noDeclarationsFilter)
.pipe(build ? nls.nls() : es.through())
.pipe(noDeclarationsFilter.restore)
.pipe(sourcemaps.write('.', {
.pipe(transpileOnly ? es.through() : sourcemaps.write('.', {
addComment: false,
includeContent: !!build,
sourceRoot: overrideOptions.sourceRoot
@@ -96,6 +96,19 @@ function createCompile(src: string, build: boolean, emitError?: boolean) {
return pipeline;
}
export function transpileTask(src: string, out: string): () => NodeJS.ReadWriteStream {
return function () {
const transpile = createCompile(src, false, true, true);
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
return srcPipe
.pipe(transpile())
.pipe(gulp.dest(out));
};
}
export function compileTask(src: string, out: string, build: boolean): () => NodeJS.ReadWriteStream {
return function () {
@@ -104,9 +117,9 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
throw new Error('compilation requires 4GB of RAM');
}
const compile = createCompile(src, build, true);
const compile = createCompile(src, build, true, false);
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
let generator = new MonacoGenerator(false);
const generator = new MonacoGenerator(false);
if (src === 'src') {
generator.execute();
}
@@ -121,12 +134,12 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteStream {
return function () {
const compile = createCompile('src', build);
const compile = createCompile('src', build, false, false);
const src = gulp.src('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
let generator = new MonacoGenerator(true);
const generator = new MonacoGenerator(true);
generator.execute();
return watchSrc
@@ -150,7 +163,7 @@ class MonacoGenerator {
this._isWatch = isWatch;
this.stream = es.through();
this._watchedFiles = {};
let onWillReadFile = (moduleId: string, filePath: string) => {
const onWillReadFile = (moduleId: string, filePath: string) => {
if (!this._isWatch) {
return;
}
@@ -192,7 +205,7 @@ class MonacoGenerator {
}
private _run(): monacodts.IMonacoDeclarationResult | null {
let r = monacodts.run3(this._declarationResolver);
const r = monacodts.run3(this._declarationResolver);
if (!r && !this._isWatch) {
// The build must always be able to generate the monaco.d.ts
throw new Error(`monaco.d.ts generation error - Cannot continue`);
@@ -225,6 +238,16 @@ class MonacoGenerator {
}
function generateApiProposalNames() {
let eol: string;
try {
const src = fs.readFileSync('src/vs/workbench/services/extensions/common/extensionsApiProposals.ts', 'utf-8');
const match = /\r?\n/m.exec(src);
eol = match ? match[0] : os.EOL;
} catch {
eol = os.EOL;
}
const pattern = /vscode\.proposed\.([a-zA-Z]+)\.d\.ts$/;
const proposalNames = new Set<string>();
@@ -253,7 +276,7 @@ function generateApiProposalNames() {
'});',
'export type ApiProposalName = keyof typeof allApiProposals;',
'',
].join(os.EOL);
].join(eol);
this.emit('data', new File({
path: 'vs/workbench/services/extensions/common/extensionsApiProposals.ts',