@@ -17,7 +17,6 @@ declare module "gulp-typescript" {
1717 stripInternal ?: boolean ;
1818 types ?: string [ ] ;
1919 }
20- interface CompileStream extends NodeJS . ReadWriteStream { } // Either gulp or gulp-typescript has some odd typings which don't reflect reality, making this required
2120}
2221import * as insert from "gulp-insert" ;
2322import * as sourcemaps from "gulp-sourcemaps" ;
@@ -378,18 +377,18 @@ gulp.task(builtLocalCompiler, false, [servicesFile], () => {
378377 return localCompilerProject . src ( )
379378 . pipe ( newer ( builtLocalCompiler ) )
380379 . pipe ( sourcemaps . init ( ) )
381- . pipe ( tsc ( localCompilerProject ) )
380+ . pipe ( localCompilerProject ( ) )
382381 . pipe ( prependCopyright ( ) )
383382 . pipe ( sourcemaps . write ( "." ) )
384- . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
383+ . pipe ( gulp . dest ( "." ) ) ;
385384} ) ;
386385
387386gulp . task ( servicesFile , false , [ "lib" , "generate-diagnostics" ] , ( ) => {
388387 const servicesProject = tsc . createProject ( "src/services/tsconfig.json" , getCompilerSettings ( { removeComments : false } , /*useBuiltCompiler*/ false ) ) ;
389388 const { js, dts} = servicesProject . src ( )
390389 . pipe ( newer ( servicesFile ) )
391390 . pipe ( sourcemaps . init ( ) )
392- . pipe ( tsc ( servicesProject ) ) ;
391+ . pipe ( servicesProject ( ) ) ;
393392 const completedJs = js . pipe ( prependCopyright ( ) )
394393 . pipe ( sourcemaps . write ( "." ) ) ;
395394 const completedDts = dts . pipe ( prependCopyright ( /*outputCopyright*/ true ) )
@@ -407,13 +406,13 @@ gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
407406 file . path = nodeDefinitionsFile ;
408407 return content + "\r\nexport = ts;" ;
409408 } ) )
410- . pipe ( gulp . dest ( builtLocalDirectory ) ) ,
409+ . pipe ( gulp . dest ( "." ) ) ,
411410 completedDts . pipe ( clone ( ) )
412411 . pipe ( insert . transform ( ( content , file ) => {
413412 file . path = nodeStandaloneDefinitionsFile ;
414413 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"' ) ;
415414 } ) )
416- ] ) . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
415+ ] ) . pipe ( gulp . dest ( "." ) ) ;
417416} ) ;
418417
419418// cancellationToken.js
@@ -423,7 +422,7 @@ gulp.task(cancellationTokenJs, false, [servicesFile], () => {
423422 return cancellationTokenProject . src ( )
424423 . pipe ( newer ( cancellationTokenJs ) )
425424 . pipe ( sourcemaps . init ( ) )
426- . pipe ( tsc ( cancellationTokenProject ) )
425+ . pipe ( cancellationTokenProject ( ) )
427426 . pipe ( prependCopyright ( ) )
428427 . pipe ( sourcemaps . write ( "." ) )
429428 . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
@@ -436,10 +435,10 @@ gulp.task(typingsInstallerJs, false, [servicesFile], () => {
436435 return cancellationTokenProject . src ( )
437436 . pipe ( newer ( typingsInstallerJs ) )
438437 . pipe ( sourcemaps . init ( ) )
439- . pipe ( tsc ( cancellationTokenProject ) )
438+ . pipe ( cancellationTokenProject ( ) )
440439 . pipe ( prependCopyright ( ) )
441440 . pipe ( sourcemaps . write ( "." ) )
442- . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
441+ . pipe ( gulp . dest ( "." ) ) ;
443442} ) ;
444443
445444const serverFile = path . join ( builtLocalDirectory , "tsserver.js" ) ;
@@ -449,10 +448,10 @@ gulp.task(serverFile, false, [servicesFile, typingsInstallerJs, cancellationToke
449448 return serverProject . src ( )
450449 . pipe ( newer ( serverFile ) )
451450 . pipe ( sourcemaps . init ( ) )
452- . pipe ( tsc ( serverProject ) )
451+ . pipe ( serverProject ( ) )
453452 . pipe ( prependCopyright ( ) )
454453 . pipe ( sourcemaps . write ( "." ) )
455- . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
454+ . pipe ( gulp . dest ( "." ) ) ;
456455} ) ;
457456
458457const tsserverLibraryFile = path . join ( builtLocalDirectory , "tsserverlibrary.js" ) ;
@@ -463,14 +462,14 @@ gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
463462 const { js, dts} : { js : NodeJS . ReadableStream , dts : NodeJS . ReadableStream } = serverLibraryProject . src ( )
464463 . pipe ( sourcemaps . init ( ) )
465464 . pipe ( newer ( tsserverLibraryFile ) )
466- . pipe ( tsc ( serverLibraryProject ) ) ;
465+ . pipe ( serverLibraryProject ( ) ) ;
467466
468467 return merge2 ( [
469468 js . pipe ( prependCopyright ( ) )
470469 . pipe ( sourcemaps . write ( "." ) )
471- . pipe ( gulp . dest ( builtLocalDirectory ) ) ,
470+ . pipe ( gulp . dest ( "." ) ) ,
472471 dts . pipe ( prependCopyright ( ) )
473- . pipe ( gulp . dest ( builtLocalDirectory ) )
472+ . pipe ( gulp . dest ( "." ) )
474473 ] ) ;
475474} ) ;
476475
@@ -542,9 +541,9 @@ gulp.task(run, false, [servicesFile], () => {
542541 return testProject . src ( )
543542 . pipe ( newer ( run ) )
544543 . pipe ( sourcemaps . init ( ) )
545- . pipe ( tsc ( testProject ) )
544+ . pipe ( testProject ( ) )
546545 . pipe ( sourcemaps . write ( "." , { includeContent : false , sourceRoot : "../../" } ) )
547- . pipe ( gulp . dest ( builtLocalDirectory ) ) ;
546+ . pipe ( gulp . dest ( "." ) ) ;
548547} ) ;
549548
550549const internalTests = "internal/" ;
@@ -723,16 +722,16 @@ declare module "convert-source-map" {
723722}
724723
725724gulp . task ( "browserify" , "Runs browserify on run.js to produce a file suitable for running tests in the browser" , [ servicesFile ] , ( done ) => {
726- const testProject = tsc . createProject ( "src/harness/tsconfig.json" , getCompilerSettings ( { outFile : "built/local/bundle.js" } , /*useBuiltCompiler*/ true ) ) ;
725+ const testProject = tsc . createProject ( "src/harness/tsconfig.json" , getCompilerSettings ( { outFile : "../../ built/local/bundle.js" } , /*useBuiltCompiler*/ true ) ) ;
727726 return testProject . src ( )
728727 . pipe ( newer ( "built/local/bundle.js" ) )
729728 . pipe ( sourcemaps . init ( ) )
730- . pipe ( tsc ( testProject ) )
729+ . pipe ( testProject ( ) )
731730 . pipe ( through2 . obj ( ( file , enc , next ) => {
732731 const originalMap = file . sourceMap ;
733732 const prebundledContent = file . contents . toString ( ) ;
734733 // Make paths absolute to help sorcery deal with all the terrible paths being thrown around
735- originalMap . sources = originalMap . sources . map ( s => path . resolve ( "src" , s ) ) ;
734+ originalMap . sources = originalMap . sources . map ( s => path . resolve ( s ) ) ;
736735 // intoStream (below) makes browserify think the input file is named this, so this is what it puts in the sourcemap
737736 originalMap . file = "built/local/_stream_0.js" ;
738737
0 commit comments