mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-15 14:05:47 -05:00
Remove lib folder (LKG) and use node_modules for building (#52226)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user