Skip to content

Commit 5dd39a6

Browse files
committed
Try and fix up LKG
1 parent 0b39eda commit 5dd39a6

File tree

2 files changed

+43
-26
lines changed

2 files changed

+43
-26
lines changed

Diff for: Gulpfile.js

+10-14
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const buildSrc = () => buildProject("src");
127127
// But, if we are bundling, we are running only d.ts emit, so maybe this is fast?
128128
task("buildSrc", series(preSrc, buildSrc));
129129

130-
const apiExtractor = async () => {
130+
const runApiExtractor = async () => {
131131
/**
132132
* @param {string} configPath
133133
*/
@@ -147,7 +147,9 @@ const apiExtractor = async () => {
147147
};
148148

149149
// TODO(jakebailey): Some tests depend on the extracted output.
150-
task("api-extractor", series(preSrc, buildSrc, apiExtractor));
150+
const apiExtractor = series(preSrc, buildSrc, runApiExtractor);
151+
apiExtractor.displayName = "api-extractor";
152+
task("api-extractor", apiExtractor);
151153

152154
/** @type {string | undefined} */
153155
let copyrightHeader;
@@ -567,27 +569,20 @@ const importDefinitelyTypedTests = () => exec(process.execPath, ["scripts/import
567569
task("importDefinitelyTypedTests", series(buildImportDefinitelyTypedTests, importDefinitelyTypedTests));
568570
task("importDefinitelyTypedTests").description = "Runs the importDefinitelyTypedTests script to copy DT's tests to the TS-internal RWC tests";
569571

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

579574
const produceLKG = async () => {
575+
// TODO(jakebailey): there are probably more files here that are needed.
580576
const expectedFiles = [
581-
"built/local/tsc.release.js",
582-
"built/local/typescriptServices.js",
583-
"built/local/typescriptServices.d.ts",
577+
"built/local/tsc.js",
584578
"built/local/tsserver.js",
585579
"built/local/typescript.js",
586580
"built/local/typescript.d.ts",
587581
"built/local/tsserverlibrary.js",
588582
"built/local/tsserverlibrary.d.ts",
589583
"built/local/typingsInstaller.js",
590-
"built/local/cancellationToken.js"
584+
"built/local/cancellationToken.js",
585+
"built/local/watchGuard.js",
591586
].concat(libs.map(lib => lib.target));
592587
const missingFiles = expectedFiles
593588
.concat(localizationTargets)
@@ -603,7 +598,8 @@ const produceLKG = async () => {
603598
}
604599
};
605600

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

Diff for: scripts/produceLKG.ts

+33-12
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,26 @@ async function copyLocalizedDiagnostics() {
2929
const dir = await fs.readdir(source);
3030
const ignoredFolders = ["enu"];
3131

32+
// TODO(jakebailey): Can we emit these files somewhere else so they are more easily skippable?
33+
ignoredFolders.push(
34+
"compiler",
35+
"deprecatedCompat",
36+
"executeCommandLine",
37+
"harness",
38+
"jsTyping",
39+
"loggedIO",
40+
"server",
41+
"services",
42+
"testRunner",
43+
"tsc",
44+
"tsserver",
45+
"tsserverlibrary",
46+
"typescript",
47+
"typingsInstaller",
48+
"typingsInstallerCore",
49+
"webServer",
50+
);
51+
3252
for (const d of dir) {
3353
const fileName = path.join(source, d);
3454
if (
@@ -44,6 +64,7 @@ async function copyTypesMap() {
4464
await copyFromBuiltLocal("typesMap.json"); // Cannot accommodate copyright header
4565
}
4666

67+
// TODO(jakebailey): Remove?
4768
async function buildProtocol() {
4869
const protocolScript = path.join(__dirname, "buildProtocol.js");
4970
if (!fs.existsSync(protocolScript)) {
@@ -59,20 +80,20 @@ async function buildProtocol() {
5980
}
6081

6182
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");
83+
// TODO(jakebailey): This does not work when unbundled.
84+
// TODO(jakebailey): Copyright is added by esbuild; maybe we should do it here?
85+
await copyFromBuiltLocal("cancellationToken.js");
86+
await copyFromBuiltLocal("tsc.js");
87+
await copyFromBuiltLocal("tsserver.js");
88+
await copyFromBuiltLocal("tsserverlibrary.js");
89+
await copyFromBuiltLocal("typescript.js");
90+
await copyFromBuiltLocal("typingsInstaller.js");
91+
await copyFromBuiltLocal("watchGuard.js");
7092
}
7193

7294
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
95+
await copyWithCopyright("tsserverlibrary.d.ts");
96+
await copyWithCopyright("typescript.d.ts");
7697
}
7798

7899
async function writeGitAttributes() {

0 commit comments

Comments
 (0)