@@ -39,9 +39,11 @@ const gulp = helpMaker(originalGulp);
39
39
const mochaParallel = require ( "./scripts/mocha-parallel.js" ) ;
40
40
const { runTestsInParallel} = mochaParallel ;
41
41
42
+ Error . stackTraceLimit = 1000 ;
43
+
42
44
const cmdLineOptions = minimist ( process . argv . slice ( 2 ) , {
43
45
boolean : [ "debug" , "light" , "colors" , "lint" , "soft" ] ,
44
- string : [ "browser" , "tests" , "host" , "reporter" ] ,
46
+ string : [ "browser" , "tests" , "host" , "reporter" , "stackTraceLimit" ] ,
45
47
alias : {
46
48
d : "debug" ,
47
49
t : "tests" ,
@@ -416,9 +418,35 @@ gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
416
418
] ) . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
417
419
} ) ;
418
420
421
+ // cancellationToken.js
422
+ const cancellationTokenJs = path . join ( builtLocalDirectory , "cancellationToken.js" ) ;
423
+ gulp . task ( cancellationTokenJs , false , [ servicesFile ] , ( ) => {
424
+ const cancellationTokenProject = tsc . createProject ( "src/server/cancellationToken/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
425
+ return cancellationTokenProject . src ( )
426
+ . pipe ( newer ( cancellationTokenJs ) )
427
+ . pipe ( sourcemaps . init ( ) )
428
+ . pipe ( tsc ( cancellationTokenProject ) )
429
+ . pipe ( prependCopyright ( ) )
430
+ . pipe ( sourcemaps . write ( "." ) )
431
+ . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
432
+ } ) ;
433
+
434
+ // typingsInstallerFile.js
435
+ const typingsInstallerJs = path . join ( builtLocalDirectory , "typingsInstaller.js" ) ;
436
+ gulp . task ( typingsInstallerJs , false , [ servicesFile ] , ( ) => {
437
+ const cancellationTokenProject = tsc . createProject ( "src/server/typingsInstaller/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
438
+ return cancellationTokenProject . src ( )
439
+ . pipe ( newer ( typingsInstallerJs ) )
440
+ . pipe ( sourcemaps . init ( ) )
441
+ . pipe ( tsc ( cancellationTokenProject ) )
442
+ . pipe ( prependCopyright ( ) )
443
+ . pipe ( sourcemaps . write ( "." ) )
444
+ . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
445
+ } ) ;
446
+
419
447
const serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
420
448
421
- gulp . task ( serverFile , false , [ servicesFile ] , ( ) => {
449
+ gulp . task ( serverFile , false , [ servicesFile , typingsInstallerJs , cancellationTokenJs ] , ( ) => {
422
450
const serverProject = tsc . createProject ( "src/server/tsconfig.json" , getCompilerSettings ( { } , /*useBuiltCompiler*/ true ) ) ;
423
451
return serverProject . src ( )
424
452
. pipe ( newer ( serverFile ) )
@@ -452,7 +480,6 @@ gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile
452
480
gulp . task ( "local" , "Builds the full compiler and services" , [ builtLocalCompiler , servicesFile , serverFile , builtGeneratedDiagnosticMessagesJSON , tsserverLibraryFile ] ) ;
453
481
gulp . task ( "tsc" , "Builds only the compiler" , [ builtLocalCompiler ] ) ;
454
482
455
-
456
483
// Generate Markdown spec
457
484
const word2mdJs = path . join ( scriptsDirectory , "word2md.js" ) ;
458
485
const word2mdTs = path . join ( scriptsDirectory , "word2md.ts" ) ;
@@ -491,7 +518,7 @@ gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); })
491
518
gulp . task ( "dontUseDebugMode" , false , [ ] , ( done ) => { useDebugMode = false ; done ( ) ; } ) ;
492
519
493
520
gulp . task ( "VerifyLKG" , false , [ ] , ( ) => {
494
- const expectedFiles = [ builtLocalCompiler , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile ] . concat ( libraryTargets ) ;
521
+ const expectedFiles = [ builtLocalCompiler , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , typingsInstallerJs , cancellationTokenJs ] . concat ( libraryTargets ) ;
495
522
const missingFiles = expectedFiles . filter ( function ( f ) {
496
523
return ! fs . existsSync ( f ) ;
497
524
} ) ;
@@ -551,14 +578,15 @@ function restoreSavedNodeEnv() {
551
578
process . env . NODE_ENV = savedNodeEnv ;
552
579
}
553
580
554
- let testTimeout = 20000 ;
581
+ let testTimeout = 40000 ;
555
582
function runConsoleTests ( defaultReporter : string , runInParallel : boolean , done : ( e ?: any ) => void ) {
556
583
const lintFlag = cmdLineOptions [ "lint" ] ;
557
584
cleanTestDirs ( ( err ) => {
558
585
if ( err ) { console . error ( err ) ; failWithStatus ( err , 1 ) ; }
559
586
const debug = cmdLineOptions [ "debug" ] ;
560
587
const tests = cmdLineOptions [ "tests" ] ;
561
588
const light = cmdLineOptions [ "light" ] ;
589
+ const stackTraceLimit = cmdLineOptions [ "stackTraceLimit" ] ;
562
590
const testConfigFile = "test.config" ;
563
591
if ( fs . existsSync ( testConfigFile ) ) {
564
592
fs . unlinkSync ( testConfigFile ) ;
@@ -578,7 +606,7 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done:
578
606
}
579
607
580
608
if ( tests || light || taskConfigsFolder ) {
581
- writeTestConfigFile ( tests , light , taskConfigsFolder , workerCount ) ;
609
+ writeTestConfigFile ( tests , light , taskConfigsFolder , workerCount , stackTraceLimit ) ;
582
610
}
583
611
584
612
if ( tests && tests . toLocaleLowerCase ( ) === "rwc" ) {
@@ -727,6 +755,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
727
755
sourcemaps : {
728
756
"built/local/_stream_0.js" : originalMap ,
729
757
"built/local/bundle.js" : maps ,
758
+ "node_modules/source-map-support/source-map-support.js" : undefined ,
730
759
}
731
760
} ) ;
732
761
const finalMap = chain . apply ( ) ;
@@ -756,8 +785,8 @@ function cleanTestDirs(done: (e?: any) => void) {
756
785
}
757
786
758
787
// used to pass data from jake command line directly to run.js
759
- function writeTestConfigFile ( tests : string , light : boolean , taskConfigsFolder ?: string , workerCount ?: number ) {
760
- const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , light : light , workerCount : workerCount , taskConfigsFolder : taskConfigsFolder } ) ;
788
+ function writeTestConfigFile ( tests : string , light : boolean , taskConfigsFolder ?: string , workerCount ?: number , stackTraceLimit ?: string ) {
789
+ const testConfigContents = JSON . stringify ( { test : tests ? [ tests ] : undefined , light, workerCount, stackTraceLimit , taskConfigsFolder } ) ;
761
790
console . log ( "Running tests with config: " + testConfigContents ) ;
762
791
fs . writeFileSync ( "test.config" , testConfigContents ) ;
763
792
}
@@ -887,7 +916,7 @@ gulp.task(loggedIOJsPath, false, [], (done) => {
887
916
const temp = path . join ( builtLocalDirectory , "temp" ) ;
888
917
mkdirP ( temp , ( err ) => {
889
918
if ( err ) { console . error ( err ) ; done ( err ) ; process . exit ( 1 ) ; } ;
890
- exec ( host , [ LKGCompiler , "--outdir" , temp , loggedIOpath ] , ( ) => {
919
+ exec ( host , [ LKGCompiler , "--types -- outdir" , temp , loggedIOpath ] , ( ) => {
891
920
fs . renameSync ( path . join ( temp , "/harness/loggedIO.js" ) , loggedIOJsPath ) ;
892
921
del ( temp ) . then ( ( ) => done ( ) , done ) ;
893
922
} , done ) ;
@@ -908,8 +937,8 @@ gulp.task(instrumenterJsPath, false, [servicesFile], () => {
908
937
. pipe ( gulp . dest ( "." ) ) ;
909
938
} ) ;
910
939
911
- gulp . task ( "tsc-instrumented" , "Builds an instrumented tsc.js" , [ loggedIOJsPath , instrumenterJsPath , servicesFile ] , ( done ) => {
912
- exec ( host , [ instrumenterJsPath , "record" , "iocapture" , builtLocalDirectory , compilerFilename ] , done , done ) ;
940
+ gulp . task ( "tsc-instrumented" , "Builds an instrumented tsc.js" , [ "local" , loggedIOJsPath , instrumenterJsPath , servicesFile ] , ( done ) => {
941
+ exec ( host , [ instrumenterJsPath , "record" , "iocapture" , builtLocalCompiler ] , done , done ) ;
913
942
} ) ;
914
943
915
944
gulp . task ( "update-sublime" , "Updates the sublime plugin's tsserver" , [ "local" , serverFile ] , ( ) => {
0 commit comments