@lage-run/cli 0.4.33 → 0.4.34

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.
Files changed (64) hide show
  1. package/CHANGELOG.json +46 -1
  2. package/CHANGELOG.md +15 -2
  3. package/lib/cli.js +12 -9
  4. package/lib/commands/addLoggerOptions.js +15 -9
  5. package/lib/commands/cache/action.js +23 -19
  6. package/lib/commands/cache/cacheDir.js +26 -15
  7. package/lib/commands/cache/clearCache.js +32 -24
  8. package/lib/commands/cache/index.js +12 -12
  9. package/lib/commands/cache/pruneCache.js +31 -23
  10. package/lib/commands/isRunningFromCI.js +8 -4
  11. package/lib/commands/run/action.js +12 -10
  12. package/lib/commands/run/createCacheProvider.js +35 -23
  13. package/lib/commands/run/createProfileReporter.js +11 -8
  14. package/lib/commands/run/createTargetGraph.d.ts +0 -1
  15. package/lib/commands/run/createTargetGraph.js +17 -15
  16. package/lib/commands/run/filterArgsForTasks.js +9 -6
  17. package/lib/commands/run/filterPipelineDefinitions.js +9 -6
  18. package/lib/commands/run/index.js +25 -41
  19. package/lib/commands/run/runAction.js +49 -41
  20. package/lib/commands/run/runners/NpmScriptRunner.js +8 -5
  21. package/lib/commands/run/runners/WorkerRunner.js +8 -5
  22. package/lib/commands/run/watchAction.js +86 -64
  23. package/lib/commands/run/watcher.js +33 -23
  24. package/lib/config/getConfig.js +19 -14
  25. package/lib/config/getMaxWorkersPerTask.js +24 -14
  26. package/lib/filter/getFilteredPackages.js +87 -63
  27. package/lib/index.js +3 -2
  28. package/lib/showHelp.js +8 -6
  29. package/lib/types/CacheOptions.js +3 -2
  30. package/lib/types/ConfigOptions.js +3 -2
  31. package/lib/types/LoggerOptions.js +3 -2
  32. package/lib/types/PipelineDefinition.js +3 -2
  33. package/lib/types/Priority.js +3 -2
  34. package/package.json +6 -6
  35. package/lib/cli.js.map +0 -1
  36. package/lib/commands/addLoggerOptions.js.map +0 -1
  37. package/lib/commands/cache/action.js.map +0 -1
  38. package/lib/commands/cache/cacheDir.js.map +0 -1
  39. package/lib/commands/cache/clearCache.js.map +0 -1
  40. package/lib/commands/cache/index.js.map +0 -1
  41. package/lib/commands/cache/pruneCache.js.map +0 -1
  42. package/lib/commands/isRunningFromCI.js.map +0 -1
  43. package/lib/commands/run/action.js.map +0 -1
  44. package/lib/commands/run/createCacheProvider.js.map +0 -1
  45. package/lib/commands/run/createProfileReporter.js.map +0 -1
  46. package/lib/commands/run/createTargetGraph.js.map +0 -1
  47. package/lib/commands/run/filterArgsForTasks.js.map +0 -1
  48. package/lib/commands/run/filterPipelineDefinitions.js.map +0 -1
  49. package/lib/commands/run/index.js.map +0 -1
  50. package/lib/commands/run/runAction.js.map +0 -1
  51. package/lib/commands/run/runners/NpmScriptRunner.js.map +0 -1
  52. package/lib/commands/run/runners/WorkerRunner.js.map +0 -1
  53. package/lib/commands/run/watchAction.js.map +0 -1
  54. package/lib/commands/run/watcher.js.map +0 -1
  55. package/lib/config/getConfig.js.map +0 -1
  56. package/lib/config/getMaxWorkersPerTask.js.map +0 -1
  57. package/lib/filter/getFilteredPackages.js.map +0 -1
  58. package/lib/index.js.map +0 -1
  59. package/lib/showHelp.js.map +0 -1
  60. package/lib/types/CacheOptions.js.map +0 -1
  61. package/lib/types/ConfigOptions.js.map +0 -1
  62. package/lib/types/LoggerOptions.js.map +0 -1
  63. package/lib/types/PipelineDefinition.js.map +0 -1
  64. package/lib/types/Priority.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,52 @@
