@lage-run/cli 0.3.18 → 0.4.0
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 +55 -1
- package/CHANGELOG.md +22 -2
- package/lib/commands/cache/action.d.ts +1 -1
- package/lib/commands/cache/action.js +2 -2
- package/lib/commands/cache/action.js.map +1 -1
- package/lib/commands/run/action.d.ts +2 -2
- package/lib/commands/run/action.js +18 -32
- package/lib/commands/run/action.js.map +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/run/index.js.map +1 -1
- package/lib/config/getConfig.d.ts +1 -1
- 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/lib/types/LoggerOptions.d.ts +0 -6
- package/package.json +4 -3
- package/lib/reporters/createReporter.d.ts +0 -8
- package/lib/reporters/createReporter.js +0 -18
- package/lib/reporters/createReporter.js.map +0 -1
- package/lib/reporters/initialize.d.ts +0 -4
- package/lib/reporters/initialize.js +0 -21
- package/lib/reporters/initialize.js.map +0 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,61 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 04 Oct 2022 03:38:40 GMT",
|
|
6
|
+
"tag": "@lage-run/cli_v0.4.0",
|
|
7
|
+
"version": "0.4.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kchau@microsoft.com",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"commit": "34e76ae75fc56a1374115e630a7dfc81b1fa6ead",
|
|
14
|
+
"comment": "Uses the new scheduler"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@lage-run/cli",
|
|
19
|
+
"comment": "Bump @lage-run/scheduler to v0.4.0",
|
|
20
|
+
"commit": "34e76ae75fc56a1374115e630a7dfc81b1fa6ead"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@lage-run/cli",
|
|
25
|
+
"comment": "Bump @lage-run/reporters to v0.2.17",
|
|
26
|
+
"commit": "34e76ae75fc56a1374115e630a7dfc81b1fa6ead"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"date": "Mon, 03 Oct 2022 20:41:25 GMT",
|
|
33
|
+
"tag": "@lage-run/cli_v0.3.19",
|
|
34
|
+
"version": "0.3.19",
|
|
35
|
+
"comments": {
|
|
36
|
+
"patch": [
|
|
37
|
+
{
|
|
38
|
+
"author": "kchau@microsoft.com",
|
|
39
|
+
"package": "@lage-run/cli",
|
|
40
|
+
"commit": "68c7fda6d0c1757b353d406b21223295c9830767",
|
|
41
|
+
"comment": "moved reporters init code in @lage-run/reporters"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@lage-run/cli",
|
|
46
|
+
"comment": "Bump @lage-run/scheduler to v0.3.14",
|
|
47
|
+
"commit": "68c7fda6d0c1757b353d406b21223295c9830767"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@lage-run/cli",
|
|
52
|
+
"comment": "Bump @lage-run/reporters to v0.2.16",
|
|
53
|
+
"commit": "68c7fda6d0c1757b353d406b21223295c9830767"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"date": "Mon, 03 Oct 2022 19:57:28 GMT",
|
|
6
60
|
"tag": "@lage-run/cli_v0.3.18",
|
|
7
61
|
"version": "0.3.18",
|
|
8
62
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
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 03:38:40 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.4.0
|
|
8
|
+
|
|
9
|
+
Tue, 04 Oct 2022 03:38:40 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Uses the new scheduler (kchau@microsoft.com)
|
|
14
|
+
- Bump @lage-run/scheduler to v0.4.0
|
|
15
|
+
- Bump @lage-run/reporters to v0.2.17
|
|
16
|
+
|
|
17
|
+
## 0.3.19
|
|
18
|
+
|
|
19
|
+
Mon, 03 Oct 2022 20:41:25 GMT
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- moved reporters init code in @lage-run/reporters (kchau@microsoft.com)
|
|
24
|
+
- Bump @lage-run/scheduler to v0.3.14
|
|
25
|
+
- Bump @lage-run/reporters to v0.2.16
|
|
26
|
+
|
|
7
27
|
## 0.3.18
|
|
8
28
|
|
|
9
|
-
Mon, 03 Oct 2022 19:57:
|
|
29
|
+
Mon, 03 Oct 2022 19:57:28 GMT
|
|
10
30
|
|
|
11
31
|
### Patches
|
|
12
32
|
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.cacheAction = void 0;
|
|
7
7
|
const clearCache_1 = require("./clearCache");
|
|
8
8
|
const getConfig_1 = require("../../config/getConfig");
|
|
9
|
-
const initialize_1 = require("../../reporters/initialize");
|
|
10
9
|
const pruneCache_1 = require("./pruneCache");
|
|
11
10
|
const logger_1 = __importDefault(require("@lage-run/logger"));
|
|
11
|
+
const reporters_1 = require("@lage-run/reporters");
|
|
12
12
|
async function cacheAction(options, command) {
|
|
13
13
|
const cwd = process.cwd();
|
|
14
14
|
const config = (0, getConfig_1.getConfig)(cwd);
|
|
15
15
|
const logger = (0, logger_1.default)();
|
|
16
|
-
(0,
|
|
16
|
+
(0, reporters_1.initializeReporters)(logger, options);
|
|
17
17
|
if (options.clear) {
|
|
18
18
|
return await (0, clearCache_1.clearCache)(process.cwd(), config.cacheOptions.internalCacheFolder, logger);
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/cache/action.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA0C;AAE1C,sDAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/cache/action.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA0C;AAE1C,sDAAmD;AACnD,6CAA0C;AAC1C,8DAA4C;AAC5C,mDAA0D;AAQnD,KAAK,UAAU,WAAW,CAAC,OAAqB,EAAE,OAAgB;IACvE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,IAAA,gBAAY,GAAE,CAAC;IAE9B,IAAA,+BAAmB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErC,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,OAAO,MAAM,IAAA,uBAAU,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;KACzF;SAAM,IAAI,OAAO,CAAC,KAAK,EAAE;QACxB,OAAO,MAAM,IAAA,uBAAU,EAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;KACxG;IAED,OAAO,CAAC,IAAI,EAAE,CAAC;AACjB,CAAC;AAdD,kCAcC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import type { ReporterInitOptions } from "
|
|
2
|
+
import type { ReporterInitOptions } from "@lage-run/reporters";
|
|
3
3
|
interface RunOptions extends ReporterInitOptions {
|
|
4
4
|
concurrency: number;
|
|
5
5
|
profile: string | boolean | undefined;
|
|
@@ -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,8 +9,9 @@ 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
|
-
const
|
|
14
|
+
const reporters_1 = require("@lage-run/reporters");
|
|
14
15
|
const isRunningFromCI_1 = require("../isRunningFromCI");
|
|
15
16
|
const scheduler_1 = require("@lage-run/scheduler");
|
|
16
17
|
const target_graph_1 = require("@lage-run/target-graph");
|
|
@@ -23,12 +24,12 @@ 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
|
|
30
31
|
const logger = (0, logger_1.default)();
|
|
31
|
-
(0,
|
|
32
|
+
(0, reporters_1.initializeReporters)(logger, options);
|
|
32
33
|
if (options.profile !== undefined) {
|
|
33
34
|
const reporter = (0, createProfileReporter_1.createProfileReporter)(options);
|
|
34
35
|
logger.addReporter(reporter);
|
|
@@ -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("@lage-run/scheduler/lib/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("@lage-run/scheduler/lib/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,
|
|
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,I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,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEvD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QACjC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;KACtB;IAED,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE;QACvC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;AACH,CAAC;AA/GD,8BA+GC"}
|
|
@@ -33,7 +33,7 @@ exports.runCommand = runCommand;
|
|
|
33
33
|
.option("--reset-cache", "resets the cache, filling it after a run")
|
|
34
34
|
.option("--skip-local-cache", "skips caching locally (defaults to true in CI environments)", isRunningFromCI_1.isRunningFromCI)
|
|
35
35
|
.option("--profile [profile]", "writes a run profile into a file that can be processed by Chromium devtool")
|
|
36
|
-
.option("--nodearg <nodeArg>", 'arguments to be passed to node (e.g. --nodearg="--max_old_space_size=1234 --heap-prof" - set via "NODE_OPTIONS" environment variable')
|
|
36
|
+
.option("--nodearg|--node-arg <nodeArg>", 'arguments to be passed to node (e.g. --nodearg="--max_old_space_size=1234 --heap-prof" - set via "NODE_OPTIONS" environment variable')
|
|
37
37
|
.option("--continue", "continues the run even on error")
|
|
38
38
|
.allowUnknownOption(true)
|
|
39
39
|
.addHelpCommand("[run] command1 [command2...commandN] [options]", "run commands")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/run/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA4C;AAC5C,4CAAoB;AACpB,qCAAqC;AACrC,0DAAuD;AACvD,wDAAqD;AAErD,MAAM,UAAU,GAAG,IAAI,mBAAO,CAAC,KAAK,CAAC,CAAC;AAgG7B,gCAAU;AA9FnB,IAAA,mCAAgB,EAAC,UAAU,CAAC;KACzB,MAAM,CAAC,kBAAS,CAAC;KACjB,MAAM,CACL,uBAAuB,EACvB,aAAa,EACb,CAAC,KAAK,EAAE,EAA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;;;;;;;;;;;;;;;;;CAsDH,CACE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ConfigOptions } from "../types/ConfigOptions";
|
|
1
|
+
import type { ConfigOptions } from "../types/ConfigOptions";
|
|
2
2
|
export declare function getConfig(cwd: string): ConfigOptions;
|
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,MA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,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,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,IA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
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.0",
|
|
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
|
},
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from "@lage-run/logger";
|
|
2
|
-
import { JsonReporter, AdoReporter, LogReporter } from "@lage-run/reporters";
|
|
3
|
-
export declare function createReporter({ reporter, grouped, verbose, logLevel, }: {
|
|
4
|
-
reporter: string;
|
|
5
|
-
grouped?: boolean;
|
|
6
|
-
verbose?: boolean;
|
|
7
|
-
logLevel?: LogLevel;
|
|
8
|
-
}): JsonReporter | AdoReporter | LogReporter;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createReporter = void 0;
|
|
4
|
-
const logger_1 = require("@lage-run/logger");
|
|
5
|
-
const reporters_1 = require("@lage-run/reporters");
|
|
6
|
-
function createReporter({ reporter = "npmLog", grouped = false, verbose = false, logLevel = logger_1.LogLevel.info, }) {
|
|
7
|
-
switch (reporter) {
|
|
8
|
-
case "json":
|
|
9
|
-
return new reporters_1.JsonReporter({ logLevel });
|
|
10
|
-
case "azureDevops":
|
|
11
|
-
case "adoLog":
|
|
12
|
-
return new reporters_1.AdoReporter({ grouped, logLevel: verbose ? logger_1.LogLevel.verbose : logLevel });
|
|
13
|
-
default:
|
|
14
|
-
return new reporters_1.LogReporter({ grouped, logLevel: verbose ? logger_1.LogLevel.verbose : logLevel });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.createReporter = createReporter;
|
|
18
|
-
//# sourceMappingURL=createReporter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createReporter.js","sourceRoot":"","sources":["../../src/reporters/createReporter.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,mDAA6E;AAE7E,SAAgB,cAAc,CAAC,EAC7B,QAAQ,GAAG,QAAQ,EACnB,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,iBAAQ,CAAC,IAAI,GAMzB;IACC,QAAQ,QAAQ,EAAE;QAChB,KAAK,MAAM;YACT,OAAO,IAAI,wBAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxC,KAAK,aAAa,CAAC;QACnB,KAAK,QAAQ;YACX,OAAO,IAAI,uBAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACvF;YACE,OAAO,IAAI,uBAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;KACxF;AACH,CAAC;AApBD,wCAoBC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Reporter } from "@lage-run/logger";
|
|
2
|
-
import { Logger } from "@lage-run/logger";
|
|
3
|
-
import { ReporterInitOptions } from "../types/LoggerOptions";
|
|
4
|
-
export declare function initializeReporters(logger: Logger, options: ReporterInitOptions): Reporter<import("@lage-run/logger").LogStructuredData>[];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initializeReporters = void 0;
|
|
4
|
-
const logger_1 = require("@lage-run/logger");
|
|
5
|
-
const createReporter_1 = require("./createReporter");
|
|
6
|
-
function initializeReporters(logger, options) {
|
|
7
|
-
const { reporter, verbose, grouped, logLevel } = options;
|
|
8
|
-
const reporterOptions = Array.isArray(reporter) ? reporter : [reporter];
|
|
9
|
-
for (const reporter of reporterOptions) {
|
|
10
|
-
const reporterInstance = (0, createReporter_1.createReporter)({
|
|
11
|
-
verbose,
|
|
12
|
-
grouped,
|
|
13
|
-
logLevel: logger_1.LogLevel[logLevel],
|
|
14
|
-
reporter: reporter,
|
|
15
|
-
});
|
|
16
|
-
logger.addReporter(reporterInstance);
|
|
17
|
-
}
|
|
18
|
-
return logger.reporters;
|
|
19
|
-
}
|
|
20
|
-
exports.initializeReporters = initializeReporters;
|
|
21
|
-
//# sourceMappingURL=initialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","sourceRoot":"","sources":["../../src/reporters/initialize.ts"],"names":[],"mappings":";;;AACA,6CAAoD;AAEpD,qDAAkD;AAElD,SAAgB,mBAAmB,CAAC,MAAc,EAAE,OAA4B;IAC9E,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACzD,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxE,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE;QACtC,MAAM,gBAAgB,GAAG,IAAA,+BAAc,EAAC;YACtC,OAAO;YACP,OAAO;YACP,QAAQ,EAAE,iBAAQ,CAAC,QAAQ,CAAC;YAC5B,QAAQ,EAAE,QAAkB;SAC7B,CAAC,CAAC;QACH,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;KACtC;IAED,OAAO,MAAM,CAAC,SAAS,CAAC;AAC1B,CAAC;AAdD,kDAcC"}
|