@lage-run/cli 0.4.15 → 0.4.17
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 +43 -1
- package/CHANGELOG.md +20 -2
- package/lib/commands/run/filterPipelineDefinitions.d.ts +3 -0
- package/lib/commands/run/filterPipelineDefinitions.js +18 -0
- package/lib/commands/run/filterPipelineDefinitions.js.map +1 -0
- package/lib/commands/run/runAction.js +7 -5
- package/lib/commands/run/runAction.js.map +1 -1
- package/lib/commands/run/watchAction.js +7 -6
- package/lib/commands/run/watchAction.js.map +1 -1
- package/lib/config/getMaxWorkersPerTask.d.ts +1 -1
- package/lib/config/getMaxWorkersPerTask.js +34 -17
- package/lib/config/getMaxWorkersPerTask.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,49 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Fri, 21 Oct 2022
|
|
5
|
+
"date": "Fri, 21 Oct 2022 23:04:28 GMT",
|
|
6
|
+
"tag": "@lage-run/cli_v0.4.17",
|
|
7
|
+
"version": "0.4.17",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "ken@gizzar.com",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"commit": "d93d94b25f3b157dedc555f836b66ee547500cd5",
|
|
14
|
+
"comment": "fixing the max worker again - this time we need to account for general pool availability"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 21 Oct 2022 21:36:38 GMT",
|
|
21
|
+
"tag": "@lage-run/cli_v0.4.16",
|
|
22
|
+
"version": "0.4.16",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "ken@gizzar.com",
|
|
27
|
+
"package": "@lage-run/cli",
|
|
28
|
+
"commit": "735930e09c2fdf476c3f2c56c1c05062401097b8",
|
|
29
|
+
"comment": "pipelines with maxWorker now create separate pools"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "beachball",
|
|
33
|
+
"package": "@lage-run/cli",
|
|
34
|
+
"comment": "Bump @lage-run/scheduler to v0.4.12",
|
|
35
|
+
"commit": "735930e09c2fdf476c3f2c56c1c05062401097b8"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "@lage-run/cli",
|
|
40
|
+
"comment": "Bump @lage-run/reporters to v0.2.26",
|
|
41
|
+
"commit": "735930e09c2fdf476c3f2c56c1c05062401097b8"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"date": "Fri, 21 Oct 2022 19:33:09 GMT",
|
|
6
48
|
"tag": "@lage-run/cli_v0.4.15",
|
|
7
49
|
"version": "0.4.15",
|
|
8
50
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @lage-run/cli
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri, 21 Oct 2022
|
|
3
|
+
This log was last generated on Fri, 21 Oct 2022 23:04:28 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.4.17
|
|
8
|
+
|
|
9
|
+
Fri, 21 Oct 2022 23:04:28 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- fixing the max worker again - this time we need to account for general pool availability (ken@gizzar.com)
|
|
14
|
+
|
|
15
|
+
## 0.4.16
|
|
16
|
+
|
|
17
|
+
Fri, 21 Oct 2022 21:36:38 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- pipelines with maxWorker now create separate pools (ken@gizzar.com)
|
|
22
|
+
- Bump @lage-run/scheduler to v0.4.12
|
|
23
|
+
- Bump @lage-run/reporters to v0.2.26
|
|
24
|
+
|
|
7
25
|
## 0.4.15
|
|
8
26
|
|
|
9
|
-
Fri, 21 Oct 2022 19:
|
|
27
|
+
Fri, 21 Oct 2022 19:33:09 GMT
|
|
10
28
|
|
|
11
29
|
### Patches
|
|
12
30
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterPipelineDefinitions = void 0;
|
|
4
|
+
function filterPipelineDefinitions(targets, pipeline) {
|
|
5
|
+
const tasksSet = new Set();
|
|
6
|
+
for (const target of targets) {
|
|
7
|
+
tasksSet.add(target.task);
|
|
8
|
+
}
|
|
9
|
+
const filteredPipeline = {};
|
|
10
|
+
for (const [id, definition] of Object.entries(pipeline !== null && pipeline !== void 0 ? pipeline : {})) {
|
|
11
|
+
if (tasksSet.has(id)) {
|
|
12
|
+
filteredPipeline[id] = definition;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return filteredPipeline;
|
|
16
|
+
}
|
|
17
|
+
exports.filterPipelineDefinitions = filterPipelineDefinitions;
|
|
18
|
+
//# sourceMappingURL=filterPipelineDefinitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterPipelineDefinitions.js","sourceRoot":"","sources":["../../../src/commands/run/filterPipelineDefinitions.ts"],"names":[],"mappings":";;;AAGA,SAAgB,yBAAyB,CAAC,OAAiC,EAAE,QAA4B;IACvG,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KAC3B;IACD,MAAM,gBAAgB,GAAuB,EAAE,CAAC;IAChD,KAAK,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAC,EAAE;QAC7D,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;YACpB,gBAAgB,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC;SACnC;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAdD,8DAcC"}
|
|
@@ -4,7 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.runAction = void 0;
|
|
7
|
+
const createCacheProvider_1 = require("./createCacheProvider");
|
|
7
8
|
const createProfileReporter_1 = require("./createProfileReporter");
|
|
9
|
+
const createTargetGraph_1 = require("./createTargetGraph");
|
|
10
|
+
const filterArgsForTasks_1 = require("./filterArgsForTasks");
|
|
11
|
+
const filterPipelineDefinitions_1 = require("./filterPipelineDefinitions");
|
|
8
12
|
const find_npm_client_1 = require("@lage-run/find-npm-client");
|
|
9
13
|
const getConfig_1 = require("../../config/getConfig");
|
|
10
14
|
const getMaxWorkersPerTask_1 = require("../../config/getMaxWorkersPerTask");
|
|
@@ -12,11 +16,7 @@ const workspace_tools_1 = require("workspace-tools");
|
|
|
12
16
|
const reporters_1 = require("@lage-run/reporters");
|
|
13
17
|
const scheduler_1 = require("@lage-run/scheduler");
|
|
14
18
|
const logger_1 = __importDefault(require("@lage-run/logger"));
|
|
15
|
-
const filterArgsForTasks_1 = require("./filterArgsForTasks");
|
|
16
|
-
const createTargetGraph_1 = require("./createTargetGraph");
|
|
17
|
-
const createCacheProvider_1 = require("./createCacheProvider");
|
|
18
19
|
async function runAction(options, command) {
|
|
19
|
-
var _a;
|
|
20
20
|
const cwd = process.cwd();
|
|
21
21
|
const config = await (0, getConfig_1.getConfig)(cwd);
|
|
22
22
|
// Configure logger
|
|
@@ -50,6 +50,8 @@ async function runAction(options, command) {
|
|
|
50
50
|
cacheOptions: config.cacheOptions,
|
|
51
51
|
skipLocalCache: options.skipLocalCache,
|
|
52
52
|
});
|
|
53
|
+
logger.verbose(`Running with ${options.concurrency} workers`);
|
|
54
|
+
const filteredPipeline = (0, filterPipelineDefinitions_1.filterPipelineDefinitions)(targetGraph.targets.values(), config.pipeline);
|
|
53
55
|
const scheduler = new scheduler_1.SimpleScheduler({
|
|
54
56
|
logger,
|
|
55
57
|
concurrency: options.concurrency,
|
|
@@ -58,7 +60,7 @@ async function runAction(options, command) {
|
|
|
58
60
|
continueOnError: options.continue,
|
|
59
61
|
shouldCache: options.cache,
|
|
60
62
|
shouldResetCache: options.resetCache,
|
|
61
|
-
maxWorkersPerTask: (0, getMaxWorkersPerTask_1.getMaxWorkersPerTask)(
|
|
63
|
+
maxWorkersPerTask: (0, getMaxWorkersPerTask_1.getMaxWorkersPerTask)(filteredPipeline, options.concurrency),
|
|
62
64
|
runners: Object.assign({ npmScript: {
|
|
63
65
|
script: require.resolve("./runners/NpmScriptRunner"),
|
|
64
66
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runAction.js","sourceRoot":"","sources":["../../../src/commands/run/runAction.ts"],"names":[],"mappings":";;;;;;AACA,mEAAgE;AAChE,+DAA0D;AAC1D,sDAAmD;AACnD,4EAAyE;AACzE,qDAAoE;AACpE,mDAA0D;AAC1D,mDAAsD;
|
|
1
|
+
{"version":3,"file":"runAction.js","sourceRoot":"","sources":["../../../src/commands/run/runAction.ts"],"names":[],"mappings":";;;;;;AACA,+DAAoD;AACpD,mEAAgE;AAChE,2DAAwD;AACxD,6DAA0D;AAC1D,2EAAwE;AACxE,+DAA0D;AAC1D,sDAAmD;AACnD,4EAAyE;AACzE,qDAAoE;AACpE,mDAA0D;AAC1D,mDAAsD;AAEtD,8DAA0D;AAoBnD,KAAK,UAAU,SAAS,CAAC,OAAmB,EAAE,OAAgB;IACnE,MAAM,GAAG,GAAG,OAAO,CA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EAAE;QACjC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;KACtB;IAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC"}
|
|
@@ -24,19 +24,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.watchAction = void 0;
|
|
27
|
+
const createCacheProvider_1 = require("./createCacheProvider");
|
|
28
|
+
const createTargetGraph_1 = require("./createTargetGraph");
|
|
29
|
+
const filterArgsForTasks_1 = require("./filterArgsForTasks");
|
|
27
30
|
const find_npm_client_1 = require("@lage-run/find-npm-client");
|
|
28
31
|
const getConfig_1 = require("../../config/getConfig");
|
|
29
32
|
const getMaxWorkersPerTask_1 = require("../../config/getMaxWorkersPerTask");
|
|
30
33
|
const workspace_tools_1 = require("workspace-tools");
|
|
34
|
+
const filterPipelineDefinitions_1 = require("./filterPipelineDefinitions");
|
|
31
35
|
const reporters_1 = require("@lage-run/reporters");
|
|
32
36
|
const scheduler_1 = require("@lage-run/scheduler");
|
|
33
|
-
const logger_1 = __importStar(require("@lage-run/logger"));
|
|
34
|
-
const filterArgsForTasks_1 = require("./filterArgsForTasks");
|
|
35
|
-
const createTargetGraph_1 = require("./createTargetGraph");
|
|
36
|
-
const createCacheProvider_1 = require("./createCacheProvider");
|
|
37
37
|
const watcher_1 = require("./watcher");
|
|
38
|
+
const logger_1 = __importStar(require("@lage-run/logger"));
|
|
38
39
|
async function watchAction(options, command) {
|
|
39
|
-
var _a;
|
|
40
40
|
const cwd = process.cwd();
|
|
41
41
|
const config = await (0, getConfig_1.getConfig)(cwd);
|
|
42
42
|
// Configure logger
|
|
@@ -72,6 +72,7 @@ async function watchAction(options, command) {
|
|
|
72
72
|
cacheOptions: config.cacheOptions,
|
|
73
73
|
skipLocalCache: false,
|
|
74
74
|
});
|
|
75
|
+
const filteredPipeline = (0, filterPipelineDefinitions_1.filterPipelineDefinitions)(targetGraph.targets.values(), config.pipeline);
|
|
75
76
|
const scheduler = new scheduler_1.SimpleScheduler({
|
|
76
77
|
logger,
|
|
77
78
|
concurrency: options.concurrency,
|
|
@@ -80,7 +81,7 @@ async function watchAction(options, command) {
|
|
|
80
81
|
continueOnError: true,
|
|
81
82
|
shouldCache: options.cache,
|
|
82
83
|
shouldResetCache: options.resetCache,
|
|
83
|
-
maxWorkersPerTask: (0, getMaxWorkersPerTask_1.getMaxWorkersPerTask)(
|
|
84
|
+
maxWorkersPerTask: (0, getMaxWorkersPerTask_1.getMaxWorkersPerTask)(filteredPipeline, options.concurrency),
|
|
84
85
|
runners: Object.assign({ npmScript: {
|
|
85
86
|
script: require.resolve("./runners/NpmScriptRunner"),
|
|
86
87
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchAction.js","sourceRoot":"","sources":["../../../src/commands/run/watchAction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"watchAction.js","sourceRoot":"","sources":["../../../src/commands/run/watchAction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+DAAoD;AACpD,2DAAwD;AACxD,6DAA0D;AAC1D,+DAA0D;AAC1D,sDAAmD;AACnD,4EAAyE;AACzE,qDAAoE;AACpE,2EAAwE;AACxE,mDAAkD;AAClD,mDAAsD;AACtD,uCAAkC;AAElC,2DAAoE;AAoB7D,KAAK,UAAU,WAAW,CAAC,OAAmB,EAAE,OAAgB;IACrE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAS,EAAC,GAAG,CAAC,CAAC;IAEpC,mBAAmB;IACnB,MAAM,MAAM,GAAG,IAAA,gBAAY,GAAE,CAAC;IAC9B,MAAM,QAAQ,GAAG,IAAI,uBAAW,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B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,EAAE;QACnC,QAAQ,CAAC,eAAe,EAAE,CAAC;QAC3B,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE;YACjD,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,IAAI,SAAS,CAAC,cAAc,EAAE;gBAClE,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aACrC;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA/FD,kCA+FC;AAED,SAAS,cAAc,CAAC,OAA4B,EAAE,SAAqB;IACzE,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ConfigOptions } from "../types/ConfigOptions";
|
|
2
|
-
export declare function getMaxWorkersPerTask(pipelineConfig: ConfigOptions["pipeline"]): Map<string, number>;
|
|
2
|
+
export declare function getMaxWorkersPerTask(pipelineConfig: ConfigOptions["pipeline"], concurrency: number): Map<string, number>;
|
|
@@ -1,30 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getMaxWorkersPerTask = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _a, _b, _c;
|
|
4
|
+
function getMaxWorkersPerTask(pipelineConfig, concurrency) {
|
|
5
|
+
var _a, _b;
|
|
10
6
|
const maxWorkersPerTask = new Map();
|
|
7
|
+
let generalPoolCount = 0;
|
|
8
|
+
let generatelPoolMaxWorkers = 0;
|
|
9
|
+
let dedicatedPoolCount = 0;
|
|
10
|
+
let dedicatedPoolMaxWorkers = 0;
|
|
11
11
|
for (const [task, taskConfig] of Object.entries(pipelineConfig)) {
|
|
12
12
|
if (!Array.isArray(taskConfig) && !task.includes("#")) {
|
|
13
|
-
const
|
|
13
|
+
const maxWorkerOption = (_a = taskConfig.maxWorkers) !== null && _a !== void 0 ? _a : (_b = taskConfig.options) === null || _b === void 0 ? void 0 : _b.maxWorkers;
|
|
14
|
+
if (typeof maxWorkerOption === "undefined") {
|
|
15
|
+
generalPoolCount++;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
14
18
|
let maxWorkers = 0;
|
|
15
|
-
if (typeof
|
|
16
|
-
|
|
17
|
-
maxWorkers = Math.floor(os_1.default.cpus().length * (parseInt(maxWorkerOptions, 10) / 100));
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
maxWorkers = parseInt(maxWorkerOptions, 10);
|
|
21
|
-
}
|
|
19
|
+
if (typeof maxWorkerOption !== "number") {
|
|
20
|
+
throw new Error(`Invalid maxWorkers value: ${maxWorkerOption}`);
|
|
22
21
|
}
|
|
23
22
|
else {
|
|
24
|
-
maxWorkers =
|
|
23
|
+
maxWorkers = maxWorkerOption;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
maxWorkersPerTask.set(task, maxWorkers);
|
|
26
|
+
dedicatedPoolCount++;
|
|
27
|
+
dedicatedPoolMaxWorkers += maxWorkers;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (dedicatedPoolCount > 0 && generalPoolCount > 0) {
|
|
31
|
+
const avgMaxWorkers = dedicatedPoolMaxWorkers / dedicatedPoolCount;
|
|
32
|
+
generatelPoolMaxWorkers = Math.max(1, Math.floor(avgMaxWorkers * generalPoolCount));
|
|
33
|
+
}
|
|
34
|
+
const grandTotal = dedicatedPoolMaxWorkers + generatelPoolMaxWorkers;
|
|
35
|
+
// try to adjust the maxWorkersPerTask to fit the concurrency
|
|
36
|
+
if (grandTotal > concurrency) {
|
|
37
|
+
let newTotal = 0;
|
|
38
|
+
for (const [task, maxWorkers] of maxWorkersPerTask.entries()) {
|
|
39
|
+
const newMaxWorkers = Math.max(1, Math.floor((maxWorkers / grandTotal) * concurrency));
|
|
40
|
+
newTotal += newMaxWorkers;
|
|
41
|
+
maxWorkersPerTask.set(task, newMaxWorkers);
|
|
42
|
+
}
|
|
43
|
+
if (newTotal > concurrency) {
|
|
44
|
+
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");
|
|
28
45
|
}
|
|
29
46
|
}
|
|
30
47
|
return maxWorkersPerTask;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMaxWorkersPerTask.js","sourceRoot":"","sources":["../../src/config/getMaxWorkersPerTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getMaxWorkersPerTask.js","sourceRoot":"","sources":["../../src/config/getMaxWorkersPerTask.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAAC,cAAyC,EAAE,WAAmB;;IACjG,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEpD,IAAI,gBAAgB,GAAG,CAAC,CAAC;IACzB,IAAI,uBAAuB,GAAG,CAAC,CAAC;IAEhC,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,IAAI,uBAAuB,GAAG,CAAC,CAAC;IAEhC,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;QAC/D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACrD,MAAM,eAAe,GAAuB,MAAA,UAAU,CAAC,UAAU,mCAAI,MAAA,UAAU,CAAC,OAAO,0CAAE,UAAU,CAAC;YAEpG,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE;gBAC1C,gBA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|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"description": "Command Line Interface for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/microsoft/lage"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@lage-run/find-npm-client": "^0.1.1",
|
|
21
21
|
"@lage-run/logger": "^1.2.0",
|
|
22
|
-
"@lage-run/scheduler": "^0.4.
|
|
22
|
+
"@lage-run/scheduler": "^0.4.12",
|
|
23
23
|
"@lage-run/target-graph": "^0.4.3",
|
|
24
24
|
"@lage-run/cache": "^0.1.20",
|
|
25
|
-
"@lage-run/reporters": "^0.2.
|
|
25
|
+
"@lage-run/reporters": "^0.2.26",
|
|
26
26
|
"commander": "^9.4.0",
|
|
27
27
|
"workspace-tools": "^0.28.0",
|
|
28
28
|
"chokidar": "3.5.3"
|