Skip to content

Commit d29dbf6

Browse files
committed
Try and fix up LKG
1 parent 89d04c6 commit d29dbf6

File tree

2 files changed

+40
-24
lines changed

2 files changed

+40
-24
lines changed

Gulpfile.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -569,27 +569,20 @@ const importDefinitelyTypedTests = () => exec(process.execPath, ["scripts/import
569569
task("importDefinitelyTypedTests", series(buildImportDefinitelyTypedTests, importDefinitelyTypedTests));
570570
task("importDefinitelyTypedTests").description = "Runs the importDefinitelyTypedTests script to copy DT's tests to the TS-internal RWC tests";
571571

572-
// TODO(jakebailey): There isn't a release build anymore; figure out what to do here.
573-
// Probably just use tsc.js.
574-
575-
const buildReleaseTsc = () => buildProject("src/tsc/tsconfig.release.json");
576-
const cleanReleaseTsc = () => cleanProject("src/tsc/tsconfig.release.json");
577-
cleanTasks.push(cleanReleaseTsc);
578-
579572
const cleanBuilt = () => del("built");
580573

581574
const produceLKG = async () => {
575+
// TODO(jakebailey): there are probably more files here that are needed.
582576
const expectedFiles = [
583-
"built/local/tsc.release.js",
584-
"built/local/typescriptServices.js",
585-
"built/local/typescriptServices.d.ts",
577+
"built/local/tsc.js",
586578
"built/local/tsserver.js",
587579
"built/local/typescript.js",
588580
"built/local/typescript.d.ts",
589581
"built/local/tsserverlibrary.js",
590582
"built/local/tsserverlibrary.d.ts",
591583
"built/local/typingsInstaller.js",
592-
"built/local/cancellationToken.js"
584+
"built/local/cancellationToken.js",
585+
"built/local/watchGuard.js",
593586
].concat(libs.map(lib => lib.target));
594587
const missingFiles = expectedFiles
595588
.concat(localizationTargets)
@@ -605,7 +598,8 @@ const produceLKG = async () => {
605598
}
606599
};
607600

608-
task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs, buildReleaseTsc), produceLKG));
601+
// TODO(jakebailey): dependencies on dts
602+
task("LKG", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildOtherOutputs), produceLKG));
609603
task("LKG").description = "Makes a new LKG out of the built js files";
610604
task("LKG").flags = {
611605
" --built": "Compile using the built version of the compiler.",

scripts/produceLKG.ts

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function produceLKG() {
1717
await copyTypesMap();
1818
await copyScriptOutputs();
1919
await copyDeclarationOutputs();
20-
await buildProtocol();
20+
if (1 !== 1) await buildProtocol(); // TODO(jakebailey): remove
2121
await writeGitAttributes();
2222
}
2323

@@ -29,6 +29,27 @@ async function copyLocalizedDiagnostics() {
2929
const dir = await fs.readdir(source);
3030
const ignoredFolders = ["enu"];
3131

32+
// TODO(jakebailey): Instead of ignoring folders, we should keep a list of
33+
// the localizationTargets somewhere that can be used by multiple modules.
34+
ignoredFolders.push(
35+
"compiler",
36+
"deprecatedCompat",
37+
"executeCommandLine",
38+
"harness",
39+
"jsTyping",
40+
"loggedIO",
41+
"server",
42+
"services",
43+
"testRunner",
44+
"tsc",
45+
"tsserver",
46+
"tsserverlibrary",
47+
"typescript",
48+
"typingsInstaller",
49+
"typingsInstallerCore",
50+
"webServer",
51+
);
52+
3253
for (const d of dir) {
3354
const fileName = path.join(source, d);
3455
if (
@@ -44,6 +65,7 @@ async function copyTypesMap() {
4465
await copyFromBuiltLocal("typesMap.json"); // Cannot accommodate copyright header
4566
}
4667

68+
// TODO(jakebailey): Remove?
4769
async function buildProtocol() {
4870
const protocolScript = path.join(__dirname, "buildProtocol.js");
4971
if (!fs.existsSync(protocolScript)) {
@@ -59,20 +81,20 @@ async function buildProtocol() {
5981
}
6082

6183
async function copyScriptOutputs() {
62-
await copyWithCopyright("cancellationToken.js");
63-
await copyWithCopyright("tsc.release.js", "tsc.js");
64-
await copyWithCopyright("tsserver.js");
65-
await copyFromBuiltLocal("tsserverlibrary.js"); // copyright added by build
66-
await copyFromBuiltLocal("typescript.js"); // copyright added by build
67-
await copyFromBuiltLocal("typescriptServices.js"); // copyright added by build
68-
await copyWithCopyright("typingsInstaller.js");
69-
await copyWithCopyright("watchGuard.js");
84+
// TODO(jakebailey): This does not work when unbundled.
85+
// TODO(jakebailey): Copyright is added by esbuild; maybe we should do it here?
86+
await copyFromBuiltLocal("cancellationToken.js");
87+
await copyFromBuiltLocal("tsc.js");
88+
await copyFromBuiltLocal("tsserver.js");
89+
await copyFromBuiltLocal("tsserverlibrary.js");
90+
await copyFromBuiltLocal("typescript.js");
91+
await copyFromBuiltLocal("typingsInstaller.js");
92+
await copyFromBuiltLocal("watchGuard.js");
7093
}
7194

7295
async function copyDeclarationOutputs() {
73-
await copyFromBuiltLocal("tsserverlibrary.d.ts"); // copyright added by build
74-
await copyFromBuiltLocal("typescript.d.ts"); // copyright added by build
75-
await copyFromBuiltLocal("typescriptServices.d.ts"); // copyright added by build
96+
await copyWithCopyright("tsserverlibrary.d.ts");
97+
await copyWithCopyright("typescript.d.ts");
7698
}
7799

78100
async function writeGitAttributes() {

0 commit comments

Comments
 (0)