@lage-run/cli 0.11.3 → 0.11.4

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/CHANGELOG.json CHANGED
@@ -2,7 +2,46 @@
2
2
  "name": "@lage-run/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 29 Mar 2023 20:02:22 GMT",
5
+ "date": "Wed, 29 Mar 2023 22:41:31 GMT",
6
+ "tag": "@lage-run/cli_v0.11.4",
7
+ "version": "0.11.4",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/cli",
13
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c",
14
+ "comment": "moving config to its own package"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@lage-run/cli",
19
+ "comment": "Bump @lage-run/config to v0.1.1",
20
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@lage-run/cli",
25
+ "comment": "Bump @lage-run/scheduler to v0.10.5",
26
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@lage-run/cli",
31
+ "comment": "Bump @lage-run/scheduler-types to v0.3.5",
32
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@lage-run/cli",
37
+ "comment": "Bump @lage-run/reporters to v1.0.7",
38
+ "commit": "ec458f83e5adb784019efaa06f902ec75f85990c"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Wed, 29 Mar 2023 20:02:40 GMT",
6
45
  "tag": "@lage-run/cli_v0.11.3",
7
46
  "version": "0.11.3",
8
47
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,24 @@
1
1
  # Change Log - @lage-run/cli
2
2
 
3
- This log was last generated on Wed, 29 Mar 2023 20:02:22 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 29 Mar 2023 22:41:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.11.4
8
+
9
+ Wed, 29 Mar 2023 22:41:31 GMT
10
+
11
+ ### Patches
12
+
13
+ - moving config to its own package (kchau@microsoft.com)
14
+ - Bump @lage-run/config to v0.1.1
15
+ - Bump @lage-run/scheduler to v0.10.5
16
+ - Bump @lage-run/scheduler-types to v0.3.5
17
+ - Bump @lage-run/reporters to v1.0.7
18
+
7
19
  ## 0.11.3
8
20
 
9
- Wed, 29 Mar 2023 20:02:22 GMT
21
+ Wed, 29 Mar 2023 20:02:40 GMT
10
22
 
11
23
  ### Patches
12
24
 
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "affectedAction", {
8
8
  });
9
9
  const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
10
10
  const _workspaceTools = require("workspace-tools");
11
- const _getConfigJs = require("../../config/getConfig.js");
11
+ const _config = require("@lage-run/config");
12
12
  const _getFilteredPackagesJs = require("../../filter/getFilteredPackages.js");
