@@ -215,14 +215,55 @@ task("watch-services").flags = {
215
215
" --built" : "Compile using the built version of the compiler."
216
216
} ;
217
217
218
- const buildServer = ( ) => buildProject ( "src/tsserver" , cmdLineOptions ) ;
218
+ const buildServer = ( ( ) => {
219
+ // build tsserver.out.js
220
+ const buildServerOut = ( ) => buildProject ( "src/tsserver/tsconfig.json" , cmdLineOptions ) ;
221
+
222
+ // create tsserver.js
223
+ const createServerJs = ( ) => src ( "built/local/tsserver.out.js" )
224
+ . pipe ( newer ( "built/local/tsserver.js" ) )
225
+ . pipe ( sourcemaps . init ( { loadMaps : true } ) )
226
+ . pipe ( prependFile ( copyright ) )
227
+ . pipe ( rename ( "tsserver.js" ) )
228
+ . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
229
+ . pipe ( dest ( "built/local" ) ) ;
230
+
231
+ // create tsserver.d.ts
232
+ const createServerDts = ( ) => src ( "built/local/tsserver.out.d.ts" )
233
+ . pipe ( newer ( "built/local/tsserver.d.ts" ) )
234
+ . pipe ( prependFile ( copyright ) )
235
+ . pipe ( transform ( content => content . replace ( / ^ ( \s * ) ( e x p o r t ) ? c o n s t e n u m ( \S + ) { ( \s * ) $ / gm, "$1$2enum $3 {$4" ) ) )
236
+ . pipe ( append ( "\nexport = ts;\nexport as namespace ts;" ) )
237
+ . pipe ( rename ( "tsserver.d.ts" ) )
238
+ . pipe ( dest ( "built/local" ) ) ;
239
+
240
+ return series (
241
+ buildServerOut ,
242
+ createServerJs ,
243
+ createServerDts ,
244
+ ) ;
245
+ } ) ( ) ;
219
246
task ( "tsserver" , series ( preBuild , buildServer ) ) ;
220
247
task ( "tsserver" ) . description = "Builds the language server" ;
221
248
task ( "tsserver" ) . flags = {
222
249
" --built" : "Compile using the built version of the compiler."
223
250
} ;
224
251
225
- const cleanServer = ( ) => cleanProject ( "src/tsserver" ) ;
252
+ const cleanServer = async ( ) => {
253
+ await cleanProject ( "src/tsserver" ) ;
254
+ if ( fs . existsSync ( "built/local/tsserver.tsconfig.json" ) ) {
255
+ await cleanProject ( "built/local/tsserver.tsconfig.json" ) ;
256
+ }
257
+ await del ( [
258
+ "built/local/tsserver.out.js" ,
259
+ "built/local/tsserver.out.js.map" ,
260
+ "built/local/tsserver.out.d.ts" ,
261
+ "built/local/tsserver.out.tsbuildinfo" ,
262
+ "built/local/tsserver.js" ,
263
+ "built/local/tsserver.js.map" ,
264
+ "built/local/tsserver.d.ts" ,
265
+ ] ) ;
266
+ } ;
226
267
cleanTasks . push ( cleanServer ) ;
227
268
task ( "clean-tsserver" , cleanServer ) ;
228
269
task ( "clean-tsserver" ) . description = "Cleans outputs for the language server" ;
@@ -249,76 +290,8 @@ task("watch-min").flags = {
249
290
" --built" : "Compile using the built version of the compiler."
250
291
} ;
251
292
252
- const buildLssl = ( ( ) => {
253
- // build tsserverlibrary.out.js
254
- const buildServerLibraryOut = ( ) => buildProject ( "src/tsserverlibrary/tsconfig.json" , cmdLineOptions ) ;
255
-
256
- // create tsserverlibrary.js
257
- const createServerLibraryJs = ( ) => src ( "built/local/tsserverlibrary.out.js" )
258
- . pipe ( newer ( "built/local/tsserverlibrary.js" ) )
259
- . pipe ( sourcemaps . init ( { loadMaps : true } ) )
260
- . pipe ( prependFile ( copyright ) )
261
- . pipe ( rename ( "tsserverlibrary.js" ) )
262
- . pipe ( sourcemaps . write ( "." , { includeContent : false , destPath : "built/local" } ) )
263
- . pipe ( dest ( "built/local" ) ) ;
264
-
265
- // create tsserverlibrary.d.ts
266
- const createServerLibraryDts = ( ) => src ( "built/local/tsserverlibrary.out.d.ts" )
267
- . pipe ( newer ( "built/local/tsserverlibrary.d.ts" ) )
268
- . pipe ( prependFile ( copyright ) )
269
- . pipe ( transform ( content => content . replace ( / ^ ( \s * ) ( e x p o r t ) ? c o n s t e n u m ( \S + ) { ( \s * ) $ / gm, "$1$2enum $3 {$4" ) ) )
270
- . pipe ( append ( "\nexport = ts;\nexport as namespace ts;" ) )
271
- . pipe ( rename ( "tsserverlibrary.d.ts" ) )
272
- . pipe ( dest ( "built/local" ) ) ;
273
-
274
- return series (
275
- buildServerLibraryOut ,
276
- createServerLibraryJs ,
277
- createServerLibraryDts ,
278
- ) ;
279
- } ) ( ) ;
280
- task ( "lssl" , series ( preBuild , buildLssl ) ) ;
281
- task ( "lssl" ) . description = "Builds language service server library" ;
282
- task ( "lssl" ) . flags = {
283
- " --built" : "Compile using the built version of the compiler."
284
- } ;
285
-
286
- const cleanLssl = async ( ) => {
287
- if ( fs . existsSync ( "built/local/tsserverlibrary.tsconfig.json" ) ) {
288
- await cleanProject ( "built/local/tsserverlibrary.tsconfig.json" ) ;
289
- }
290
- await del ( [
291
- "built/local/tsserverlibrary.out.js" ,
292
- "built/local/tsserverlibrary.out.d.ts" ,
293
- "built/local/tsserverlibrary.out.tsbuildinfo" ,
294
- "built/local/tsserverlibrary.js" ,
295
- "built/local/tsserverlibrary.d.ts" ,
296
- ] ) ;
297
- } ;
298
- cleanTasks . push ( cleanLssl ) ;
299
- task ( "clean-lssl" , cleanLssl ) ;
300
- task ( "clean-lssl" ) . description = "Clean outputs for the language service server library" ;
301
-
302
- const watchLssl = ( ) => watch ( [
303
- "src/compiler/tsconfig.json" ,
304
- "src/compiler/**/*.ts" ,
305
- "src/jsTyping/tsconfig.json" ,
306
- "src/jsTyping/**/*.ts" ,
307
- "src/services/tsconfig.json" ,
308
- "src/services/**/*.ts" ,
309
- "src/server/tsconfig.json" ,
310
- "src/server/**/*.ts" ,
311
- "src/tsserver/tsconfig.json" ,
312
- "src/tsserver/**/*.ts" ,
313
- ] , buildLssl ) ;
314
- task ( "watch-lssl" , series ( preBuild , parallel ( watchLib , watchDiagnostics , watchLssl ) ) ) ;
315
- task ( "watch-lssl" ) . description = "Watch for changes and rebuild tsserverlibrary only" ;
316
- task ( "watch-lssl" ) . flags = {
317
- " --built" : "Compile using the built version of the compiler."
318
- } ;
319
-
320
293
const buildTests = ( ) => buildProject ( "src/testRunner" ) ;
321
- task ( "tests" , series ( preBuild , parallel ( buildLssl , buildTests ) ) ) ;
294
+ task ( "tests" , series ( preBuild , parallel ( buildServer , buildTests ) ) ) ;
322
295
task ( "tests" ) . description = "Builds the test infrastructure" ;
323
296
task ( "tests" ) . flags = {
324
297
" --built" : "Compile using the built version of the compiler."
@@ -412,7 +385,7 @@ const cleanTypesMap = () => del("built/local/typesMap.json");
412
385
cleanTasks . push ( cleanTypesMap ) ;
413
386
414
387
// Drop a copy of diagnosticMessages.generated.json into the built/local folder. This allows
415
- // it to be synced to the Azure DevOps repo, so that it can get picked up by the build
388
+ // it to be synced to the Azure DevOps repo, so that it can get picked up by the build
416
389
// pipeline that generates the localization artifacts that are then fed into the translation process.
417
390
const builtLocalDiagnosticMessagesGeneratedJson = "built/local/diagnosticMessages.generated.json" ;
418
391
const copyBuiltLocalDiagnosticMessages = ( ) => src ( diagnosticMessagesGeneratedJson )
@@ -428,13 +401,13 @@ task("other-outputs").description = "Builds miscelaneous scripts and documents d
428
401
429
402
const buildFoldStart = async ( ) => { if ( fold . isTravis ( ) ) console . log ( fold . start ( "build" ) ) ; } ;
430
403
const buildFoldEnd = async ( ) => { if ( fold . isTravis ( ) ) console . log ( fold . end ( "build" ) ) ; } ;
431
- task ( "local" , series ( buildFoldStart , preBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLssl , buildOtherOutputs ) , buildFoldEnd ) ) ;
404
+ task ( "local" , series ( buildFoldStart , preBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildOtherOutputs ) , buildFoldEnd ) ) ;
432
405
task ( "local" ) . description = "Builds the full compiler and services" ;
433
406
task ( "local" ) . flags = {
434
407
" --built" : "Compile using the built version of the compiler."
435
408
} ;
436
409
437
- task ( "watch-local" , series ( preBuild , parallel ( watchLib , watchDiagnostics , watchTsc , watchServices , watchServer , watchLssl ) ) ) ;
410
+ task ( "watch-local" , series ( preBuild , parallel ( watchLib , watchDiagnostics , watchTsc , watchServices , watchServer ) ) ) ;
438
411
task ( "watch-local" ) . description = "Watches for changes to projects in src/ (but does not execute tests)." ;
439
412
task ( "watch-local" ) . flags = {
440
413
" --built" : "Compile using the built version of the compiler."
@@ -444,7 +417,7 @@ const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/moch
444
417
task ( "generate-code-coverage" , series ( preBuild , buildTests , generateCodeCoverage ) ) ;
445
418
task ( "generate-code-coverage" ) . description = "Generates code coverage data via istanbul" ;
446
419
447
- const preTest = parallel ( buildTsc , buildTests , buildServices , buildLssl ) ;
420
+ const preTest = parallel ( buildTsc , buildTests , buildServices , buildServer ) ;
448
421
preTest . displayName = "preTest" ;
449
422
450
423
const postTest = ( done ) => cmdLineOptions . lint ? lint ( done ) : done ( ) ;
@@ -529,7 +502,7 @@ const cleanInstrumenter = () => cleanProject("src/instrumenter");
529
502
cleanTasks . push ( cleanInstrumenter ) ;
530
503
531
504
const tscInstrumented = ( ) => exec ( process . execPath , [ "built/local/instrumenter.js" , "record" , cmdLineOptions . tests || "iocapture" , "built/local" ] ) ;
532
- task ( "tsc-instrumented" , series ( lkgPreBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLssl , buildLoggedIO , buildInstrumenter ) , tscInstrumented ) ) ;
505
+ task ( "tsc-instrumented" , series ( lkgPreBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLoggedIO , buildInstrumenter ) , tscInstrumented ) ) ;
533
506
task ( "tsc-instrumented" ) . description = "Builds an instrumented tsc.js" ;
534
507
task ( "tsc-instrumented" ) . flags = {
535
508
"-t --tests=<testname>" : "The test to run."
@@ -563,10 +536,9 @@ const produceLKG = async () => {
563
536
"built/local/typescriptServices.js" ,
564
537
"built/local/typescriptServices.d.ts" ,
565
538
"built/local/tsserver.js" ,
539
+ "built/local/tsserver.d.ts" ,
566
540
"built/local/typescript.js" ,
567
541
"built/local/typescript.d.ts" ,
568
- "built/local/tsserverlibrary.js" ,
569
- "built/local/tsserverlibrary.d.ts" ,
570
542
"built/local/typingsInstaller.js" ,
571
543
"built/local/cancellationToken.js"
572
544
] . concat ( libs . map ( lib => lib . target ) ) ;
@@ -584,7 +556,7 @@ const produceLKG = async () => {
584
556
}
585
557
} ;
586
558
587
- task ( "LKG" , series ( lkgPreBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLssl , buildOtherOutputs , buildReleaseTsc ) , produceLKG ) ) ;
559
+ task ( "LKG" , series ( lkgPreBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildOtherOutputs , buildReleaseTsc ) , produceLKG ) ) ;
588
560
task ( "LKG" ) . description = "Makes a new LKG out of the built js files" ;
589
561
task ( "LKG" ) . flags = {
590
562
" --built" : "Compile using the built version of the compiler." ,
@@ -630,7 +602,7 @@ const watchRuntests = () => watch(["built/local/*.js", "tests/cases/**/*.ts", "t
630
602
await runConsoleTests ( "built/local/run.js" , "min" , /*runInParallel*/ true , /*watchMode*/ true ) ;
631
603
}
632
604
} ) ;
633
- task ( "watch" , series ( preBuild , preTest , parallel ( watchLib , watchDiagnostics , watchServices , watchLssl , watchTests , watchRuntests ) ) ) ;
605
+ task ( "watch" , series ( preBuild , preTest , parallel ( watchLib , watchDiagnostics , watchServices , watchServer , watchTests , watchRuntests ) ) ) ;
634
606
task ( "watch" ) . description = "Watches for changes and rebuilds and runs tests in parallel." ;
635
607
task ( "watch" ) . flags = {
636
608
"-t --tests=<regex>" : "Pattern for tests to run. Forces tests to be run in a single worker." ,
0 commit comments