@lage-run/cli 0.7.1 → 0.7.3
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 +37 -1
- package/CHANGELOG.md +19 -2
- package/lib/commands/cache/action.d.ts +1 -1
- package/lib/commands/cache/action.js +2 -2
- package/lib/commands/createReporter.d.ts +3 -0
- package/lib/commands/createReporter.js +46 -0
- package/lib/commands/initializeReporters.d.ts +3 -0
- package/lib/commands/initializeReporters.js +29 -0
- package/lib/commands/run/action.d.ts +1 -1
- package/lib/commands/run/infoAction.d.ts +1 -1
- package/lib/commands/run/runAction.d.ts +1 -1
- package/lib/commands/run/runAction.js +2 -10
- package/lib/commands/run/watchAction.d.ts +1 -1
- package/lib/types/ReporterInitOptions.d.ts +10 -0
- package/lib/types/ReporterInitOptions.js +4 -0
- package/package.json +3 -3
- package/lib/commands/run/createProfileReporter.d.ts +0 -5
- package/lib/commands/run/createProfileReporter.js +0 -16
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Tue, 31 Jan 2023 23:54:40 GMT",
|
|
6
|
+
"tag": "@lage-run/cli_v0.7.3",
|
|
7
|
+
"version": "0.7.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"comment": "Bump @lage-run/scheduler to v0.8.2",
|
|
14
|
+
"commit": "9340358c80d388e0d56b40d1fdb965e1b4e20454"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 31 Jan 2023 18:24:39 GMT",
|
|
21
|
+
"tag": "@lage-run/cli_v0.7.2",
|
|
22
|
+
"version": "0.7.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "kchau@microsoft.com",
|
|
27
|
+
"package": "@lage-run/cli",
|
|
28
|
+
"commit": "ac2bf4264854e06e86236a54421374b2c2602f7b",
|
|
29
|
+
"comment": "switch back to old log reporter when \"verbose\" or \"grouped\" are used"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "beachball",
|
|
33
|
+
"package": "@lage-run/cli",
|
|
34
|
+
"comment": "Bump @lage-run/reporters to v1.0.0",
|
|
35
|
+
"commit": "ac2bf4264854e06e86236a54421374b2c2602f7b"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Mon, 30 Jan 2023 17:26:59 GMT",
|
|
6
42
|
"tag": "@lage-run/cli_v0.7.1",
|
|
7
43
|
"version": "0.7.1",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
# Change Log - @lage-run/cli
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 31 Jan 2023 23:54:40 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.7.3
|
|
8
|
+
|
|
9
|
+
Tue, 31 Jan 2023 23:54:40 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @lage-run/scheduler to v0.8.2
|
|
14
|
+
|
|
15
|
+
## 0.7.2
|
|
16
|
+
|
|
17
|
+
Tue, 31 Jan 2023 18:24:39 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- switch back to old log reporter when "verbose" or "grouped" are used (kchau@microsoft.com)
|
|
22
|
+
- Bump @lage-run/reporters to v1.0.0
|
|
23
|
+
|
|
7
24
|
## 0.7.1
|
|
8
25
|
|
|
9
|
-
Mon, 30 Jan 2023 17:26:
|
|
26
|
+
Mon, 30 Jan 2023 17:26:59 GMT
|
|
10
27
|
|
|
11
28
|
### Patches
|
|
12
29
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
|
-
import type { ReporterInitOptions } from "
|
|
2
|
+
import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
|
|
3
3
|
interface CacheOptions extends ReporterInitOptions {
|
|
4
4
|
prune?: number;
|
|
5
5
|
clear?: boolean;
|
|
@@ -10,7 +10,7 @@ const _clearCacheJs = require("./clearCache.js");
|
|
|
10
10
|
const _getConfigJs = require("../../config/getConfig.js");
|
|
11
11
|
const _pruneCacheJs = require("./pruneCache.js");
|
|
12
12
|
const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
|
|
13
|
-
const
|
|
13
|
+
const _initializeReportersJs = require("../initializeReporters.js");
|
|
14
14
|
function _interopRequireDefault(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : {
|
|
16
16
|
default: obj
|
|
@@ -20,7 +20,7 @@ async function cacheAction(options, command) {
|
|
|
20
20
|
const cwd = process.cwd();
|
|
21
21
|
const config = await (0, _getConfigJs.getConfig)(cwd);
|
|
22
22
|
const logger = (0, _logger.default)();
|
|
23
|
-
(0,
|
|
23
|
+
(0, _initializeReportersJs.initializeReporters)(logger, options);
|
|
24
24
|
if (options.clear) {
|
|
25
25
|
return await (0, _clearCacheJs.clearCache)({
|
|
26
26
|
cwd: process.cwd(),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JsonReporter, AdoReporter, LogReporter, ProgressReporter, ChromeTraceEventsReporter } from "@lage-run/reporters";
|
|
2
|
+
import type { ReporterInitOptions } from "../types/ReporterInitOptions.js";
|
|
3
|
+
export declare function createReporter(reporter: string, options: ReporterInitOptions): ChromeTraceEventsReporter | JsonReporter | AdoReporter | LogReporter | ProgressReporter;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "createReporter", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>createReporter
|
|
8
|
+
});
|
|
9
|
+
const _logger = require("@lage-run/logger");
|
|
10
|
+
const _reporters = require("@lage-run/reporters");
|
|
11
|
+
function createReporter(reporter, options) {
|
|
12
|
+
const { verbose , grouped , logLevel: logLevelName , concurrency , profile } = options;
|
|
13
|
+
const logLevel = _logger.LogLevel[logLevelName];
|
|
14
|
+
switch(reporter){
|
|
15
|
+
case "profile":
|
|
16
|
+
return new _reporters.ChromeTraceEventsReporter({
|
|
17
|
+
concurrency,
|
|
18
|
+
outputFile: typeof profile === "string" ? profile : undefined
|
|
19
|
+
});
|
|
20
|
+
case "json":
|
|
21
|
+
return new _reporters.JsonReporter({
|
|
22
|
+
logLevel
|
|
23
|
+
});
|
|
24
|
+
case "azureDevops":
|
|
25
|
+
case "adoLog":
|
|
26
|
+
return new _reporters.AdoReporter({
|
|
27
|
+
grouped,
|
|
28
|
+
logLevel: verbose ? _logger.LogLevel.verbose : logLevel
|
|
29
|
+
});
|
|
30
|
+
case "old":
|
|
31
|
+
return new _reporters.LogReporter({
|
|
32
|
+
grouped,
|
|
33
|
+
logLevel: verbose ? _logger.LogLevel.verbose : logLevel
|
|
34
|
+
});
|
|
35
|
+
default:
|
|
36
|
+
if (verbose || grouped) {
|
|
37
|
+
return new _reporters.LogReporter({
|
|
38
|
+
grouped,
|
|
39
|
+
logLevel: verbose ? _logger.LogLevel.verbose : logLevel
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return new _reporters.ProgressReporter({
|
|
43
|
+
concurrency
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Logger } from "@lage-run/logger";
|
|
2
|
+
import type { ReporterInitOptions } from "../types/ReporterInitOptions.js";
|
|
3
|
+
export declare function initializeReporters(logger: Logger, options: ReporterInitOptions): import("@lage-run/logger").Reporter<import("@lage-run/logger").LogStructuredData>[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "initializeReporters", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>initializeReporters
|
|
8
|
+
});
|
|
9
|
+
const _createReporterJs = require("./createReporter.js");
|
|
10
|
+
function initializeReporters(logger, options) {
|
|
11
|
+
const { reporter } = options;
|
|
12
|
+
// filter out falsy values (e.g. undefined) from the reporter array
|
|
13
|
+
const reporterOptions = (Array.isArray(reporter) ? reporter : [
|
|
14
|
+
reporter
|
|
15
|
+
]).filter(Boolean);
|
|
16
|
+
if (reporterOptions.length === 0) {
|
|
17
|
+
// "default" is just a dummy name to trigger the default case in createReporter
|
|
18
|
+
reporterOptions.push("default");
|
|
19
|
+
}
|
|
20
|
+
// add profile reporter if --profile is passed
|
|
21
|
+
if (options.profile) {
|
|
22
|
+
reporterOptions.push("profile");
|
|
23
|
+
}
|
|
24
|
+
for (const reporterName of reporterOptions){
|
|
25
|
+
const reporterInstance = (0, _createReporterJs.createReporter)(reporterName, options);
|
|
26
|
+
logger.addReporter(reporterInstance);
|
|
27
|
+
}
|
|
28
|
+
return logger.reporters;
|
|
29
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
|
-
import type { ReporterInitOptions } from "
|
|
2
|
+
import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
|
|
3
3
|
interface RunOptions extends ReporterInitOptions {
|
|
4
4
|
concurrency: number;
|
|
5
5
|
profile: string | boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
|
-
import type { ReporterInitOptions } from "
|
|
2
|
+
import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
|
|
3
3
|
interface RunOptions extends ReporterInitOptions {
|
|
4
4
|
dependencies: boolean;
|
|
5
5
|
dependents: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
|
-
import type { ReporterInitOptions } from "
|
|
2
|
+
import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
|
|
3
3
|
interface RunOptions extends ReporterInitOptions {
|
|
4
4
|
concurrency: number;
|
|
5
5
|
maxWorkersPerTask: string[];
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "runAction", {
|
|
|
7
7
|
get: ()=>runAction
|
|
8
8
|
});
|
|
9
9
|
const _createCacheProviderJs = require("./createCacheProvider.js");
|
|
10
|
-
const _createProfileReporterJs = require("./createProfileReporter.js");
|
|
11
10
|
const _createTargetGraphJs = require("./createTargetGraph.js");
|
|
12
11
|
const _filterArgsForTasksJs = require("./filterArgsForTasks.js");
|
|
13
12
|
const _filterPipelineDefinitionsJs = require("./filterPipelineDefinitions.js");
|
|
@@ -15,7 +14,7 @@ const _findNpmClient = require("@lage-run/find-npm-client");
|
|
|
15
14
|
const _getConfigJs = require("../../config/getConfig.js");
|
|
16
15
|
const _getMaxWorkersPerTaskJs = require("../../config/getMaxWorkersPerTask.js");
|
|
17
16
|
const _workspaceTools = require("workspace-tools");
|
|
18
|
-
const
|
|
17
|
+
const _initializeReportersJs = require("../initializeReporters.js");
|
|
19
18
|
const _scheduler = require("@lage-run/scheduler");
|
|
20
19
|
const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
|
|
21
20
|
const _getConcurrencyJs = require("../../config/getConcurrency.js");
|
|
@@ -33,17 +32,10 @@ async function runAction(options, command) {
|
|
|
33
32
|
const allowNoTargetRuns = options.allowNoTargetRuns || config.allowNoTargetRuns;
|
|
34
33
|
// Configure logger
|
|
35
34
|
const logger = (0, _logger.default)();
|
|
36
|
-
(0,
|
|
35
|
+
(0, _initializeReportersJs.initializeReporters)(logger, {
|
|
37
36
|
...options,
|
|
38
37
|
concurrency
|
|
39
38
|
});
|
|
40
|
-
if (options.profile !== undefined) {
|
|
41
|
-
const reporter = (0, _createProfileReporterJs.createProfileReporter)({
|
|
42
|
-
concurrency,
|
|
43
|
-
profile: options.profile
|
|
44
|
-
});
|
|
45
|
-
logger.addReporter(reporter);
|
|
46
|
-
}
|
|
47
39
|
// Build Target Graph
|
|
48
40
|
const root = (0, _workspaceTools.getWorkspaceRoot)(process.cwd());
|
|
49
41
|
const packageInfos = (0, _workspaceTools.getPackageInfos)(root);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
|
-
import type { ReporterInitOptions } from "
|
|
2
|
+
import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
|
|
3
3
|
interface RunOptions extends ReporterInitOptions {
|
|
4
4
|
concurrency: number;
|
|
5
5
|
maxWorkersPerTask: string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LogLevel } from "@lage-run/logger";
|
|
2
|
+
export interface ReporterInitOptions {
|
|
3
|
+
reporter: string[] | string;
|
|
4
|
+
progress: boolean;
|
|
5
|
+
verbose: boolean;
|
|
6
|
+
grouped: boolean;
|
|
7
|
+
concurrency: number;
|
|
8
|
+
logLevel: keyof typeof LogLevel;
|
|
9
|
+
profile?: boolean | string;
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Command Line Interface for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/microsoft/lage"
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@lage-run/find-npm-client": "^0.1.4",
|
|
22
22
|
"@lage-run/logger": "^1.2.2",
|
|
23
|
-
"@lage-run/scheduler": "^0.8.
|
|
23
|
+
"@lage-run/scheduler": "^0.8.2",
|
|
24
24
|
"@lage-run/scheduler-types": "^0.3.0",
|
|
25
25
|
"@lage-run/target-graph": "^0.6.1",
|
|
26
26
|
"@lage-run/cache": "^0.2.3",
|
|
27
|
-
"@lage-run/reporters": "^0.
|
|
27
|
+
"@lage-run/reporters": "^1.0.0",
|
|
28
28
|
"commander": "^9.4.0",
|
|
29
29
|
"workspace-tools": "^0.29.0",
|
|
30
30
|
"chokidar": "3.5.3",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "createProfileReporter", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: ()=>createProfileReporter
|
|
8
|
-
});
|
|
9
|
-
const _reporters = require("@lage-run/reporters");
|
|
10
|
-
function createProfileReporter(options) {
|
|
11
|
-
const { concurrency , profile } = options;
|
|
12
|
-
return new _reporters.ChromeTraceEventsReporter({
|
|
13
|
-
concurrency,
|
|
14
|
-
outputFile: typeof profile === "string" ? profile : undefined
|
|
15
|
-
});
|
|
16
|
-
}
|