@lage-run/config 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/getConfig.js CHANGED
@@ -40,6 +40,7 @@ async function getConfig(cwd) {
40
40
  concurrency: config?.concurrency ?? availableParallelism,
41
41
  allowNoTargetRuns: config?.allowNoTargetRuns ?? false,
42
42
  enableTargetConfigMerging: config?.enableTargetConfigMerging ?? false,
43
+ enablePhantomTargetOptimization: config?.enablePhantomTargetOptimization ?? false,
43
44
  reporters: config?.reporters ?? {}
44
45
  };
45
46
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/getConfig.ts"],"sourcesContent":["import os from \"os\";\nimport { readConfigFile } from \"./readConfigFile.js\";\nimport type { ConfigOptions } from \"./types/ConfigOptions.js\";\nimport type { CacheOptions } from \"./types/CacheOptions.js\";\n\n/**\n * Get the lage config with defaults.\n */\nexport async function getConfig(cwd: string): Promise<ConfigOptions> {\n const config = (await readConfigFile(cwd)) || ({} as Partial<ConfigOptions>);\n const availableParallelism = \"availableParallelism\" in os ? (os as any)[\"availableParallelism\"]() : os.cpus().length - 1;\n return {\n cacheOptions: config?.cacheOptions ?? ({} as CacheOptions),\n ignore: config?.ignore ?? [],\n npmClient: config?.npmClient ?? \"npm\",\n pipeline: config?.pipeline ?? {},\n priorities: config?.priorities ?? [],\n repoWideChanges: config?.repoWideChanges ?? [\n \"lage.config.js\",\n \"lage.config.mjs\",\n \"lage.config.cjs\",\n \"package-lock.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"lerna.json\",\n \"rush.json\",\n ],\n loggerOptions: config?.loggerOptions ?? {},\n runners: config?.runners ?? {},\n workerIdleMemoryLimit: config?.workerIdleMemoryLimit ?? os.totalmem(), // 0 means no limit,\n concurrency: config?.concurrency ?? availableParallelism,\n allowNoTargetRuns: config?.allowNoTargetRuns ?? false,\n enableTargetConfigMerging: config?.enableTargetConfigMerging ?? false,\n reporters: config?.reporters ?? {},\n };\n}\n"],"names":["getConfig","cwd","config","readConfigFile","availableParallelism","os","cpus","length","cacheOptions","ignore","npmClient","pipeline","priorities","repoWideChanges","loggerOptions","runners","workerIdleMemoryLimit","totalmem","concurrency","allowNoTargetRuns","enableTargetConfigMerging","reporters"],"mappings":";;;;+BAQsBA;;;eAAAA;;;2DARP;gCACgB;;;;;;AAOxB,eAAeA,UAAUC,GAAW;IACzC,MAAMC,SAAS,AAAC,MAAMC,IAAAA,8BAAc,EAACF,QAAU,CAAC;IAChD,MAAMG,uBAAuB,0BAA0BC,WAAE,GAAG,AAACA,WAAE,AAAQ,CAAC,uBAAuB,KAAKA,WAAE,CAACC,IAAI,GAAGC,MAAM,GAAG;IACvH,OAAO;QACLC,cAAcN,QAAQM,gBAAiB,CAAC;QACxCC,QAAQP,QAAQO,UAAU,EAAE;QAC5BC,WAAWR,QAAQQ,aAAa;QAChCC,UAAUT,QAAQS,YAAY,CAAC;QAC/BC,YAAYV,QAAQU,cAAc,EAAE;QACpCC,iBAAiBX,QAAQW,mBAAmB;YAC1C;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,eAAeZ,QAAQY,iBAAiB,CAAC;QACzCC,SAASb,QAAQa,WAAW,CAAC;QAC7BC,uBAAuBd,QAAQc,yBAAyBX,WAAE,CAACY,QAAQ;QACnEC,aAAahB,QAAQgB,eAAed;QACpCe,mBAAmBjB,QAAQiB,qBAAqB;QAChDC,2BAA2BlB,QAAQkB,6BAA6B;QAChEC,WAAWnB,QAAQmB,aAAa,CAAC;IACnC;AACF"}
1
+ {"version":3,"sources":["../src/getConfig.ts"],"sourcesContent":["import os from \"os\";\nimport { readConfigFile } from \"./readConfigFile.js\";\nimport type { ConfigOptions } from \"./types/ConfigOptions.js\";\nimport type { CacheOptions } from \"./types/CacheOptions.js\";\n\n/**\n * Get the lage config with defaults.\n */\nexport async function getConfig(cwd: string): Promise<ConfigOptions> {\n const config = (await readConfigFile(cwd)) || ({} as Partial<ConfigOptions>);\n const availableParallelism = \"availableParallelism\" in os ? (os as any)[\"availableParallelism\"]() : os.cpus().length - 1;\n return {\n cacheOptions: config?.cacheOptions ?? ({} as CacheOptions),\n ignore: config?.ignore ?? [],\n npmClient: config?.npmClient ?? \"npm\",\n pipeline: config?.pipeline ?? {},\n priorities: config?.priorities ?? [],\n repoWideChanges: config?.repoWideChanges ?? [\n \"lage.config.js\",\n \"lage.config.mjs\",\n \"lage.config.cjs\",\n \"package-lock.json\",\n \"yarn.lock\",\n \"pnpm-lock.yaml\",\n \"lerna.json\",\n \"rush.json\",\n ],\n loggerOptions: config?.loggerOptions ?? {},\n runners: config?.runners ?? {},\n workerIdleMemoryLimit: config?.workerIdleMemoryLimit ?? os.totalmem(), // 0 means no limit,\n concurrency: config?.concurrency ?? availableParallelism,\n allowNoTargetRuns: config?.allowNoTargetRuns ?? false,\n enableTargetConfigMerging: config?.enableTargetConfigMerging ?? false,\n enablePhantomTargetOptimization: config?.enablePhantomTargetOptimization ?? false,\n reporters: config?.reporters ?? {},\n };\n}\n"],"names":["getConfig","cwd","config","readConfigFile","availableParallelism","os","cpus","length","cacheOptions","ignore","npmClient","pipeline","priorities","repoWideChanges","loggerOptions","runners","workerIdleMemoryLimit","totalmem","concurrency","allowNoTargetRuns","enableTargetConfigMerging","enablePhantomTargetOptimization","reporters"],"mappings":";;;;+BAQsBA;;;eAAAA;;;2DARP;gCACgB;;;;;;AAOxB,eAAeA,UAAUC,GAAW;IACzC,MAAMC,SAAS,AAAC,MAAMC,IAAAA,8BAAc,EAACF,QAAU,CAAC;IAChD,MAAMG,uBAAuB,0BAA0BC,WAAE,GAAG,AAACA,WAAE,AAAQ,CAAC,uBAAuB,KAAKA,WAAE,CAACC,IAAI,GAAGC,MAAM,GAAG;IACvH,OAAO;QACLC,cAAcN,QAAQM,gBAAiB,CAAC;QACxCC,QAAQP,QAAQO,UAAU,EAAE;QAC5BC,WAAWR,QAAQQ,aAAa;QAChCC,UAAUT,QAAQS,YAAY,CAAC;QAC/BC,YAAYV,QAAQU,cAAc,EAAE;QACpCC,iBAAiBX,QAAQW,mBAAmB;YAC1C;YACA;YACA;YACA;YACA;YACA;YACA;YACA;SACD;QACDC,eAAeZ,QAAQY,iBAAiB,CAAC;QACzCC,SAASb,QAAQa,WAAW,CAAC;QAC7BC,uBAAuBd,QAAQc,yBAAyBX,WAAE,CAACY,QAAQ;QACnEC,aAAahB,QAAQgB,eAAed;QACpCe,mBAAmBjB,QAAQiB,qBAAqB;QAChDC,2BAA2BlB,QAAQkB,6BAA6B;QAChEC,iCAAiCnB,QAAQmB,mCAAmC;QAC5EC,WAAWpB,QAAQoB,aAAa,CAAC;IACnC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/getMaxWorkersPerTask.ts"],"sourcesContent":["import type { ConfigOptions } from \"./types/ConfigOptions.js\";\n\nexport function getMaxWorkersPerTask(pipelineConfig: ConfigOptions[\"pipeline\"], concurrency: number): Map<string, number> {\n const maxWorkersPerTask = new Map<string, number>();\n\n let generalPoolCount = 0;\n let generatelPoolMaxWorkers = 0;\n\n let dedicatedPoolCount = 0;\n let dedicatedPoolMaxWorkers = 0;\n\n for (const [task, taskConfig] of Object.entries(pipelineConfig)) {\n if (!Array.isArray(taskConfig) && !task.includes(\"#\")) {\n const maxWorkerOption: number | undefined =\n taskConfig.maxWorkers ??\n // deprecated usage--a \"worker\" target's options should only include WorkerTargetOptions props.\n taskConfig.options?.maxWorkers;\n\n if (typeof maxWorkerOption === \"undefined\") {\n generalPoolCount++;\n continue;\n }\n\n let maxWorkers = 0;\n\n if (typeof maxWorkerOption !== \"number\") {\n throw new Error(`Invalid maxWorkers value: ${maxWorkerOption}`);\n } else {\n maxWorkers = maxWorkerOption;\n }\n\n maxWorkersPerTask.set(task, maxWorkers);\n dedicatedPoolCount++;\n dedicatedPoolMaxWorkers += maxWorkers;\n }\n }\n\n if (dedicatedPoolCount > 0 && generalPoolCount > 0) {\n const avgMaxWorkers = dedicatedPoolMaxWorkers / dedicatedPoolCount;\n generatelPoolMaxWorkers = Math.max(1, Math.floor(avgMaxWorkers * generalPoolCount));\n }\n\n const grandTotal = dedicatedPoolMaxWorkers + generatelPoolMaxWorkers;\n\n // try to adjust the maxWorkersPerTask to fit the concurrency\n if (grandTotal > concurrency) {\n let newTotal = 0;\n for (const [task, maxWorkers] of maxWorkersPerTask.entries()) {\n const newMaxWorkers = Math.max(1, Math.floor((maxWorkers / grandTotal) * concurrency));\n newTotal += newMaxWorkers;\n maxWorkersPerTask.set(task, newMaxWorkers);\n }\n\n if (newTotal > concurrency) {\n throw new Error(\n \"Could not adjust maxWorkers per task to fit the concurrency, try reducing the maxWorkers, or increasing the --concurrency CLI argument, or separate the tasks to be run\"\n );\n }\n }\n\n return maxWorkersPerTask;\n}\n\nexport function getMaxWorkersPerTaskFromOptions(maxWorkersPerTask: string[]): Map<string, number> {\n return new Map([\n ...maxWorkersPerTask.map((setting) => {\n const [task, maxWorkers] = setting.split(/[=:]/);\n return [task, parseInt(maxWorkers, 10)] as [string, number];\n }),\n ]);\n}\n"],"names":["getMaxWorkersPerTask","getMaxWorkersPerTaskFromOptions","pipelineConfig","concurrency","maxWorkersPerTask","Map","generalPoolCount","generatelPoolMaxWorkers","dedicatedPoolCount","dedicatedPoolMaxWorkers","task","taskConfig","Object","entries","Array","isArray","includes","maxWorkerOption","maxWorkers","options","Error","set","avgMaxWorkers","Math","max","floor","grandTotal","newTotal","newMaxWorkers","map","setting","split","parseInt"],"mappings":";;;;;;;;;;;QAEgBA;eAAAA;;QA6DAC;eAAAA;;;AA7DT,SAASD,qBAAqBE,cAAyC,EAAEC,WAAmB;IACjG,MAAMC,oBAAoB,IAAIC;IAE9B,IAAIC,mBAAmB;IACvB,IAAIC,0BAA0B;IAE9B,IAAIC,qBAAqB;IACzB,IAAIC,0BAA0B;IAE9B,KAAK,MAAM,CAACC,MAAMC,WAAW,IAAIC,OAAOC,OAAO,CAACX,gBAAiB;QAC/D,IAAI,CAACY,MAAMC,OAAO,CAACJ,eAAe,CAACD,KAAKM,QAAQ,CAAC,MAAM;YACrD,MAAMC,kBACJN,WAAWO,UAAU,IACrB,+FAA+F;YAC/FP,WAAWQ,OAAO,EAAED;YAEtB,IAAI,OAAOD,oBAAoB,aAAa;gBAC1CX;gBACA;YACF;YAEA,IAAIY,aAAa;YAEjB,IAAI,OAAOD,oBAAoB,UAAU;gBACvC,MAAM,IAAIG,MAAM,CAAC,0BAA0B,EAAEH,iBAAiB;YAChE,OAAO;gBACLC,aAAaD;YACf;YAEAb,kBAAkBiB,GAAG,CAACX,MAAMQ;YAC5BV;YACAC,2BAA2BS;QAC7B;IACF;IAEA,IAAIV,qBAAqB,KAAKF,mBAAmB,GAAG;QAClD,MAAMgB,gBAAgBb,0BAA0BD;QAChDD,0BAA0BgB,KAAKC,GAAG,CAAC,GAAGD,KAAKE,KAAK,CAACH,gBAAgBhB;IACnE;IAEA,MAAMoB,aAAajB,0BAA0BF;IAE7C,6DAA6D;IAC7D,IAAImB,aAAavB,aAAa;QAC5B,IAAIwB,WAAW;QACf,KAAK,MAAM,CAACjB,MAAMQ,WAAW,IAAId,kBAAkBS,OAAO,GAAI;YAC5D,MAAMe,gBAAgBL,KAAKC,GAAG,CAAC,GAAGD,KAAKE,KAAK,CAAC,AAACP,aAAaQ,aAAcvB;YACzEwB,YAAYC;YACZxB,kBAAkBiB,GAAG,CAACX,MAAMkB;QAC9B;QAEA,IAAID,WAAWxB,aAAa;YAC1B,MAAM,IAAIiB,MACR;QAEJ;IACF;IAEA,OAAOhB;AACT;AAEO,SAASH,gCAAgCG,iBAA2B;IACzE,OAAO,IAAIC,IAAI;WACVD,kBAAkByB,GAAG,CAAC,CAACC;YACxB,MAAM,CAACpB,MAAMQ,WAAW,GAAGY,QAAQC,KAAK,CAAC;YACzC,OAAO;gBAACrB;gBAAMsB,SAASd,YAAY;aAAI;QACzC;KACD;AACH"}
1
+ {"version":3,"sources":["../src/getMaxWorkersPerTask.ts"],"sourcesContent":["import type { ConfigOptions } from \"./types/ConfigOptions.js\";\n\nexport function getMaxWorkersPerTask(pipelineConfig: ConfigOptions[\"pipeline\"], concurrency: number): Map<string, number> {\n const maxWorkersPerTask = new Map<string, number>();\n\n let generalPoolCount = 0;\n let generatelPoolMaxWorkers = 0;\n\n let dedicatedPoolCount = 0;\n let dedicatedPoolMaxWorkers = 0;\n\n for (const [task, taskConfig] of Object.entries(pipelineConfig)) {\n if (!Array.isArray(taskConfig) && !task.includes(\"#\")) {\n const maxWorkerOption: number | undefined =\n taskConfig.maxWorkers ??\n // deprecated usage--a \"worker\" target's options should only include WorkerTargetOptions props.\n (taskConfig.options?.maxWorkers as number | undefined);\n\n if (typeof maxWorkerOption === \"undefined\") {\n generalPoolCount++;\n continue;\n }\n\n let maxWorkers = 0;\n\n if (typeof maxWorkerOption !== \"number\") {\n throw new Error(`Invalid maxWorkers value: ${maxWorkerOption}`);\n } else {\n maxWorkers = maxWorkerOption;\n }\n\n maxWorkersPerTask.set(task, maxWorkers);\n dedicatedPoolCount++;\n dedicatedPoolMaxWorkers += maxWorkers;\n }\n }\n\n if (dedicatedPoolCount > 0 && generalPoolCount > 0) {\n const avgMaxWorkers = dedicatedPoolMaxWorkers / dedicatedPoolCount;\n generatelPoolMaxWorkers = Math.max(1, Math.floor(avgMaxWorkers * generalPoolCount));\n }\n\n const grandTotal = dedicatedPoolMaxWorkers + generatelPoolMaxWorkers;\n\n // try to adjust the maxWorkersPerTask to fit the concurrency\n if (grandTotal > concurrency) {\n let newTotal = 0;\n for (const [task, maxWorkers] of maxWorkersPerTask.entries()) {\n const newMaxWorkers = Math.max(1, Math.floor((maxWorkers / grandTotal) * concurrency));\n newTotal += newMaxWorkers;\n maxWorkersPerTask.set(task, newMaxWorkers);\n }\n\n if (newTotal > concurrency) {\n throw new Error(\n \"Could not adjust maxWorkers per task to fit the concurrency, try reducing the maxWorkers, or increasing the --concurrency CLI argument, or separate the tasks to be run\"\n );\n }\n }\n\n return maxWorkersPerTask;\n}\n\nexport function getMaxWorkersPerTaskFromOptions(maxWorkersPerTask: string[]): Map<string, number> {\n return new Map([\n ...maxWorkersPerTask.map((setting) => {\n const [task, maxWorkers] = setting.split(/[=:]/);\n return [task, parseInt(maxWorkers, 10)] as [string, number];\n }),\n ]);\n}\n"],"names":["getMaxWorkersPerTask","getMaxWorkersPerTaskFromOptions","pipelineConfig","concurrency","maxWorkersPerTask","Map","generalPoolCount","generatelPoolMaxWorkers","dedicatedPoolCount","dedicatedPoolMaxWorkers","task","taskConfig","Object","entries","Array","isArray","includes","maxWorkerOption","maxWorkers","options","Error","set","avgMaxWorkers","Math","max","floor","grandTotal","newTotal","newMaxWorkers","map","setting","split","parseInt"],"mappings":";;;;;;;;;;;QAEgBA;eAAAA;;QA6DAC;eAAAA;;;AA7DT,SAASD,qBAAqBE,cAAyC,EAAEC,WAAmB;IACjG,MAAMC,oBAAoB,IAAIC;IAE9B,IAAIC,mBAAmB;IACvB,IAAIC,0BAA0B;IAE9B,IAAIC,qBAAqB;IACzB,IAAIC,0BAA0B;IAE9B,KAAK,MAAM,CAACC,MAAMC,WAAW,IAAIC,OAAOC,OAAO,CAACX,gBAAiB;QAC/D,IAAI,CAACY,MAAMC,OAAO,CAACJ,eAAe,CAACD,KAAKM,QAAQ,CAAC,MAAM;YACrD,MAAMC,kBACJN,WAAWO,UAAU,IACrB,+FAA+F;YAC9FP,WAAWQ,OAAO,EAAED;YAEvB,IAAI,OAAOD,oBAAoB,aAAa;gBAC1CX;gBACA;YACF;YAEA,IAAIY,aAAa;YAEjB,IAAI,OAAOD,oBAAoB,UAAU;gBACvC,MAAM,IAAIG,MAAM,CAAC,0BAA0B,EAAEH,iBAAiB;YAChE,OAAO;gBACLC,aAAaD;YACf;YAEAb,kBAAkBiB,GAAG,CAACX,MAAMQ;YAC5BV;YACAC,2BAA2BS;QAC7B;IACF;IAEA,IAAIV,qBAAqB,KAAKF,mBAAmB,GAAG;QAClD,MAAMgB,gBAAgBb,0BAA0BD;QAChDD,0BAA0BgB,KAAKC,GAAG,CAAC,GAAGD,KAAKE,KAAK,CAACH,gBAAgBhB;IACnE;IAEA,MAAMoB,aAAajB,0BAA0BF;IAE7C,6DAA6D;IAC7D,IAAImB,aAAavB,aAAa;QAC5B,IAAIwB,WAAW;QACf,KAAK,MAAM,CAACjB,MAAMQ,WAAW,IAAId,kBAAkBS,OAAO,GAAI;YAC5D,MAAMe,gBAAgBL,KAAKC,GAAG,CAAC,GAAGD,KAAKE,KAAK,CAAC,AAACP,aAAaQ,aAAcvB;YACzEwB,YAAYC;YACZxB,kBAAkBiB,GAAG,CAACX,MAAMkB;QAC9B;QAEA,IAAID,WAAWxB,aAAa;YAC1B,MAAM,IAAIiB,MACR;QAEJ;IACF;IAEA,OAAOhB;AACT;AAEO,SAASH,gCAAgCG,iBAA2B;IACzE,OAAO,IAAIC,IAAI;WACVD,kBAAkByB,GAAG,CAAC,CAACC;YACxB,MAAM,CAACpB,MAAMQ,WAAW,GAAGY,QAAQC,KAAK,CAAC;YACzC,OAAO;gBAACrB;gBAAMsB,SAASd,YAAY;aAAI;QACzC;KACD;AACH"}
package/lib/index.d.ts CHANGED
@@ -7,4 +7,4 @@ export type { ConfigOptions, ConfigFileOptions } from "./types/ConfigOptions.js"
7
7
  export type { CacheOptions } from "./types/CacheOptions.js";
