@lage-run/cli 0.1.4 → 0.2.2
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 +76 -1
- package/CHANGELOG.md +31 -2
- package/lib/cli.js +2 -0
- package/lib/cli.js.map +1 -1
- package/lib/commands/addLoggerOptions.d.ts +2 -0
- package/lib/commands/addLoggerOptions.js +12 -0
- package/lib/commands/addLoggerOptions.js.map +1 -0
- package/lib/commands/cache/action.d.ts +8 -0
- package/lib/commands/cache/action.js +25 -0
- package/lib/commands/cache/action.js.map +1 -0
- package/lib/commands/cache/cacheDir.d.ts +4 -0
- package/lib/commands/cache/cacheDir.js +23 -0
- package/lib/commands/cache/cacheDir.js.map +1 -0
- package/lib/commands/cache/clearCache.d.ts +2 -0
- package/lib/commands/cache/clearCache.js +32 -0
- package/lib/commands/cache/clearCache.js.map +1 -0
- package/lib/commands/cache/index.d.ts +3 -0
- package/lib/commands/cache/index.js +13 -0
- package/lib/commands/cache/index.js.map +1 -0
- package/lib/commands/cache/pruneCache.d.ts +2 -0
- package/lib/commands/cache/pruneCache.js +33 -0
- package/lib/commands/cache/pruneCache.js.map +1 -0
- package/lib/commands/run/{runAction.d.ts → action.d.ts} +2 -6
- package/lib/commands/run/{runAction.js → action.js} +8 -40
- package/lib/commands/run/action.js.map +1 -0
- package/lib/commands/run/index.js +4 -6
- package/lib/commands/run/index.js.map +1 -1
- package/lib/{createReporter.d.ts → reporters/createReporter.d.ts} +0 -0
- package/lib/{createReporter.js → reporters/createReporter.js} +0 -0
- package/lib/reporters/createReporter.js.map +1 -0
- package/lib/reporters/initialize.d.ts +4 -0
- package/lib/reporters/initialize.js +21 -0
- package/lib/reporters/initialize.js.map +1 -0
- package/lib/types/LoggerOptions.d.ts +6 -0
- package/package.json +7 -7
- package/lib/commands/run/runAction.js.map +0 -1
- package/lib/createReporter.js.map +0 -1
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,82 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 25 Aug 2022 20:06:32 GMT",
|
|
6
|
+
"tag": "@lage-run/cli_v0.2.2",
|
|
7
|
+
"version": "0.2.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kchau@microsoft.com",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"commit": "4ee91529498d9601050df121f3b9a3db634ae068",
|
|
14
|
+
"comment": "Fixes where the reporter instances can be found (from logger instance)"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 24 Aug 2022 22:26:03 GMT",
|
|
21
|
+
"tag": "@lage-run/cli_v0.2.1",
|
|
22
|
+
"version": "0.2.1",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "renovate@whitesourcesoftware.com",
|
|
27
|
+
"package": "@lage-run/cli",
|
|
28
|
+
"commit": "ae1468bf230ea12b1910214d0ce394da75675d09",
|
|
29
|
+
"comment": "Update dependency @types/node to v14.18.26"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "beachball",
|
|
33
|
+
"package": "@lage-run/cli",
|
|
34
|
+
"comment": "Bump @lage-run/logger to v1.1.3",
|
|
35
|
+
"commit": "ae1468bf230ea12b1910214d0ce394da75675d09"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "@lage-run/cli",
|
|
40
|
+
"comment": "Bump @lage-run/scheduler to v0.1.7",
|
|
41
|
+
"commit": "ae1468bf230ea12b1910214d0ce394da75675d09"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@lage-run/cli",
|
|
46
|
+
"comment": "Bump @lage-run/target-graph to v0.2.2",
|
|
47
|
+
"commit": "ae1468bf230ea12b1910214d0ce394da75675d09"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@lage-run/cli",
|
|
52
|
+
"comment": "Bump @lage-run/cache to v0.1.6",
|
|
53
|
+
"commit": "ae1468bf230ea12b1910214d0ce394da75675d09"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@lage-run/cli",
|
|
58
|
+
"comment": "Bump @lage-run/reporters to v0.1.6",
|
|
59
|
+
"commit": "ae1468bf230ea12b1910214d0ce394da75675d09"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Wed, 24 Aug 2022 20:50:50 GMT",
|
|
66
|
+
"tag": "@lage-run/cli_v0.2.0",
|
|
67
|
+
"version": "0.2.0",
|
|
68
|
+
"comments": {
|
|
69
|
+
"minor": [
|
|
70
|
+
{
|
|
71
|
+
"author": "ken@gizzar.com",
|
|
72
|
+
"package": "@lage-run/cli",
|
|
73
|
+
"commit": "bc21cddad948d0ff517a3a1f8a4cb5cc249af03b",
|
|
74
|
+
"comment": "adds cache command"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"date": "Wed, 24 Aug 2022 16:23:48 GMT",
|
|
6
81
|
"tag": "@lage-run/cli_v0.1.4",
|
|
7
82
|
"version": "0.1.4",
|
|
8
83
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
# Change Log - @lage-run/cli
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 25 Aug 2022 20:06:32 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.2.2
|
|
8
|
+
|
|
9
|
+
Thu, 25 Aug 2022 20:06:32 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Fixes where the reporter instances can be found (from logger instance) (kchau@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 0.2.1
|
|
16
|
+
|
|
17
|
+
Wed, 24 Aug 2022 22:26:03 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Update dependency @types/node to v14.18.26 (renovate@whitesourcesoftware.com)
|
|
22
|
+
- Bump @lage-run/logger to v1.1.3
|
|
23
|
+
- Bump @lage-run/scheduler to v0.1.7
|
|
24
|
+
- Bump @lage-run/target-graph to v0.2.2
|
|
25
|
+
- Bump @lage-run/cache to v0.1.6
|
|
26
|
+
- Bump @lage-run/reporters to v0.1.6
|
|
27
|
+
|
|
28
|
+
## 0.2.0
|
|
29
|
+
|
|
30
|
+
Wed, 24 Aug 2022 20:50:50 GMT
|
|
31
|
+
|
|
32
|
+
### Minor changes
|
|
33
|
+
|
|
34
|
+
- adds cache command (ken@gizzar.com)
|
|
35
|
+
|
|
7
36
|
## 0.1.4
|
|
8
37
|
|
|
9
|
-
Wed, 24 Aug 2022 16:23:
|
|
38
|
+
Wed, 24 Aug 2022 16:23:48 GMT
|
|
10
39
|
|
|
11
40
|
### Patches
|
|
12
41
|
|
package/lib/cli.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const commander_1 = require("commander");
|
|
4
4
|
const run_1 = require("./commands/run");
|
|
5
|
+
const cache_1 = require("./commands/cache");
|
|
5
6
|
async function main() {
|
|
6
7
|
const program = new commander_1.Command();
|
|
7
8
|
program.addCommand(run_1.runCommand, { isDefault: true });
|
|
9
|
+
program.addCommand(cache_1.cacheCommand);
|
|
8
10
|
await program.parseAsync(process.argv);
|
|
9
11
|
}
|
|
10
12
|
main().catch((err) => {
|
package/lib/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AAEpC,wCAA4C;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AAEpC,wCAA4C;AAC5C,4CAAgD;AAEhD,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;IAC9B,OAAO,CAAC,UAAU,CAAC,gBAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,UAAU,CAAC,oBAAY,CAAC,CAAC;IAEjC,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addLoggerOptions = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
function addLoggerOptions(program) {
|
|
6
|
+
return program
|
|
7
|
+
.option("--reporter <reporter...>", "reporter", "npmLog")
|
|
8
|
+
.addOption(new commander_1.Option("--log-level <level>", "log level").choices(["info", "warn", "error", "verbose", "silly"]).conflicts("--verbose"))
|
|
9
|
+
.option("--verbose", "verbose output");
|
|
10
|
+
}
|
|
11
|
+
exports.addLoggerOptions = addLoggerOptions;
|
|
12
|
+
//# sourceMappingURL=addLoggerOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addLoggerOptions.js","sourceRoot":"","sources":["../../src/commands/addLoggerOptions.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAE5C,SAAgB,gBAAgB,CAAC,OAAgB;IAC/C,OAAO,OAAO;SACX,MAAM,CAAC,0BAA0B,EAAE,UAAU,EAAE,QAAQ,CAAC;SACxD,SAAS,CAAC,IAAI,kBAAM,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;SACvI,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;AAC3C,CAAC;AALD,4CAKC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { ReporterInitOptions } from "../../types/LoggerOptions";
|
|
3
|
+
interface CacheOptions extends ReporterInitOptions {
|
|
4
|
+
prune?: number;
|
|
5
|
+
clear?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function cacheAction(options: CacheOptions, command: Command): Promise<void>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
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.cacheAction = void 0;
|
|
7
|
+
const clearCache_1 = require("./clearCache");
|
|
8
|
+
const getConfig_1 = require("../../config/getConfig");
|
|
9
|
+
const initialize_1 = require("../../reporters/initialize");
|
|
10
|
+
const pruneCache_1 = require("./pruneCache");
|
|
11
|
+
const logger_1 = __importDefault(require("@lage-run/logger"));
|
|
12
|
+
async function cacheAction(options, command) {
|
|
13
|
+
const cwd = process.cwd();
|
|
14
|
+
const config = (0, getConfig_1.getConfig)(cwd);
|
|
15
|
+
const logger = (0, logger_1.default)();
|
|
16
|
+
(0, initialize_1.initializeReporters)(logger, options);
|
|
17
|
+
if (options.prune) {
|
|
18
|
+
await (0, pruneCache_1.pruneCache)(options.prune, process.cwd(), config.cacheOptions.internalCacheFolder, logger);
|
|
19
|
+
}
|
|
20
|
+
if (options.clear) {
|
|
21
|
+
await (0, clearCache_1.clearCache)(process.cwd(), config.cacheOptions.internalCacheFolder, logger);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.cacheAction = cacheAction;
|
|
25
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/cache/action.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA0C;AAE1C,sDAAmD;AACnD,2DAAiE;AACjE,6CAA0C;AAC1C,8DAA4C;AAQrC,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,gCAAmB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErC,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,MAAM,IAAA,uBAAU,EAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;KACjG;IAED,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,MAAM,IAAA,uBAAU,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;KAClF;AACH,CAAC;AAdD,kCAcC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.removeCacheEntry = exports.getCacheDir = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const promises_1 = require("fs/promises");
|
|
9
|
+
function getCacheDir(workspace, internalCacheFolder) {
|
|
10
|
+
const cacheFolder = !internalCacheFolder ? undefined : internalCacheFolder;
|
|
11
|
+
return path_1.default.join(workspace, cacheFolder !== null && cacheFolder !== void 0 ? cacheFolder : "node_modules/.cache/backfill");
|
|
12
|
+
}
|
|
13
|
+
exports.getCacheDir = getCacheDir;
|
|
14
|
+
async function removeCacheEntry(entryPath, entryStat) {
|
|
15
|
+
if (entryStat.isDirectory()) {
|
|
16
|
+
(0, promises_1.rm)(entryPath, { recursive: true });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
(0, promises_1.unlink)(entryPath);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.removeCacheEntry = removeCacheEntry;
|
|
23
|
+
//# sourceMappingURL=cacheDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheDir.js","sourceRoot":"","sources":["../../../src/commands/cache/cacheDir.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AACxB,0CAAyC;AAEzC,SAAgB,WAAW,CAAC,SAAiB,EAAE,mBAA2B;IACxE,MAAM,WAAW,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC3E,OAAO,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,8BAA8B,CAAC,CAAC;AAC7E,CAAC;AAHD,kCAGC;AAEM,KAAK,UAAU,gBAAgB,CAAC,SAAiB,EAAE,SAAmB;IAC3E,IAAI,SAAS,CAAC,WAAW,EAAE,EAAE;QAC3B,IAAA,aAAE,EAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KACpC;SAAM;QACL,IAAA,iBAAM,EAAC,SAAS,CAAC,CAAC;KACnB;AACH,CAAC;AAND,4CAMC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.clearCache = void 0;
|
|
7
|
+
const cacheDir_1 = require("./cacheDir");
|
|
8
|
+
const workspace_tools_1 = require("workspace-tools");
|
|
9
|
+
const promises_1 = require("fs/promises");
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
async function clearCache(cwd, internalCacheFolder, logger) {
|
|
13
|
+
const workspaceRoot = (0, workspace_tools_1.getWorkspaceRoot)(cwd);
|
|
14
|
+
if (!workspaceRoot) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const workspaces = (0, workspace_tools_1.getWorkspaces)(workspaceRoot);
|
|
18
|
+
for (const workspace of workspaces) {
|
|
19
|
+
const cachePath = (0, cacheDir_1.getCacheDir)(workspace.path, internalCacheFolder);
|
|
20
|
+
if (fs_1.default.existsSync(cachePath)) {
|
|
21
|
+
logger.info(`clearing cache for ${workspace.name}`);
|
|
22
|
+
const entries = fs_1.default.readdirSync(cachePath);
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
const entryPath = path_1.default.join(cachePath, entry);
|
|
25
|
+
const entryStat = await (0, promises_1.stat)(entryPath);
|
|
26
|
+
await (0, cacheDir_1.removeCacheEntry)(entryPath, entryStat);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.clearCache = clearCache;
|
|
32
|
+
//# sourceMappingURL=clearCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearCache.js","sourceRoot":"","sources":["../../../src/commands/cache/clearCache.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA2D;AAC3D,qDAAkE;AAElE,0CAAmC;AACnC,4CAAoB;AACpB,gDAAwB;AAEjB,KAAK,UAAU,UAAU,CAAC,GAAW,EAAE,mBAA2B,EAAE,MAAc;IACvF,MAAM,aAAa,GAAG,IAAA,kCAAgB,EAAC,GAAG,CAAC,CAAC;IAE5C,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO;KACR;IAED,MAAM,UAAU,GAAG,IAAA,+BAAa,EAAC,aAAa,CAAC,CAAC;IAEhD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,SAAS,GAAG,IAAA,sBAAW,EAAC,SAAS,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAEnE,IAAI,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC5B,MAAM,CAAC,IAAI,CAAC,sBAAsB,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;YACpD,MAAM,OAAO,GAAG,YAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YAE1C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;gBAC3B,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAC9C,MAAM,SAAS,GAAG,MAAM,IAAA,eAAI,EAAC,SAAS,CAAC,CAAC;gBAExC,MAAM,IAAA,2BAAgB,EAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC9C;SACF;KACF;AACH,CAAC;AAxBD,gCAwBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cacheCommand = void 0;
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const addLoggerOptions_1 = require("../addLoggerOptions");
|
|
6
|
+
const action_1 = require("./action");
|
|
7
|
+
const cacheCommand = new commander_1.Command("cache");
|
|
8
|
+
exports.cacheCommand = cacheCommand;
|
|
9
|
+
(0, addLoggerOptions_1.addLoggerOptions)(cacheCommand)
|
|
10
|
+
.action(action_1.cacheAction)
|
|
11
|
+
.addOption(new commander_1.Option("--prune <days>", "Prunes cache older than certain number of <days>").argParser(parseInt).default(30).conflicts("--clear"))
|
|
12
|
+
.option("--clear", "Clears the cache locally");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/cache/index.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAC5C,0DAAuD;AACvD,qCAAuC;AAEvC,MAAM,YAAY,GAAG,IAAI,mBAAO,CAAC,OAAO,CAAC,CAAC;AASjC,oCAAY;AAPrB,IAAA,mCAAgB,EAAC,YAAY,CAAC;KAC3B,MAAM,CAAC,oBAAW,CAAC;KACnB,SAAS,CACR,IAAI,kBAAM,CAAC,gBAAgB,EAAE,kDAAkD,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CACtI;KACA,MAAM,CAAC,SAAS,EAAE,0BAA0B,CAAC,CAAC"}
|
|
@@ -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.pruneCache = void 0;
|
|
7
|
+
const promises_1 = require("fs/promises");
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const cacheDir_1 = require("./cacheDir");
|
|
11
|
+
const workspace_tools_1 = require("workspace-tools");
|
|
12
|
+
const MS_IN_A_DAY = 1000 * 60 * 60 * 24;
|
|
13
|
+
async function pruneCache(pruneDays, cwd, internalCacheFolder, logger) {
|
|
14
|
+
const prunePeriod = pruneDays || 30;
|
|
15
|
+
const now = new Date();
|
|
16
|
+
const workspaces = (0, workspace_tools_1.getWorkspaces)(cwd);
|
|
17
|
+
for (const workspace of workspaces) {
|
|
18
|
+
const cachePath = (0, cacheDir_1.getCacheDir)(workspace.path, internalCacheFolder);
|
|
19
|
+
if (fs_1.default.existsSync(cachePath)) {
|
|
20
|
+
const entries = fs_1.default.readdirSync(cachePath);
|
|
21
|
+
logger.info(`prune cache for ${workspace.name} older than ${prunePeriod} days`);
|
|
22
|
+
for (const entry of entries) {
|
|
23
|
+
const entryPath = path_1.default.join(cachePath, entry);
|
|
24
|
+
const entryStat = await (0, promises_1.stat)(entryPath);
|
|
25
|
+
if (now.getTime() - entryStat.mtime.getTime() > prunePeriod * MS_IN_A_DAY) {
|
|
26
|
+
await (0, cacheDir_1.removeCacheEntry)(entryPath, entryStat);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.pruneCache = pruneCache;
|
|
33
|
+
//# sourceMappingURL=pruneCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pruneCache.js","sourceRoot":"","sources":["../../../src/commands/cache/pruneCache.ts"],"names":[],"mappings":";;;;;;AACA,0CAAmC;AACnC,4CAAoB;AACpB,gDAAwB;AACxB,yCAA2D;AAC3D,qDAAgD;AAEhD,MAAM,WAAW,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEjC,KAAK,UAAU,UAAU,CAAC,SAAiB,EAAE,GAAW,EAAE,mBAA2B,EAAE,MAAc;IAC1G,MAAM,WAAW,GAAG,SAAS,IAAI,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,UAAU,GAAG,IAAA,+BAAa,EAAC,GAAG,CAAC,CAAC;IACtC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,SAAS,GAAG,IAAA,sBAAW,EAAC,SAAS,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAEnE,IAAI,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC5B,MAAM,OAAO,GAAG,YAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YAE1C,MAAM,CAAC,IAAI,CAAC,mBAAmB,SAAS,CAAC,IAAI,eAAe,WAAW,OAAO,CAAC,CAAC;YAEhF,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;gBAC3B,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBAC9C,MAAM,SAAS,GAAG,MAAM,IAAA,eAAI,EAAC,SAAS,CAAC,CAAC;gBAExC,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,WAAW,GAAG,WAAW,EAAE;oBACzE,MAAM,IAAA,2BAAgB,EAAC,SAAS,EAAE,SAAS,CAAC,CAAC;iBAC9C;aACF;SACF;KACF;AACH,CAAC;AAtBD,gCAsBC"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import {
|
|
3
|
-
interface RunOptions {
|
|
4
|
-
reporter: string[];
|
|
2
|
+
import { ReporterInitOptions } from "../../types/LoggerOptions";
|
|
3
|
+
interface RunOptions extends ReporterInitOptions {
|
|
5
4
|
concurrency: number;
|
|
6
5
|
profile: string | boolean | undefined;
|
|
7
|
-
verbose: boolean;
|
|
8
|
-
logLevel: keyof typeof LogLevel;
|
|
9
|
-
grouped: boolean;
|
|
10
6
|
dependencies: boolean;
|
|
11
7
|
dependents: boolean;
|
|
12
8
|
since: string;
|
|
@@ -1,39 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.runAction = void 0;
|
|
27
7
|
const cache_1 = require("@lage-run/cache");
|
|
28
8
|
const createProfileReporter_1 = require("./createProfileReporter");
|
|
29
|
-
const createReporter_1 = require("../../createReporter");
|
|
30
9
|
const findNpmClient_1 = require("../../workspace/findNpmClient");
|
|
31
10
|
const getConfig_1 = require("../../config/getConfig");
|
|
32
11
|
const getFilteredPackages_1 = require("../../filter/getFilteredPackages");
|
|
33
12
|
const workspace_tools_1 = require("workspace-tools");
|
|
34
13
|
const scheduler_1 = require("@lage-run/scheduler");
|
|
35
14
|
const target_graph_1 = require("@lage-run/target-graph");
|
|
36
|
-
const logger_1 =
|
|
15
|
+
const logger_1 = __importDefault(require("@lage-run/logger"));
|
|
16
|
+
const initialize_1 = require("../../reporters/initialize");
|
|
37
17
|
function filterArgsForTasks(args) {
|
|
38
18
|
const optionsPosition = args.findIndex((arg) => arg.startsWith("-"));
|
|
39
19
|
return {
|
|
@@ -45,23 +25,11 @@ async function runAction(options, command) {
|
|
|
45
25
|
var _a, _b;
|
|
46
26
|
const cwd = process.cwd();
|
|
47
27
|
const config = (0, getConfig_1.getConfig)(cwd);
|
|
48
|
-
const reporterInstances = [];
|
|
49
28
|
// Configure logger
|
|
50
29
|
const logger = (0, logger_1.default)();
|
|
51
|
-
|
|
52
|
-
for (const reporter of reporterOptions) {
|
|
53
|
-
const reporterInstance = (0, createReporter_1.createReporter)({
|
|
54
|
-
verbose: options.verbose,
|
|
55
|
-
grouped: options.grouped,
|
|
56
|
-
logLevel: logger_1.LogLevel[options.logLevel],
|
|
57
|
-
reporter: reporter,
|
|
58
|
-
});
|
|
59
|
-
reporterInstances.push(reporterInstance);
|
|
60
|
-
logger.addReporter(reporterInstance);
|
|
61
|
-
}
|
|
30
|
+
(0, initialize_1.initializeReporters)(logger, options);
|
|
62
31
|
if (options.profile !== undefined) {
|
|
63
32
|
const reporter = (0, createProfileReporter_1.createProfileReporter)(options);
|
|
64
|
-
reporterInstances.push(reporter);
|
|
65
33
|
logger.addReporter(reporter);
|
|
66
34
|
}
|
|
67
35
|
// Build Target Graph
|
|
@@ -131,12 +99,12 @@ async function runAction(options, command) {
|
|
|
131
99
|
runner,
|
|
132
100
|
});
|
|
133
101
|
const summary = await scheduler.run(root, targetGraph);
|
|
134
|
-
for (const
|
|
135
|
-
|
|
102
|
+
for (const reporter of logger.reporters) {
|
|
103
|
+
reporter.summarize(summary);
|
|
136
104
|
}
|
|
137
105
|
if (summary.results !== "success") {
|
|
138
106
|
process.exitCode = 1;
|
|
139
107
|
}
|
|
140
108
|
}
|
|
141
109
|
exports.runAction = runAction;
|
|
142
|
-
//# sourceMappingURL=
|
|
110
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/commands/run/action.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAmG;AAEnG,mEAAgE;AAChE,iEAA8D;AAC9D,sDAAmD;AACnD,0EAAuE;AACvE,qDAAoE;AACpE,mDAAuE;AACvE,yDAA4D;AAC5D,8DAAoE;AACpE,2DAAiE;AAGjE,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,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;QAC1E,QAAQ,EAAE,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;KACpE,CAAC;AACJ,CAAC;AAgBM,KAAK,UAAU,SAAS,CAAC,OAAmB,EAAE,OAAgB;;IACnE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,GAAG,CAAC,CAAC;IAE9B,mBAAmB;IACnB,MAAM,MAAM,GAAG,IAAA,gBAAY,GAAE,CAAC;IAE9B,IAAA,gCAAmB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QACjC,MAAM,QAAQ,GAAG,IAAA,6CAAqB,EAAC,OAAO,CAAC,CAAC;QAChD,MAAM,CAAC,WAA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AW,EAAE,OAAO,CAAC,KAAK;QAC1B,gBAAgB,EAAE,OAAO,CAAC,UAAU;QACpC,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEvD,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE;QACvC,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;KAC7B;IAED,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QACjC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;KACtB;AACH,CAAC;AAtGD,8BAsGC"}
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.runCommand = void 0;
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const os_1 = __importDefault(require("os"));
|
|
9
|
-
const
|
|
9
|
+
const action_1 = require("./action");
|
|
10
|
+
const addLoggerOptions_1 = require("../addLoggerOptions");
|
|
10
11
|
const runCommand = new commander_1.Command("run");
|
|
11
12
|
exports.runCommand = runCommand;
|
|
12
|
-
runCommand
|
|
13
|
-
.action(
|
|
13
|
+
(0, addLoggerOptions_1.addLoggerOptions)(runCommand)
|
|
14
|
+
.action(action_1.runAction)
|
|
14
15
|
.option("-c, --concurrency <n>", "concurrency", (value) => {
|
|
15
16
|
if (value.endsWith("%")) {
|
|
16
17
|
return (parseInt(value.slice(0, -1)) / 100) * os_1.default.cpus().length;
|
|
@@ -20,14 +21,11 @@ runCommand
|
|
|
20
21
|
}
|
|
21
22
|
}, os_1.default.cpus().length - 1)
|
|
22
23
|
// Common Options
|
|
23
|
-
.option("--reporter <reporter...>", "reporter", "npmLog")
|
|
24
24
|
.option("--scope <scope...>", "scopes the run to a subset of packages (by default, includes the dependencies and dependents as well)")
|
|
25
25
|
.option("--no-dependents|--no-deps", "disables running any dependents of the scoped packages")
|
|
26
26
|
.option("--dependencies|--include-dependencies", 'adds the scoped packages dependencies as the "entry points" for the target graph run')
|
|
27
27
|
.option("--since <since>", "only runs packages that have changed since the given commit, tag, or branch")
|
|
28
28
|
.option("--to <scope...>", "runs up to a package (shorthand for --scope=<scope...> --no-dependents)")
|
|
29
|
-
.addOption(new commander_1.Option("--log-level <level>", "log level").choices(["info", "warn", "error", "verbose", "silly"]).conflicts("--verbose"))
|
|
30
|
-
.option("--verbose", "verbose output")
|
|
31
29
|
// Run Command Options
|
|
32
30
|
.option("--grouped", "groups the logs", false)
|
|
33
31
|
.option("--no-cache", "disables the cache")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/run/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA4C;AAC5C,4CAAoB;AACpB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/run/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAA4C;AAC5C,4CAAoB;AACpB,qCAAqC;AACrC,0DAAuD;AAEvD,MAAM,UAAU,GAAG,IAAI,mBAAO,CAAC,KAAK,CAAC,CAAC;AAiG7B,gCAAU;AA/FnB,IAAA,mCAAgB,EAAC,UAAU,CAAC;KACzB,MAAM,CAAC,kBAAS,CAAC;KACjB,MAAM,CACL,uBAAuB,EACvB,aAAa,EACb,CAAC,KAAK,EAAE,EAAE;IACR,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;KAChE;SAAM;QACL,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;KAChD;AACH,CAAC,EACD,YAAE,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CACrB;IACD,iBAAiB;KAChB,MAAM,CAAC,oBAAoB,EAAE,uGAAuG,CAAC;KACrI,MAAM,CAAC,2BAA2B,EAAE,wDAAwD,CAAC;KAC7F,MAAM,CAAC,uCAAuC,EAAE,sFAAsF,CAAC;KACvI,MAAM,CAAC,iBAAiB,EAAE,6EAA6E,CAAC;KACxG,MAAM,CAAC,iBAAiB,EAAE,yEAAyE,CAAC;IAErG,sBAAsB;KACrB,MAAM,CAAC,WAAW,EAAE,iBAAiB,EAAE,KAAK,CAAC;KAC7C,MAAM,CAAC,YAAY,EAAE,oBAAoB,CAAC;KAC1C,MAAM,CAAC,eAAe,EAAE,0CAA0C,CAAC;KACnE,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC;KAErD,MAAM,CAAC,qBAAqB,EAAE,4EAA4E,CAAC;KAC3G,MAAM,CACL,qBAAqB,EACrB,sIAAsI,CACvI;KACA,MAAM,CAAC,YAAY,EAAE,iCAAiC,CAAC;KAEvD,kBAAkB,CAAC,IAAI,CAAC;KACxB,cAAc,CAAC,gDAAgD,EAAE,cAAc,CAAC;KAChF,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDH,CACE,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createReporter.js","sourceRoot":"","sources":["../../src/reporters/createReporter.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,mDAAgF;AAEhF,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,0BAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;KAC3F;AACH,CAAC;AApBD,wCAoBC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
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>[];
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Command Line Interface for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/microsoft/lage"
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"test": "jest"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@lage-run/logger": "^1.1.
|
|
21
|
-
"@lage-run/scheduler": "^0.1.
|
|
22
|
-
"@lage-run/target-graph": "^0.2.
|
|
23
|
-
"@lage-run/cache": "^0.1.
|
|
24
|
-
"@lage-run/reporters": "^0.1.
|
|
20
|
+
"@lage-run/logger": "^1.1.3",
|
|
21
|
+
"@lage-run/scheduler": "^0.1.7",
|
|
22
|
+
"@lage-run/target-graph": "^0.2.2",
|
|
23
|
+
"@lage-run/cache": "^0.1.6",
|
|
24
|
+
"@lage-run/reporters": "^0.1.6",
|
|
25
25
|
"commander": "^9.4.0",
|
|
26
26
|
"workspace-tools": "^0.26.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/jest": "^27.0.1",
|
|
30
|
-
"@types/node": "
|
|
30
|
+
"@types/node": "14.18.26",
|
|
31
31
|
"jest": "^27.2.0",
|
|
32
32
|
"memory-streams": "^0.1.3",
|
|
33
33
|
"ts-jest": "^27.0.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runAction.js","sourceRoot":"","sources":["../../../src/commands/run/runAction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAmG;AAEnG,mEAAgE;AAChE,yDAAsD;AACtD,iEAA8D;AAC9D,sDAAmD;AACnD,0EAAuE;AACvE,qDAAoE;AACpE,mDAAuE;AACvE,yDAA4D;AAC5D,2DAAoE;AAEpE,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,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;QAC1E,QAAQ,EAAE,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;KACpE,CAAC;AACJ,CAAC;AAoBM,KAAK,UAAU,SAAS,CAAC,OAAmB,EAAE,OAAgB;;IACnE,MAAM,GAAG,GAAG,OAAO,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