@rushstack/rush-sdk 5.170.1-pr5378.0 → 5.171.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rush-lib.d.ts +132 -457
- package/lib-commonjs/{logic/operations → cli/parsing}/ParseParallelism.js +1 -2
- package/lib-commonjs/index.js +0 -1
- package/lib-commonjs/logic/operations/OperationExecutionManager.js +3 -0
- package/lib-commonjs/logic/operations/OperationStatus.js +0 -1
- package/lib-commonjs/logic/operations/WeightedOperationPlugin.js +3 -0
- package/lib-dts/api/CommandLineConfiguration.d.ts +0 -7
- package/lib-dts/api/CommandLineJson.d.ts +0 -1
- package/lib-dts/api/EventHooks.d.ts +1 -1
- package/lib-dts/cli/parsing/ParseParallelism.d.ts +17 -0
- package/lib-dts/cli/parsing/SelectionParameterSet.d.ts +1 -1
- package/lib-dts/cli/scriptActions/PhasedScriptAction.d.ts +12 -2
- package/lib-dts/index.d.ts +4 -7
- package/lib-dts/logic/ProjectWatcher.d.ts +42 -64
- package/lib-dts/logic/buildCache/OperationBuildCache.d.ts +2 -2
- package/lib-dts/logic/operations/IOperationExecutionResult.d.ts +16 -57
- package/lib-dts/logic/operations/IOperationRunner.d.ts +2 -32
- package/lib-dts/logic/operations/IPCOperationRunner.d.ts +8 -8
- package/lib-dts/logic/operations/Operation.d.ts +14 -50
- package/lib-dts/logic/operations/OperationExecutionManager.d.ts +60 -0
- package/lib-dts/logic/operations/OperationExecutionRecord.d.ts +9 -21
- package/lib-dts/logic/operations/OperationStatus.d.ts +0 -4
- package/lib-dts/logic/operations/ShellOperationRunner.d.ts +5 -6
- package/lib-dts/logic/operations/ShellOperationRunnerPlugin.d.ts +1 -2
- package/lib-dts/logic/operations/ValidateOperationsPlugin.d.ts +3 -1
- package/lib-dts/logic/operations/WeightedOperationPlugin.d.ts +10 -0
- package/lib-dts/pluginFramework/PhasedCommandHooks.d.ts +98 -32
- package/lib-dts/utilities/Stopwatch.d.ts +2 -2
- package/lib-shim/index.js +0 -1
- package/package.json +8 -8
- package/lib-commonjs/logic/operations/IOperationGraph.js +0 -2
- package/lib-commonjs/logic/operations/OperationGraph.js +0 -3
- package/lib-commonjs/pluginFramework/OperationGraphHooks.js +0 -3
- package/lib-dts/logic/operations/IOperationGraph.d.ts +0 -137
- package/lib-dts/logic/operations/OperationGraph.d.ts +0 -125
- package/lib-dts/logic/operations/ParseParallelism.d.ts +0 -33
- package/lib-dts/pluginFramework/OperationGraphHooks.d.ts +0 -129
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const _m = require("../../../lib-shim/index.js")._rushSdk_loadInternalModule("
|
|
1
|
+
const _m = require("../../../lib-shim/index.js")._rushSdk_loadInternalModule("cli/parsing/ParseParallelism");
|
|
2
2
|
module.exports = _m;
|
|
3
|
-
exports.coerceParallelism = _m.coerceParallelism;
|
|
4
3
|
exports.getNumberOfCores = _m.getNumberOfCores;
|
|
5
4
|
exports.parseParallelism = _m.parseParallelism;
|
|
6
5
|
exports.parseParallelismPercent = _m.parseParallelismPercent;
|
package/lib-commonjs/index.js
CHANGED
|
@@ -25,7 +25,6 @@ exports.LockStepVersionPolicy = _m.LockStepVersionPolicy;
|
|
|
25
25
|
exports.LookupByPath = _m.LookupByPath;
|
|
26
26
|
exports.NpmOptionsConfiguration = _m.NpmOptionsConfiguration;
|
|
27
27
|
exports.Operation = _m.Operation;
|
|
28
|
-
exports.OperationGraphHooks = _m.OperationGraphHooks;
|
|
29
28
|
exports.OperationStatus = _m.OperationStatus;
|
|
30
29
|
exports.PackageJsonDependency = _m.PackageJsonDependency;
|
|
31
30
|
exports.PackageJsonDependencyMeta = _m.PackageJsonDependencyMeta;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const _m = require("../../../lib-shim/index.js")._rushSdk_loadInternalModule("logic/operations/OperationStatus");
|
|
2
2
|
module.exports = _m;
|
|
3
3
|
exports.OperationStatus = _m.OperationStatus;
|
|
4
|
-
exports.SUCCESS_STATUSES = _m.SUCCESS_STATUSES;
|
|
5
4
|
exports.TERMINAL_STATUSES = _m.TERMINAL_STATUSES;
|
|
@@ -85,13 +85,6 @@ export interface IPhasedCommandConfig extends IPhasedCommandWithoutPhasesJson, I
|
|
|
85
85
|
* How many milliseconds to wait after receiving a file system notification before executing in watch mode.
|
|
86
86
|
*/
|
|
87
87
|
watchDebounceMs?: number;
|
|
88
|
-
/**
|
|
89
|
-
* If true, when running this command in watch mode the operation graph will include every project
|
|
90
|
-
* in the repository (respecting phase selection), but only the projects selected by the user's
|
|
91
|
-
* CLI project selection parameters will be initially enabled. Other projects will remain disabled
|
|
92
|
-
* unless they become required or are explicitly selected in a subsequent pass.
|
|
93
|
-
*/
|
|
94
|
-
includeAllProjectsInWatchGraph?: boolean;
|
|
95
88
|
/**
|
|
96
89
|
* If set to `true`, then this phased command will always perform an install before executing, regardless of CLI flags.
|
|
97
90
|
* If set to `false`, then Rush will define a built-in "--install" CLI flag for this command.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function getNumberOfCores(): number;
|
|
2
|
+
/**
|
|
3
|
+
* Since the JSON value is a string, it must be a percentage like "50%",
|
|
4
|
+
* which we convert to a number based on the available parallelism.
|
|
5
|
+
* For example, if the available parallelism (not the -p flag) is 8 and the weight is "50%",
|
|
6
|
+
* then the resulting weight will be 4.
|
|
7
|
+
*
|
|
8
|
+
* @param weight
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function parseParallelismPercent(weight: string, numberOfCores?: number): number;
|
|
12
|
+
/**
|
|
13
|
+
* Parses a command line specification for desired parallelism.
|
|
14
|
+
* Factored out to enable unit tests
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseParallelism(rawParallelism: string | undefined, numberOfCores?: number): number;
|
|
17
|
+
//# sourceMappingURL=ParseParallelism.d.ts.map
|
|
@@ -46,7 +46,7 @@ export declare class SelectionParameterSet {
|
|
|
46
46
|
*
|
|
47
47
|
* If no parameters are specified, returns all projects in the Rush config file.
|
|
48
48
|
*/
|
|
49
|
-
getSelectedProjectsAsync(terminal: ITerminal
|
|
49
|
+
getSelectedProjectsAsync(terminal: ITerminal): Promise<Set<RushConfigurationProject>>;
|
|
50
50
|
/**
|
|
51
51
|
* Represents the selection as `--filter` parameters to pnpm.
|
|
52
52
|
*
|
|
@@ -13,7 +13,6 @@ export interface IPhasedScriptActionOptions extends IBaseScriptActionOptions<IPh
|
|
|
13
13
|
originalPhases: Set<IPhase>;
|
|
14
14
|
initialPhases: Set<IPhase>;
|
|
15
15
|
watchPhases: Set<IPhase>;
|
|
16
|
-
includeAllProjectsInWatchGraph: boolean;
|
|
17
16
|
phases: Map<string, IPhase>;
|
|
18
17
|
alwaysWatch: boolean;
|
|
19
18
|
alwaysInstall: boolean | undefined;
|
|
@@ -45,9 +44,10 @@ export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandC
|
|
|
45
44
|
private readonly _watchDebounceMs;
|
|
46
45
|
private readonly _alwaysWatch;
|
|
47
46
|
private readonly _alwaysInstall;
|
|
48
|
-
private readonly _includeAllProjectsInWatchGraph;
|
|
49
47
|
private readonly _knownPhases;
|
|
50
48
|
private readonly _terminal;
|
|
49
|
+
private _changedProjectsOnly;
|
|
50
|
+
private _executionAbortController;
|
|
51
51
|
private readonly _changedProjectsOnlyParameter;
|
|
52
52
|
private readonly _selectionParameters;
|
|
53
53
|
private readonly _verboseParameter;
|
|
@@ -64,6 +64,16 @@ export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandC
|
|
|
64
64
|
private readonly _includePhaseDeps;
|
|
65
65
|
constructor(options: IPhasedScriptActionOptions);
|
|
66
66
|
runAsync(): Promise<void>;
|
|
67
|
+
private _runInitialPhasesAsync;
|
|
68
|
+
private _registerWatchModeInterface;
|
|
69
|
+
/**
|
|
70
|
+
* Runs the command in watch mode. Fundamentally is a simple loop:
|
|
71
|
+
* 1) Wait for a change to one or more projects in the selection
|
|
72
|
+
* 2) Invoke the command on the changed projects, and, if applicable, impacted projects
|
|
73
|
+
* Uses the same algorithm as --impacted-by
|
|
74
|
+
* 3) Goto (1)
|
|
75
|
+
*/
|
|
76
|
+
private _runWatchPhasesAsync;
|
|
67
77
|
/**
|
|
68
78
|
* Runs a set of operations and reports the results.
|
|
69
79
|
*/
|
package/lib-dts/index.d.ts
CHANGED
|
@@ -40,17 +40,14 @@ export { ExperimentsConfiguration, type IExperimentsJson } from './api/Experimen
|
|
|
40
40
|
export { CustomTipsConfiguration, CustomTipId, type ICustomTipsJson, type ICustomTipInfo, type ICustomTipItemJson, CustomTipSeverity, CustomTipType } from './api/CustomTipsConfiguration';
|
|
41
41
|
export { ProjectChangeAnalyzer, type IGetChangedProjectsOptions } from './logic/ProjectChangeAnalyzer';
|
|
42
42
|
export type { IInputsSnapshot, GetInputsSnapshotAsyncFn as GetInputsSnapshotAsyncFn, IRushConfigurationProjectForSnapshot } from './logic/incremental/InputsSnapshot';
|
|
43
|
-
export type { IOperationRunner, IOperationRunnerContext
|
|
44
|
-
export type {
|
|
45
|
-
export { type IOperationOptions,
|
|
46
|
-
export { type IParallelismScalar, type Parallelism } from './logic/operations/ParseParallelism';
|
|
43
|
+
export type { IOperationRunner, IOperationRunnerContext } from './logic/operations/IOperationRunner';
|
|
44
|
+
export type { IExecutionResult, IOperationExecutionResult } from './logic/operations/IOperationExecutionResult';
|
|
45
|
+
export { type IOperationOptions, Operation } from './logic/operations/Operation';
|
|
47
46
|
export { OperationStatus } from './logic/operations/OperationStatus';
|
|
48
47
|
export type { ILogFilePaths } from './logic/operations/ProjectLogWritable';
|
|
49
48
|
export { RushSession, type IRushSessionOptions, type CloudBuildCacheProviderFactory, type CobuildLockProviderFactory } from './pluginFramework/RushSession';
|
|
50
49
|
export { type IRushCommand, type IGlobalCommand, type IPhasedCommand, RushLifecycleHooks } from './pluginFramework/RushLifeCycle';
|
|
51
|
-
export { type ICreateOperationsContext, type
|
|
52
|
-
export type { IOperationGraph, IOperationGraphIterationOptions } from './logic/operations/IOperationGraph';
|
|
53
|
-
export { OperationGraphHooks } from './pluginFramework/OperationGraphHooks';
|
|
50
|
+
export { type ICreateOperationsContext, type IExecuteOperationsContext, PhasedCommandHooks } from './pluginFramework/PhasedCommandHooks';
|
|
54
51
|
export type { IRushPlugin } from './pluginFramework/IRushPlugin';
|
|
55
52
|
export type { IBuiltInPluginConfiguration as _IBuiltInPluginConfiguration } from './pluginFramework/PluginLoader/BuiltInPluginLoader';
|
|
56
53
|
export type { IRushPluginConfigurationBase as _IRushPluginConfigurationBase } from './api/RushPluginsConfiguration';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type ITerminal } from '@rushstack/terminal';
|
|
2
|
-
import type { IInputsSnapshot } from './incremental/InputsSnapshot';
|
|
2
|
+
import type { IInputsSnapshot, GetInputsSnapshotAsyncFn } from './incremental/InputsSnapshot';
|
|
3
3
|
import type { RushConfiguration } from '../api/RushConfiguration';
|
|
4
4
|
import type { RushConfigurationProject } from '../api/RushConfigurationProject';
|
|
5
|
-
import type { IOperationGraph } from './operations/IOperationGraph';
|
|
6
5
|
export interface IProjectWatcherOptions {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
abortSignal: AbortSignal;
|
|
7
|
+
getInputsSnapshotAsync: GetInputsSnapshotAsyncFn;
|
|
8
|
+
debounceMs?: number;
|
|
9
9
|
rushConfiguration: RushConfiguration;
|
|
10
|
+
projectsToWatch: ReadonlySet<RushConfigurationProject>;
|
|
10
11
|
terminal: ITerminal;
|
|
11
|
-
|
|
12
|
-
initialSnapshot: IInputsSnapshot;
|
|
12
|
+
initialSnapshot?: IInputsSnapshot | undefined;
|
|
13
13
|
}
|
|
14
14
|
export interface IProjectChangeResult {
|
|
15
15
|
/**
|
|
@@ -25,81 +25,59 @@ export interface IPromptGeneratorFunction {
|
|
|
25
25
|
(isPaused: boolean): Iterable<string>;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* rebuild iterations on the operation graph.
|
|
28
|
+
* This class is for incrementally watching a set of projects in the repository for changes.
|
|
30
29
|
*
|
|
31
|
-
*
|
|
32
|
-
* signal
|
|
30
|
+
* We are manually using fs.watch() instead of `chokidar` because all we want from the file system watcher is a boolean
|
|
31
|
+
* signal indicating that "at least 1 file in a watched project changed". We then defer to getInputsSnapshotAsync (which
|
|
32
|
+
* is responsible for change detection in all incremental builds) to determine what actually chanaged.
|
|
33
|
+
*
|
|
34
|
+
* Calling `waitForChange()` will return a promise that resolves when the package-deps of one or
|
|
35
|
+
* more projects differ from the value the previous time it was invoked. The first time will always resolve with the full selection.
|
|
33
36
|
*/
|
|
34
37
|
export declare class ProjectWatcher {
|
|
38
|
+
private readonly _abortSignal;
|
|
39
|
+
private readonly _getInputsSnapshotAsync;
|
|
35
40
|
private readonly _debounceMs;
|
|
41
|
+
private readonly _repoRoot;
|
|
36
42
|
private readonly _rushConfiguration;
|
|
43
|
+
private readonly _projectsToWatch;
|
|
37
44
|
private readonly _terminal;
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
private
|
|
41
|
-
private
|
|
42
|
-
private
|
|
43
|
-
private
|
|
45
|
+
private _initialSnapshot;
|
|
46
|
+
private _previousSnapshot;
|
|
47
|
+
private _forceChangedProjects;
|
|
48
|
+
private _resolveIfChanged;
|
|
49
|
+
private _onAbort;
|
|
50
|
+
private _getPromptLines;
|
|
44
51
|
private _lastStatus;
|
|
45
52
|
private _renderedStatusLines;
|
|
46
|
-
|
|
47
|
-
private _stdinListening;
|
|
48
|
-
private _stdinHadRawMode;
|
|
49
|
-
private _onStdinDataBound;
|
|
53
|
+
isPaused: boolean;
|
|
50
54
|
constructor(options: IProjectWatcherOptions);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
pause(): void;
|
|
56
|
+
resume(): void;
|
|
57
|
+
invalidateProject(project: RushConfigurationProject, reason: string): boolean;
|
|
58
|
+
invalidateAll(reason: string): void;
|
|
55
59
|
clearStatus(): void;
|
|
56
|
-
/**
|
|
57
|
-
* Re-renders the most recent status line (or a default) in place.
|
|
58
|
-
*/
|
|
59
60
|
rerenderStatus(): void;
|
|
61
|
+
setPromptGenerator(promptGenerator: IPromptGeneratorFunction): void;
|
|
60
62
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
63
|
+
* Waits for a change to the package-deps of one or more of the selected projects, since the previous invocation.
|
|
64
|
+
* Will return immediately the first time it is invoked, since no state has been recorded.
|
|
65
|
+
* If no change is currently present, watches the source tree of all selected projects for file changes.
|
|
66
|
+
* `waitForChange` is not allowed to be called multiple times concurrently.
|
|
64
67
|
*/
|
|
68
|
+
waitForChangeAsync(onWatchingFiles?: () => void): Promise<IProjectChangeResult>;
|
|
65
69
|
private _setStatus;
|
|
66
70
|
/**
|
|
67
|
-
*
|
|
68
|
-
* On platforms without native recursive watch support (Linux), enumerates nested
|
|
69
|
-
* folders from the last snapshot to set up individual watchers.
|
|
70
|
-
*/
|
|
71
|
-
private _startWatching;
|
|
72
|
-
/**
|
|
73
|
-
* Closes all active file system watchers and waits for their close events to settle.
|
|
74
|
-
*/
|
|
75
|
-
private _stopWatchingAsync;
|
|
76
|
-
/**
|
|
77
|
-
* Handles a raw file system event by debouncing and scheduling an iteration.
|
|
78
|
-
* Ignores changes to `.git` and `node_modules`.
|
|
79
|
-
*/
|
|
80
|
-
private _onFsEvent;
|
|
81
|
-
/**
|
|
82
|
-
* Schedules a new execution iteration on the graph in response to detected file changes.
|
|
83
|
-
*/
|
|
84
|
-
private _scheduleIteration;
|
|
85
|
-
/**
|
|
86
|
-
* Sets up a raw-mode stdin listener so the user can interact with the watch session
|
|
87
|
-
* via single-key keybinds. Captures the previous raw-mode state for restoration on dispose.
|
|
88
|
-
*/
|
|
89
|
-
private _ensureStdin;
|
|
90
|
-
/**
|
|
91
|
-
* Removes the stdin listener and restores the previous raw-mode state.
|
|
92
|
-
*/
|
|
93
|
-
private _disposeStdin;
|
|
94
|
-
/**
|
|
95
|
-
* Processes a chunk of stdin data, dispatching each character to the appropriate
|
|
96
|
-
* keybind action on the operation graph.
|
|
71
|
+
* Determines which, if any, projects (within the selection) have new hashes for files that are not in .gitignore
|
|
97
72
|
*/
|
|
98
|
-
private
|
|
73
|
+
private _computeChangedAsync;
|
|
74
|
+
private _commitChanges;
|
|
99
75
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
76
|
+
* Tests for inequality of the passed Maps. Order invariant.
|
|
77
|
+
*
|
|
78
|
+
* @returns `true` if the maps are different, `false` otherwise
|
|
102
79
|
*/
|
|
103
|
-
private
|
|
80
|
+
private static _haveProjectDepsChanged;
|
|
81
|
+
private static _enumeratePathsToWatch;
|
|
104
82
|
}
|
|
105
83
|
//# sourceMappingURL=ProjectWatcher.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ITerminal } from '@rushstack/terminal';
|
|
2
2
|
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
3
|
import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
|
|
4
|
-
import type {
|
|
4
|
+
import type { IOperationExecutionResult } from '../operations/IOperationExecutionResult';
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
@@ -58,7 +58,7 @@ export declare class OperationBuildCache {
|
|
|
58
58
|
private static _tryGetTarUtility;
|
|
59
59
|
get cacheId(): string | undefined;
|
|
60
60
|
static getOperationBuildCache(options: IProjectBuildCacheOptions): OperationBuildCache;
|
|
61
|
-
static forOperation(executionResult:
|
|
61
|
+
static forOperation(executionResult: IOperationExecutionResult, options: IOperationBuildCacheOptions): OperationBuildCache;
|
|
62
62
|
tryRestoreFromCacheAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
|
|
63
63
|
trySetCacheEntryAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
|
|
64
64
|
/**
|
|
@@ -1,68 +1,17 @@
|
|
|
1
1
|
import type { StdioSummarizer, IProblemCollector } from '@rushstack/terminal';
|
|
2
2
|
import type { OperationStatus } from './OperationStatus';
|
|
3
|
-
import type { IOperationLastState } from './IOperationRunner';
|
|
4
3
|
import type { Operation } from './Operation';
|
|
5
4
|
import type { IStopwatchResult } from '../../utilities/Stopwatch';
|
|
6
5
|
import type { ILogFilePaths } from './ProjectLogWritable';
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @alpha
|
|
10
|
-
*/
|
|
11
|
-
export interface IOperationStateHashComponents {
|
|
12
|
-
/**
|
|
13
|
-
* The state hashes of operation dependencies, sorted by name.
|
|
14
|
-
* Each entry is of the form `{dependencyName}={hash}`.
|
|
15
|
-
*/
|
|
16
|
-
readonly dependencies: readonly string[];
|
|
17
|
-
/**
|
|
18
|
-
* The hash of the operation's own local inputs (e.g. tracked files, environment variables).
|
|
19
|
-
*/
|
|
20
|
-
readonly local: string;
|
|
21
|
-
/**
|
|
22
|
-
* The hash of the operation's configuration (e.g. CLI parameters).
|
|
23
|
-
*/
|
|
24
|
-
readonly config: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
7
|
+
* The `IOperationExecutionResult` interface represents the results of executing an {@link Operation}.
|
|
27
8
|
* @alpha
|
|
28
9
|
*/
|
|
29
|
-
export interface
|
|
10
|
+
export interface IOperationExecutionResult {
|
|
30
11
|
/**
|
|
31
12
|
* The operation itself
|
|
32
13
|
*/
|
|
33
14
|
readonly operation: Operation;
|
|
34
|
-
/**
|
|
35
|
-
* The relative path to the folder that contains operation metadata. This folder will be automatically included in cache entries.
|
|
36
|
-
*/
|
|
37
|
-
readonly metadataFolderPath: string;
|
|
38
|
-
/**
|
|
39
|
-
* Gets the hash of the state of all registered inputs to this operation.
|
|
40
|
-
* Calling this method will throw if Git is not available.
|
|
41
|
-
*/
|
|
42
|
-
getStateHash(): string;
|
|
43
|
-
/**
|
|
44
|
-
* Gets the structured components of the state hash. This is useful for debugging and
|
|
45
|
-
* incremental change detection.
|
|
46
|
-
* Calling this method will throw if Git is not available.
|
|
47
|
-
*/
|
|
48
|
-
getStateHashComponents(): IOperationStateHashComponents;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* The `IConfigurableOperation` interface represents an {@link Operation} whose
|
|
52
|
-
* execution can be configured before running.
|
|
53
|
-
* @alpha
|
|
54
|
-
*/
|
|
55
|
-
export interface IConfigurableOperation extends IBaseOperationExecutionResult {
|
|
56
|
-
/**
|
|
57
|
-
* True if the operation should execute in this iteration, false otherwise.
|
|
58
|
-
*/
|
|
59
|
-
enabled: boolean;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* The `IOperationExecutionResult` interface represents the results of executing an {@link Operation}.
|
|
63
|
-
* @alpha
|
|
64
|
-
*/
|
|
65
|
-
export interface IOperationExecutionResult extends IBaseOperationExecutionResult, IOperationLastState {
|
|
66
15
|
/**
|
|
67
16
|
* The current execution status of an operation. Operations start in the 'ready' state,
|
|
68
17
|
* but can be 'blocked' if an upstream operation failed. It is 'executing' when
|
|
@@ -79,10 +28,6 @@ export interface IOperationExecutionResult extends IBaseOperationExecutionResult
|
|
|
79
28
|
* If this operation is only present in the graph to maintain dependency relationships, this flag will be set to true.
|
|
80
29
|
*/
|
|
81
30
|
readonly silent: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* True if the operation should execute in this iteration, false otherwise.
|
|
84
|
-
*/
|
|
85
|
-
readonly enabled: boolean;
|
|
86
31
|
/**
|
|
87
32
|
* Object tracking execution timing.
|
|
88
33
|
*/
|
|
@@ -99,10 +44,24 @@ export interface IOperationExecutionResult extends IBaseOperationExecutionResult
|
|
|
99
44
|
* The value indicates the duration of the same operation without cache hit.
|
|
100
45
|
*/
|
|
101
46
|
readonly nonCachedDurationMs: number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* The relative path to the folder that contains operation metadata. This folder will be automatically included in cache entries.
|
|
49
|
+
*/
|
|
50
|
+
readonly metadataFolderPath: string | undefined;
|
|
102
51
|
/**
|
|
103
52
|
* The paths to the log files, if applicable.
|
|
104
53
|
*/
|
|
105
54
|
readonly logFilePaths: ILogFilePaths | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the hash of the state of all registered inputs to this operation.
|
|
57
|
+
* Calling this method will throw if Git is not available.
|
|
58
|
+
*/
|
|
59
|
+
getStateHash(): string;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the components of the state hash. This is useful for debugging purposes.
|
|
62
|
+
* Calling this method will throw if Git is not available.
|
|
63
|
+
*/
|
|
64
|
+
getStateHashComponents(): ReadonlyArray<string>;
|
|
106
65
|
}
|
|
107
66
|
/**
|
|
108
67
|
* The `IExecutionResult` interface represents the results of executing a set of {@link Operation}s.
|
|
@@ -4,17 +4,6 @@ import type { OperationStatus } from './OperationStatus';
|
|
|
4
4
|
import type { OperationMetadataManager } from './OperationMetadataManager';
|
|
5
5
|
import type { IStopwatchResult } from '../../utilities/Stopwatch';
|
|
6
6
|
import type { IEnvironment } from '../../utilities/Utilities';
|
|
7
|
-
/**
|
|
8
|
-
* A snapshot of a previous operation execution, passed to runners to inform incremental behavior.
|
|
9
|
-
*
|
|
10
|
-
* @beta
|
|
11
|
-
*/
|
|
12
|
-
export interface IOperationLastState {
|
|
13
|
-
/**
|
|
14
|
-
* The status from the previous execution of this operation.
|
|
15
|
-
*/
|
|
16
|
-
readonly status: OperationStatus;
|
|
17
|
-
}
|
|
18
7
|
/**
|
|
19
8
|
* Information passed to the executing `IOperationRunner`
|
|
20
9
|
*
|
|
@@ -60,12 +49,6 @@ export interface IOperationRunnerContext {
|
|
|
60
49
|
* it later (for example to re-print errors at end of execution).
|
|
61
50
|
*/
|
|
62
51
|
error?: Error;
|
|
63
|
-
/**
|
|
64
|
-
* Returns a callback that invalidates this operation so that it will be re-executed in the next iteration.
|
|
65
|
-
* The returned callback captures only the minimal state needed, avoiding retention of the full context.
|
|
66
|
-
* Callers should store the result rather than calling this method repeatedly.
|
|
67
|
-
*/
|
|
68
|
-
getInvalidateCallback(): (reason: string) => void;
|
|
69
52
|
/**
|
|
70
53
|
* Invokes the specified callback with a terminal that is associated with this operation.
|
|
71
54
|
*
|
|
@@ -78,7 +61,7 @@ export interface IOperationRunnerContext {
|
|
|
78
61
|
}
|
|
79
62
|
/**
|
|
80
63
|
* The `Operation` class is a node in the dependency graph of work that needs to be scheduled by the
|
|
81
|
-
* `
|
|
64
|
+
* `OperationExecutionManager`. Each `Operation` has a `runner` member of type `IOperationRunner`, whose
|
|
82
65
|
* implementation manages the actual process for running a single operation.
|
|
83
66
|
*
|
|
84
67
|
* @beta
|
|
@@ -110,26 +93,13 @@ export interface IOperationRunner {
|
|
|
110
93
|
* analysis purposes.
|
|
111
94
|
*/
|
|
112
95
|
readonly isNoOp?: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* If true, this runner currently owns some kind of active resource (e.g. a service or a watch process).
|
|
115
|
-
* This can be used to determine if the operation is "in progress" even if it is not currently executing.
|
|
116
|
-
* If the runner supports this property, it should update it as appropriate during execution.
|
|
117
|
-
* The property is optional to avoid breaking existing implementations of IOperationRunner.
|
|
118
|
-
*/
|
|
119
|
-
readonly isActive?: boolean;
|
|
120
96
|
/**
|
|
121
97
|
* Method to be executed for the operation.
|
|
122
|
-
* @param context - The context object containing information about the execution environment.
|
|
123
|
-
* @param lastState - The last execution result of this operation, if any.
|
|
124
98
|
*/
|
|
125
|
-
executeAsync(context: IOperationRunnerContext
|
|
99
|
+
executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
|
|
126
100
|
/**
|
|
127
101
|
* Return a hash of the configuration that affects the operation.
|
|
128
102
|
*/
|
|
129
103
|
getConfigHash(): string;
|
|
130
|
-
/**
|
|
131
|
-
* If this runner performs any background work to optimize future runs, this method will clean it up.
|
|
132
|
-
*/
|
|
133
|
-
closeAsync?(): Promise<void>;
|
|
134
104
|
}
|
|
135
105
|
//# sourceMappingURL=IOperationRunner.d.ts.map
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type { OperationRequestRunCallback } from '@rushstack/operation-graph';
|
|
1
2
|
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
2
3
|
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
|
-
import type { IOperationRunner, IOperationRunnerContext
|
|
4
|
+
import type { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
4
5
|
import { OperationStatus } from './OperationStatus';
|
|
5
6
|
export interface IIPCOperationRunnerOptions {
|
|
6
7
|
phase: IPhase;
|
|
7
8
|
project: RushConfigurationProject;
|
|
8
9
|
name: string;
|
|
9
|
-
|
|
10
|
-
incrementalCommand: string | undefined;
|
|
10
|
+
commandToRun: string;
|
|
11
11
|
commandForHash: string;
|
|
12
12
|
persist: boolean;
|
|
13
|
+
requestRun: OperationRequestRunCallback;
|
|
13
14
|
ignoredParameterValues: ReadonlyArray<string>;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
@@ -22,17 +23,16 @@ export declare class IPCOperationRunner implements IOperationRunner {
|
|
|
22
23
|
readonly silent: boolean;
|
|
23
24
|
readonly warningsAreAllowed: boolean;
|
|
24
25
|
private readonly _rushProject;
|
|
25
|
-
private readonly
|
|
26
|
-
private readonly _incrementalCommand;
|
|
26
|
+
private readonly _commandToRun;
|
|
27
27
|
private readonly _commandForHash;
|
|
28
28
|
private readonly _persist;
|
|
29
|
+
private readonly _requestRun;
|
|
29
30
|
private readonly _ignoredParameterValues;
|
|
30
31
|
private _ipcProcess;
|
|
31
32
|
private _processReadyPromise;
|
|
32
33
|
constructor(options: IIPCOperationRunnerOptions);
|
|
33
|
-
|
|
34
|
-
executeAsync(context: IOperationRunnerContext, lastState?: IOperationLastState): Promise<OperationStatus>;
|
|
34
|
+
executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
|
|
35
35
|
getConfigHash(): string;
|
|
36
|
-
|
|
36
|
+
shutdownAsync(): Promise<void>;
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=IPCOperationRunner.d.ts.map
|
|
@@ -2,18 +2,6 @@ import type { RushConfigurationProject } from '../../api/RushConfigurationProjec
|
|
|
2
2
|
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
3
3
|
import type { IOperationRunner } from './IOperationRunner';
|
|
4
4
|
import type { IOperationSettings } from '../../api/RushProjectConfiguration';
|
|
5
|
-
import { type Parallelism } from './ParseParallelism';
|
|
6
|
-
/**
|
|
7
|
-
* State for the `enabled` property of an `Operation`.
|
|
8
|
-
*
|
|
9
|
-
* - `true`: The operation should be executed if it or any dependencies changed.
|
|
10
|
-
* - `false`: The operation should be skipped.
|
|
11
|
-
* - `"ignore-dependency-changes"`: The operation should be executed if there are local changes in the project,
|
|
12
|
-
* otherwise it should be skipped. This is useful for operations like "test" where you may want to skip
|
|
13
|
-
* testing projects that haven't changed.
|
|
14
|
-
* @alpha
|
|
15
|
-
*/
|
|
16
|
-
export type OperationEnabledState = boolean | 'ignore-dependency-changes';
|
|
17
5
|
/**
|
|
18
6
|
* Options for constructing a new Operation.
|
|
19
7
|
* @alpha
|
|
@@ -27,18 +15,6 @@ export interface IOperationOptions {
|
|
|
27
15
|
* The Rush project associated with this Operation
|
|
28
16
|
*/
|
|
29
17
|
project: RushConfigurationProject;
|
|
30
|
-
/**
|
|
31
|
-
* If set to false, this operation will be skipped during evaluation (return OperationStatus.Skipped).
|
|
32
|
-
* This is useful for plugins to alter the scope of the operation graph across executions,
|
|
33
|
-
* e.g. to enable or disable unit test execution, or to include or exclude dependencies.
|
|
34
|
-
*
|
|
35
|
-
* The special value "ignore-dependency-changes" can be used to indicate that this operation should only
|
|
36
|
-
* be executed if there are local changes in the project. This is useful for operations like
|
|
37
|
-
* "test" where you may want to skip testing projects that haven't changed.
|
|
38
|
-
*
|
|
39
|
-
* The default value is `true`, meaning the operation will be executed if it or any dependencies change.
|
|
40
|
-
*/
|
|
41
|
-
enabled?: OperationEnabledState;
|
|
42
18
|
/**
|
|
43
19
|
* When the scheduler is ready to process this `Operation`, the `runner` implements the actual work of
|
|
44
20
|
* running the operation.
|
|
@@ -55,7 +31,7 @@ export interface IOperationOptions {
|
|
|
55
31
|
}
|
|
56
32
|
/**
|
|
57
33
|
* The `Operation` class is a node in the dependency graph of work that needs to be scheduled by the
|
|
58
|
-
* `
|
|
34
|
+
* `OperationExecutionManager`. Each `Operation` has a `runner` member of type `IOperationRunner`, whose
|
|
59
35
|
* implementation manages the actual process of running a single operation.
|
|
60
36
|
*
|
|
61
37
|
* The graph of `Operation` instances will be cloned into a separate execution graph after processing.
|
|
@@ -91,23 +67,17 @@ export declare class Operation {
|
|
|
91
67
|
*/
|
|
92
68
|
runner: IOperationRunner | undefined;
|
|
93
69
|
/**
|
|
94
|
-
* The
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* - `> 1` slots: operation that spawns multiple threads or requires significant RAM; reserving
|
|
106
|
-
* extra slots prevents overloading the machine (e.g. a whole-program bundler or a test suite
|
|
107
|
-
* that runs its own internal parallelism).
|
|
108
|
-
* - `0` slots: effectively free (e.g. a no-op or cache-restore step).
|
|
109
|
-
*/
|
|
110
|
-
weight: Parallelism;
|
|
70
|
+
* The weight for this operation. This scalar is the contribution of this operation to the
|
|
71
|
+
* `criticalPathLength` calculation above. Modify to indicate the following:
|
|
72
|
+
* - `weight` === 1: indicates that this operation has an average duration
|
|
73
|
+
* - `weight` > 1: indicates that this operation takes longer than average and so the scheduler
|
|
74
|
+
* should try to favor starting it over other, shorter operations. An example might be an operation that
|
|
75
|
+
* bundles an entire application and runs whole-program optimization.
|
|
76
|
+
* - `weight` < 1: indicates that this operation takes less time than average and so the scheduler
|
|
77
|
+
* should favor other, longer operations over it. An example might be an operation to unpack a cached
|
|
78
|
+
* output, or an operation using NullOperationRunner, which might use a value of 0.
|
|
79
|
+
*/
|
|
80
|
+
weight: number;
|
|
111
81
|
/**
|
|
112
82
|
* Get the operation settings for this operation, defaults to the values defined in
|
|
113
83
|
* the project configuration.
|
|
@@ -117,14 +87,8 @@ export declare class Operation {
|
|
|
117
87
|
* If set to false, this operation will be skipped during evaluation (return OperationStatus.Skipped).
|
|
118
88
|
* This is useful for plugins to alter the scope of the operation graph across executions,
|
|
119
89
|
* e.g. to enable or disable unit test execution, or to include or exclude dependencies.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
* be executed if there are local changes in the project. This is useful for operations like
|
|
123
|
-
* "test" where you may want to skip testing projects that haven't changed.
|
|
124
|
-
*
|
|
125
|
-
* The default value is `true`, meaning the operation will be executed if it or any dependencies change.
|
|
126
|
-
*/
|
|
127
|
-
enabled: OperationEnabledState;
|
|
90
|
+
*/
|
|
91
|
+
enabled: boolean;
|
|
128
92
|
constructor(options: IOperationOptions);
|
|
129
93
|
/**
|
|
130
94
|
* The name of this operation, for logging.
|