@lage-run/cli 0.7.3 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.json +31 -1
  2. package/CHANGELOG.md +18 -2
  3. package/lib/cli.js +2 -0
  4. package/lib/commands/addFilterOptions.js +1 -1
  5. package/lib/commands/addLoggerOptions.js +6 -2
  6. package/lib/commands/affected/action.js +105 -0
  7. package/lib/commands/affected/index.js +13 -0
  8. package/lib/commands/createReporter.js +7 -12
  9. package/lib/commands/run/index.js +1 -1
  10. package/lib/types/FilterOptions.js +4 -0
  11. package/package.json +1 -1
  12. package/lib/cli.d.ts +0 -1
  13. package/lib/commands/addFilterOptions.d.ts +0 -2
  14. package/lib/commands/addLoggerOptions.d.ts +0 -2
  15. package/lib/commands/cache/action.d.ts +0 -8
  16. package/lib/commands/cache/cacheDir.d.ts +0 -1
  17. package/lib/commands/cache/clearCache.d.ts +0 -8
  18. package/lib/commands/cache/index.d.ts +0 -3
  19. package/lib/commands/cache/pruneCache.d.ts +0 -9
  20. package/lib/commands/cache/runners/ClearCacheRunner.d.ts +0 -5
  21. package/lib/commands/cache/runners/PruneCacheRunner.d.ts +0 -5
  22. package/lib/commands/createReporter.d.ts +0 -3
  23. package/lib/commands/initializeReporters.d.ts +0 -3
  24. package/lib/commands/isRunningFromCI.d.ts +0 -1
  25. package/lib/commands/run/action.d.ts +0 -23
  26. package/lib/commands/run/createCacheProvider.d.ts +0 -15
  27. package/lib/commands/run/createTargetGraph.d.ts +0 -21
  28. package/lib/commands/run/filterArgsForTasks.d.ts +0 -4
  29. package/lib/commands/run/filterPipelineDefinitions.d.ts +0 -3
  30. package/lib/commands/run/index.d.ts +0 -3
  31. package/lib/commands/run/infoAction.d.ts +0 -14
  32. package/lib/commands/run/runAction.d.ts +0 -21
  33. package/lib/commands/run/runners/NpmScriptRunner.d.ts +0 -1
  34. package/lib/commands/run/runners/WorkerRunner.d.ts +0 -1
  35. package/lib/commands/run/watchAction.d.ts +0 -20
  36. package/lib/commands/run/watcher.d.ts +0 -3
  37. package/lib/config/getConcurrency.d.ts +0 -1
  38. package/lib/config/getConfig.d.ts +0 -2
  39. package/lib/config/getMaxWorkersPerTask.d.ts +0 -3
  40. package/lib/filter/getFilteredPackages.d.ts +0 -21
  41. package/lib/index.d.ts +0 -1
  42. package/lib/showHelp.d.ts +0 -1
  43. package/lib/types/CacheOptions.d.ts +0 -7
  44. package/lib/types/ConfigOptions.d.ts +0 -56
  45. package/lib/types/LoggerOptions.d.ts +0 -15
  46. package/lib/types/PipelineDefinition.d.ts +0 -12
  47. package/lib/types/Priority.d.ts +0 -8
  48. package/lib/types/ReporterInitOptions.d.ts +0 -10
  49. package/lib/types/errors.d.ts +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@lage-run/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 31 Jan 2023 23:54:40 GMT",
