@@ -125,6 +125,20 @@ const buildSrc = () => buildProject("src");
125125
126126task ( "build-src" , series ( preSrc , buildSrc ) ) ;
127127
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+
128142/** @type {string | undefined } */
129143let copyrightHeader ;
130144function getCopyrightHeader ( ) {
@@ -267,6 +281,7 @@ const esbuildServices = esbuildTask("./src/typescript/typescript.ts", "./built/l
267281const writeServicesCJSShim = ( ) => writeCJSReexport ( "./built/local/typescript/typescript.js" , "./built/local/typescript.js" ) ;
268282const buildServicesProject = ( ) => buildProject ( "src/typescript" ) ;
269283
284+ // TODO(jakebailey): rename this; no longer "services".
270285const buildServices = ( ) => {
271286 if ( cmdLineOptions . bundle ) return esbuildServices . build ( ) ;
272287 writeServicesCJSShim ( ) ;
@@ -296,6 +311,9 @@ task("watch-services").flags = {
296311 " --built" : "Compile using the built version of the compiler."
297312} ;
298313
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" ;
299317
300318const esbuildServer = esbuildTask ( "./src/tsserver/server.ts" , "./built/local/tsserver.js" , /* exportIsTsObject */ true ) ;
301319const writeServerCJSShim = ( ) => writeCJSReexport ( "./built/local/tsserver/server.js" , "./built/local/tsserver.js" ) ;
@@ -347,10 +365,11 @@ task("watch-min").flags = {
347365const esbuildLssl = esbuildTask ( "./src/tsserverlibrary/tsserverlibrary.ts" , "./built/local/tsserverlibrary.js" , /* exportIsTsObject */ true ) ;
348366const writeLsslCJSShim = ( ) => writeCJSReexport ( "./built/local/tsserverlibrary/tsserverlibrary.js" , "./built/local/tsserverlibrary.js" ) ;
349367
368+ const buildLsslProject = ( ) => buildProject ( "src/tsserverlibrary" ) ;
350369const buildLssl = ( ) => {
351370 if ( cmdLineOptions . bundle ) return esbuildLssl . build ( ) ;
352371 writeLsslCJSShim ( ) ;
353- return buildProject ( "src/tsserverlibrary" ) ;
372+ return buildLsslProject ( ) ;
354373} ;
355374task ( "lssl" , series ( preBuild , buildLssl ) ) ;
356375task ( "lssl" ) . description = "Builds language service server library" ;
@@ -374,6 +393,14 @@ task("watch-lssl").flags = {
374393 " --built" : "Compile using the built version of the compiler."
375394} ;
376395
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+
377404const testRunner = "./built/local/run.js" ;
378405const esbuildTests = esbuildTask ( "./src/testRunner/_namespaces/Harness.ts" , testRunner ) ;
379406const writeTestsCJSShim = ( ) => writeCJSReexport ( "./built/local/testRunner/runner.js" , testRunner ) ;
@@ -478,7 +505,7 @@ const buildOtherOutputs = parallel(buildCancellationToken, buildTypingsInstaller
478505task ( "other-outputs" , series ( preBuild , buildOtherOutputs ) ) ;
479506task ( "other-outputs" ) . description = "Builds miscelaneous scripts and documents distributed with the LKG" ;
480507
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 ) ) ) ;
482509task ( "local" ) . description = "Builds the full compiler and services" ;
483510task ( "local" ) . flags = {
484511 " --built" : "Compile using the built version of the compiler."
@@ -494,7 +521,7 @@ const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
494521preTest . displayName = "preTest" ;
495522
496523const 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 ) ) ;
498525task ( "runtests" ) . description = "Runs the tests using the built run.js file." ;
499526task ( "runtests" ) . flags = {
500527 "-t --tests=<regex>" : "Pattern for tests to run." ,
@@ -513,7 +540,7 @@ task("runtests").flags = {
513540} ;
514541
515542const 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 ) ) ;
517544task ( "runtests-parallel" ) . description = "Runs all the tests in parallel using the built run.js file." ;
518545task ( "runtests-parallel" ) . flags = {
519546 " --light" : "Run tests in light mode (fewer verifications, but tests run faster)." ,
@@ -599,8 +626,7 @@ const produceLKG = async () => {
599626 }
600627} ;
601628
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 ) ) ;
604630task ( "LKG" ) . description = "Makes a new LKG out of the built js files" ;
605631task ( "LKG" ) . flags = {
606632 " --built" : "Compile using the built version of the compiler." ,
0 commit comments