2
2
  "name": "@lage-run/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 04 Nov 2022 21:13:54 GMT",
5
+ "date": "Thu, 10 Nov 2022 20:20:28 GMT",
6
+ "tag": "@lage-run/cli_v0.4.34",
7
+ "version": "0.4.34",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/cli",
13
+ "commit": "b1a42cb963a5fc680e4c59b1e705acbc964f0804",
14
+ "comment": "update api from targetgraphbuilder"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@lage-run/cli",
19
+ "comment": "Bump @lage-run/scheduler to v0.5.11",
20
+ "commit": "b1a42cb963a5fc680e4c59b1e705acbc964f0804"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@lage-run/cli",
25
+ "comment": "Bump @lage-run/scheduler-types to v0.2.7",
26
+ "commit": "b1a42cb963a5fc680e4c59b1e705acbc964f0804"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@lage-run/cli",
31
+ "comment": "Bump @lage-run/target-graph to v0.6.0",
32
+ "commit": "b1a42cb963a5fc680e4c59b1e705acbc964f0804"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@lage-run/cli",
37
+ "comment": "Bump @lage-run/cache to v0.2.1",
38
+ "commit": "b1a42cb963a5fc680e4c59b1e705acbc964f0804"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@lage-run/cli",
43
+ "comment": "Bump @lage-run/reporters to v0.2.38",
44
+ "commit": "b1a42cb963a5fc680e4c59b1e705acbc964f0804"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Fri, 04 Nov 2022 21:14:01 GMT",
6
51
  "tag": "@lage-run/cli_v0.4.33",
7
52
  "version": "0.4.33",
8
53
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,25 @@
1
1
  # Change Log - @lage-run/cli
2
2
 
3
- This log was last generated on Fri, 04 Nov 2022 21:13:54 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 10 Nov 2022 20:20:28 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.4.34
8
+
9
+ Thu, 10 Nov 2022 20:20:28 GMT
10
+
11
+ ### Patches
12
+
13
+ - update api from targetgraphbuilder (kchau@microsoft.com)
14
+ - Bump @lage-run/scheduler to v0.5.11
15
+ - Bump @lage-run/scheduler-types to v0.2.7
16
+ - Bump @lage-run/target-graph to v0.6.0
17
+ - Bump @lage-run/cache to v0.2.1
18
+ - Bump @lage-run/reporters to v0.2.38
19
+
7
20
  ## 0.4.33
8
21
 
9
- Fri, 04 Nov 2022 21:13:54 GMT
22
+ Fri, 04 Nov 2022 21:14:01 GMT
10
23
 
11
24
  ### Patches
12
25
 
package/lib/cli.js CHANGED
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const commander_1 = require("commander");
4
- const run_1 = require("./commands/run");
5
- const cache_1 = require("./commands/cache");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _commander = require("commander");
6
+ const _run = require("./commands/run");
7
+ const _cache = require("./commands/cache");
6
8
  async function main() {
7
- const program = new commander_1.Command();
8
- program.addCommand(run_1.runCommand, { isDefault: true });
9
- program.addCommand(cache_1.cacheCommand);
9
+ const program = new _commander.Command();
10
+ program.addCommand(_run.runCommand, {
11
+ isDefault: true
12
+ });
13
+ program.addCommand(_cache.cacheCommand);
10
14
  await program.parseAsync(process.argv);
11
15
  }
12
- main().catch((err) => {
16
+ main().catch((err)=>{
13
17
  // eslint-disable-next-line no-console
14
18
  console.error(err);
15
19
  process.exitCode = 1;
16
20
  });
17
- //# sourceMappingURL=cli.js.map
@@ -1,12 +1,18 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addLoggerOptions = void 0;
4
- const commander_1 = require("commander");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "addLoggerOptions", {
6
+ enumerable: true,
7
+ get: ()=>addLoggerOptions
8
+ });
9
+ const _commander = require("commander");
5
10
  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");
11
+ return program.option("--reporter <reporter...>", "reporter", "npmLog").addOption(new _commander.Option("--log-level <level>", "log level").choices([
12
+ "info",
13
+ "warn",
14
+ "error",
15
+ "verbose",
16
+ "silly"
17
+ ]).conflicts("--verbose")).option("--verbose", "verbose output");
10
18
  }
