@rushstack/rush-sdk 5.102.0-pr3949.7 → 5.103.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 +10 -435
- package/lib/api/EnvironmentConfiguration.d.ts +0 -61
- package/lib/api/RushProjectConfiguration.d.ts +5 -19
- package/lib/index.d.ts +2 -5
- package/lib/logic/RushConstants.d.ts +0 -4
- package/lib/logic/buildCache/ProjectBuildCache.d.ts +7 -6
- package/lib/logic/operations/AsyncOperationQueue.d.ts +4 -23
- package/lib/logic/operations/IOperationExecutionResult.d.ts +1 -9
- package/lib/logic/operations/IOperationRunner.d.ts +6 -25
- package/lib/logic/operations/NullOperationRunner.d.ts +2 -2
- package/lib/logic/operations/OperationExecutionManager.d.ts +0 -6
- package/lib/logic/operations/OperationExecutionRecord.d.ts +1 -19
- package/lib/logic/operations/OperationMetadataManager.d.ts +1 -3
- package/lib/logic/operations/OperationStateFile.d.ts +0 -2
- package/lib/logic/operations/OperationStatus.d.ts +0 -8
- package/lib/logic/operations/ProjectLogWritable.d.ts +0 -11
- package/lib/logic/operations/ShellOperationRunner.d.ts +26 -4
- package/lib/pluginFramework/PhasedCommandHooks.d.ts +4 -31
- package/lib/pluginFramework/RushSession.d.ts +2 -11
- package/package.json +2 -2
- package/lib/api/CobuildConfiguration.d.ts +0 -71
- package/lib/api/CobuildConfiguration.js +0 -1
- package/lib/logic/cobuild/CobuildLock.d.ts +0 -43
- package/lib/logic/cobuild/CobuildLock.js +0 -1
- package/lib/logic/cobuild/DisjointSet.d.ts +0 -28
- package/lib/logic/cobuild/DisjointSet.js +0 -1
- package/lib/logic/cobuild/ICobuildLockProvider.d.ts +0 -99
- package/lib/logic/cobuild/ICobuildLockProvider.js +0 -1
- package/lib/logic/operations/CacheableOperationPlugin.d.ts +0 -51
- package/lib/logic/operations/CacheableOperationPlugin.js +0 -1
- package/lib/logic/operations/LegacySkipPlugin.d.ts +0 -22
- package/lib/logic/operations/LegacySkipPlugin.js +0 -1
- package/lib/logic/operations/PeriodicCallback.d.ts +0 -20
- package/lib/logic/operations/PeriodicCallback.js +0 -1
- package/lib/utilities/NullTerminalProvider.d.ts +0 -10
- package/lib/utilities/NullTerminalProvider.js +0 -1
|
@@ -120,43 +120,6 @@ export declare const EnvironmentVariableNames: {
|
|
|
120
120
|
* this environment variable is ignored.
|
|
121
121
|
*/
|
|
122
122
|
readonly RUSH_BUILD_CACHE_WRITE_ALLOWED: "RUSH_BUILD_CACHE_WRITE_ALLOWED";
|
|
123
|
-
/**
|
|
124
|
-
* Setting this environment variable overrides the value of `cobuildEnabled` in the `cobuild.json`
|
|
125
|
-
* configuration file.
|
|
126
|
-
*
|
|
127
|
-
* @remarks
|
|
128
|
-
* Specify `1` to enable the cobuild or `0` to disable it.
|
|
129
|
-
*
|
|
130
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
131
|
-
*/
|
|
132
|
-
readonly RUSH_COBUILD_ENABLED: "RUSH_COBUILD_ENABLED";
|
|
133
|
-
/**
|
|
134
|
-
* Setting this environment variable opts into running with cobuilds. The context id should be the same across
|
|
135
|
-
* multiple VMs, but changed when it is a new round of cobuilds.
|
|
136
|
-
*
|
|
137
|
-
* e.g. `Build.BuildNumber` in Azure DevOps Pipeline.
|
|
138
|
-
*
|
|
139
|
-
* @remarks
|
|
140
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
141
|
-
*/
|
|
142
|
-
readonly RUSH_COBUILD_CONTEXT_ID: "RUSH_COBUILD_CONTEXT_ID";
|
|
143
|
-
/**
|
|
144
|
-
* Explicitly specifies a name for each participating cobuild runner.
|
|
145
|
-
*
|
|
146
|
-
* Setting this environment variable opts into running with cobuilds.
|
|
147
|
-
*
|
|
148
|
-
* @remarks
|
|
149
|
-
* This environment variable is optional, if it is not provided, a random id is used.
|
|
150
|
-
*
|
|
151
|
-
* If there is no cobuild configured, then this environment variable is ignored.
|
|
152
|
-
*/
|
|
153
|
-
readonly RUSH_COBUILD_RUNNER_ID: "RUSH_COBUILD_RUNNER_ID";
|
|
154
|
-
/**
|
|
155
|
-
* If this variable is set to "1", When getting distributed builds, Rush will automatically handle the leaf project
|
|
156
|
-
* with build cache "disabled" by writing to the cache in a special "log files only mode". This is useful when you
|
|
157
|
-
* want to use Cobuilds to improve the performance in CI validations and the leaf projects have not enabled cache.
|
|
158
|
-
*/
|
|
159
|
-
readonly RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED: "RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED";
|
|
160
123
|
/**
|
|
161
124
|
* Explicitly specifies the path for the Git binary that is invoked by certain Rush operations.
|
|
162
125
|
*/
|
|
@@ -201,10 +164,6 @@ export declare class EnvironmentConfiguration {
|
|
|
201
164
|
private static _buildCacheCredential;
|
|
202
165
|
private static _buildCacheEnabled;
|
|
203
166
|
private static _buildCacheWriteAllowed;
|
|
204
|
-
private static _cobuildEnabled;
|
|
205
|
-
private static _cobuildContextId;
|
|
206
|
-
private static _cobuildRunnerId;
|
|
207
|
-
private static _cobuildLeafProjectLogOnlyAllowed;
|
|
208
167
|
private static _gitBinaryPath;
|
|
209
168
|
private static _tarBinaryPath;
|
|
210
169
|
/**
|
|
@@ -260,26 +219,6 @@ export declare class EnvironmentConfiguration {
|
|
|
260
219
|
* See {@link EnvironmentVariableNames.RUSH_BUILD_CACHE_WRITE_ALLOWED}
|
|
261
220
|
*/
|
|
262
221
|
static get buildCacheWriteAllowed(): boolean | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* If set, enables or disables the cobuild feature.
|
|
265
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_ENABLED}
|
|
266
|
-
*/
|
|
267
|
-
static get cobuildEnabled(): boolean | undefined;
|
|
268
|
-
/**
|
|
269
|
-
* Provides a determined cobuild context id if configured
|
|
270
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}
|
|
271
|
-
*/
|
|
272
|
-
static get cobuildContextId(): string | undefined;
|
|
273
|
-
/**
|
|
274
|
-
* Provides a determined cobuild runner id if configured
|
|
275
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_RUNNER_ID}
|
|
276
|
-
*/
|
|
277
|
-
static get cobuildRunnerId(): string | undefined;
|
|
278
|
-
/**
|
|
279
|
-
* If set, enables or disables the cobuild leaf project log only feature.
|
|
280
|
-
* See {@link EnvironmentVariableNames.RUSH_COBUILD_LEAF_PROJECT_LOG_ONLY_ALLOWED}
|
|
281
|
-
*/
|
|
282
|
-
static get cobuildLeafProjectLogOnlyAllowed(): boolean | undefined;
|
|
283
222
|
/**
|
|
284
223
|
* Allows the git binary path to be explicitly provided.
|
|
285
224
|
* See {@link EnvironmentVariableNames.RUSH_GIT_BINARY_PATH}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
2
|
import { RushConfigurationProject } from './RushConfigurationProject';
|
|
3
3
|
import type { IPhase } from './CommandLineConfiguration';
|
|
4
4
|
/**
|
|
5
|
-
* Describes the file structure for the
|
|
6
|
-
* @internal
|
|
5
|
+
* Describes the file structure for the "<project root>/config/rush-project.json" config file.
|
|
7
6
|
*/
|
|
8
7
|
export interface IRushProjectJson {
|
|
9
8
|
/**
|
|
@@ -27,9 +26,6 @@ export interface IRushProjectJson {
|
|
|
27
26
|
disableBuildCacheForProject?: boolean;
|
|
28
27
|
operationSettings?: IOperationSettings[];
|
|
29
28
|
}
|
|
30
|
-
/**
|
|
31
|
-
* @alpha
|
|
32
|
-
*/
|
|
33
29
|
export interface IOperationSettings {
|
|
34
30
|
/**
|
|
35
31
|
* The name of the operation. This should be a key in the `package.json`'s `scripts` object.
|
|
@@ -78,17 +74,17 @@ export interface IOperationSettings {
|
|
|
78
74
|
* Use this class to load the "config/rush-project.json" config file.
|
|
79
75
|
*
|
|
80
76
|
* This file provides project-specific configuration options.
|
|
81
|
-
* @
|
|
77
|
+
* @public
|
|
82
78
|
*/
|
|
83
79
|
export declare class RushProjectConfiguration {
|
|
84
80
|
private static readonly _configCache;
|
|
85
81
|
readonly project: RushConfigurationProject;
|
|
86
82
|
/**
|
|
87
|
-
* {@inheritdoc
|
|
83
|
+
* {@inheritdoc IRushProjectJson.incrementalBuildIgnoredGlobs}
|
|
88
84
|
*/
|
|
89
85
|
readonly incrementalBuildIgnoredGlobs: ReadonlyArray<string>;
|
|
90
86
|
/**
|
|
91
|
-
* {@inheritdoc
|
|
87
|
+
* {@inheritdoc IRushProjectJson.disableBuildCacheForProject}
|
|
92
88
|
*/
|
|
93
89
|
readonly disableBuildCacheForProject: boolean;
|
|
94
90
|
readonly operationSettingsByOperationName: ReadonlyMap<string, Readonly<IOperationSettings>>;
|
|
@@ -102,11 +98,6 @@ export declare class RushProjectConfiguration {
|
|
|
102
98
|
* that are not used by "rush build" will not cause "rush build" to exit with an error.
|
|
103
99
|
*/
|
|
104
100
|
validatePhaseConfiguration(phases: Iterable<IPhase>, terminal: ITerminal): void;
|
|
105
|
-
/**
|
|
106
|
-
* Examines the list of source files for the project and the target phase and returns a reason
|
|
107
|
-
* why the project cannot enable the build cache for that phase, or undefined if it is safe to so do.
|
|
108
|
-
*/
|
|
109
|
-
getCacheDisabledReason(trackedFileNames: Iterable<string>, phaseName: string): string | undefined;
|
|
110
101
|
/**
|
|
111
102
|
* Loads the rush-project.json data for the specified project.
|
|
112
103
|
*/
|
|
@@ -120,11 +111,6 @@ export declare class RushProjectConfiguration {
|
|
|
120
111
|
* having to validate the rest of the `rush-project.json` file against the repo's command-line configuration.
|
|
121
112
|
*/
|
|
122
113
|
static tryLoadIgnoreGlobsForProjectAsync(project: RushConfigurationProject, terminal: ITerminal): Promise<ReadonlyArray<string> | undefined>;
|
|
123
|
-
/**
|
|
124
|
-
* Load the rush-project.json data for all selected projects.
|
|
125
|
-
* Validate compatibility of output folders across all selected phases.
|
|
126
|
-
*/
|
|
127
|
-
static tryLoadAndValidateForProjectsAsync(projects: Iterable<RushConfigurationProject>, phases: ReadonlySet<IPhase>, terminal: ITerminal): Promise<ReadonlyMap<RushConfigurationProject, RushProjectConfiguration>>;
|
|
128
114
|
private static _tryLoadJsonForProjectAsync;
|
|
129
115
|
private static _getRushProjectConfiguration;
|
|
130
116
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,6 @@ export { INpmOptionsJson as _INpmOptionsJson, NpmOptionsConfiguration } from './
|
|
|
9
9
|
export { IYarnOptionsJson as _IYarnOptionsJson, YarnOptionsConfiguration } from './logic/yarn/YarnOptionsConfiguration';
|
|
10
10
|
export { IPnpmOptionsJson as _IPnpmOptionsJson, PnpmStoreOptions, PnpmOptionsConfiguration } from './logic/pnpm/PnpmOptionsConfiguration';
|
|
11
11
|
export { BuildCacheConfiguration } from './api/BuildCacheConfiguration';
|
|
12
|
-
export { CobuildConfiguration, ICobuildJson } from './api/CobuildConfiguration';
|
|
13
12
|
export { GetCacheEntryIdFunction, IGenerateCacheEntryIdOptions } from './logic/buildCache/CacheEntryId';
|
|
14
13
|
export { FileSystemBuildCacheProvider, IFileSystemBuildCacheProviderOptions } from './logic/buildCache/FileSystemBuildCacheProvider';
|
|
15
14
|
export { IPhase, PhaseBehaviorForMissingScript as IPhaseBehaviorForMissingScript } from './api/CommandLineConfiguration';
|
|
@@ -17,7 +16,6 @@ export { EnvironmentConfiguration, EnvironmentVariableNames, IEnvironmentConfigu
|
|
|
17
16
|
export { RushConstants } from './logic/RushConstants';
|
|
18
17
|
export { PackageManagerName, PackageManager } from './api/packageManager/PackageManager';
|
|
19
18
|
export { RushConfigurationProject } from './api/RushConfigurationProject';
|
|
20
|
-
export { IRushProjectJson as _IRushProjectJson, IOperationSettings, RushProjectConfiguration } from './api/RushProjectConfiguration';
|
|
21
19
|
export { RushUserConfiguration } from './api/RushUserConfiguration';
|
|
22
20
|
export { RushGlobalFolder as _RushGlobalFolder } from './api/RushGlobalFolder';
|
|
23
21
|
export { ApprovedPackagesItem, ApprovedPackagesConfiguration } from './api/ApprovedPackagesConfiguration';
|
|
@@ -34,12 +32,12 @@ export { ILaunchOptions, Rush } from './api/Rush';
|
|
|
34
32
|
export { RushInternals as _RushInternals } from './api/RushInternals';
|
|
35
33
|
export { ExperimentsConfiguration, IExperimentsJson } from './api/ExperimentsConfiguration';
|
|
36
34
|
export { CustomTipsConfiguration, CustomTipId, ICustomTipsJson, ICustomTipItemJson } from './api/CustomTipsConfiguration';
|
|
37
|
-
export { ProjectChangeAnalyzer, IGetChangedProjectsOptions
|
|
35
|
+
export { ProjectChangeAnalyzer, IGetChangedProjectsOptions } from './logic/ProjectChangeAnalyzer';
|
|
38
36
|
export { IOperationRunner, IOperationRunnerContext } from './logic/operations/IOperationRunner';
|
|
39
37
|
export { IExecutionResult, IOperationExecutionResult } from './logic/operations/IOperationExecutionResult';
|
|
40
38
|
export { IOperationOptions, Operation } from './logic/operations/Operation';
|
|
41
39
|
export { OperationStatus } from './logic/operations/OperationStatus';
|
|
42
|
-
export { RushSession, IRushSessionOptions, CloudBuildCacheProviderFactory
|
|
40
|
+
export { RushSession, IRushSessionOptions, CloudBuildCacheProviderFactory } from './pluginFramework/RushSession';
|
|
43
41
|
export { IRushCommand, IGlobalCommand, IPhasedCommand, RushLifecycleHooks } from './pluginFramework/RushLifeCycle';
|
|
44
42
|
export { ICreateOperationsContext, PhasedCommandHooks } from './pluginFramework/PhasedCommandHooks';
|
|
45
43
|
export { IRushPlugin } from './pluginFramework/IRushPlugin';
|
|
@@ -47,7 +45,6 @@ export { IBuiltInPluginConfiguration as _IBuiltInPluginConfiguration } from './p
|
|
|
47
45
|
export { IRushPluginConfigurationBase as _IRushPluginConfigurationBase } from './api/RushPluginsConfiguration';
|
|
48
46
|
export { ILogger } from './pluginFramework/logging/Logger';
|
|
49
47
|
export { ICloudBuildCacheProvider } from './logic/buildCache/ICloudBuildCacheProvider';
|
|
50
|
-
export { ICobuildLockProvider, ICobuildContext, ICobuildCompletedState } from './logic/cobuild/ICobuildLockProvider';
|
|
51
48
|
export { ICredentialCacheOptions, ICredentialCacheEntry, CredentialCache } from './logic/CredentialCache';
|
|
52
49
|
export type { ITelemetryData, ITelemetryMachineInfo, ITelemetryOperationResult } from './logic/Telemetry';
|
|
53
50
|
export { IStopwatchResult } from './utilities/Stopwatch';
|
|
@@ -154,10 +154,6 @@ export declare class RushConstants {
|
|
|
154
154
|
* Changing this ensures that cache entries generated by an old version will no longer register as a cache hit.
|
|
155
155
|
*/
|
|
156
156
|
static readonly buildCacheVersion: number;
|
|
157
|
-
/**
|
|
158
|
-
* Cobuild configuration file.
|
|
159
|
-
*/
|
|
160
|
-
static readonly cobuildFilename: string;
|
|
161
157
|
/**
|
|
162
158
|
* Per-project configuration filename.
|
|
163
159
|
*/
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
-
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
3
2
|
import { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
3
|
+
import { RushProjectConfiguration } from '../../api/RushProjectConfiguration';
|
|
4
4
|
import { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
|
|
5
5
|
export interface IProjectBuildCacheOptions {
|
|
6
6
|
buildCacheConfiguration: BuildCacheConfiguration;
|
|
7
|
-
|
|
7
|
+
projectConfiguration: RushProjectConfiguration;
|
|
8
8
|
projectOutputFolderNames: ReadonlyArray<string>;
|
|
9
9
|
additionalProjectOutputFilePaths?: ReadonlyArray<string>;
|
|
10
10
|
additionalContext?: Record<string, string>;
|
|
11
|
-
|
|
11
|
+
command: string;
|
|
12
|
+
trackedProjectFiles: string[] | undefined;
|
|
12
13
|
projectChangeAnalyzer: ProjectChangeAnalyzer;
|
|
13
14
|
terminal: ITerminal;
|
|
14
15
|
phaseName: string;
|
|
@@ -29,10 +30,10 @@ export declare class ProjectBuildCache {
|
|
|
29
30
|
private _cacheId;
|
|
30
31
|
private constructor();
|
|
31
32
|
private static _tryGetTarUtility;
|
|
32
|
-
get cacheId(): string | undefined;
|
|
33
33
|
static tryGetProjectBuildCache(options: IProjectBuildCacheOptions): Promise<ProjectBuildCache | undefined>;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
private static _validateProject;
|
|
35
|
+
tryRestoreFromCacheAsync(terminal: ITerminal): Promise<boolean>;
|
|
36
|
+
trySetCacheEntryAsync(terminal: ITerminal): Promise<boolean>;
|
|
36
37
|
/**
|
|
37
38
|
* Walks the declared output folders of the project and collects a list of files.
|
|
38
39
|
* @returns The list of output files as project-relative paths, or `undefined` if a
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* at this time, the caller has a chance to make a decision:
|
|
5
|
-
* 1. Manually invoke `tryGetRemoteExecutingOperation()` to get the remote executing operation.
|
|
6
|
-
* 2. If there is no remote executing operation available, wait for some time and return in callback, which
|
|
7
|
-
* internally invoke `assignOperations()` to assign new operations.
|
|
8
|
-
* NOTE: the caller must wait for some time to avoid busy loop and burn CPU cycles.
|
|
9
|
-
*/
|
|
10
|
-
export declare const UNASSIGNED_OPERATION: 'UNASSIGNED_OPERATION';
|
|
11
|
-
export type IOperationIteratorResult = OperationExecutionRecord | typeof UNASSIGNED_OPERATION;
|
|
12
|
-
/**
|
|
13
|
-
* Implementation of the async iteration protocol for a collection of IOperation objects.
|
|
3
|
+
* Implmentation of the async iteration protocol for a collection of IOperation objects.
|
|
14
4
|
* The async iterator will wait for an operation to be ready for execution, or terminate if there are no more operations.
|
|
15
5
|
*
|
|
16
6
|
* @remarks
|
|
@@ -18,12 +8,9 @@ export type IOperationIteratorResult = OperationExecutionRecord | typeof UNASSIG
|
|
|
18
8
|
* it must manually invoke `assignOperations()` after performing the updates, otherwise iterators will
|
|
19
9
|
* stall until another operations completes.
|
|
20
10
|
*/
|
|
21
|
-
export declare class AsyncOperationQueue implements AsyncIterable<
|
|
11
|
+
export declare class AsyncOperationQueue implements AsyncIterable<OperationExecutionRecord>, AsyncIterator<OperationExecutionRecord> {
|
|
22
12
|
private readonly _queue;
|
|
23
13
|
private readonly _pendingIterators;
|
|
24
|
-
private readonly _totalOperations;
|
|
25
|
-
private readonly _completedOperations;
|
|
26
|
-
private _isDone;
|
|
27
14
|
/**
|
|
28
15
|
* @param operations - The set of operations to be executed
|
|
29
16
|
* @param sortFn - A function that sorts operations in reverse priority order:
|
|
@@ -36,23 +23,17 @@ export declare class AsyncOperationQueue implements AsyncIterable<IOperationIter
|
|
|
36
23
|
* For use with `for await (const operation of taskQueue)`
|
|
37
24
|
* @see {AsyncIterator}
|
|
38
25
|
*/
|
|
39
|
-
next(): Promise<IteratorResult<
|
|
40
|
-
/**
|
|
41
|
-
* Set a callback to be invoked when one operation is completed.
|
|
42
|
-
* If all operations are completed, set the queue to done, resolve all pending iterators in next cycle.
|
|
43
|
-
*/
|
|
44
|
-
complete(record: OperationExecutionRecord): void;
|
|
26
|
+
next(): Promise<IteratorResult<OperationExecutionRecord>>;
|
|
45
27
|
/**
|
|
46
28
|
* Routes ready operations with 0 dependencies to waiting iterators. Normally invoked as part of `next()`, but
|
|
47
29
|
* if the caller does not update operation dependencies prior to calling `next()`, may need to be invoked manually.
|
|
48
30
|
*/
|
|
49
31
|
assignOperations(): void;
|
|
50
|
-
tryGetRemoteExecutingOperation(): OperationExecutionRecord | undefined;
|
|
51
32
|
/**
|
|
52
33
|
* Returns this queue as an async iterator, such that multiple functions iterating this object concurrently
|
|
53
34
|
* receive distinct iteration results.
|
|
54
35
|
*/
|
|
55
|
-
[Symbol.asyncIterator](): AsyncIterator<
|
|
36
|
+
[Symbol.asyncIterator](): AsyncIterator<OperationExecutionRecord>;
|
|
56
37
|
}
|
|
57
38
|
export interface IOperationSortFunction {
|
|
58
39
|
/**
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { StdioSummarizer } from '@rushstack/terminal';
|
|
2
2
|
import type { OperationStatus } from './OperationStatus';
|
|
3
|
-
import type { Operation } from './Operation';
|
|
4
3
|
import type { IStopwatchResult } from '../../utilities/Stopwatch';
|
|
4
|
+
import type { Operation } from './Operation';
|
|
5
5
|
/**
|
|
6
6
|
* The `IOperationExecutionResult` interface represents the results of executing an {@link Operation}.
|
|
7
7
|
* @alpha
|
|
8
8
|
*/
|
|
9
9
|
export interface IOperationExecutionResult {
|
|
10
|
-
/**
|
|
11
|
-
* The operation itself
|
|
12
|
-
*/
|
|
13
|
-
readonly operation: Operation;
|
|
14
10
|
/**
|
|
15
11
|
* The current execution status of an operation. Operations start in the 'ready' state,
|
|
16
12
|
* but can be 'blocked' if an upstream operation failed. It is 'executing' when
|
|
@@ -35,10 +31,6 @@ export interface IOperationExecutionResult {
|
|
|
35
31
|
* The value indicates the duration of the same operation without cache hit.
|
|
36
32
|
*/
|
|
37
33
|
readonly nonCachedDurationMs: number | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* The id of the runner which actually runs the building process in cobuild mode.
|
|
40
|
-
*/
|
|
41
|
-
readonly cobuildRunnerId: string | undefined;
|
|
42
34
|
}
|
|
43
35
|
/**
|
|
44
36
|
* The `IExecutionResult` interface represents the results of executing a set of {@link Operation}s.
|
|
@@ -35,25 +35,6 @@ export interface IOperationRunnerContext {
|
|
|
35
35
|
* Object used to track elapsed time.
|
|
36
36
|
*/
|
|
37
37
|
stopwatch: IStopwatchResult;
|
|
38
|
-
/**
|
|
39
|
-
* The current execution status of an operation. Operations start in the 'ready' state,
|
|
40
|
-
* but can be 'blocked' if an upstream operation failed. It is 'executing' when
|
|
41
|
-
* the operation is executing. Once execution is complete, it is either 'success' or
|
|
42
|
-
* 'failure'.
|
|
43
|
-
*/
|
|
44
|
-
status: OperationStatus;
|
|
45
|
-
/**
|
|
46
|
-
* Error which occurred while executing this operation, this is stored in case we need
|
|
47
|
-
* it later (for example to re-print errors at end of execution).
|
|
48
|
-
*/
|
|
49
|
-
error?: Error;
|
|
50
|
-
/**
|
|
51
|
-
* Normally the incremental build logic will rebuild changed projects as well as
|
|
52
|
-
* any projects that directly or indirectly depend on a changed project.
|
|
53
|
-
* If true, then the incremental build logic will only rebuild changed projects and
|
|
54
|
-
* ignore dependent projects.
|
|
55
|
-
*/
|
|
56
|
-
readonly changedProjectsOnly: boolean;
|
|
57
38
|
}
|
|
58
39
|
/**
|
|
59
40
|
* The `Operation` class is a node in the dependency graph of work that needs to be scheduled by the
|
|
@@ -68,9 +49,9 @@ export interface IOperationRunner {
|
|
|
68
49
|
*/
|
|
69
50
|
readonly name: string;
|
|
70
51
|
/**
|
|
71
|
-
*
|
|
52
|
+
* This flag determines if the operation is allowed to be skipped if up to date.
|
|
72
53
|
*/
|
|
73
|
-
|
|
54
|
+
isSkipAllowed: boolean;
|
|
74
55
|
/**
|
|
75
56
|
* Indicates that this runner's duration has meaning.
|
|
76
57
|
*/
|
|
@@ -85,12 +66,12 @@ export interface IOperationRunner {
|
|
|
85
66
|
*/
|
|
86
67
|
warningsAreAllowed: boolean;
|
|
87
68
|
/**
|
|
88
|
-
*
|
|
69
|
+
* Indicates if the output of this operation may be written to the cache
|
|
89
70
|
*/
|
|
90
|
-
|
|
71
|
+
isCacheWriteAllowed: boolean;
|
|
91
72
|
/**
|
|
92
|
-
*
|
|
73
|
+
* Method to be executed for the operation.
|
|
93
74
|
*/
|
|
94
|
-
|
|
75
|
+
executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
|
|
95
76
|
}
|
|
96
77
|
//# sourceMappingURL=IOperationRunner.d.ts.map
|
|
@@ -25,11 +25,11 @@ export declare class NullOperationRunner implements IOperationRunner {
|
|
|
25
25
|
readonly name: string;
|
|
26
26
|
readonly reportTiming: boolean;
|
|
27
27
|
readonly silent: boolean;
|
|
28
|
-
|
|
28
|
+
isSkipAllowed: boolean;
|
|
29
|
+
isCacheWriteAllowed: boolean;
|
|
29
30
|
readonly warningsAreAllowed: boolean;
|
|
30
31
|
readonly result: OperationStatus;
|
|
31
32
|
constructor({ name, result, silent }: INullOperationRunnerParams);
|
|
32
33
|
executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
|
|
33
|
-
getConfigHash(): string;
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=NullOperationRunner.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TerminalWritable } from '@rushstack/terminal';
|
|
2
2
|
import { Operation } from './Operation';
|
|
3
|
-
import { OperationStatus } from './OperationStatus';
|
|
4
3
|
import { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
5
4
|
import { IExecutionResult } from './IOperationExecutionResult';
|
|
6
5
|
export interface IOperationExecutionManagerOptions {
|
|
@@ -9,8 +8,6 @@ export interface IOperationExecutionManagerOptions {
|
|
|
9
8
|
parallelism: number;
|
|
10
9
|
changedProjectsOnly: boolean;
|
|
11
10
|
destination?: TerminalWritable;
|
|
12
|
-
beforeExecuteOperation?: (operation: OperationExecutionRecord) => Promise<OperationStatus | undefined>;
|
|
13
|
-
afterExecuteOperation?: (operation: OperationExecutionRecord) => Promise<void>;
|
|
14
11
|
onOperationStatusChanged?: (record: OperationExecutionRecord) => void;
|
|
15
12
|
beforeExecuteOperations?: (records: Map<Operation, OperationExecutionRecord>) => Promise<void>;
|
|
16
13
|
}
|
|
@@ -30,14 +27,11 @@ export declare class OperationExecutionManager {
|
|
|
30
27
|
private readonly _colorsNewlinesTransform;
|
|
31
28
|
private readonly _streamCollator;
|
|
32
29
|
private readonly _terminal;
|
|
33
|
-
private readonly _beforeExecuteOperation?;
|
|
34
|
-
private readonly _afterExecuteOperation?;
|
|
35
30
|
private readonly _onOperationStatusChanged?;
|
|
36
31
|
private readonly _beforeExecuteOperations?;
|
|
37
32
|
private _hasAnyFailures;
|
|
38
33
|
private _hasAnyNonAllowedWarnings;
|
|
39
34
|
private _completedOperations;
|
|
40
|
-
private _executionQueue;
|
|
41
35
|
constructor(operations: Set<Operation>, options: IOperationExecutionManagerOptions);
|
|
42
36
|
private _streamCollator_onWriterActive;
|
|
43
37
|
/**
|
|
@@ -5,25 +5,16 @@ import { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
|
5
5
|
import { Operation } from './Operation';
|
|
6
6
|
import { Stopwatch } from '../../utilities/Stopwatch';
|
|
7
7
|
import { OperationMetadataManager } from './OperationMetadataManager';
|
|
8
|
-
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
9
|
-
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
10
8
|
export interface IOperationExecutionRecordContext {
|
|
11
9
|
streamCollator: StreamCollator;
|
|
12
10
|
onOperationStatusChanged?: (record: OperationExecutionRecord) => void;
|
|
13
11
|
debugMode: boolean;
|
|
14
12
|
quietMode: boolean;
|
|
15
|
-
changedProjectsOnly: boolean;
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Internal class representing everything about executing an operation
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
16
|
*/
|
|
22
17
|
export declare class OperationExecutionRecord implements IOperationRunnerContext {
|
|
23
|
-
/**
|
|
24
|
-
* The associated operation.
|
|
25
|
-
*/
|
|
26
|
-
readonly operation: Operation;
|
|
27
18
|
/**
|
|
28
19
|
* The current execution status of an operation. Operations start in the 'ready' state,
|
|
29
20
|
* but can be 'blocked' if an upstream operation failed. It is 'executing' when
|
|
@@ -46,7 +37,6 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
|
|
|
46
37
|
* operation to execute, the operation with the highest criticalPathLength is chosen.
|
|
47
38
|
*
|
|
48
39
|
* Example:
|
|
49
|
-
* ```
|
|
50
40
|
* (0) A
|
|
51
41
|
* \
|
|
52
42
|
* (1) B C (0) (applications)
|
|
@@ -63,7 +53,6 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
|
|
|
63
53
|
* X has a score of 1, since the only package which depends on it is A
|
|
64
54
|
* Z has a score of 2, since only X depends on it, and X has a score of 1
|
|
65
55
|
* Y has a score of 2, since the chain Y->X->C is longer than Y->C
|
|
66
|
-
* ```
|
|
67
56
|
*
|
|
68
57
|
* The algorithm is implemented in AsyncOperationQueue.ts as calculateCriticalPathLength()
|
|
69
58
|
*/
|
|
@@ -80,8 +69,6 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
|
|
|
80
69
|
readonly stdioSummarizer: StdioSummarizer;
|
|
81
70
|
readonly runner: IOperationRunner;
|
|
82
71
|
readonly weight: number;
|
|
83
|
-
readonly associatedPhase: IPhase | undefined;
|
|
84
|
-
readonly associatedProject: RushConfigurationProject | undefined;
|
|
85
72
|
readonly _operationMetadataManager: OperationMetadataManager | undefined;
|
|
86
73
|
private readonly _context;
|
|
87
74
|
private _collatedWriter;
|
|
@@ -89,13 +76,8 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
|
|
|
89
76
|
get name(): string;
|
|
90
77
|
get debugMode(): boolean;
|
|
91
78
|
get quietMode(): boolean;
|
|
92
|
-
get changedProjectsOnly(): boolean;
|
|
93
79
|
get collatedWriter(): CollatedWriter;
|
|
94
80
|
get nonCachedDurationMs(): number | undefined;
|
|
95
|
-
|
|
96
|
-
executeAsync({ onStart, onResult }: {
|
|
97
|
-
onStart: (record: OperationExecutionRecord) => Promise<OperationStatus | undefined>;
|
|
98
|
-
onResult: (record: OperationExecutionRecord) => Promise<void>;
|
|
99
|
-
}): Promise<void>;
|
|
81
|
+
executeAsync(onResult: (record: OperationExecutionRecord) => void): Promise<void>;
|
|
100
82
|
}
|
|
101
83
|
//# sourceMappingURL=OperationExecutionRecord.d.ts.map
|
|
@@ -16,8 +16,6 @@ export interface IOperationMetaData {
|
|
|
16
16
|
durationInSeconds: number;
|
|
17
17
|
logPath: string;
|
|
18
18
|
errorLogPath: string;
|
|
19
|
-
cobuildContextId: string | undefined;
|
|
20
|
-
cobuildRunnerId: string | undefined;
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
21
|
* A helper class for managing the meta files of a operation.
|
|
@@ -40,7 +38,7 @@ export declare class OperationMetadataManager {
|
|
|
40
38
|
* Example: `.rush/temp/operation/_phase_build/error.log`
|
|
41
39
|
*/
|
|
42
40
|
get relativeFilepaths(): string[];
|
|
43
|
-
saveAsync({ durationInSeconds,
|
|
41
|
+
saveAsync({ durationInSeconds, logPath, errorLogPath }: IOperationMetaData): Promise<void>;
|
|
44
42
|
tryRestoreAsync({ terminal, logPath, errorLogPath }: {
|
|
45
43
|
terminal: ITerminal;
|
|
46
44
|
logPath: string;
|
|
@@ -10,8 +10,6 @@ export interface IOperationStateFileOptions {
|
|
|
10
10
|
*/
|
|
11
11
|
export interface IOperationStateJson {
|
|
12
12
|
nonCachedDurationMs: number;
|
|
13
|
-
cobuildContextId: string | undefined;
|
|
14
|
-
cobuildRunnerId: string | undefined;
|
|
15
13
|
}
|
|
16
14
|
/**
|
|
17
15
|
* A helper class for managing the state file of a operation.
|
|
@@ -7,18 +7,10 @@ export declare enum OperationStatus {
|
|
|
7
7
|
* The Operation is on the queue, ready to execute (but may be waiting for dependencies)
|
|
8
8
|
*/
|
|
9
9
|
Ready = "READY",
|
|
10
|
-
/**
|
|
11
|
-
* The Operation is Queued
|
|
12
|
-
*/
|
|
13
|
-
Queued = "QUEUED",
|
|
14
10
|
/**
|
|
15
11
|
* The Operation is currently executing
|
|
16
12
|
*/
|
|
17
13
|
Executing = "EXECUTING",
|
|
18
|
-
/**
|
|
19
|
-
* The Operation is currently executing by a remote process
|
|
20
|
-
*/
|
|
21
|
-
RemoteExecuting = "REMOTE EXECUTING",
|
|
22
14
|
/**
|
|
23
15
|
* The Operation completed successfully and did not write to standard output
|
|
24
16
|
*/
|
|
@@ -11,17 +11,6 @@ export declare class ProjectLogWritable extends TerminalWritable {
|
|
|
11
11
|
private _logWriter;
|
|
12
12
|
private _errorLogWriter;
|
|
13
13
|
constructor(project: RushConfigurationProject, terminal: CollatedTerminal, logFilenameIdentifier: string);
|
|
14
|
-
static getLogFilePaths({ project, logFilenameIdentifier, isLegacyLog }: {
|
|
15
|
-
project: RushConfigurationProject;
|
|
16
|
-
logFilenameIdentifier: string;
|
|
17
|
-
isLegacyLog?: boolean;
|
|
18
|
-
}): {
|
|
19
|
-
logPath: string;
|
|
20
|
-
errorLogPath: string;
|
|
21
|
-
relativeLogPath: string;
|
|
22
|
-
relativeErrorLogPath: string;
|
|
23
|
-
};
|
|
24
|
-
writeChunk(chunk: ITerminalChunk): void;
|
|
25
14
|
protected onWriteChunk(chunk: ITerminalChunk): void;
|
|
26
15
|
protected onClose(): void;
|
|
27
16
|
}
|
|
@@ -3,11 +3,20 @@ import { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
|
3
3
|
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
4
|
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
5
5
|
import type { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
6
|
+
import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
|
|
6
7
|
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
8
|
+
export interface IProjectDeps {
|
|
9
|
+
files: {
|
|
10
|
+
[filePath: string]: string;
|
|
11
|
+
};
|
|
12
|
+
arguments: string;
|
|
13
|
+
}
|
|
7
14
|
export interface IOperationRunnerOptions {
|
|
8
15
|
rushProject: RushConfigurationProject;
|
|
9
16
|
rushConfiguration: RushConfiguration;
|
|
17
|
+
buildCacheConfiguration: BuildCacheConfiguration | undefined;
|
|
10
18
|
commandToRun: string;
|
|
19
|
+
isIncrementalBuildAllowed: boolean;
|
|
11
20
|
projectChangeAnalyzer: ProjectChangeAnalyzer;
|
|
12
21
|
displayName: string;
|
|
13
22
|
phase: IPhase;
|
|
@@ -23,18 +32,31 @@ export interface IOperationRunnerOptions {
|
|
|
23
32
|
*/
|
|
24
33
|
export declare class ShellOperationRunner implements IOperationRunner {
|
|
25
34
|
readonly name: string;
|
|
35
|
+
isCacheWriteAllowed: boolean;
|
|
36
|
+
isSkipAllowed: boolean;
|
|
26
37
|
readonly reportTiming: boolean;
|
|
27
38
|
readonly silent: boolean;
|
|
28
|
-
readonly cacheable: boolean;
|
|
29
39
|
readonly warningsAreAllowed: boolean;
|
|
30
|
-
private readonly _commandToRun;
|
|
31
|
-
private readonly _logFilenameIdentifier;
|
|
32
40
|
private readonly _rushProject;
|
|
41
|
+
private readonly _phase;
|
|
33
42
|
private readonly _rushConfiguration;
|
|
43
|
+
private readonly _buildCacheConfiguration;
|
|
44
|
+
private readonly _commandName;
|
|
45
|
+
private readonly _commandToRun;
|
|
46
|
+
private readonly _isCacheReadAllowed;
|
|
47
|
+
private readonly _projectChangeAnalyzer;
|
|
48
|
+
private readonly _packageDepsFilename;
|
|
49
|
+
private readonly _logFilenameIdentifier;
|
|
50
|
+
private readonly _selectedPhases;
|
|
51
|
+
/**
|
|
52
|
+
* UNINITIALIZED === we haven't tried to initialize yet
|
|
53
|
+
* undefined === we didn't create one because the feature is not enabled
|
|
54
|
+
*/
|
|
55
|
+
private _projectBuildCache;
|
|
34
56
|
constructor(options: IOperationRunnerOptions);
|
|
35
57
|
executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
|
|
36
|
-
getConfigHash(): string;
|
|
37
58
|
private _executeAsync;
|
|
59
|
+
private _tryGetProjectBuildCacheAsync;
|
|
38
60
|
}
|
|
39
61
|
/**
|
|
40
62
|
* When running a command from the "scripts" block in package.json, if the command
|