@lage-run/cli 0.3.19 → 0.4.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/CHANGELOG.json +43 -1
- package/CHANGELOG.md +20 -2
- package/lib/commands/run/action.d.ts +1 -1
- package/lib/commands/run/action.js +16 -30
- package/lib/commands/run/action.js.map +1 -1
- package/lib/commands/run/runners/NpmScriptRunner.d.ts +1 -0
- package/lib/commands/run/runners/NpmScriptRunner.js +6 -0
- package/lib/commands/run/runners/NpmScriptRunner.js.map +1 -0
- package/lib/commands/run/runners/WorkerRunner.d.ts +1 -0
- package/lib/commands/run/runners/WorkerRunner.js +6 -0
- package/lib/commands/run/runners/WorkerRunner.js.map +1 -0
- package/lib/config/getConfig.js +2 -1
- package/lib/config/getConfig.js.map +1 -1
- package/lib/config/getMaxWorkersPerTask.d.ts +2 -0
- package/lib/config/getMaxWorkersPerTask.js +33 -0
- package/lib/config/getMaxWorkersPerTask.js.map +1 -0
- package/lib/types/ConfigOptions.d.ts +6 -0
- package/package.json +4 -3
- package/tsconfig.json +1 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,49 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 04 Oct 2022 15:51:38 GMT",
|
|
6
|
+
"tag": "@lage-run/cli_v0.4.1",
|
|
7
|
+
"version": "0.4.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kchau@microsoft.com",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"commit": "91bc0629f6fc8a49784da920328c6c34f1292b85",
|
|
14
|
+
"comment": "actually publish runners and workers"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 04 Oct 2022 03:38:54 GMT",
|
|
21
|
+
"tag": "@lage-run/cli_v0.4.0",
|
|
22
|
+
"version": "0.4.0",
|
|
23
|
+
"comments": {
|
|
24
|
+
"minor": [
|
|
25
|
+
{
|
|
26
|
+
"author": "kchau@microsoft.com",
|
|
27
|
+
"package": "@lage-run/cli",
|
|
28
|
+
"commit": "34e76ae75fc56a1374115e630a7dfc81b1fa6ead",
|
|
29
|
+
"comment": "Uses the new scheduler"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "beachball",
|
|
33
|
+
"package": "@lage-run/cli",
|
|
34
|
+
"comment": "Bump @lage-run/scheduler to v0.4.0",
|
|
35
|
+
"commit": "34e76ae75fc56a1374115e630a7dfc81b1fa6ead"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "@lage-run/cli",
|
|
40
|
+
"comment": "Bump @lage-run/reporters to v0.2.17",
|
|
41
|
+
"commit": "34e76ae75fc56a1374115e630a7dfc81b1fa6ead"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"date": "Mon, 03 Oct 2022 20:41:25 GMT",
|
|
6
48
|
"tag": "@lage-run/cli_v0.3.19",
|
|
7
49
|
"version": "0.3.19",
|
|
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
|
|
3
|
+
This log was last generated on Tue, 04 Oct 2022 15:51:38 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.4.1
|
|
8
|
+
|
|
9
|
+
Tue, 04 Oct 2022 15:51:38 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- actually publish runners and workers (kchau@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 0.4.0
|
|
16
|
+
|
|
17
|
+
Tue, 04 Oct 2022 03:38:54 GMT
|
|
18
|
+
|
|
19
|
+
### Minor changes
|
|
20
|
+
|
|
21
|
+
- Uses the new scheduler (kchau@microsoft.com)
|
|
22
|
+
- Bump @lage-run/scheduler to v0.4.0
|
|
23
|
+
- Bump @lage-run/reporters to v0.2.17
|
|
24
|
+
|
|
7
25
|
## 0.3.19
|
|
8
26
|
|
|
9
|
-
Mon, 03 Oct 2022 20:41:
|
|
27
|
+
Mon, 03 Oct 2022 20:41:25 GMT
|
|
10
28
|
|
|
11
29
|
### Patches
|
|
12
30
|
|
|
@@ -11,7 +11,7 @@ interface RunOptions extends ReporterInitOptions {
|
|
|
11
11
|
continue: boolean;
|
|
12
12
|
cache: boolean;
|
|
13
13
|
resetCache: boolean;
|
|
14
|
-
|
|
14
|
+
nodeArg: string;
|
|
15
15
|
}
|
|
16
16
|
export declare function runAction(options: RunOptions, command: Command): Promise<void>;
|
|
17
17
|
export {};
|
|
@@ -9,6 +9,7 @@ const createProfileReporter_1 = require("./createProfileReporter");
|
|
|
9
9
|
const find_npm_client_1 = require("@lage-run/find-npm-client");
|
|
10
10
|
const getConfig_1 = require("../../config/getConfig");
|
|
11
11
|
const getFilteredPackages_1 = require("../../filter/getFilteredPackages");
|
|
12
|
+
const getMaxWorkersPerTask_1 = require("../../config/getMaxWorkersPerTask");
|
|
12
13
|
const workspace_tools_1 = require("workspace-tools");
|
|
13
14
|
const reporters_1 = require("@lage-run/reporters");
|
|
14
15
|
const isRunningFromCI_1 = require("../isRunningFromCI");
|
|
@@ -23,7 +24,7 @@ function filterArgsForTasks(args) {
|
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
async function runAction(options, command) {
|
|
26
|
-
var _a, _b;
|
|
27
|
+
var _a, _b, _c;
|
|
27
28
|
const cwd = process.cwd();
|
|
28
29
|
const config = (0, getConfig_1.getConfig)(cwd);
|
|
29
30
|
// Configure logger
|
|
@@ -83,27 +84,6 @@ async function runAction(options, command) {
|
|
|
83
84
|
environmentGlob: config.cacheOptions.environmentGlob,
|
|
84
85
|
cacheKey: config.cacheOptions.cacheKey,
|
|
85
86
|
});
|
|
86
|
-
// Run Tasks with Scheduler + NpmScriptRunner
|
|
87
|
-
const runners = {
|
|
88
|
-
npmScript: new scheduler_1.NpmScriptRunner({
|
|
89
|
-
logger,
|
|
90
|
-
nodeOptions: options.nodeargs,
|
|
91
|
-
taskArgs,
|
|
92
|
-
npmCmd: (0, find_npm_client_1.findNpmClient)(config.npmClient),
|
|
93
|
-
}),
|
|
94
|
-
worker: new scheduler_1.WorkerRunner({
|
|
95
|
-
logger,
|
|
96
|
-
workerTargetConfigs: Object.entries(config.pipeline).reduce((workerTargetConfigs, [id, def]) => {
|
|
97
|
-
if (!Array.isArray(def) && def.type === "worker") {
|
|
98
|
-
workerTargetConfigs[id] = def;
|
|
99
|
-
}
|
|
100
|
-
return workerTargetConfigs;
|
|
101
|
-
}, {}),
|
|
102
|
-
}),
|
|
103
|
-
};
|
|
104
|
-
const runnerPicker = new scheduler_1.TargetRunnerPicker({
|
|
105
|
-
runners,
|
|
106
|
-
});
|
|
107
87
|
const scheduler = new scheduler_1.SimpleScheduler({
|
|
108
88
|
logger,
|
|
109
89
|
concurrency: options.concurrency,
|
|
@@ -112,20 +92,26 @@ async function runAction(options, command) {
|
|
|
112
92
|
continueOnError: options.continue,
|
|
113
93
|
shouldCache: options.cache,
|
|
114
94
|
shouldResetCache: options.resetCache,
|
|
115
|
-
|
|
95
|
+
maxWorkersPerTask: (0, getMaxWorkersPerTask_1.getMaxWorkersPerTask)((_c = config.pipeline) !== null && _c !== void 0 ? _c : {}),
|
|
96
|
+
runners: Object.assign({ npmScript: {
|
|
97
|
+
script: require.resolve("./runners/NpmScriptRunner"),
|
|
98
|
+
options: {
|
|
99
|
+
nodeArg: options.nodeArg,
|
|
100
|
+
taskArgs,
|
|
101
|
+
npmCmd: (0, find_npm_client_1.findNpmClient)(config.npmClient),
|
|
102
|
+
},
|
|
103
|
+
}, worker: {
|
|
104
|
+
script: require.resolve("./runners/WorkerRunner"),
|
|
105
|
+
options: {},
|
|
106
|
+
} }, config.runners),
|
|
116
107
|
});
|
|
117
108
|
const summary = await scheduler.run(root, targetGraph);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
await runner.cleanup();
|
|
121
|
-
}
|
|
109
|
+
if (summary.results !== "success") {
|
|
110
|
+
process.exitCode = 1;
|
|
122
111
|
}
|
|
123
112
|
for (const reporter of logger.reporters) {
|
|
124
113
|
reporter.summarize(summary);
|
|
125
114
|
}
|
|
126
|
-
if (summary.results !== "success") {
|
|
127
|
-
process.exitCode = 1;
|
|
128
|
-
}
|
|
129
115
|
}
|
|
130
116
|
exports.runAction = runAction;
|
|
131
117
|
//# sourceMappingURL=action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/run/action.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAmG;AAEnG,mEAAgE;AAChE,+DAA0D;AAC1D,sDAAmD;AACnD,0EAAuE;AACvE,qDAAoE;AACpE,mDAA0D;AAC1D,wDAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/run/action.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAmG;AAEnG,mEAAgE;AAChE,+DAA0D;AAC1D,sDAAmD;AACnD,0EAAuE;AACvE,4EAAyE;AACzE,qDAAoE;AACpE,mDAA0D;AAC1D,wDAAqD;AACrD,mDAAsD;AACtD,yDAA4D;AAC5D,8DAA4C;AAG5C,SAAS,kBAAkB,CAAC,IAAc;IACxC,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACrE,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,KAAK,CAAC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MAAM,CAAC,SAAS,EAAE;QACvC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC;AA/GD,8BA+GC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NpmScriptRunner } from "@lage-run/scheduler";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NpmScriptRunner = void 0;
|
|
4
|
+
var scheduler_1 = require("@lage-run/scheduler");
|
|
5
|
+
Object.defineProperty(exports, "NpmScriptRunner", { enumerable: true, get: function () { return scheduler_1.NpmScriptRunner; } });
|
|
6
|
+
//# sourceMappingURL=NpmScriptRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NpmScriptRunner.js","sourceRoot":"","sources":["../../../../src/commands/run/runners/NpmScriptRunner.ts"],"names":[],"mappings":";;;AAAA,iDAAsD;AAA7C,4GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WorkerRunner } from "@lage-run/scheduler";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkerRunner = void 0;
|
|
4
|
+
var scheduler_1 = require("@lage-run/scheduler");
|
|
5
|
+
Object.defineProperty(exports, "WorkerRunner", { enumerable: true, get: function () { return scheduler_1.WorkerRunner; } });
|
|
6
|
+
//# sourceMappingURL=WorkerRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkerRunner.js","sourceRoot":"","sources":["../../../../src/commands/run/runners/WorkerRunner.ts"],"names":[],"mappings":";;;AAAA,iDAAmD;AAA1C,yGAAA,YAAY,OAAA"}
|
package/lib/config/getConfig.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.getConfig = void 0;
|
|
|
4
4
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
5
5
|
const workspace_tools_1 = require("workspace-tools");
|
|
6
6
|
function getConfig(cwd) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8
8
|
// Verify presence of git
|
|
9
9
|
const root = (0, workspace_tools_1.getWorkspaceRoot)(cwd);
|
|
10
10
|
if (!root) {
|
|
@@ -28,6 +28,7 @@ function getConfig(cwd) {
|
|
|
28
28
|
"rush.json",
|
|
29
29
|
],
|
|
30
30
|
loggerOptions: (_g = configResults === null || configResults === void 0 ? void 0 : configResults.config.loggerOptions) !== null && _g !== void 0 ? _g : {},
|
|
31
|
+
runners: (_h = configResults === null || configResults === void 0 ? void 0 : configResults.config.runners) !== null && _h !== void 0 ? _h : {},
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
exports.getConfig = getConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfig.js","sourceRoot":"","sources":["../../src/config/getConfig.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAC9C,qDAAmD;AAGnD,SAAgB,SAAS,CAAC,GAAW;;IACnC,yBAAyB;IACzB,MAAM,IAAI,GAAG,IAAA,kCAAgB,EAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;KAClG;IAED,iCAAiC;IACjC,MAAM,gBAAgB,GAAG,MAAM,CAAC;IAChC,MAAM,aAAa,GAAG,IAAA,6BAAe,EAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,GAAG,CAAC,CAAC;IAC5E,OAAO;QACL,YAAY,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,YAAY,mCAAI,EAAE;QACtD,MAAM,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE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AAE,MAAM,CAAC,MAAM,mCAAI,EAAE;QAC1C,SAAS,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,SAAS,mCAAI,KAAK;QACnD,QAAQ,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,QAAQ,mCAAI,EAAE;QAC9C,UAAU,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,UAAU,mCAAI,EAAE;QAClD,eAAe,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,eAAe,mCAAI;YACxD,gBAAgB;YAChB,mBAAmB;YACnB,WAAW;YACX,gBAAgB;YAChB,YAAY;YACZ,WAAW;SACZ;QACD,aAAa,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,aAAa,mCAAI,EAAE;QACxD,OAAO,EAAE,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,OAAO,mCAAI,EAAE;KAC7C,CAAC;AACJ,CAAC;AA3BD,8BA2BC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getMaxWorkersPerTask = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
function getMaxWorkersPerTask(pipelineConfig) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const maxWorkersPerTask = new Map();
|
|
11
|
+
for (const [task, taskConfig] of Object.entries(pipelineConfig)) {
|
|
12
|
+
if (!Array.isArray(taskConfig) && !task.includes("#")) {
|
|
13
|
+
const maxWorkerOptions = (_b = (_a = taskConfig.options) === null || _a === void 0 ? void 0 : _a.maxWorkers) !== null && _b !== void 0 ? _b : os_1.default.cpus().length - 1;
|
|
14
|
+
let maxWorkers = 0;
|
|
15
|
+
if (typeof maxWorkerOptions === "string") {
|
|
16
|
+
if (maxWorkerOptions.endsWith("%")) {
|
|
17
|
+
maxWorkers = Math.floor(os_1.default.cpus().length * (parseInt(maxWorkerOptions, 10) / 100));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
maxWorkers = parseInt(maxWorkerOptions, 10);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
maxWorkers = maxWorkerOptions;
|
|
25
|
+
}
|
|
26
|
+
maxWorkers = isNaN(maxWorkers) ? os_1.default.cpus().length - 1 : maxWorkers;
|
|
27
|
+
maxWorkersPerTask.set(task, Math.min(maxWorkers, os_1.default.cpus().length - 1));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return maxWorkersPerTask;
|
|
31
|
+
}
|
|
32
|
+
exports.getMaxWorkersPerTask = getMaxWorkersPerTask;
|
|
33
|
+
//# sourceMappingURL=getMaxWorkersPerTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMaxWorkersPerTask.js","sourceRoot":"","sources":["../../src/config/getMaxWorkersPerTask.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAGpB,SAAgB,oBAAoB,CAAC,cAAyC;;IAC5E,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEpD,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,gBAAgB,GAAoB,MAAA,MAAA,UAAU,CAAC,OAAO,0CAAE,UAAU,mCAAI,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;YACjG,IAAI,UAAU,GAAG,CAAC,CAAC;YACnB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE;gBACxC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAClC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,gBAAgB,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;iBACpF;qBAAM;oBACL,UAAU,GAAG,QAAQ,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;iBAC7C;aACF;iBAAM;gBACL,UAAU,GAAG,gBAAgB,CAAC;aAC/B;YAED,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;YAEnE,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SACzE;KACF;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAxBD,oDAwBC"}
|
|
@@ -2,6 +2,7 @@ import { CacheOptions } from "./CacheOptions";
|
|
|
2
2
|
import { Priority } from "./Priority";
|
|
3
3
|
import { PipelineDefinition } from "./PipelineDefinition";
|
|
4
4
|
import { LoggerOptions } from "./LoggerOptions";
|
|
5
|
+
import { TargetRunnerPickerOptions } from "@lage-run/scheduler/lib/runners/TargetRunnerPicker";
|
|
5
6
|
export declare type NpmClient = "npm" | "yarn" | "pnpm";
|
|
6
7
|
export interface ConfigOptions {
|
|
7
8
|
/**
|
|
@@ -35,4 +36,9 @@ export interface ConfigOptions {
|
|
|
35
36
|
* Options that will be sent to all log reporters.
|
|
36
37
|
*/
|
|
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;
|
|
38
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Command Line Interface for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/microsoft/lage"
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
"test": "jest"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
+
"@lage-run/find-npm-client": "^0.1.1",
|
|
20
21
|
"@lage-run/logger": "^1.2.0",
|
|
21
|
-
"@lage-run/scheduler": "^0.
|
|
22
|
+
"@lage-run/scheduler": "^0.4.0",
|
|
22
23
|
"@lage-run/target-graph": "^0.4.2",
|
|
23
24
|
"@lage-run/cache": "^0.1.16",
|
|
24
|
-
"@lage-run/reporters": "^0.2.
|
|
25
|
+
"@lage-run/reporters": "^0.2.17",
|
|
25
26
|
"commander": "^9.4.0",
|
|
26
27
|
"workspace-tools": "^0.28.0"
|
|
27
28
|
},
|
package/tsconfig.json
CHANGED