5
+ "date": "Mon, 06 Feb 2023 23:42:47 GMT",
6
+ "tag": "@lage-run/cli_v0.8.1",
7
+ "version": "0.8.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/cli",
13
+ "commit": "f3d37c7c751b57cba8f2197036b69ce67436af3f",
14
+ "comment": "fixing up some logger options to set up proper conflicts"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 03 Feb 2023 00:20:10 GMT",
21
+ "tag": "@lage-run/cli_v0.8.0",
22
+ "version": "0.8.0",
23
+ "comments": {
24
+ "minor": [
25
+ {
26
+ "author": "kchau@microsoft.com",
27
+ "package": "@lage-run/cli",
28
+ "commit": "9772c8f6e81edac6a8ae1b4a4c26b1cb8c0986b0",
29
+ "comment": "adding an affected command"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Tue, 31 Jan 2023 23:54:49 GMT",
6
36
  "tag": "@lage-run/cli_v0.7.3",
7
37
  "version": "0.7.3",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @lage-run/cli
2
2
 
3
- This log was last generated on Tue, 31 Jan 2023 23:54:40 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 06 Feb 2023 23:42:47 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.8.1
8
+
9
+ Mon, 06 Feb 2023 23:42:47 GMT
10
+
11
+ ### Patches
12
+
13
+ - fixing up some logger options to set up proper conflicts (kchau@microsoft.com)
14
+
15
+ ## 0.8.0
16
+
17
+ Fri, 03 Feb 2023 00:20:10 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - adding an affected command (kchau@microsoft.com)
22
+
7
23
  ## 0.7.3
8
24
 
9
- Tue, 31 Jan 2023 23:54:40 GMT
25
+ Tue, 31 Jan 2023 23:54:49 GMT
10
26
 
11
27
  ### Patches
12
28
 
package/lib/cli.js CHANGED
@@ -6,12 +6,14 @@ const _commander = require("commander");
6
6
  const _indexJs = require("./commands/run/index.js");
7
7
  const _indexJs1 = require("./commands/cache/index.js");
8
8
  const _errorsJs = require("./types/errors.js");
9
+ const _indexJs2 = require("./commands/affected/index.js");
9
10
  async function main() {
10
11
  const program = new _commander.Command();
11
12
  program.addCommand(_indexJs.runCommand, {
12
13
  isDefault: true
13
14
  });
14
15
  program.addCommand(_indexJs1.cacheCommand);
16
+ program.addCommand(_indexJs2.affectedCommand);
15
17
  await program.parseAsync(process.argv);
16
18
  }
17
19
  main().catch((err)=>{
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "addFilterOptions", {
7
7
  get: ()=>addFilterOptions
8
8
  });
9
9
  function addFilterOptions(program) {
10
- return program.option("--scope <scope...>", "scopes the run to a subset of packages (by default, includes the dependencies and dependents as well)").option("--no-deps|--no-dependents", "disables running any dependents of the scoped packages").option("--include-dependencies|--dependencies", 'adds the scoped packages dependencies as the "entry points" for the target graph run').option("--to <scope...>", "runs up to a package (shorthand for --scope=<scope...> --no-dependents)").option("--since <since>", "only runs packages that have changed since the given commit, tag, or branch").option("--ignore <ignore...>", "ignores files when calculating the scope with `--since` in addition to the files specified in lage.config", []).option("--allow-no-target-runs");
10
+ return program.option("--scope <scope...>", "scopes the run to a subset of packages (by default, includes the dependencies and dependents as well)").option("--no-deps|--no-dependents", "disables running any dependents of the scoped packages").option("--include-dependencies|--dependencies", 'adds the scoped packages dependencies as the "entry points" for the target graph run').option("--to <scope...>", "runs up to a package (shorthand for --scope=<scope...> --no-dependents)").option("--since <since>", "only runs packages that have changed since the given commit, tag, or branch").option("--ignore <ignore...>", "ignores files when calculating the scope with `--since` in addition to the files specified in lage.config", []);
11
11
  }
@@ -9,11 +9,15 @@ Object.defineProperty(exports, "addLoggerOptions", {
9
9
  const _commander = require("commander");
10
10
  function addLoggerOptions(program) {
11
11
  const isCI = process.env.CI || process.env.TF_BUILD;
12
- return program.option("--reporter <reporter...>", "reporter", "npmLog").option("--grouped", "groups the logs", false).addOption(new _commander.Option("--progress").conflicts("--reporter").default(!isCI)).addOption(new _commander.Option("--log-level <level>", "log level").choices([
12
+ return program.option("--reporter <reporter...>", "reporter").option("--grouped", "groups the logs", false).addOption(new _commander.Option("--progress").conflicts([
13
+ "reporter",
14
+ "grouped",
15
+ "verbose"
16
+ ]).default(!isCI)).addOption(new _commander.Option("--log-level <level>", "log level").choices([
13
17
  "info",
14
18
  "warn",
15
19
  "error",
16
20
  "verbose",
17
21
  "silly"
18
- ]).conflicts("--verbose")).option("--verbose", "verbose output");
22
+ ]).conflicts("verbose")).option("--verbose", "verbose output", false);
19
23
  }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "affectedAction", {
6
+ enumerable: true,
7
+ get: ()=>affectedAction
8
+ });
9
+ const _logger = /*#__PURE__*/ _interopRequireDefault(require("@lage-run/logger"));
10
+ const _workspaceTools = require("workspace-tools");
11
+ const _getConfigJs = require("../../config/getConfig.js");
12
+ const _getFilteredPackagesJs = require("../../filter/getFilteredPackages.js");
13
+ function _interopRequireDefault(obj) {
14
+ return obj && obj.__esModule ? obj : {
15
+ default: obj
16
+ };
17
+ }
18
+ async function affectedAction(options) {
19
+ const { dependencies , dependents , since , scope , ignore , outputFormat } = options;
20
+ const cwd = process.cwd();
21
+ const config = await (0, _getConfigJs.getConfig)(cwd);
22
+ const logger = (0, _logger.default)();
23
+ const root = (0, _workspaceTools.getWorkspaceRoot)(cwd);
24
+ const packageInfos = (0, _workspaceTools.getPackageInfos)(root);
25
+ const packages = (0, _getFilteredPackagesJs.getFilteredPackages)({
26
+ root,
27
+ logger,
28
+ packageInfos,
29
+ includeDependencies: dependencies,
30
+ includeDependents: dependents,
31
+ since,
32
+ scope,
33
+ repoWideChanges: config.repoWideChanges,
34
+ sinceIgnoreGlobs: ignore
35
+ });
36
+ let output = "";
37
+ switch(outputFormat){
38
+ case "graph":
39
+ output = renderGraph({
40
+ packages,
41
+ packageInfos
42
+ });
43
+ break;
44
+ case "json":
45
+ output = renderJson({
46
+ packages,
47
+ packageInfos
48
+ });
49
+ break;
50
+ default:
51
+ output = renderDefault({
52
+ packages
53
+ });
54
+ break;
55
+ }
56
+ // eslint-disable-next-line no-console
57
+ console.log(output);
58
+ }
59
+ function renderDefault(props) {
60
+ const { packages } = props;
61
+ return `
62
+ All Affected Packages
63
+ ---------------------
64
+
65
+ ${packages.join("\n")}
66
+ `;
67
+ }
68
+ function renderJson(props) {
69
+ const graph = generatePackageGraph(props);
70
+ return JSON.stringify(graph);
71
+ }
72
+ function renderGraph(props) {
73
+ const graph = generatePackageGraph(props);
74
+ const { packages } = graph;
75
+ const adjacencies = [];
76
+ for (const [pkg, info] of Object.entries(packages)){
77
+ for (const dep of info.dependencies){
78
+ adjacencies.push([
79
+ pkg,
80
+ dep
81
+ ]);
82
+ }
83
+ }
84
+ return `
85
+ digraph affected {
86
+ ${adjacencies.map((entry)=>` "${entry[0]}" -> "${entry[1]}"`).join("\n")}
87
+ }
88
+ `;
89
+ }
90
+ function generatePackageGraph(props) {
91
+ const { packages , packageInfos } = props;
92
+ const packageGraph = packages.reduce((accum, pkg)=>{
93
+ const dependencies = Object.keys(packageInfos[pkg].dependencies ?? {}).filter((dep)=>packages.includes(dep));
94
+ const dependents = Object.keys(packageInfos[pkg].dependents ?? {}).filter((dep)=>packages.includes(dep));
95
+ accum[pkg] = {
96
+ dependencies,
97
+ dependents
98
+ };
99
+ return accum;
100
+ }, {});
101
+ return {
102
+ packages: packageGraph,
103
+ count: packages.length
104
+ };
105
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "affectedCommand", {
6
+ enumerable: true,
7
+ get: ()=>affectedCommand
8
+ });
9
+ const _commander = require("commander");
10
+ const _addFilterOptionsJs = require("../addFilterOptions.js");
11
+ const _actionJs = require("./action.js");
12
+ const affectedCommand = new _commander.Command("affected");
13
+ (0, _addFilterOptionsJs.addFilterOptions)(affectedCommand).action(_actionJs.affectedAction).option("--output-format <graph|json|default>", `Generate a report about what packages are affected by the current change (defaults to human readable format) ` + `"graph" will generate a GraphViz .dot file format`).option("--since <branch>", "Calculate changes since this branch (defaults to origin/master)", "origin/master");
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "createReporter", {
9
9
  const _logger = require("@lage-run/logger");
10
10
  const _reporters = require("@lage-run/reporters");
11
11
  function createReporter(reporter, options) {
12
- const { verbose , grouped , logLevel: logLevelName , concurrency , profile } = options;
12
+ const { verbose , grouped , logLevel: logLevelName , concurrency , profile , progress } = options;
13
13
  const logLevel = _logger.LogLevel[logLevelName];
14
14
  switch(reporter){
15
15
  case "profile":
@@ -27,20 +27,15 @@ function createReporter(reporter, options) {
27
27
  grouped,
28
28
  logLevel: verbose ? _logger.LogLevel.verbose : logLevel
29
29
  });
30
- case "old":
31
- return new _reporters.LogReporter({
32
- grouped,
33
- logLevel: verbose ? _logger.LogLevel.verbose : logLevel
34
- });
35
30
  default:
36
- if (verbose || grouped) {
37
- return new _reporters.LogReporter({
38
- grouped,
39
- logLevel: verbose ? _logger.LogLevel.verbose : logLevel
31
+ if (progress && !(verbose || grouped)) {
32
+ return new _reporters.ProgressReporter({
33
+ concurrency
40
34
  });
41
35
  }
42
- return new _reporters.ProgressReporter({
43
- concurrency
36
+ return new _reporters.LogReporter({
37
+ grouped,
38
+ logLevel: verbose ? _logger.LogLevel.verbose : logLevel
44
39
  });
45
40
  }
46
41
  }
@@ -13,7 +13,7 @@ const _isRunningFromCIJs = require("../isRunningFromCI.js");
13
13
  const _addFilterOptionsJs = require("../addFilterOptions.js");
14
14
  const runCommand = new _commander.Command("run");
15
15
  (0, _addFilterOptionsJs.addFilterOptions)((0, _addLoggerOptionsJs.addLoggerOptions)(runCommand)).action(_actionJs.action).option("-c, --concurrency <n>", "concurrency", (value)=>parseInt(value, 10)).option("--max-workers-per-task <maxWorkersPerTarget...>", "set max worker per task, e.g. --max-workers-per-task build=2 test=4", [])// Run Command Options
16
- .option("--no-cache", "disables the cache").option("--reset-cache", "resets the cache, filling it after a run").option("--skip-local-cache", "skips caching locally (defaults to true in CI environments)", _isRunningFromCIJs.isRunningFromCI).option("--profile [profile]", "writes a run profile into a file that can be processed by Chromium devtool").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').option("--continue", "continues the run even on error").addOption(new _commander.Option("--info", "outputs information about a run action, suitable for calculating shards or as an input for another task runner").conflicts("unstableWatch")).option("--unstable-watch", "runs in watch mode").allowUnknownOption(true).addHelpCommand("[run] command1 [command2...commandN] [options]", "run commands").addHelpText("after", `
16
+ .option("--no-cache", "disables the cache").option("--reset-cache", "resets the cache, filling it after a run").option("--skip-local-cache", "skips caching locally (defaults to true in CI environments)", _isRunningFromCIJs.isRunningFromCI).option("--profile [profile]", "writes a run profile into a file that can be processed by Chromium devtool").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').option("--continue", "continues the run even on error").option("--allow-no-target-runs").addOption(new _commander.Option("--info", "outputs information about a run action, suitable for calculating shards or as an input for another task runner").conflicts("unstableWatch")).option("--unstable-watch", "runs in watch mode").allowUnknownOption(true).addHelpCommand("[run] command1 [command2...commandN] [options]", "run commands").addHelpText("after", `
17
17
  Runs a set of commands in a target graph. The targets are defined by packages and their scripts as defined the package.json files.
18
18
 
19
19
  Examples
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/cli",
3
- "version": "0.7.3",
3
+ "version": "0.8.1",
4
4
  "description": "Command Line Interface for Lage",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"
package/lib/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function addFilterOptions(program: Command): Command;
@@ -1,2 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function addLoggerOptions(program: Command): Command;
@@ -1,8 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
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 {};
@@ -1 +0,0 @@
1
- export declare function getCacheDir(workspace: string, internalCacheFolder: string): string;
@@ -1,8 +0,0 @@
1
- import type { Logger } from "@lage-run/logger";
2
- export interface ClearCacheOptions {
3
- cwd: string;
4
- internalCacheFolder: string;
5
- logger: Logger;
6
- concurrency: number;
7
- }
8
- export declare function clearCache(options: ClearCacheOptions): Promise<void>;
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- declare const cacheCommand: Command;
3
- export { cacheCommand };
@@ -1,9 +0,0 @@
1
- import type { Logger } from "@lage-run/logger";
2
- export interface PruneCacheOptions {
3
- cwd: string;
4
- internalCacheFolder: string;
5
- logger: Logger;
6
- concurrency: number;
7
- pruneDays: number;
8
- }
9
- export declare function pruneCache(options: PruneCacheOptions): Promise<void>;
@@ -1,5 +0,0 @@
1
- import type { TargetRunner, TargetRunnerOptions } from "@lage-run/scheduler-types";
2
- export declare class ClearCacheRunner implements TargetRunner {
3
- shouldRun(): Promise<boolean>;
4
- run(runOptions: TargetRunnerOptions): Promise<void>;
5
- }
@@ -1,5 +0,0 @@
1
- import type { TargetRunner, TargetRunnerOptions } from "@lage-run/scheduler-types";
2
- export declare class PruneCacheRunner implements TargetRunner {
3
- shouldRun(): Promise<boolean>;
4
- run(runOptions: TargetRunnerOptions): Promise<void>;
5
- }
@@ -1,3 +0,0 @@
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;
@@ -1,3 +0,0 @@
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>[];
@@ -1 +0,0 @@
1
- export declare const isRunningFromCI: boolean;
@@ -1,23 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
3
- interface RunOptions extends ReporterInitOptions {
4
- concurrency: number;
5
- profile: string | boolean | undefined;
6
- dependencies: boolean;
7
- dependents: boolean;
8
- since: string;
9
- to: string[];
10
- scope: string[];
11
- skipLocalCache: boolean;
12
- continue: boolean;
13
- cache: boolean;
14
- resetCache: boolean;
15
- nodeArg: string;
16
- ignore: string[];
17
- unstableWatch: boolean;
18
- info: boolean;
19
- maxWorkersPerTask: string[];
20
- allowNoTargetRuns: boolean;
21
- }
22
- export declare function action(options: RunOptions, command: Command): Promise<void>;
23
- export {};
@@ -1,15 +0,0 @@
1
- import type { CacheOptions } from "@lage-run/cache";
2
- import { RemoteFallbackCacheProvider, TargetHasher } from "@lage-run/cache";
3
- import type { Logger } from "@lage-run/logger";
4
- interface CreateCacheOptions {
5
- cacheOptions?: CacheOptions;
6
- logger: Logger;
7
- root: string;
8
- skipLocalCache: boolean;
9
- cliArgs: string[];
10
- }
11
- export declare function createCache(options: CreateCacheOptions): {
12
- cacheProvider: RemoteFallbackCacheProvider;
13
- hasher: TargetHasher;
14
- };
15
- export {};
@@ -1,21 +0,0 @@
1
- import type { Logger } from "@lage-run/logger";
2
- import type { PackageInfos } from "workspace-tools";
3
- import type { PipelineDefinition } from "../../types/PipelineDefinition.js";
4
- interface CreateTargetGraphOptions {
5
- logger: Logger;
6
- root: string;
7
- dependencies: boolean;
8
- dependents: boolean;
9
- since: string;
10
- scope: string[];
11
- ignore: string[];
12
- repoWideChanges: string[];
13
- pipeline: PipelineDefinition;
14
- outputs: string[];
15
- tasks: string[];
16
- packageInfos: PackageInfos;
17
- }
18
- export declare function createTargetGraph(options: CreateTargetGraphOptions): {
19
- targets: Map<string, import("@lage-run/target-graph").Target>;
20
- };
21
- export {};
@@ -1,4 +0,0 @@
1
- export declare function filterArgsForTasks(args: string[]): {
2
- tasks: string[];
3
- taskArgs: string[];
4
- };
@@ -1,3 +0,0 @@
1
- import type { Target } from "@lage-run/target-graph";
2
- import type { PipelineDefinition } from "../../types/PipelineDefinition.js";
3
- export declare function filterPipelineDefinitions(targets: IterableIterator<Target>, pipeline: PipelineDefinition): PipelineDefinition;
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- declare const runCommand: Command;
3
- export { runCommand };
@@ -1,14 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
3
- interface RunOptions extends ReporterInitOptions {
4
- dependencies: boolean;
5
- dependents: boolean;
6
- since: string;
7
- scope: string[];
8
- to: string[];
9
- cache: boolean;
10
- nodeArg: string;
11
- ignore: string[];
12
- }
13
- export declare function infoAction(options: RunOptions, command: Command): Promise<void>;
14
- export {};
@@ -1,21 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
3
- interface RunOptions extends ReporterInitOptions {
4
- concurrency: number;
5
- maxWorkersPerTask: string[];
6
- profile: string | boolean | undefined;
7
- dependencies: boolean;
8
- dependents: boolean;
9
- since: string;
10
- scope: string[];
11
- to: string[];
12
- skipLocalCache: boolean;
13
- continue: boolean;
14
- cache: boolean;
15
- resetCache: boolean;
16
- nodeArg: string;
17
- ignore: string[];
18
- allowNoTargetRuns: boolean;
19
- }
20
- export declare function runAction(options: RunOptions, command: Command): Promise<void>;
21
- export {};
@@ -1 +0,0 @@
1
- export { NpmScriptRunner } from "@lage-run/scheduler";
@@ -1 +0,0 @@
1
- export { WorkerRunner } from "@lage-run/scheduler";
@@ -1,20 +0,0 @@
1
- import type { Command } from "commander";
2
- import type { ReporterInitOptions } from "../../types/ReporterInitOptions.js";
3
- interface RunOptions extends ReporterInitOptions {
4
- concurrency: number;
5
- maxWorkersPerTask: string[];
6
- profile: string | boolean | undefined;
7
- dependencies: boolean;
8
- dependents: boolean;
9
- since: string;
10
- scope: string[];
11
- to: string[];
12
- skipLocalCache: boolean;
13
- continue: boolean;
14
- cache: boolean;
15
- resetCache: boolean;
16
- nodeArg: string;
17
- ignore: string[];
18
- }
19
- export declare function watchAction(options: RunOptions, command: Command): Promise<void>;
20
- export {};
@@ -1,3 +0,0 @@
1
- /// <reference types="node" />
2
- import EventEmitter from "events";
3
- export declare function watch(cwd: string): EventEmitter;
@@ -1 +0,0 @@
1
- export declare function getConcurrency(optionsConcurrency: number | undefined, configConcurrency: number | undefined): number;
@@ -1,2 +0,0 @@
1
- import type { ConfigOptions } from "../types/ConfigOptions.js";
2
- export declare function getConfig(cwd: string): Promise<ConfigOptions>;
@@ -1,3 +0,0 @@
1
- import type { ConfigOptions } from "../types/ConfigOptions.js";
2
- export declare function getMaxWorkersPerTask(pipelineConfig: ConfigOptions["pipeline"], concurrency: number): Map<string, number>;
3
- export declare function getMaxWorkersPerTaskFromOptions(maxWorkersPerTask: string[]): Map<string, number>;
@@ -1,21 +0,0 @@
1
- import type { PackageInfos } from "workspace-tools";
2
- import type { Logger } from "@lage-run/logger";
3
- export declare function getFilteredPackages(options: {
4
- root: string;
5
- packageInfos: PackageInfos;
6
- logger: Logger;
7
- scope: string[] | undefined;
8
- since: string | undefined;
9
- sinceIgnoreGlobs: string[] | undefined;
10
- repoWideChanges: string[];
11
- includeDependents: boolean;
12
- includeDependencies: boolean;
13
- }): string[];
14
- export declare function filterPackages(options: {
15
- logger: Logger;
16
- packageInfos: PackageInfos;
17
- includeDependents: boolean;
18
- includeDependencies: boolean;
19
- scopedPackages: string[] | undefined;
20
- changedPackages: string[] | undefined;
21
- }): string[];
package/lib/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export type { ConfigOptions } from "./types/ConfigOptions.js";
package/lib/showHelp.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function showHelp(msg: string): void;
@@ -1,7 +0,0 @@
1
- import type { Config as BackfillCacheOptions } from "backfill-config";
2
- export type CacheOptions = BackfillCacheOptions & {
3
- environmentGlob: string[];
4
- cacheKey: string;
5
- writeRemoteCache: boolean;
6
- skipLocalCache: boolean;
7
- };
@@ -1,56 +0,0 @@
1
- import type { CacheOptions } from "./CacheOptions.js";
2
- import type { Priority } from "./Priority.js";
3
- import type { PipelineDefinition } from "./PipelineDefinition.js";
4
- import type { LoggerOptions } from "./LoggerOptions.js";
5
- import type { TargetRunnerPickerOptions } from "@lage-run/scheduler/lib/runners/TargetRunnerPicker.js";
6
- export type NpmClient = "npm" | "yarn" | "pnpm";
7
- export interface ConfigOptions {
8
- /**
9
- * Defines the task pipeline, prefix with "^" character to denote a direct topological dependency,
10
- * prefix with ^^ to denote a transitive topological dependency.
11
- *
12
- * Example:
13
- *
14
- * ```
15
- * {
16
- * build: ["^build"],
17
- * test: ["build"],
18
- * lint: []
19
- * bundle: ["^^transpile"],
20
- * transpile: [],
21
- * }
22
- * ```
23
- */
24
- pipeline: PipelineDefinition;
25
- /** Backfill cache options */
26
- cacheOptions: CacheOptions;
27
- /** Which files to ignore when calculating scopes with --since */
28
- ignore: string[];
29
- /** disables --since flag when any of this list of files changed */
30
- repoWideChanges: string[];
31
- /** Which NPM Client to use when running npm lifecycle scripts */
32
- npmClient: NpmClient;
33
- /** Optional priority to set on tasks in a package to make the scheduler give priority to tasks on the critical path for high priority tasks */
34
- priorities: Priority[];
35
- /**
36
- * Options that will be sent to all log reporters.
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;
44
- /**
45
- * Maximum worker idle memory, this would cause workers to restart if they exceed this limit. This is useful to prevent memory leaks.
46
- */
47
- workerIdleMemoryLimit: number;
48
- /**
49
- * Maximum number of concurrent tasks to run
50
- */
51
- concurrency: number;
52
- /**
53
- * Allows for no targets run
54
- */
55
- allowNoTargetRuns: boolean;
56
- }
@@ -1,15 +0,0 @@
1
- import type { LogLevel } from "@lage-run/logger";
2
- export interface LoggerOptions {
3
- disp?: {
4
- [level: string]: string;
5
- };
6
- style?: {
7
- [level: string]: {
8
- fg?: string;
9
- bg?: string;
10
- };
11
- };
12
- levels?: {
13
- [level: string]: LogLevel;
14
- };
15
- }
@@ -1,12 +0,0 @@
1
- import type { TargetConfig } from "@lage-run/target-graph";
2
- import type { ConfigOptions } from "./ConfigOptions.js";
3
- export interface FactoryArgs {
4
- cwd: string;
5
- config: ConfigOptions;
6
- }
7
- export interface TargetConfigFactory {
8
- (args: FactoryArgs): TargetConfig | TargetConfig[];
9
- }
10
- export interface PipelineDefinition {
11
- [task: string]: string[] | TargetConfig;
12
- }
@@ -1,8 +0,0 @@
1
- export interface Priority {
2
- /** package name, as in package.json */
3
- package?: string;
4
- /** task name, as listed in the `scripts` section of package.json */
5
- task: string;
6
- /** priority, the higher the more priority; undefined priority means lowest priority*/
7
- priority: number;
8
- }
@@ -1,10 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export declare const NoTargetFoundError: Error;