Remove lib folder (LKG) and use node_modules for building (#52226)

This commit is contained in:
Jake Bailey
2023-03-07 15:34:47 -08:00
committed by GitHub
parent 2f229ab870
commit 3f4d16a25e
105 changed files with 51 additions and 763515 deletions

View File

@@ -35,7 +35,7 @@ const parsed = minimist(process.argv.slice(2), {
workers: +(process.env.workerCount ?? 0) || ((os.cpus().length - (ci ? 0 : 1)) || 1),
failed: false,
keepFailed: false,
lkg: true,
lkg: false,
dirty: false,
built: false,
ci,
@@ -48,8 +48,8 @@ const parsed = minimist(process.argv.slice(2), {
/** @type {CommandLineOptions} */
const options = /** @type {any} */ (parsed);
if (options.built) {
options.lkg = false;
if (options.built && options.lkg) {
throw new Error("--built and --lkg are mutually exclusive");
}
if (!options.bundle && !options.typecheck) {

View File

@@ -30,11 +30,14 @@ class ProjectQueue {
}
}
const execTsc = (/** @type {string[]} */ ...args) =>
exec(process.execPath,
[resolve(findUpRoot(), cmdLineOptions.lkg ? "./lib/tsc.js" : "./built/local/tsc.js"),
"-b", ...args],
{ hidePrompt: true });
const tscPath = resolve(
findUpRoot(),
cmdLineOptions.lkg ? "./lib/tsc.js" :
cmdLineOptions.built ? "./built/local/tsc.js" :
"./node_modules/typescript/lib/tsc.js",
);
const execTsc = (/** @type {string[]} */ ...args) => exec(process.execPath, [tscPath, "-b", ...args], { hidePrompt: true });
const projectBuilder = new ProjectQueue((projects) => execTsc(...(cmdLineOptions.bundle ? [] : ["--emitDeclarationOnly", "false"]), ...projects));
@@ -48,7 +51,7 @@ const projectCleaner = new ProjectQueue((projects) => execTsc("--clean", ...proj
/**
* @param {string} project
*/
export const cleanProject = (project) => projectCleaner.enqueue(project);
export const cleanProject = (project) => projectCleaner.enqueue(project);
const projectWatcher = new ProjectQueue((projects) => execTsc("--watch", "--preserveWatchOutput", ...projects));