@@ -17,7 +17,6 @@ declare module "gulp-typescript" {
17
17
stripInternal ?: boolean ;
18
18
types ?: string [ ] ;
19
19
}
20
- interface CompileStream extends NodeJS . ReadWriteStream { } // Either gulp or gulp-typescript has some odd typings which don't reflect reality, making this required
21
20
}
22
21
import * as insert from "gulp-insert" ;
23
22
import * as sourcemaps from "gulp-sourcemaps" ;
@@ -169,7 +168,7 @@ for (const i in libraryTargets) {
169
168
gulp . task ( target , false , [ ] , function ( ) {
170
169
return gulp . src ( sources )
171
170
. pipe ( newer ( target ) )
172
- . pipe ( concat ( target , { newLine : "" } ) )
171
+ . pipe ( concat ( target , { newLine : "\n\n " } ) )
173
172
. pipe ( gulp . dest ( "." ) ) ;
174
173
} ) ;
175
174
}
@@ -380,18 +379,18 @@ gulp.task(builtLocalCompiler, false, [servicesFile], () => {
380
379
return localCompilerProject . src ( )
381
380
. pipe ( newer ( builtLocalCompiler ) )
382
381
. pipe ( sourcemaps . init ( ) )
383
- . pipe ( tsc ( localCompilerProject ) )
382
+ . pipe ( localCompilerProject ( ) )
384
383
. pipe ( prependCopyright ( ) )
385
384
. pipe ( sourcemaps . write ( "." ) )
386
- . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
385
+ . pipe ( gulp . dest ( "." ) ) ;
387
386
} ) ;
388
387
389
388
gulp . task ( servicesFile , false , [ "lib" , "generate-diagnostics" ] , ( ) => {
390
389
const servicesProject = tsc . createProject ( "src/services/tsconfig.json" , getCompilerSettings ( { removeComments : false } , /*useBuiltCompiler*/ false ) ) ;
391
390
const { js, dts} = servicesProject . src ( )
392
391
. pipe ( newer ( servicesFile ) )
393
392
. pipe ( sourcemaps . init ( ) )
394
- . pipe ( tsc ( servicesProject ) ) ;
393
+ . pipe ( servicesProject ( ) ) ;
395
394
const completedJs = js . pipe ( prependCopyright ( ) )
396
395
. pipe ( sourcemaps . write ( "." ) ) ;
397
396
const completedDts = dts . pipe ( prependCopyright ( /*outputCopyright*/ true ) )
@@ -409,26 +408,52 @@ gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
409
408
file . path = nodeDefinitionsFile ;
410
409
return content + "\r\nexport = ts;" ;
411
410
} ) )
412
- . pipe ( gulp . dest ( builtLocalDirectory ) ) ,
411
+ . pipe ( gulp . dest ( "." ) ) ,
413
412
completedDts . pipe ( clone ( ) )
414
413
. pipe ( insert . transform ( ( content , file ) => {
415
414
file . path = nodeStandaloneDefinitionsFile ;
416
415
return content . replace ( / d e c l a r e ( n a m e s p a c e | m o d u l e ) t s / g, 'declare module "typescript"' ) ;
417
416
} ) )
418
- ] ) . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
417
+ ] ) . pipe ( gulp . dest ( "." ) ) ;
418
+ } ) ;
419
+
420
+ // cancellationToken.js
421
+ const cancellationTokenJs = path . join ( builtLocalDirectory , "cancellationToken.js" ) ;
422
+ gulp . task ( cancellationTokenJs , false , [ servicesFile ] , ( ) => {
423
+ const cancellationTokenProject = tsc . createProject ( "src/server/cancellationToken/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
424
+ return cancellationTokenProject . src ( )
425
+ . pipe ( newer ( cancellationTokenJs ) )
426
+ . pipe ( sourcemaps . init ( ) )
427
+ . pipe ( cancellationTokenProject ( ) )
428
+ . pipe ( prependCopyright ( ) )
429
+ . pipe ( sourcemaps . write ( "." ) )
430
+ . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
431
+ } ) ;
432
+
433
+ // typingsInstallerFile.js
434
+ const typingsInstallerJs = path . join ( builtLocalDirectory , "typingsInstaller.js" ) ;
435
+ gulp . task ( typingsInstallerJs , false , [ servicesFile ] , ( ) => {
436
+ const cancellationTokenProject = tsc . createProject ( "src/server/typingsInstaller/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
437
+ return cancellationTokenProject . src ( )
438
+ . pipe ( newer ( typingsInstallerJs ) )
439
+ . pipe ( sourcemaps . init ( ) )
440
+ . pipe ( cancellationTokenProject ( ) )
441
+ . pipe ( prependCopyright ( ) )
442
+ . pipe ( sourcemaps . write ( "." ) )
443
+ . pipe ( gulp . dest ( "." ) ) ;
419
444
} ) ;
420
445
421
446
const serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
422
447
423
- gulp . task ( serverFile , false , [ servicesFile ] , ( ) => {
448
+ gulp . task ( serverFile , false , [ servicesFile , typingsInstallerJs , cancellationTokenJs ] , ( ) => {
424
449
const serverProject = tsc . createProject ( "src/server/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
425
450
return serverProject . src ( )
426
451
. pipe ( newer ( serverFile ) )
427
452
. pipe ( sourcemaps . init ( ) )
428
- . pipe ( tsc ( serverProject ) )
453
+ . pipe ( serverProject ( ) )
429
454
. pipe ( prependCopyright ( ) )
430
455
. pipe ( sourcemaps . write ( "." ) )
431
- . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
456
+ . pipe ( gulp . dest ( "." ) ) ;
432
457
} ) ;
433
458
434
459
const tsserverLibraryFile = path . join ( builtLocalDirectory , "tsserverlibrary.js" ) ;
@@ -439,22 +464,21 @@ gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
439
464
const { js, dts} : { js : NodeJS . ReadableStream , dts : NodeJS . ReadableStream } = serverLibraryProject . src ( )
440
465
. pipe ( sourcemaps . init ( ) )
441
466
. pipe ( newer ( tsserverLibraryFile ) )
442
- . pipe ( tsc ( serverLibraryProject ) ) ;
467
+ . pipe ( serverLibraryProject ( ) ) ;
443
468
444
469
return merge2 ( [
445
470
js . pipe ( prependCopyright ( ) )
446
471
. pipe ( sourcemaps . write ( "." ) )
447
- . pipe ( gulp . dest ( builtLocalDirectory ) ) ,
472
+ . pipe ( gulp . dest ( "." ) ) ,
448
473
dts . pipe ( prependCopyright ( ) )
449
- . pipe ( gulp . dest ( builtLocalDirectory ) )
474
+ . pipe ( gulp . dest ( "." ) )
450
475
] ) ;
451
476
} ) ;
452
477
453
478
gulp . task ( "lssl" , "Builds language service server library" , [ tsserverLibraryFile ] ) ;
454
479
gulp . task ( "local" , "Builds the full compiler and services" , [ builtLocalCompiler , servicesFile , serverFile , builtGeneratedDiagnosticMessagesJSON , tsserverLibraryFile ] ) ;
455
480
gulp . task ( "tsc" , "Builds only the compiler" , [ builtLocalCompiler ] ) ;
456
481
457
-
458
482
// Generate Markdown spec
459
483
const word2mdJs = path . join ( scriptsDirectory , "word2md.js" ) ;
460
484
const word2mdTs = path . join ( scriptsDirectory , "word2md.ts" ) ;
@@ -493,7 +517,7 @@ gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); })
493
517
gulp . task ( "dontUseDebugMode" , false , [ ] , ( done ) => { useDebugMode = false ; done ( ) ; } ) ;
494
518
495
519
gulp . task ( "VerifyLKG" , false , [ ] , ( ) => {
496
- const expectedFiles = [ builtLocalCompiler , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile ] . concat ( libraryTargets ) ;
520
+ const expectedFiles = [ builtLocalCompiler , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , typingsInstallerJs , cancellationTokenJs ] . concat ( libraryTargets ) ;
497
521
const missingFiles = expectedFiles . filter ( function ( f ) {
498
522
return ! fs . existsSync ( f ) ;
499
523
} ) ;
@@ -519,9 +543,9 @@ gulp.task(run, false, [servicesFile], () => {
519
543
return testProject . src ( )
520
544
. pipe ( newer ( run ) )
521
545
. pipe ( sourcemaps . init ( ) )
522
- . pipe ( tsc ( testProject ) )
546
+ . pipe ( testProject ( ) )
523
547
. pipe ( sourcemaps . write ( "." , { includeContent : false , sourceRoot : "../../" } ) )
524
- . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
548
+ . pipe ( gulp . dest ( "." ) ) ;
525
549
} ) ;
526
550
527
551
const internalTests = "internal/" ;
@@ -705,7 +729,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
705
729
return testProject . src ( )
706
730
. pipe ( newer ( "built/local/bundle.js" ) )
707
731
. pipe ( sourcemaps . init ( ) )
708
- . pipe ( tsc ( testProject ) )
732
+ . pipe ( testProject )
709
733
. pipe ( through2 . obj ( ( file , enc , next ) => {
710
734
const originalMap = file . sourceMap ;
711
735
const prebundledContent = file . contents . toString ( ) ;
0 commit comments