13
13
  function _interopRequireDefault(obj) {
14
14
  return obj && obj.__esModule ? obj : {
@@ -18,7 +18,7 @@ function _interopRequireDefault(obj) {
18
18
  async function affectedAction(options) {
19
19
  const { dependencies , dependents , since , scope , ignore , outputFormat } = options;
20
20
  const cwd = process.cwd();
21
- const config = await (0, _getConfigJs.getConfig)(cwd);
21
+ const config = await (0, _config.getConfig)(cwd);
22
22
  const logger = (0, _logger.default)();
23
23
  const root = (0, _workspaceTools.getWorkspaceRoot)(cwd);
24
24
  const packageInfos = (0, _workspaceTools.getPackageInfos)(root);
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "cacheAction", {
7
7
  get: ()=>cacheAction
8
8
  });
9
9
  const _clearCacheJs = require("./clearCache.js");
10
- const _getConfigJs = require("../../config/getConfig.js");
10
+ const _config = require("@lage-run/config");
11
11
  const _pruneCacheJs = require("./pruneCache.js");
12
12
  const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
13
13
  function _interopRequireDefault(obj) {
@@ -17,7 +17,7 @@ function _interopRequireDefault(obj) {
17
17
  }
18
18
  async function cacheAction(options, command) {
19
19
  const cwd = process.cwd();
20
- const config = await (0, _getConfigJs.getConfig)(cwd);
20
+ const config = await (0, _config.getConfig)(cwd);
21
21
  const logger = (0, _logger.default)();
22
22
  if (options.clear) {
23
23
  return await (0, _clearCacheJs.clearCache)({
@@ -6,15 +6,14 @@ Object.defineProperty(exports, "clearCache", {
6
6
  enumerable: true,
7
7
  get: ()=>clearCache
8
8
  });
9
- const _getConfigJs = require("../../config/getConfig.js");
9
+ const _config = require("@lage-run/config");
10
10
  const _workspaceTools = require("workspace-tools");
11
- const _getConcurrencyJs = require("../../config/getConcurrency.js");
12
11
  const _cache = require("@lage-run/cache");
13
12
  async function clearCache(options) {
14
13
  const { logger , cwd } = options;
15
- const config = await (0, _getConfigJs.getConfig)(cwd);
14
+ const config = await (0, _config.getConfig)(cwd);
16
15
  const workspaceRoot = (0, _workspaceTools.getWorkspaceRoot)(cwd);
17
- const concurrency = (0, _getConcurrencyJs.getConcurrency)(options.concurrency, config.concurrency);
16
+ const concurrency = (0, _config.getConcurrency)(options.concurrency, config.concurrency);
18
17
  if (!workspaceRoot) {
19
18
  return;
20
19
  }
@@ -7,14 +7,13 @@ Object.defineProperty(exports, "pruneCache", {
7
7
  get: ()=>pruneCache
8
8
  });
9
9
  const _workspaceTools = require("workspace-tools");
10
- const _getConfigJs = require("../../config/getConfig.js");
11
- const _getConcurrencyJs = require("../../config/getConcurrency.js");
10
+ const _config = require("@lage-run/config");
12
11
  const _cache = require("@lage-run/cache");
13
12
  async function pruneCache(options) {
14
13
  const { logger , cwd , pruneDays } = options;
15
- const config = await (0, _getConfigJs.getConfig)(cwd);
14
+ const config = await (0, _config.getConfig)(cwd);
16
15
  const workspaceRoot = (0, _workspaceTools.getWorkspaceRoot)(cwd);
17
- const concurrency = (0, _getConcurrencyJs.getConcurrency)(options.concurrency, config.concurrency);
16
+ const concurrency = (0, _config.getConcurrency)(options.concurrency, config.concurrency);
18
17
  if (!workspaceRoot) {
19
18
  return;
20
19
  }
@@ -1,6 +1,6 @@
1
1
  import type { Logger } from "@lage-run/logger";
2
2
  import type { PackageInfos } from "workspace-tools";
3
- import type { PipelineDefinition } from "../../types/PipelineDefinition.js";
3
+ import type { PipelineDefinition } from "@lage-run/config";
4
4
  interface CreateTargetGraphOptions {
5
5
  logger: Logger;
6
6
  root: string;
@@ -1,3 +1,3 @@
1
1
  import type { Target } from "@lage-run/target-graph";
2
- import type { PipelineDefinition } from "../../types/PipelineDefinition.js";
2
+ import type { PipelineDefinition } from "@lage-run/config";
3
3
  export declare function filterPipelineDefinitions(targets: IterableIterator<Target>, pipeline: PipelineDefinition): PipelineDefinition;
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "infoAction", {
9
9
  const _createCacheProviderJs = require("./createCacheProvider.js");
10
10
  const _createTargetGraphJs = require("./createTargetGraph.js");
11
11
  const _filterArgsForTasksJs = require("./filterArgsForTasks.js");
12
- const _getConfigJs = require("../../config/getConfig.js");
12
+ const _config = require("@lage-run/config");
13
13
  const _workspaceTools = require("workspace-tools");
14
14
  const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
15
15
  const _targetGraph = require("@lage-run/target-graph");
@@ -20,7 +20,7 @@ function _interopRequireDefault(obj) {
20
20
  }
21
21
  async function infoAction(options, command) {
22
22
  const cwd = process.cwd();
23
- const config = await (0, _getConfigJs.getConfig)(cwd);
23
+ const config = await (0, _config.getConfig)(cwd);
24
24
  const logger = (0, _logger.default)();
25
25
  // Build Target Graph
26
26
  const root = (0, _workspaceTools.getWorkspaceRoot)(process.cwd());
@@ -11,13 +11,11 @@ const _createTargetGraphJs = require("./createTargetGraph.js");
11
11
  const _filterArgsForTasksJs = require("./filterArgsForTasks.js");
12
12
  const _filterPipelineDefinitionsJs = require("./filterPipelineDefinitions.js");
13
13
  const _findNpmClient = require("@lage-run/find-npm-client");
14
- const _getConfigJs = require("../../config/getConfig.js");
15
- const _getMaxWorkersPerTaskJs = require("../../config/getMaxWorkersPerTask.js");
14
+ const _config = require("@lage-run/config");
16
15
  const _workspaceTools = require("workspace-tools");
17
16
  const _initializeReportersJs = require("../initializeReporters.js");
18
17
  const _scheduler = require("@lage-run/scheduler");
19
18
  const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
20
- const _getConcurrencyJs = require("../../config/getConcurrency.js");
21
19
  const _errorsJs = require("../../types/errors.js");
22
20
  function _interopRequireDefault(obj) {
23
21
  return obj && obj.__esModule ? obj : {
@@ -26,9 +24,9 @@ function _interopRequireDefault(obj) {
26
24
  }
27
25
  async function runAction(options, command) {
28
26
  const cwd = process.cwd();
29
- const config = await (0, _getConfigJs.getConfig)(cwd);
27
+ const config = await (0, _config.getConfig)(cwd);
30
28
  // Merged options
31
- const concurrency = (0, _getConcurrencyJs.getConcurrency)(options.concurrency, config.concurrency);
29
+ const concurrency = (0, _config.getConcurrency)(options.concurrency, config.concurrency);
32
30
  const allowNoTargetRuns = options.allowNoTargetRuns || config.allowNoTargetRuns;
33
31
  // Configure logger
34
32
  const logger = (0, _logger.default)();
@@ -64,7 +62,7 @@ async function runAction(options, command) {
64
62
  });
65
63
  logger.verbose(`Running with ${concurrency} workers`);
66
64
  const filteredPipeline = (0, _filterPipelineDefinitionsJs.filterPipelineDefinitions)(targetGraph.targets.values(), config.pipeline);
67
- const maxWorkersPerTaskMap = (0, _getMaxWorkersPerTaskJs.getMaxWorkersPerTaskFromOptions)(options.maxWorkersPerTask);
65
+ const maxWorkersPerTaskMap = (0, _config.getMaxWorkersPerTaskFromOptions)(options.maxWorkersPerTask);
68
66
  const scheduler = new _scheduler.SimpleScheduler({
69
67
  logger,
70
68
  concurrency,
@@ -74,7 +72,7 @@ async function runAction(options, command) {
74
72
  shouldCache: options.cache,
75
73
  shouldResetCache: options.resetCache,
76
74
  maxWorkersPerTask: new Map([
77
- ...(0, _getMaxWorkersPerTaskJs.getMaxWorkersPerTask)(filteredPipeline, concurrency),
75
+ ...(0, _config.getMaxWorkersPerTask)(filteredPipeline, concurrency),
78
76
  ...maxWorkersPerTaskMap
79
77
  ]),
80
78
  runners: {
@@ -10,15 +10,13 @@ const _createCacheProviderJs = require("./createCacheProvider.js");
10
10
  const _createTargetGraphJs = require("./createTargetGraph.js");
11
11
  const _filterArgsForTasksJs = require("./filterArgsForTasks.js");
12
12
  const _findNpmClient = require("@lage-run/find-npm-client");
13
- const _getConfigJs = require("../../config/getConfig.js");
14
- const _getMaxWorkersPerTaskJs = require("../../config/getMaxWorkersPerTask.js");
13
+ const _config = require("@lage-run/config");
15
14
  const _workspaceTools = require("workspace-tools");
16
15
  const _filterPipelineDefinitionsJs = require("./filterPipelineDefinitions.js");
17
16
  const _reporters = require("@lage-run/reporters");
18
17
  const _scheduler = require("@lage-run/scheduler");
19
18
  const _watcherJs = require("./watcher.js");
20
19
  const _logger = /*#__PURE__*/ _interopRequireWildcard(require("@lage-run/logger"));
21
- const _getConcurrencyJs = require("../../config/getConcurrency.js");
22
20
  function _getRequireWildcardCache(nodeInterop) {
23
21
  if (typeof WeakMap !== "function") return null;
24
22
  var cacheBabelInterop = new WeakMap();
@@ -60,8 +58,8 @@ function _interopRequireWildcard(obj, nodeInterop) {
60
58
  }
61
59
  async function watchAction(options, command) {
62
60
  const cwd = process.cwd();
63
- const config = await (0, _getConfigJs.getConfig)(cwd);
64
- const concurrency = (0, _getConcurrencyJs.getConcurrency)(options.concurrency, config.concurrency);
61
+ const config = await (0, _config.getConfig)(cwd);
62
+ const concurrency = (0, _config.getConcurrency)(options.concurrency, config.concurrency);
65
63
  // Configure logger
66
64
  const logger = (0, _logger.default)();
67
65
  const reporter = new _reporters.LogReporter({
@@ -96,7 +94,7 @@ async function watchAction(options, command) {
96
94
  cliArgs: taskArgs
97
95
  });
98
96
  const filteredPipeline = (0, _filterPipelineDefinitionsJs.filterPipelineDefinitions)(targetGraph.targets.values(), config.pipeline);
99
- const maxWorkersPerTaskMap = (0, _getMaxWorkersPerTaskJs.getMaxWorkersPerTaskFromOptions)(options.maxWorkersPerTask);
97
+ const maxWorkersPerTaskMap = (0, _config.getMaxWorkersPerTaskFromOptions)(options.maxWorkersPerTask);
100
98
  const scheduler = new _scheduler.SimpleScheduler({
101
99
  logger,
102
100
  concurrency,
@@ -106,7 +104,7 @@ async function watchAction(options, command) {
106
104
  shouldCache: options.cache,
107
105
  shouldResetCache: options.resetCache,
108
106
  maxWorkersPerTask: new Map([
109
- ...(0, _getMaxWorkersPerTaskJs.getMaxWorkersPerTask)(filteredPipeline, concurrency),
107
+ ...(0, _config.getMaxWorkersPerTask)(filteredPipeline, concurrency),
110
108
  ...maxWorkersPerTaskMap
111
109
  ]),
112
110
  runners: {
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export type { CacheOptions } from "./types/CacheOptions.js";
2
- export type { ConfigOptions } from "./types/ConfigOptions.js";
3
- export type { Priority } from "./types/Priority.js";
4
- export type { PipelineDefinition } from "./types/PipelineDefinition.js";
5
- export type { LoggerOptions } from "./types/LoggerOptions.js";
6
- export type { TargetRunnerPickerOptions } from "@lage-run/scheduler";
1
+ export type { CacheOptions } from "@lage-run/config";
2
+ export type { ConfigOptions } from "@lage-run/config";
3
+ export type { Priority } from "@lage-run/config";
4
+ export type { PipelineDefinition } from "@lage-run/config";
5
+ export type { LoggerOptions } from "@lage-run/config";
6
+ export type { TargetRunnerPickerOptions } from "@lage-run/scheduler-types";
7
7
  export type { TargetConfig } from "@lage-run/target-graph";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/cli",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "Command Line Interface for Lage",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"
@@ -18,23 +18,22 @@
18
18
  "lint": "monorepo-scripts lint"
19
19
  },
20
20
  "dependencies": {
21
+ "@lage-run/config": "^0.1.1",
21
22
  "@lage-run/find-npm-client": "^0.1.4",
22
23
  "@lage-run/logger": "^1.2.2",
23
- "@lage-run/scheduler": "^0.10.4",
24
- "@lage-run/scheduler-types": "^0.3.4",
24
+ "@lage-run/scheduler": "^0.10.5",
25
+ "@lage-run/scheduler-types": "^0.3.5",
25
26
  "@lage-run/target-graph": "^0.8.1",
26
27
  "@lage-run/cache": "^0.5.1",
27
- "@lage-run/reporters": "^1.0.6",
28
+ "@lage-run/reporters": "^1.0.7",
28
29
  "commander": "^9.4.0",
29
30
  "workspace-tools": "^0.30.0",
30
31
  "chokidar": "3.5.3",
31
- "fast-glob": "^3.2.11",
32
- "cosmiconfig": "^7.0.0"
32
+ "fast-glob": "^3.2.11"
33
33
  },
34
34
  "devDependencies": {
35
35
  "monorepo-scripts": "*",
36
- "@lage-run/monorepo-fixture": "*",
37
- "backfill-config": "6.3.1"
36
+ "@lage-run/monorepo-fixture": "*"
38
37
  },
39
38
  "publishConfig": {
40
39
  "access": "public"
@@ -1 +0,0 @@
1
- export declare function getConcurrency(optionsConcurrency: number | undefined, configConcurrency: number | undefined): number;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "getConcurrency", {
6
- enumerable: true,
7
- get: ()=>getConcurrency
8
- });
9
- const _os = /*#__PURE__*/ _interopRequireDefault(require("os"));
10
- function _interopRequireDefault(obj) {
11
- return obj && obj.__esModule ? obj : {
12
- default: obj
13
- };
14
- }
15
- function getConcurrency(optionsConcurrency, configConcurrency) {
16
- return optionsConcurrency || configConcurrency || _os.default.cpus().length - 1;
17
- }
@@ -1,2 +0,0 @@
1
- import type { ConfigOptions } from "../types/ConfigOptions.js";
2
- export declare function getConfig(cwd: string): Promise<ConfigOptions>;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "getConfig", {
6
- enumerable: true,
7
- get: ()=>getConfig
8
- });
9
- const _os = /*#__PURE__*/ _interopRequireDefault(require("os"));
10
- const _cosmiconfig = require("cosmiconfig");
11
- const _workspaceTools = require("workspace-tools");
12
- function _interopRequireDefault(obj) {
13
- return obj && obj.__esModule ? obj : {
14
- default: obj
15
- };
16
- }
17
- async function getConfig(cwd) {
18
- // Verify presence of git
19
- const root = (0, _workspaceTools.getWorkspaceRoot)(cwd);
20
- if (!root) {
21
- throw new Error("This must be called inside a codebase that is part of a JavaScript workspace.");
22
- }
23
- // Search for lage.config.js file
24
- const ConfigModuleName = "lage";
25
- const configExplorer = await (0, _cosmiconfig.cosmiconfig)(ConfigModuleName);
26
- const results = await configExplorer.search(root ?? cwd);
27
- const config = results?.config;
28
- return {
29
- cacheOptions: config?.cacheOptions ?? {},
30
- ignore: config?.ignore ?? [],
31
- npmClient: config?.npmClient ?? "npm",
32
- pipeline: config?.pipeline ?? {},
33
- priorities: config?.priorities ?? [],
34
- repoWideChanges: config?.repoWideChanges ?? [
35
- "lage.config.js",
36
- "package-lock.json",
37
- "yarn.lock",
38
- "pnpm-lock.yaml",
39
- "lerna.json",
40
- "rush.json"
41
- ],
42
- loggerOptions: config?.loggerOptions ?? {},
43
- runners: config?.runners ?? {},
44
- workerIdleMemoryLimit: config?.workerIdleMemoryLimit ?? _os.default.totalmem(),
45
- concurrency: config?.concurrency ?? _os.default.cpus().length - 1,
46
- allowNoTargetRuns: config?.allowNoTargetRuns ?? false
47
- };
48
- }
@@ -1,3 +0,0 @@
1
- import type { ConfigOptions } from "../types/ConfigOptions.js";
2
- export declare function getMaxWorkersPerTask(pipelineConfig: ConfigOptions["pipeline"], concurrency: number): Map<string, number>;
3
- export declare function getMaxWorkersPerTaskFromOptions(maxWorkersPerTask: string[]): Map<string, number>;
@@ -1,68 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- getMaxWorkersPerTask: ()=>getMaxWorkersPerTask,
13
- getMaxWorkersPerTaskFromOptions: ()=>getMaxWorkersPerTaskFromOptions
14
- });
15
- function getMaxWorkersPerTask(pipelineConfig, concurrency) {
16
- const maxWorkersPerTask = new Map();
17
- let generalPoolCount = 0;
18
- let generatelPoolMaxWorkers = 0;
19
- let dedicatedPoolCount = 0;
20
- let dedicatedPoolMaxWorkers = 0;
21
- for (const [task, taskConfig] of Object.entries(pipelineConfig)){
22
- if (!Array.isArray(taskConfig) && !task.includes("#")) {
23
- const maxWorkerOption = taskConfig.maxWorkers ?? taskConfig.options?.maxWorkers;
24
- if (typeof maxWorkerOption === "undefined") {
25
- generalPoolCount++;
26
- continue;
27
- }
28
- let maxWorkers = 0;
29
- if (typeof maxWorkerOption !== "number") {
30
- throw new Error(`Invalid maxWorkers value: ${maxWorkerOption}`);
31
- } else {
32
- maxWorkers = maxWorkerOption;
33
- }
34
- maxWorkersPerTask.set(task, maxWorkers);
35
- dedicatedPoolCount++;
36
- dedicatedPoolMaxWorkers += maxWorkers;
37
- }
38
- }
39
- if (dedicatedPoolCount > 0 && generalPoolCount > 0) {
40
- const avgMaxWorkers = dedicatedPoolMaxWorkers / dedicatedPoolCount;
41
- generatelPoolMaxWorkers = Math.max(1, Math.floor(avgMaxWorkers * generalPoolCount));
42
- }
43
- const grandTotal = dedicatedPoolMaxWorkers + generatelPoolMaxWorkers;
44
- // try to adjust the maxWorkersPerTask to fit the concurrency
45
- if (grandTotal > concurrency) {
46
- let newTotal = 0;
47
- for (const [task, maxWorkers] of maxWorkersPerTask.entries()){
48
- const newMaxWorkers = Math.max(1, Math.floor(maxWorkers / grandTotal * concurrency));
49
- newTotal += newMaxWorkers;
50
- maxWorkersPerTask.set(task, newMaxWorkers);
51
- }
52
- if (newTotal > concurrency) {
53
- throw new Error("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");
54
- }
55
- }
56
- return maxWorkersPerTask;
57
- }
58
- function getMaxWorkersPerTaskFromOptions(maxWorkersPerTask) {
59
- return new Map([
60
- ...maxWorkersPerTask.map((setting)=>{
61
- const [task, maxWorkers] = setting.split(/[=:]/);
62
- return [
63
- task,
64
- parseInt(maxWorkers, 10)
65
- ];
66
- })
67
- ]);
68
- }
@@ -1,7 +0,0 @@
1
- import type { Config as BackfillCacheOptions } from "backfill-config";
2
- export type CacheOptions = BackfillCacheOptions & {
3
- environmentGlob: string[];
4
- cacheKey: string;
5
- writeRemoteCache: boolean;
6
- skipLocalCache: boolean;
7
- };
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,56 +0,0 @@
1
- import type { CacheOptions } from "./CacheOptions.js";
2
- import type { Priority } from "./Priority.js";
3
- import type { PipelineDefinition } from "./PipelineDefinition.js";
4
- import type { LoggerOptions } from "./LoggerOptions.js";
5
- import type { TargetRunnerPickerOptions } from "@lage-run/scheduler";
6
- export type NpmClient = "npm" | "yarn" | "pnpm";
7
- export interface ConfigOptions {
8
- /**
9
- * Defines the task pipeline, prefix with "^" character to denote a direct topological dependency,
10
- * prefix with ^^ to denote a transitive topological dependency.
11
- *
12
- * Example:
13
- *
14
- * ```
15
- * {
16
- * build: ["^build"],
17
- * test: ["build"],
18
- * lint: []
19
- * bundle: ["^^transpile"],
20
- * transpile: [],
21
- * }
22
- * ```
23
- */
24
- pipeline: PipelineDefinition;
25
- /** Backfill cache options */
26
- cacheOptions: CacheOptions;
27
- /** Which files to ignore when calculating scopes with --since */
28
- ignore: string[];
29
- /** disables --since flag when any of this list of files changed */
30
- repoWideChanges: string[];
31
- /** Which NPM Client to use when running npm lifecycle scripts */
32
- npmClient: NpmClient;
33
- /** Optional priority to set on tasks in a package to make the scheduler give priority to tasks on the critical path for high priority tasks */
34
- priorities: Priority[];
35
- /**
36
- * Options that will be sent to all log reporters.
37
- */
38
- loggerOptions: LoggerOptions;
39
- /**
40
- * Custom runners for tasks in the pipeline. The key is the task name, and the value is a configuration describing what would be
41
- * passed to the runner constructor.
42
- */
43
- runners: TargetRunnerPickerOptions;
44
- /**
45
- * Maximum worker idle memory, this would cause workers to restart if they exceed this limit. This is useful to prevent memory leaks.
46
- */
47
- workerIdleMemoryLimit: number;
48
- /**
49
- * Maximum number of concurrent tasks to run
50
- */
51
- concurrency: number;
52
- /**
53
- * Allows for no targets run
54
- */
55
- allowNoTargetRuns: boolean;
56
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,15 +0,0 @@
1
- import type { LogLevel } from "@lage-run/logger";
2
- export interface LoggerOptions {
3
- disp?: {
4
- [level: string]: string;
5
- };
6
- style?: {
7
- [level: string]: {
8
- fg?: string;
9
- bg?: string;
10
- };
11
- };
12
- levels?: {
13
- [level: string]: LogLevel;
14
- };
15
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -1,12 +0,0 @@
1
- import type { TargetConfig } from "@lage-run/target-graph";
2
- import type { ConfigOptions } from "./ConfigOptions.js";
3
- export interface FactoryArgs {
4
- cwd: string;
5
- config: ConfigOptions;
6
- }
7
- export interface TargetConfigFactory {
8
- (args: FactoryArgs): TargetConfig | TargetConfig[];
9
- }
10
- export interface PipelineDefinition {
11
- [task: string]: string[] | TargetConfig;
12
- }
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
@@ -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
- });