@@ -125,6 +125,20 @@ const buildSrc = () => buildProject("src");
125
125
126
126
task ( "build-src" , series ( preSrc , buildSrc ) ) ;
127
127
128
+ /**
129
+ * @param {string } entrypoint
130
+ * @param {string } output
131
+ */
132
+ async function runDtsBundler ( entrypoint , output ) {
133
+ await exec ( process . execPath , [
134
+ "./scripts/dtsBundler.mjs" ,
135
+ "--entrypoint" ,
136
+ entrypoint ,
137
+ "--output" ,
138
+ output ,
139
+ ] ) ;
140
+ }
141
+
128
142
/** @type {string | undefined } */
129
143
let copyrightHeader ;
130
144
function getCopyrightHeader ( ) {
@@ -267,6 +281,7 @@ const esbuildServices = esbuildTask("./src/typescript/typescript.ts", "./built/l
267
281
const writeServicesCJSShim = ( ) => writeCJSReexport ( "./built/local/typescript/typescript.js" , "./built/local/typescript.js" ) ;
268
282
const buildServicesProject = ( ) => buildProject ( "src/typescript" ) ;
269
283
284
+ // TODO(jakebailey): rename this; no longer "services".
270
285
const buildServices = ( ) => {
271
286
if ( cmdLineOptions . bundle ) return esbuildServices . build ( ) ;
272
287
writeServicesCJSShim ( ) ;
@@ -296,6 +311,9 @@ task("watch-services").flags = {
296
311
" --built" : "Compile using the built version of the compiler."
297
312
} ;
298
313
314
+ const dtsServices = ( ) => runDtsBundler ( "./built/local/typescript/typescript.d.ts" , "./built/local/typescript.d.ts" ) ;
315
+ task ( "dts-services" , series ( preBuild , buildServicesProject , dtsServices ) ) ;
316
+ task ( "dts-services" ) . description = "Builds typescript.d.ts" ;
299
317
300
318
const esbuildServer = esbuildTask ( "./src/tsserver/server.ts" , "./built/local/tsserver.js" , /* exportIsTsObject */ true ) ;
301
319
const writeServerCJSShim = ( ) => writeCJSReexport ( "./built/local/tsserver/server.js" , "./built/local/tsserver.js" ) ;
@@ -347,10 +365,11 @@ task("watch-min").flags = {
347
365
const esbuildLssl = esbuildTask ( "./src/tsserverlibrary/tsserverlibrary.ts" , "./built/local/tsserverlibrary.js" , /* exportIsTsObject */ true ) ;
348
366
const writeLsslCJSShim = ( ) => writeCJSReexport ( "./built/local/tsserverlibrary/tsserverlibrary.js" , "./built/local/tsserverlibrary.js" ) ;
349
367
368
+ const buildLsslProject = ( ) => buildProject ( "src/tsserverlibrary" ) ;
350
369
const buildLssl = ( ) => {
351
370
if ( cmdLineOptions . bundle ) return esbuildLssl . build ( ) ;
352
371
writeLsslCJSShim ( ) ;
353
- return buildProject ( "src/tsserverlibrary" ) ;
372
+ return buildLsslProject ( ) ;
354
373
} ;
355
374
task ( "lssl" , series ( preBuild , buildLssl ) ) ;
356
375
task ( "lssl" ) . description = "Builds language service server library" ;
@@ -374,6 +393,14 @@ task("watch-lssl").flags = {
374
393
" --built" : "Compile using the built version of the compiler."
375
394
} ;
376
395
396
+ const dtsLssl = ( ) => runDtsBundler ( "./built/local/tsserverlibrary/tsserverlibrary.d.ts" , "./built/local/tsserverlibrary.d.ts" ) ;
397
+ task ( "dts-lssl" , series ( preBuild , buildLsslProject , dtsLssl ) ) ;
398
+ task ( "dts-lssl" ) . description = "Builds tsserverlibrary.d.ts" ;
399
+
400
+ // TODO(jakebailey): this is probably not efficient, but, gulp.
401
+ const dts = series ( preBuild , parallel ( buildServicesProject , buildLsslProject ) , parallel ( dtsServices , dtsLssl ) ) ;
402
+ task ( "dts" , dts ) ;
403
+
377
404
const testRunner = "./built/local/run.js" ;
378
405
const esbuildTests = esbuildTask ( "./src/testRunner/_namespaces/Harness.ts" , testRunner ) ;
379
406
const writeTestsCJSShim = ( ) => writeCJSReexport ( "./built/local/testRunner/runner.js" , testRunner ) ;
@@ -478,7 +505,7 @@ const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller
478
505
task ( "other-outputs" , series ( preBuild , buildOtherOutputs ) ) ;
479
506
task ( "other-outputs" ) . description = "Builds miscelaneous scripts and documents distributed with the LKG" ;
480
507
481
- task ( "local" , series ( preBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLssl , buildOtherOutputs ) ) ) ;
508
+ task ( "local" , series ( preBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLssl , buildOtherOutputs , dts ) ) ) ;
482
509
task ( "local" ) . description = "Builds the full compiler and services" ;
483
510
task ( "local" ) . flags = {
484
511
" --built" : "Compile using the built version of the compiler."
@@ -494,7 +521,7 @@ const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
494
521
preTest . displayName = "preTest" ;
495
522
496
523
const runTests = ( ) => runConsoleTests ( testRunner , "mocha-fivemat-progress-reporter" , /*runInParallel*/ false , /*watchMode*/ false ) ;
497
- task ( "runtests" , series ( preBuild , preTest , runTests ) ) ;
524
+ task ( "runtests" , series ( preBuild , preTest , dts , runTests ) ) ;
498
525
task ( "runtests" ) . description = "Runs the tests using the built run.js file." ;
499
526
task ( "runtests" ) . flags = {
500
527
"-t --tests=<regex>" : "Pattern for tests to run." ,
@@ -513,7 +540,7 @@ task("runtests").flags = {
513
540
} ;
514
541
515
542
const runTestsParallel = ( ) => runConsoleTests ( testRunner , "min" , /*runInParallel*/ cmdLineOptions . workers > 1 , /*watchMode*/ false ) ;
516
- task ( "runtests-parallel" , series ( preBuild , preTest , runTestsParallel ) ) ;
543
+ task ( "runtests-parallel" , series ( preBuild , preTest , dts , runTestsParallel ) ) ;
517
544
task ( "runtests-parallel" ) . description = "Runs all the tests in parallel using the built run.js file." ;
518
545
task ( "runtests-parallel" ) . flags = {
519
546
" --light" : "Run tests in light mode (fewer verifications, but tests run faster)." ,
@@ -599,8 +626,7 @@ const produceLKG = async () => {
599
626
}
600
627
} ;
601
628
602
- // TODO(jakebailey): dependencies on dts
603
- task ( "LKG" , series ( lkgPreBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLssl , buildOtherOutputs ) , produceLKG ) ) ;
629
+ task ( "LKG" , series ( lkgPreBuild , parallel ( localize , buildTsc , buildServer , buildServices , buildLssl , buildOtherOutputs , dts ) , produceLKG ) ) ;
604
630
task ( "LKG" ) . description = "Makes a new LKG out of the built js files" ;
605
631
task ( "LKG" ) . flags = {
606
632
" --built" : "Compile using the built version of the compiler." ,
0 commit comments