11
- exports.addLoggerOptions = addLoggerOptions;
12
- //# sourceMappingURL=addLoggerOptions.js.map
@@ -1,26 +1,30 @@
1
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_js_1 = require("./clearCache.js");
8
- const getConfig_js_1 = require("../../config/getConfig.js");
9
- const pruneCache_js_1 = require("./pruneCache.js");
10
- const logger_1 = __importDefault(require("@lage-run/logger"));
11
- const reporters_1 = require("@lage-run/reporters");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "cacheAction", {
6
+ enumerable: true,
7
+ get: ()=>cacheAction
8
+ });
9
+ const _clearCacheJs = require("./clearCache.js");
10
+ const _getConfigJs = require("../../config/getConfig.js");
11
+ const _pruneCacheJs = require("./pruneCache.js");
12
+ const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
13
+ const _reporters = require("@lage-run/reporters");
14
+ function _interopRequireDefault(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
12
19
  async function cacheAction(options, command) {
13
20
  const cwd = process.cwd();
14
- const config = await (0, getConfig_js_1.getConfig)(cwd);
15
- const logger = (0, logger_1.default)();
16
- (0, reporters_1.initializeReporters)(logger, options);
21
+ const config = await (0, _getConfigJs.getConfig)(cwd);
22
+ const logger = (0, _logger.default)();
23
+ (0, _reporters.initializeReporters)(logger, options);
17
24
  if (options.clear) {
18
- return await (0, clearCache_js_1.clearCache)(process.cwd(), config.cacheOptions.internalCacheFolder, logger);
19
- }
20
- else if (options.prune) {
21
- return await (0, pruneCache_js_1.pruneCache)(options.prune, process.cwd(), config.cacheOptions.internalCacheFolder, logger);
25
+ return await (0, _clearCacheJs.clearCache)(process.cwd(), config.cacheOptions.internalCacheFolder, logger);
26
+ } else if (options.prune) {
27
+ return await (0, _pruneCacheJs.pruneCache)(options.prune, process.cwd(), config.cacheOptions.internalCacheFolder, logger);
22
28
  }
23
29
  command.help();
24
30
  }
25
- exports.cacheAction = cacheAction;
26
- //# sourceMappingURL=action.js.map
@@ -1,23 +1,34 @@
1
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");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getCacheDir: ()=>getCacheDir,
13
+ removeCacheEntry: ()=>removeCacheEntry
14
+ });
15
+ const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
16
+ const _promises = require("fs/promises");
17
+ function _interopRequireDefault(obj) {
18
+ return obj && obj.__esModule ? obj : {
19
+ default: obj
20
+ };
21
+ }
9
22
  function getCacheDir(workspace, internalCacheFolder) {
10
23
  const cacheFolder = !internalCacheFolder ? undefined : internalCacheFolder;
11
- return path_1.default.join(workspace, cacheFolder ?? "node_modules/.cache/backfill");
24
+ return _path.default.join(workspace, cacheFolder ?? "node_modules/.cache/backfill");
12
25
  }
13
- exports.getCacheDir = getCacheDir;
14
26
  async function removeCacheEntry(entryPath, entryStat) {
15
27
  if (entryStat.isDirectory()) {
16
- (0, promises_1.rm)(entryPath, { recursive: true });
17
- }
18
- else {
19
- (0, promises_1.unlink)(entryPath);
28
+ (0, _promises.rm)(entryPath, {
29
+ recursive: true
30
+ });
31
+ } else {
32
+ (0, _promises.unlink)(entryPath);
20
33
  }
21
34
  }