8
8
  export type { AzureCredentialName } from "./types/CacheOptions.js";
9
9
  export type { LoggerOptions } from "./types/LoggerOptions.js";
10
- export type { Priority } from "./types/Priority.js";
10
+ export { isRunningFromCI } from "./isRunningFromCI.js";
package/lib/index.js CHANGED
@@ -21,6 +21,9 @@ _export(exports, {
21
21
  get getMaxWorkersPerTaskFromOptions () {
22
22
  return _getMaxWorkersPerTask.getMaxWorkersPerTaskFromOptions;
23
23
  },
24
+ get isRunningFromCI () {
25
+ return _isRunningFromCI.isRunningFromCI;
26
+ },
24
27
  get readConfigFile () {
25
28
  return _readConfigFile.readConfigFile;
26
29
  }
@@ -29,3 +32,4 @@ const _getConfig = require("./getConfig.js");
29
32
  const _getConcurrency = require("./getConcurrency.js");
30
33
  const _getMaxWorkersPerTask = require("./getMaxWorkersPerTask.js");
31
34
  const _readConfigFile = require("./readConfigFile.js");
35
+ const _isRunningFromCI = require("./isRunningFromCI.js");
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { getConfig } from \"./getConfig.js\";\nexport { getConcurrency } from \"./getConcurrency.js\";\nexport { getMaxWorkersPerTask, getMaxWorkersPerTaskFromOptions } from \"./getMaxWorkersPerTask.js\";\nexport { readConfigFile } from \"./readConfigFile.js\";\nexport type { PipelineDefinition } from \"./types/PipelineDefinition.js\";\nexport type { ConfigOptions, ConfigFileOptions } from \"./types/ConfigOptions.js\";\nexport type { CacheOptions } from \"./types/CacheOptions.js\";\nexport type { AzureCredentialName } from \"./types/CacheOptions.js\";\nexport type { LoggerOptions } from \"./types/LoggerOptions.js\";\nexport type { Priority } from \"./types/Priority.js\";\n"],"names":["getConcurrency","getConfig","getMaxWorkersPerTask","getMaxWorkersPerTaskFromOptions","readConfigFile"],"mappings":";;;;;;;;;;;QACSA;eAAAA,8BAAc;;QADdC;eAAAA,oBAAS;;QAETC;eAAAA,0CAAoB;;QAAEC;eAAAA,qDAA+B;;QACrDC;eAAAA,8BAAc;;;2BAHG;gCACK;sCACuC;gCACvC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { getConfig } from \"./getConfig.js\";\nexport { getConcurrency } from \"./getConcurrency.js\";\nexport { getMaxWorkersPerTask, getMaxWorkersPerTaskFromOptions } from \"./getMaxWorkersPerTask.js\";\nexport { readConfigFile } from \"./readConfigFile.js\";\nexport type { PipelineDefinition } from \"./types/PipelineDefinition.js\";\nexport type { ConfigOptions, ConfigFileOptions } from \"./types/ConfigOptions.js\";\nexport type { CacheOptions } from \"./types/CacheOptions.js\";\nexport type { AzureCredentialName } from \"./types/CacheOptions.js\";\nexport type { LoggerOptions } from \"./types/LoggerOptions.js\";\nexport { isRunningFromCI } from \"./isRunningFromCI.js\";\n"],"names":["getConcurrency","getConfig","getMaxWorkersPerTask","getMaxWorkersPerTaskFromOptions","isRunningFromCI","readConfigFile"],"mappings":";;;;;;;;;;;QACSA;eAAAA,8BAAc;;QADdC;eAAAA,oBAAS;;QAETC;eAAAA,0CAAoB;;QAAEC;eAAAA,qDAA+B;;QAOrDC;eAAAA,gCAAe;;QANfC;eAAAA,8BAAc;;;2BAHG;gCACK;sCACuC;gCACvC;iCAMC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Detect if we're running in a CI environment:
3
+ * - `process.env.TF_BUILD` for ADO
4
+ * - `process.env.CI` for most others
5
+ * - not running in a test (`process.env.NODE_ENV` is `test` or `process.env.JEST_WORKER_ID` is set)
6
+ */
7
+ export declare const isRunningFromCI: boolean;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Detect if we're running in a CI environment:
3
+ * - `process.env.TF_BUILD` for ADO
4
+ * - `process.env.CI` for most others
5
+ * - not running in a test (`process.env.NODE_ENV` is `test` or `process.env.JEST_WORKER_ID` is set)
6
+ */ "use strict";
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ Object.defineProperty(exports, "isRunningFromCI", {
11
+ enumerable: true,
12
+ get: function() {
13
+ return isRunningFromCI;
14
+ }
15
+ });
16
+ const isRunningFromCI = process.env.NODE_ENV !== "test" && !process.env.JEST_WORKER_ID && (!!process.env.CI || !!process.env.TF_BUILD);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/isRunningFromCI.ts"],"sourcesContent":["/**\n * Detect if we're running in a CI environment:\n * - `process.env.TF_BUILD` for ADO\n * - `process.env.CI` for most others\n * - not running in a test (`process.env.NODE_ENV` is `test` or `process.env.JEST_WORKER_ID` is set)\n */\nexport const isRunningFromCI: boolean =\n process.env.NODE_ENV !== \"test\" && !process.env.JEST_WORKER_ID && (!!process.env.CI || !!process.env.TF_BUILD);\n"],"names":["isRunningFromCI","process","env","NODE_ENV","JEST_WORKER_ID","CI","TF_BUILD"],"mappings":"AAAA;;;;;CAKC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,kBACXC,QAAQC,GAAG,CAACC,QAAQ,KAAK,UAAU,CAACF,QAAQC,GAAG,CAACE,cAAc,IAAK,CAAA,CAAC,CAACH,QAAQC,GAAG,CAACG,EAAE,IAAI,CAAC,CAACJ,QAAQC,GAAG,CAACI,QAAQ,AAAD"}
@@ -31,7 +31,7 @@ type ExtendedCacheStorageConfig = Exclude<BackfillCacheOptions["cacheStorageConf
31
31
  export type CacheOptions = Omit<BackfillCacheOptions, "cacheStorageConfig"> & {
32
32
  /**
33
33
  * Use this to specify a remote cache provider such as `'azure-blob'`.
34
- * @see https://github.com/microsoft/backfill#configuration
34
+ * @see https://www.npmjs.com/package/backfill#configuration
35
35
  */
36
36
  cacheStorageConfig?: ExtendedCacheStorageConfig;
37
37
  /**
@@ -1,5 +1,5 @@
1
1
  import type { CacheOptions } from "./CacheOptions.js";
2
- import type { Priority } from "./Priority.js";
2
+ import type { Priority } from "@lage-run/target-graph";
3
3
  import type { PipelineDefinition } from "./PipelineDefinition.js";
4
4
  import type { LoggerOptions } from "./LoggerOptions.js";
5
5
  import type { TargetRunnerPickerOptions } from "@lage-run/runners";
@@ -17,7 +17,8 @@ export interface ConfigOptions {
17
17
  * - No prefix for dependencies on tasks for the same package.
18
18
  * - Prefix with `^` to denote a direct package-topological dependency. (e.g. `^build` means run the `build` task
19
19
  * in topological order by package.)
20
- * - Prefix with `^^` to denote a transitive package-topological dependency. (e.g. `^^transpile` means run the `transpile` task for nested dependencies, but *not* for the current package.)
20
+ * - Prefix with `^^` to denote a transitive package-topological dependency. (e.g. `^^transpile` means run the
21
+ * `transpile` task for nested dependencies, but *not* for the current package.)
21
22
  * - Use `packageName#taskName` to denote a dependency on a specific package's task: in the example below,
22
23
  * package `foo`'s `build` task depends on package `bar`'s `bundle` task.
23
24
  *
@@ -50,8 +51,9 @@ export interface ConfigOptions {
50
51
  */
51
52
  loggerOptions: LoggerOptions;
52
53
  /**
53
- * Custom runners for tasks in the pipeline. The key is the task name, and the value is a configuration describing what would be
54
- * passed to the runner constructor.
54
+ * Custom runners for tasks in the pipeline.
55
+ *
56
+ * Keys are runner names, to be used as `TargetConfig.type` in the lage config.
55
57
  */
56
58
  runners: TargetRunnerPickerOptions;
57
59
  /**
@@ -70,6 +72,12 @@ export interface ConfigOptions {
70
72
  * Enables the merging of target config files, rather than simply replace it when multiple matches are encoutered
71
73
  */
72
74
  enableTargetConfigMerging: boolean;
75
+ /**
76
+ * Enables phantom target optimization. When enabled, targets created for packages that don't actually define
77
+ * the corresponding npm script are excluded from transitive (`^^`) dependency expansion.
78
+ * This prevents unwanted cross-package dependency chains when phantom targets are later removed.
79
+ */
80
+ enablePhantomTargetOptimization: boolean;
73
81
  /**
74
82
  * Custom reporters that can be referenced by name in the --reporter CLI flag.
75
83
  * The key is the reporter name, and the value is the path to the reporter module.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/config",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "Config management for Lage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,10 +19,10 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@lage-run/logger": "^1.3.3",
22
- "@lage-run/runners": "^1.3.0",
23
- "@lage-run/target-graph": "^0.12.3",
24
- "backfill-config": "^6.7.1",
25
- "cosmiconfig": "^9.0.0",
22
+ "@lage-run/runners": "^1.4.0",
23
+ "@lage-run/target-graph": "^0.14.0",
24
+ "backfill-config": "^6.7.2",
25
+ "cosmiconfig": "^9.0.1",
26
26
  "workspace-tools": "^0.41.0"
27
27
  },
28
28
  "devDependencies": {
@@ -1,8 +0,0 @@
1
- export interface Priority {
2
- /** package name, as in package.json */
3
- package?: string;
4
- /** task name, as listed in the `scripts` section of package.json */
5
- task: string;
6
- /** priority, the higher the more priority; undefined priority means lowest priority*/
7
- priority: number;
8
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}