@@ -41,6 +41,7 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
41
41
boolean : [ "debug" , "inspect" , "light" , "colors" , "lint" , "soft" ] ,
42
42
string : [ "browser" , "tests" , "host" , "reporter" , "stackTraceLimit" ] ,
43
43
alias : {
44
+ b : "browser" ,
44
45
d : "debug" ,
45
46
t : "tests" ,
46
47
test : "tests" ,
@@ -162,7 +163,10 @@ const librarySourceMap = [
162
163
163
164
// JavaScript + all host library
164
165
{ target : "lib.d.ts" , sources : [ "header.d.ts" , "es5.d.ts" ] . concat ( hostsLibrarySources ) } ,
165
- { target : "lib.es6.d.ts" , sources : [ "header.d.ts" , "es5.d.ts" ] . concat ( es2015LibrarySources , hostsLibrarySources , "dom.iterable.d.ts" ) }
166
+ { target : "lib.es6.d.ts" , sources : [ "header.d.ts" , "es5.d.ts" ] . concat ( es2015LibrarySources , hostsLibrarySources , "dom.iterable.d.ts" ) } ,
167
+ { target : "lib.es2016.full.d.ts" , sources : [ "header.d.ts" , "es2016.d.ts" ] . concat ( es2015LibrarySources , hostsLibrarySources , "dom.iterable.d.ts" ) } ,
168
+ { target : "lib.es2017.full.d.ts" , sources : [ "header.d.ts" , "es2017.d.ts" ] . concat ( es2015LibrarySources , hostsLibrarySources , "dom.iterable.d.ts" ) } ,
169
+ { target : "lib.esnext.full.d.ts" , sources : [ "header.d.ts" , "esnext.d.ts" ] . concat ( es2015LibrarySources , hostsLibrarySources , "dom.iterable.d.ts" ) } ,
166
170
] . concat ( es2015LibrarySourceMap , es2016LibrarySourceMap , es2017LibrarySourceMap , esnextLibrarySourceMap ) ;
167
171
168
172
const libraryTargets = librarySourceMap . map ( function ( f ) {
@@ -384,7 +388,7 @@ function prependCopyright(outputCopyright: boolean = !useDebugMode) {
384
388
}
385
389
386
390
gulp . task ( builtLocalCompiler , /*help*/ false , [ servicesFile ] , ( ) => {
387
- const localCompilerProject = tsc . createProject ( "src/compiler/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
391
+ const localCompilerProject = tsc . createProject ( "src/compiler/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
388
392
return localCompilerProject . src ( )
389
393
. pipe ( newer ( builtLocalCompiler ) )
390
394
. pipe ( sourcemaps . init ( ) )
@@ -395,14 +399,14 @@ gulp.task(builtLocalCompiler, /*help*/ false, [servicesFile], () => {
395
399
} ) ;
396
400
397
401
gulp . task ( servicesFile , /*help*/ false , [ "lib" , "generate-diagnostics" ] , ( ) => {
398
- const servicesProject = tsc . createProject ( "src/services/tsconfig.json" , getCompilerSettings ( { removeComments : false } , /*useBuiltCompiler*/ false ) ) ;
402
+ const servicesProject = tsc . createProject ( "src/services/tsconfig.json" , getCompilerSettings ( { removeComments : false } , /*useBuiltCompiler*/ false ) ) ;
399
403
const { js, dts} = servicesProject . src ( )
400
404
. pipe ( newer ( servicesFile ) )
401
405
. pipe ( sourcemaps . init ( ) )
402
406
. pipe ( servicesProject ( ) ) ;
403
407
const completedJs = js . pipe ( prependCopyright ( ) )
404
408
. pipe ( sourcemaps . write ( "." ) ) ;
405
- const completedDts = dts . pipe ( prependCopyright ( /*outputCopyright*/ true ) )
409
+ const completedDts = dts . pipe ( prependCopyright ( /*outputCopyright*/ true ) )
406
410
. pipe ( insert . transform ( ( contents , file ) => {
407
411
file . path = standaloneDefinitionsFile ;
408
412
return contents . replace ( / ^ ( \s * ) ( e x p o r t ) ? c o n s t e n u m ( \S + ) { ( \s * ) $ / gm, "$1$2enum $3 {$4" ) ;
@@ -429,7 +433,7 @@ gulp.task(servicesFile, /*help*/ false, ["lib", "generate-diagnostics"], () => {
429
433
// cancellationToken.js
430
434
const cancellationTokenJs = path . join ( builtLocalDirectory , "cancellationToken.js" ) ;
431
435
gulp . task ( cancellationTokenJs , /*help*/ false , [ servicesFile ] , ( ) => {
432
- const cancellationTokenProject = tsc . createProject ( "src/server/cancellationToken/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
436
+ const cancellationTokenProject = tsc . createProject ( "src/server/cancellationToken/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
433
437
return cancellationTokenProject . src ( )
434
438
. pipe ( newer ( cancellationTokenJs ) )
435
439
. pipe ( sourcemaps . init ( ) )
@@ -442,7 +446,7 @@ gulp.task(cancellationTokenJs, /*help*/ false, [servicesFile], () => {
442
446
// typingsInstallerFile.js
443
447
const typingsInstallerJs = path . join ( builtLocalDirectory , "typingsInstaller.js" ) ;
444
448
gulp . task ( typingsInstallerJs , /*help*/ false , [ servicesFile ] , ( ) => {
445
- const cancellationTokenProject = tsc . createProject ( "src/server/typingsInstaller/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
449
+ const cancellationTokenProject = tsc . createProject ( "src/server/typingsInstaller/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
446
450
return cancellationTokenProject . src ( )
447
451
. pipe ( newer ( typingsInstallerJs ) )
448
452
. pipe ( sourcemaps . init ( ) )
@@ -455,7 +459,7 @@ gulp.task(typingsInstallerJs, /*help*/ false, [servicesFile], () => {
455
459
const serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
456
460
457
461
gulp . task ( serverFile , /*help*/ false , [ servicesFile , typingsInstallerJs , cancellationTokenJs ] , ( ) => {
458
- const serverProject = tsc . createProject ( "src/server/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
462
+ const serverProject = tsc . createProject ( "src/server/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
459
463
return serverProject . src ( )
460
464
. pipe ( newer ( serverFile ) )
461
465
. pipe ( sourcemaps . init ( ) )
@@ -479,7 +483,7 @@ gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => {
479
483
js . pipe ( prependCopyright ( ) )
480
484
. pipe ( sourcemaps . write ( "." ) )
481
485
. pipe ( gulp . dest ( "src/server" ) ) ,
482
- dts . pipe ( prependCopyright ( /*outputCopyright*/ true ) )
486
+ dts . pipe ( prependCopyright ( /*outputCopyright*/ true ) )
483
487
. pipe ( insert . transform ( ( content ) => {
484
488
return content + "\r\nexport = ts;\r\nexport as namespace ts;" ;
485
489
} ) )
@@ -551,7 +555,7 @@ gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUse
551
555
// Task to build the tests infrastructure using the built compiler
552
556
const run = path . join ( builtLocalDirectory , "run.js" ) ;
553
557
gulp . task ( run , /*help*/ false , [ servicesFile ] , ( ) => {
554
- const testProject = tsc . createProject ( "src/harness/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
558
+ const testProject = tsc . createProject ( "src/harness/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
555
559
return testProject . src ( )
556
560
. pipe ( newer ( run ) )
557
561
. pipe ( sourcemaps . init ( ) )
@@ -757,7 +761,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
757
761
browserify ( intoStream ( file . contents ) , { debug : true } )
758
762
. bundle ( ( err , res ) => {
759
763
// assumes file.contents is a Buffer
760
- const maps = JSON . parse ( convertMap . fromSource ( res . toString ( ) , /*largeSource*/ true ) . toJSON ( ) ) ;
764
+ const maps = JSON . parse ( convertMap . fromSource ( res . toString ( ) , /*largeSource*/ true ) . toJSON ( ) ) ;
761
765
delete maps . sourceRoot ;
762
766
maps . sources = maps . sources . map ( s => path . resolve ( s === "_stream_0.js" ? "built/local/_stream_0.js" : s ) ) ;
763
767
// Strip browserify's inline comments away (could probably just let sorcery do this, but then we couldn't fix the paths)
@@ -775,7 +779,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
775
779
} ) ;
776
780
const finalMap = chain . apply ( ) ;
777
781
file . sourceMap = finalMap ;
778
- next ( undefined , file ) ;
782
+ next ( /*err*/ undefined , file ) ;
779
783
} ) ;
780
784
} ) )
781
785
. pipe ( sourcemaps . write ( "." , { includeContent : false } ) )
@@ -1024,7 +1028,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
1024
1028
const fileMatcher = cmdLineOptions [ "files" ] ;
1025
1029
const files = fileMatcher
1026
1030
? `src/**/${ fileMatcher } `
1027
- : "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'" ;
1031
+ : "Gulpfile.ts 'scripts/tslint/*.ts' ' src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'" ;
1028
1032
const cmd = `node node_modules/tslint/bin/tslint ${ files } --format stylish` ;
1029
1033
console . log ( "Linting: " + cmd ) ;
1030
1034
child_process . execSync ( cmd , { stdio : [ 0 , 1 , 2 ] } ) ;
0 commit comments