22
- exports.removeCacheEntry = removeCacheEntry;
23
- //# sourceMappingURL=cacheDir.js.map
@@ -1,36 +1,44 @@
1
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_js_1 = require("./cacheDir.js");
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"));
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "clearCache", {
6
+ enumerable: true,
7
+ get: ()=>clearCache
8
+ });
9
+ const _cacheDirJs = require("./cacheDir.js");
10
+ const _workspaceTools = require("workspace-tools");
11
+ const _promises = require("fs/promises");
12
+ const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
13
+ const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
14
+ function _interopRequireDefault(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
12
19
  async function clearCache(cwd, internalCacheFolder, logger) {
13
- const workspaceRoot = (0, workspace_tools_1.getWorkspaceRoot)(cwd);
20
+ const workspaceRoot = (0, _workspaceTools.getWorkspaceRoot)(cwd);
14
21
  if (!workspaceRoot) {
15
22
  return;
16
23
  }
17
- const workspaces = (0, workspace_tools_1.getWorkspaces)(workspaceRoot);
18
- for (const workspace of workspaces) {
24
+ const workspaces = (0, _workspaceTools.getWorkspaces)(workspaceRoot);
25
+ for (const workspace of workspaces){
19
26
  logger.info(`clear cache for ${workspace.name}`);
20
- const cachePath = (0, cacheDir_js_1.getCacheDir)(workspace.path, internalCacheFolder);
21
- const logOutputCachePath = path_1.default.join(workspace.path, "node_modules/.cache/lage/output/");
22
- await Promise.all([clearPath(cachePath), clearPath(logOutputCachePath)]);
27
+ const cachePath = (0, _cacheDirJs.getCacheDir)(workspace.path, internalCacheFolder);
28
+ const logOutputCachePath = _path.default.join(workspace.path, "node_modules/.cache/lage/output/");
29
+ await Promise.all([
30
+ clearPath(cachePath),
31
+ clearPath(logOutputCachePath)
32
+ ]);
23
33
  }
24
34
  }
25
- exports.clearCache = clearCache;
26
35
  async function clearPath(cachePath) {
27
- if (fs_1.default.existsSync(cachePath)) {
28
- const entries = fs_1.default.readdirSync(cachePath);
29
- for (const entry of entries) {
30
- const entryPath = path_1.default.join(cachePath, entry);
31
- const entryStat = await (0, promises_1.stat)(entryPath);
32
- await (0, cacheDir_js_1.removeCacheEntry)(entryPath, entryStat);
36
+ if (_fs.default.existsSync(cachePath)) {
37
+ const entries = _fs.default.readdirSync(cachePath);
38
+ for (const entry of entries){
39
+ const entryPath = _path.default.join(cachePath, entry);
40
+ const entryStat = await (0, _promises.stat)(entryPath);
41
+ await (0, _cacheDirJs.removeCacheEntry)(entryPath, entryStat);
33
42
  }
34
43
  }
35
44
  }
36
- //# sourceMappingURL=clearCache.js.map
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cacheCommand = void 0;
4
- const commander_1 = require("commander");
5
- const addLoggerOptions_js_1 = require("../addLoggerOptions.js");
6
- const action_js_1 = require("./action.js");
7
- const cacheCommand = new commander_1.Command("cache");
8
- exports.cacheCommand = cacheCommand;
9
- (0, addLoggerOptions_js_1.addLoggerOptions)(cacheCommand)
10
- .action(action_js_1.cacheAction)
11
- .addOption(new commander_1.Option("--prune <days>", "Prunes cache older than certain number of <days>").argParser(parseInt).conflicts("--clear"))
12
- .option("--clear", "Clears the cache locally");
13
- //# sourceMappingURL=index.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "cacheCommand", {
6
+ enumerable: true,
7
+ get: ()=>cacheCommand
8
+ });
9
+ const _commander = require("commander");
10
+ const _addLoggerOptionsJs = require("../addLoggerOptions.js");
11
+ const _actionJs = require("./action.js");
12
+ const cacheCommand = new _commander.Command("cache");
13
+ (0, _addLoggerOptionsJs.addLoggerOptions)(cacheCommand).action(_actionJs.cacheAction).addOption(new _commander.Option("--prune <days>", "Prunes cache older than certain number of <days>").argParser(parseInt).conflicts("--clear")).option("--clear", "Clears the cache locally");
@@ -1,37 +1,45 @@
1
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_js_1 = require("./cacheDir.js");
11
- const workspace_tools_1 = require("workspace-tools");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "pruneCache", {
6
+ enumerable: true,
7
+ get: ()=>pruneCache
8
+ });
9
+ const _promises = require("fs/promises");
10
+ const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
11
+ const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
12
+ const _cacheDirJs = require("./cacheDir.js");
13
+ const _workspaceTools = require("workspace-tools");
14
+ function _interopRequireDefault(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
12
19
  const MS_IN_A_DAY = 1000 * 60 * 60 * 24;
13
20
  async function pruneCache(pruneDays, cwd, internalCacheFolder, logger) {
14
21
  const prunePeriod = pruneDays || 30;
15
22
  const now = new Date().getTime();
16
- const workspaces = (0, workspace_tools_1.getWorkspaces)(cwd);
17
- for (const workspace of workspaces) {
23
+ const workspaces = (0, _workspaceTools.getWorkspaces)(cwd);
24
+ for (const workspace of workspaces){
18
25
  logger.info(`prune cache for ${workspace.name} older than ${prunePeriod} days`);
19
- const cachePath = (0, cacheDir_js_1.getCacheDir)(workspace.path, internalCacheFolder);
20
- const logOutputCachePath = path_1.default.join(workspace.path, "node_modules/.cache/lage/output/");
21
- await Promise.all([prunePath(cachePath, prunePeriod, now), prunePath(logOutputCachePath, prunePeriod, now)]);
26
+ const cachePath = (0, _cacheDirJs.getCacheDir)(workspace.path, internalCacheFolder);
27
+ const logOutputCachePath = _path.default.join(workspace.path, "node_modules/.cache/lage/output/");
28
+ await Promise.all([
29
+ prunePath(cachePath, prunePeriod, now),
30
+ prunePath(logOutputCachePath, prunePeriod, now)
31
+ ]);
22
32
  }
23
33
  }
24
- exports.pruneCache = pruneCache;
25
34
  async function prunePath(cachePath, days, now) {
26
- if (fs_1.default.existsSync(cachePath)) {
27
- const entries = fs_1.default.readdirSync(cachePath);
28
- for (const entry of entries) {
29
- const entryPath = path_1.default.join(cachePath, entry);
30
- const entryStat = await (0, promises_1.stat)(entryPath);
35
+ if (_fs.default.existsSync(cachePath)) {
36
+ const entries = _fs.default.readdirSync(cachePath);
37
+ for (const entry of entries){
38
+ const entryPath = _path.default.join(cachePath, entry);
39
+ const entryStat = await (0, _promises.stat)(entryPath);
31
40
  if (now - entryStat.mtime.getTime() > days * MS_IN_A_DAY) {
32
- await (0, cacheDir_js_1.removeCacheEntry)(entryPath, entryStat);
41
+ await (0, _cacheDirJs.removeCacheEntry)(entryPath, entryStat);
33
42
  }
34
43
  }
35
44
  }
36
45
  }
37
- //# sourceMappingURL=pruneCache.js.map
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isRunningFromCI = void 0;
4
- exports.isRunningFromCI = process.env.NODE_ENV !== "test" && (!!process.env.CI || !!process.env.TF_BUILD);
5
- //# sourceMappingURL=isRunningFromCI.js.map
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "isRunningFromCI", {
6
+ enumerable: true,
7
+ get: ()=>isRunningFromCI
8
+ });
9
+ const isRunningFromCI = process.env.NODE_ENV !== "test" && (!!process.env.CI || !!process.env.TF_BUILD);
@@ -1,15 +1,17 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.action = void 0;
4
- const runAction_js_1 = require("./runAction.js");
5
- const watchAction_js_1 = require("./watchAction.js");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "action", {
6
+ enumerable: true,
7
+ get: ()=>action
8
+ });
9
+ const _runActionJs = require("./runAction.js");
10
+ const _watchActionJs = require("./watchAction.js");
6
11
  async function action(options, command) {
7
12
  if (options.unstableWatch) {
8
- return (0, watchAction_js_1.watchAction)(options, command);
9
- }
10
- else {
11
- return (0, runAction_js_1.runAction)(options, command);
13
+ return (0, _watchActionJs.watchAction)(options, command);
14
+ } else {
15
+ return (0, _runActionJs.runAction)(options, command);
12
16
  }
13
17
  }
14
- exports.action = action;
15
- //# sourceMappingURL=action.js.map
@@ -1,35 +1,47 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createCache = void 0;
4
- const cache_1 = require("@lage-run/cache");
5
- const isRunningFromCI_js_1 = require("../isRunningFromCI.js");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "createCache", {
6
+ enumerable: true,
7
+ get: ()=>createCache
8
+ });
9
+ const _cache = require("@lage-run/cache");
10
+ const _isRunningFromCIJs = require("../isRunningFromCI.js");
6
11
  function createCache(options) {
7
- const { cacheOptions, logger, root, skipLocalCache } = options;
12
+ const { cacheOptions , logger , root , skipLocalCache } = options;
8
13
  const hasRemoteCacheConfig = !!cacheOptions?.cacheStorageConfig || !!process.env.BACKFILL_CACHE_PROVIDER || !!process.env.BACKFILL_CACHE_PROVIDER_OPTIONS;
9
14
  // Create Cache Provider
10
- const cacheProvider = new cache_1.RemoteFallbackCacheProvider({
15
+ const cacheProvider = new _cache.RemoteFallbackCacheProvider({
11
16
  root,
12
17
  logger,
13
- localCacheProvider: skipLocalCache === true
14
- ? undefined
15
- : new cache_1.BackfillCacheProvider({
16
- logger,
17
- root,
18
- cacheOptions: {
19
- outputGlob: cacheOptions?.outputGlob,
20
- ...(cacheOptions?.internalCacheFolder && { internalCacheFolder: cacheOptions.internalCacheFolder }),
21
- ...(cacheOptions?.incrementalCaching && { incrementalCaching: cacheOptions.incrementalCaching }),
18
+ localCacheProvider: skipLocalCache === true ? undefined : new _cache.BackfillCacheProvider({
19
+ logger,
20
+ root,
21
+ cacheOptions: {
22
+ outputGlob: cacheOptions?.outputGlob,
23
+ ...cacheOptions?.internalCacheFolder && {
24
+ internalCacheFolder: cacheOptions.internalCacheFolder
22
25
  },
23
- }),
24
- remoteCacheProvider: hasRemoteCacheConfig ? new cache_1.BackfillCacheProvider({ logger, root, cacheOptions: cacheOptions ?? {} }) : undefined,
25
- writeRemoteCache: cacheOptions?.writeRemoteCache === true || String(process.env.LAGE_WRITE_CACHE).toLowerCase() === "true" || isRunningFromCI_js_1.isRunningFromCI,
26
+ ...cacheOptions?.incrementalCaching && {
27
+ incrementalCaching: cacheOptions.incrementalCaching
28
+ }
29
+ }
30
+ }),
31
+ remoteCacheProvider: hasRemoteCacheConfig ? new _cache.BackfillCacheProvider({
32
+ logger,
33
+ root,
34
+ cacheOptions: cacheOptions ?? {}
35
+ }) : undefined,
36
+ writeRemoteCache: cacheOptions?.writeRemoteCache === true || String(process.env.LAGE_WRITE_CACHE).toLowerCase() === "true" || _isRunningFromCIJs.isRunningFromCI
26
37
  });
27
- const hasher = new cache_1.TargetHasher({
38
+ const hasher = new _cache.TargetHasher({
28
39
  root,
29
40
  environmentGlob: cacheOptions?.environmentGlob ?? [],
30
- cacheKey: cacheOptions?.cacheKey,
41
+ cacheKey: cacheOptions?.cacheKey
31
42
  });
32
- return { cacheProvider, hasher };
43
+ return {
44
+ cacheProvider,
45
+ hasher
46
+ };
33
47
  }
34
- exports.createCache = createCache;
35
- //# sourceMappingURL=createCacheProvider.js.map
@@ -1,13 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createProfileReporter = void 0;
4
- const reporters_1 = require("@lage-run/reporters");
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");
5
10
  function createProfileReporter(options) {
6
- const { concurrency, profile } = options;
7
- return new reporters_1.ChromeTraceEventsReporter({
11
+ const { concurrency , profile } = options;
12
+ return new _reporters.ChromeTraceEventsReporter({
8
13
  concurrency: concurrency,
9
- outputFile: typeof profile === "string" ? profile : undefined,
14
+ outputFile: typeof profile === "string" ? profile : undefined
10
15
  });
11
16
  }
12
- exports.createProfileReporter = createProfileReporter;
13
- //# sourceMappingURL=createProfileReporter.js.map
@@ -17,6 +17,5 @@ interface CreateTargetGraphOptions {
17
17
  }
18
18
  export declare function createTargetGraph(options: CreateTargetGraphOptions): {
19
19
  targets: Map<string, import("@lage-run/target-graph").Target>;
20
- dependencies: [string, string][];
21
20
  };
22
21
  export {};
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTargetGraph = void 0;
4
- const target_graph_1 = require("@lage-run/target-graph");
5
- const getFilteredPackages_js_1 = require("../../filter/getFilteredPackages.js");
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "createTargetGraph", {
6
+ enumerable: true,
7
+ get: ()=>createTargetGraph
8
+ });
9
+ const _targetGraph = require("@lage-run/target-graph");
10
+ const _getFilteredPackagesJs = require("../../filter/getFilteredPackages.js");
6
11
  function createTargetGraph(options) {
7
- const { logger, root, dependencies, dependents, since, scope, repoWideChanges, ignore, pipeline, outputs, tasks, packageInfos } = options;
8
- const builder = new target_graph_1.TargetGraphBuilder(root, packageInfos);
9
- const packages = (0, getFilteredPackages_js_1.getFilteredPackages)({
12
+ const { logger , root , dependencies , dependents , since , scope , repoWideChanges , ignore , pipeline , outputs , tasks , packageInfos } = options;
13
+ const builder = new _targetGraph.WorkspaceTargetGraphBuilder(root, packageInfos);
14
+ const packages = (0, _getFilteredPackagesJs.getFilteredPackages)({
10
15
  root,
11
16
  logger,
12
17
  packageInfos,
@@ -15,22 +20,19 @@ function createTargetGraph(options) {
15
20
  since,
16
21
  scope,
17
22
  repoWideChanges,
18
- sinceIgnoreGlobs: ignore,
23
+ sinceIgnoreGlobs: ignore
19
24
  });
20
- for (const [id, definition] of Object.entries(pipeline)) {
25
+ for (const [id, definition] of Object.entries(pipeline)){
21
26
  if (Array.isArray(definition)) {
22
27
  builder.addTargetConfig(id, {
23
28
  cache: true,
24
29
  dependsOn: definition,
25
30
  options: {},
26
- outputs,
31
+ outputs
27
32
  });
28
- }
29
- else {
33
+ } else {
30
34
  builder.addTargetConfig(id, definition);
31
35
  }
32
36
  }
33
- return builder.buildTargetGraph(tasks, packages);
37
+ return builder.build(tasks, packages);
34
38
  }
35
- exports.createTargetGraph = createTargetGraph;
36
- //# sourceMappingURL=createTargetGraph.js.map
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterArgsForTasks = void 0;
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "filterArgsForTasks", {
6
+ enumerable: true,
7
+ get: ()=>filterArgsForTasks
8
+ });
4
9
  function filterArgsForTasks(args) {
5
- const optionsPosition = args.findIndex((arg) => arg.startsWith("-"));
10
+ const optionsPosition = args.findIndex((arg)=>arg.startsWith("-"));
6
11
  return {
7
12
  tasks: args.slice(0, optionsPosition === -1 ? undefined : optionsPosition),
8
- taskArgs: optionsPosition === -1 ? [] : args.slice(optionsPosition),
13
+ taskArgs: optionsPosition === -1 ? [] : args.slice(optionsPosition)
9
14
  };
10
15
  }
11
- exports.filterArgsForTasks = filterArgsForTasks;
12
- //# sourceMappingURL=filterArgsForTasks.js.map