mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 08:14:36 -05:00
use tsb 4.0.2 use project files as src-stream, https://github.com/microsoft/vscode/issues/80632
This commit is contained in:
@@ -36,8 +36,8 @@ function getTypeScriptCompilerOptions(src) {
|
||||
function createCompile(src, build, emitError) {
|
||||
const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json');
|
||||
const overrideOptions = Object.assign(Object.assign({}, getTypeScriptCompilerOptions(src)), { inlineSources: Boolean(build) });
|
||||
const ts = tsb.create(projectPath, overrideOptions, false, err => reporter(err));
|
||||
return function (token) {
|
||||
const compilation = tsb.create(projectPath, overrideOptions, false, err => reporter(err));
|
||||
function pipeline(token) {
|
||||
const utf8Filter = util.filter(data => /(\/|\\)test(\/|\\).*utf8/.test(data.path));
|
||||
const tsFilter = util.filter(data => /\.ts$/.test(data.path));
|
||||
const noDeclarationsFilter = util.filter(data => !(/\.d\.ts$/.test(data.path)));
|
||||
@@ -48,7 +48,7 @@ function createCompile(src, build, emitError) {
|
||||
.pipe(utf8Filter.restore)
|
||||
.pipe(tsFilter)
|
||||
.pipe(util.loadSourcemaps())
|
||||
.pipe(ts(token))
|
||||
.pipe(compilation(token))
|
||||
.pipe(noDeclarationsFilter)
|
||||
.pipe(build ? nls() : es.through())
|
||||
.pipe(noDeclarationsFilter.restore)
|
||||
@@ -60,17 +60,20 @@ function createCompile(src, build, emitError) {
|
||||
.pipe(tsFilter.restore)
|
||||
.pipe(reporter.end(!!emitError));
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
pipeline.tsProjectSrc = () => {
|
||||
return compilation.src({ base: src });
|
||||
};
|
||||
return pipeline;
|
||||
}
|
||||
function compileTask(src, out, build) {
|
||||
return function () {
|
||||
const compile = createCompile(src, build, true);
|
||||
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
|
||||
let generator = new MonacoGenerator(false);
|
||||
if (src === 'src') {
|
||||
generator.execute();
|
||||
}
|
||||
return srcPipe
|
||||
return compile.tsProjectSrc()
|
||||
.pipe(generator.stream)
|
||||
.pipe(compile())
|
||||
.pipe(gulp.dest(out));
|
||||
@@ -80,7 +83,7 @@ exports.compileTask = compileTask;
|
||||
function watchTask(out, build) {
|
||||
return function () {
|
||||
const compile = createCompile('src', build);
|
||||
const src = gulp.src('src/**', { base: 'src' });
|
||||
const src = compile.tsProjectSrc();
|
||||
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
|
||||
let generator = new MonacoGenerator(true);
|
||||
generator.execute();
|
||||
|
||||
@@ -39,13 +39,13 @@ function getTypeScriptCompilerOptions(src: string): ts.CompilerOptions {
|
||||
return options;
|
||||
}
|
||||
|
||||
function createCompile(src: string, build: boolean, emitError?: boolean): (token?: util.ICancellationToken) => NodeJS.ReadWriteStream {
|
||||
function createCompile(src: string, build: boolean, emitError?: boolean) {
|
||||
const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json');
|
||||
const overrideOptions = { ...getTypeScriptCompilerOptions(src), inlineSources: Boolean(build) };
|
||||
|
||||
const ts = tsb.create(projectPath, overrideOptions, false, err => reporter(err));
|
||||
const compilation = tsb.create(projectPath, overrideOptions, false, err => reporter(err));
|
||||
|
||||
return function (token?: util.ICancellationToken) {
|
||||
function pipeline(token?: util.ICancellationToken) {
|
||||
|
||||
const utf8Filter = util.filter(data => /(\/|\\)test(\/|\\).*utf8/.test(data.path));
|
||||
const tsFilter = util.filter(data => /\.ts$/.test(data.path));
|
||||
@@ -58,7 +58,7 @@ function createCompile(src: string, build: boolean, emitError?: boolean): (token
|
||||
.pipe(utf8Filter.restore)
|
||||
.pipe(tsFilter)
|
||||
.pipe(util.loadSourcemaps())
|
||||
.pipe(ts(token))
|
||||
.pipe(compilation(token))
|
||||
.pipe(noDeclarationsFilter)
|
||||
.pipe(build ? nls() : es.through())
|
||||
.pipe(noDeclarationsFilter.restore)
|
||||
@@ -71,7 +71,11 @@ function createCompile(src: string, build: boolean, emitError?: boolean): (token
|
||||
.pipe(reporter.end(!!emitError));
|
||||
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
pipeline.tsProjectSrc = () => {
|
||||
return compilation.src({ base: src });
|
||||
};
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
export function compileTask(src: string, out: string, build: boolean): () => NodeJS.ReadWriteStream {
|
||||
@@ -79,14 +83,12 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
|
||||
return function () {
|
||||
const compile = createCompile(src, build, true);
|
||||
|
||||
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
|
||||
|
||||
let generator = new MonacoGenerator(false);
|
||||
if (src === 'src') {
|
||||
generator.execute();
|
||||
}
|
||||
|
||||
return srcPipe
|
||||
return compile.tsProjectSrc()
|
||||
.pipe(generator.stream)
|
||||
.pipe(compile())
|
||||
.pipe(gulp.dest(out));
|
||||
@@ -98,7 +100,7 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt
|
||||
return function () {
|
||||
const compile = createCompile('src', build);
|
||||
|
||||
const src = gulp.src('src/**', { base: 'src' });
|
||||
const src = compile.tsProjectSrc();
|
||||
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
|
||||
|
||||
let generator = new MonacoGenerator(true);
|
||||
|
||||
5
build/lib/typings/gulp-tsb.d.ts
vendored
5
build/lib/typings/gulp-tsb.d.ts
vendored
@@ -8,7 +8,10 @@ declare module "gulp-tsb" {
|
||||
|
||||
export interface IncrementalCompiler {
|
||||
(token?: ICancellationToken): NodeJS.ReadWriteStream;
|
||||
src(): NodeJS.ReadStream;
|
||||
src(opts?: {
|
||||
cwd?: string;
|
||||
base?: string;
|
||||
}): NodeJS.ReadStream;
|
||||
}
|
||||
export function create(projectPath: string, existingOptions: any, verbose?: boolean, onError?: (message: any) => void): IncrementalCompiler;
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
"gulp-rename": "^1.2.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-shell": "^0.6.5",
|
||||
"gulp-tsb": "4.0.1",
|
||||
"gulp-tsb": "4.0.2",
|
||||
"gulp-tslint": "^8.1.3",
|
||||
"gulp-untar": "^0.0.7",
|
||||
"gulp-vinyl-zip": "^2.1.2",
|
||||
|
||||
@@ -3697,10 +3697,10 @@ gulp-symdest@^1.1.1:
|
||||
queue "^3.1.0"
|
||||
vinyl-fs "^2.4.3"
|
||||
|
||||
gulp-tsb@4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/gulp-tsb/-/gulp-tsb-4.0.1.tgz#be2d8900d9227abf0e728a33139891e49b9e85d3"
|
||||
integrity sha512-HHR5qMjj/NyFlYdY6AIql7bWosFAknNfeJumwdkPkNaw6GtHVoaK+hPmWgmyK9Otf9nqcETtI5KI2vIla6Vhdw==
|
||||
gulp-tsb@4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/gulp-tsb/-/gulp-tsb-4.0.2.tgz#8717a18f1ce032147e010028f0a59863bd552b96"
|
||||
integrity sha512-xF88h0vFH8JkunSnmVrYfrR3LGTMAY+KTkHHF/S9BAOCsdaC83/hv4EmpcLxev7B+2yd3+xcitlsDFMBSo/gSw==
|
||||
dependencies:
|
||||
ansi-colors "^1.0.1"
|
||||
fancy-log "^1.3.2"
|
||||
|
||||
Reference in New Issue
Block a user