@rushstack/rush-sdk 5.96.0 → 5.97.1-pr3481.18
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 +445 -49
- package/lib/api/CobuildConfiguration.d.ts +63 -0
- package/lib/api/CobuildConfiguration.js +1 -0
- package/lib/api/EnvironmentConfiguration.d.ts +61 -20
- package/lib/api/ExperimentsConfiguration.d.ts +5 -0
- package/lib/api/LastInstallFlag.d.ts +58 -21
- package/lib/api/LastLinkFlag.d.ts +3 -7
- package/lib/api/RushConfiguration.d.ts +52 -0
- package/lib/api/RushConfigurationProject.d.ts +6 -0
- package/lib/api/base/BaseFlag.d.ts +50 -0
- package/lib/api/base/BaseFlag.js +1 -0
- package/lib/api/packageManager/PnpmPackageManager.d.ts +14 -0
- package/lib/cli/actions/InstallAction.d.ts +7 -0
- package/lib/cli/actions/ListAction.d.ts +4 -0
- package/lib/cli/actions/UpdateAction.d.ts +7 -0
- package/lib/cli/parsing/SelectionParameterSet.d.ts +17 -3
- package/lib/index.d.ts +5 -2
- package/lib/logic/PurgeManager.d.ts +1 -0
- package/lib/logic/RushConstants.d.ts +15 -0
- package/lib/logic/base/BaseInstallManagerTypes.d.ts +23 -0
- package/lib/logic/buildCache/ProjectBuildCache.d.ts +5 -4
- package/lib/logic/cobuild/CobuildLock.d.ts +24 -0
- package/lib/logic/cobuild/CobuildLock.js +1 -0
- package/lib/logic/cobuild/ICobuildLockProvider.d.ts +46 -0
- package/lib/logic/cobuild/ICobuildLockProvider.js +1 -0
- package/lib/logic/installManager/InstallHelpers.d.ts +1 -0
- package/lib/logic/operations/AsyncOperationQueue.d.ts +23 -4
- package/lib/logic/operations/CacheableOperationPlugin.d.ts +21 -0
- package/lib/logic/operations/CacheableOperationPlugin.js +1 -0
- package/lib/logic/operations/IOperationRunner.d.ts +29 -10
- package/lib/logic/operations/OperationExecutionManager.d.ts +5 -0
- package/lib/logic/operations/OperationExecutionRecord.d.ts +7 -1
- package/lib/logic/operations/OperationRunnerHooks.d.ts +50 -0
- package/lib/logic/operations/OperationRunnerHooks.js +1 -0
- package/lib/logic/operations/OperationStatus.d.ts +8 -0
- package/lib/logic/operations/PeriodicCallback.d.ts +20 -0
- package/lib/logic/operations/PeriodicCallback.js +1 -0
- package/lib/logic/operations/ShellOperationRunner.d.ts +4 -13
- package/lib/logic/pnpm/IPnpmfile.d.ts +16 -0
- package/lib/logic/pnpm/PnpmProjectShrinkwrapFile.d.ts +7 -0
- package/lib/logic/pnpm/PnpmShrinkwrapFile.d.ts +26 -0
- package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.d.ts +3 -0
- package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.js +1 -0
- package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.d.ts +23 -0
- package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.js +1 -0
- package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.d.ts +10 -0
- package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.js +1 -0
- package/lib/logic/versionMismatch/VersionMismatchFinderProject.d.ts +2 -0
- package/lib/pluginFramework/PhasedCommandHooks.d.ts +15 -1
- package/lib/pluginFramework/RushSession.d.ts +11 -2
- package/lib/utilities/PathConstants.d.ts +1 -0
- package/lib/utilities/npmrcUtilities.d.ts +1 -1
- package/lib-shim/index.d.ts.map +1 -1
- package/lib-shim/index.js +5 -5
- package/lib-shim/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -20,7 +20,15 @@ export declare class SelectionParameterSet {
|
|
|
20
20
|
private readonly _fromVersionPolicy;
|
|
21
21
|
private readonly _toVersionPolicy;
|
|
22
22
|
private readonly _selectorParserByScope;
|
|
23
|
+
private readonly _selectors;
|
|
24
|
+
private _isSelectionSpecified;
|
|
23
25
|
constructor(rushConfiguration: RushConfiguration, action: CommandLineParameterProvider, gitOptions: IGitSelectorParserOptions);
|
|
26
|
+
/**
|
|
27
|
+
* Check if any of the selection parameters have a value specified on the command line
|
|
28
|
+
*
|
|
29
|
+
* Returns true if specifying any selection parameters, otherwise false.
|
|
30
|
+
*/
|
|
31
|
+
get isSelectionSpecified(): boolean;
|
|
24
32
|
/**
|
|
25
33
|
* Computes the set of selected projects based on all parameter values.
|
|
26
34
|
*
|
|
@@ -28,14 +36,19 @@ export declare class SelectionParameterSet {
|
|
|
28
36
|
*/
|
|
29
37
|
getSelectedProjectsAsync(terminal: ITerminal): Promise<Set<RushConfigurationProject>>;
|
|
30
38
|
/**
|
|
31
|
-
* Represents the selection as `--filter` parameters to pnpm
|
|
39
|
+
* Represents the selection as `--filter` parameters to pnpm, and selected projects when partial install
|
|
32
40
|
*
|
|
33
41
|
* @remarks
|
|
34
42
|
* This is a separate from the selection to allow the filters to be represented more concisely.
|
|
35
43
|
*
|
|
36
|
-
* @see https://pnpm.
|
|
44
|
+
* @see https://pnpm.io/filtering
|
|
37
45
|
*/
|
|
38
|
-
getPnpmFilterArgumentsAsync(terminal: ITerminal): Promise<
|
|
46
|
+
getPnpmFilterArgumentsAsync(terminal: ITerminal): Promise<{
|
|
47
|
+
pnpmFilterArguments: string[];
|
|
48
|
+
splitWorkspacePnpmFilterArguments: string[];
|
|
49
|
+
selectedProjects: Set<RushConfigurationProject> | undefined;
|
|
50
|
+
hasSelectSplitWorkspaceProject: boolean;
|
|
51
|
+
}>;
|
|
39
52
|
/**
|
|
40
53
|
* Usage telemetry for selection parameters. Only saved locally, and if requested in the config.
|
|
41
54
|
*/
|
|
@@ -47,5 +60,6 @@ export declare class SelectionParameterSet {
|
|
|
47
60
|
* Handles '.', unscoped names, and scoped names.
|
|
48
61
|
*/
|
|
49
62
|
private _evaluateProjectParameterAsync;
|
|
63
|
+
toArguments(): string[];
|
|
50
64
|
}
|
|
51
65
|
//# sourceMappingURL=SelectionParameterSet.d.ts.map
|
package/lib/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ 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';
|
|
12
13
|
export { GetCacheEntryIdFunction, IGenerateCacheEntryIdOptions } from './logic/buildCache/CacheEntryId';
|
|
13
14
|
export { FileSystemBuildCacheProvider, IFileSystemBuildCacheProviderOptions } from './logic/buildCache/FileSystemBuildCacheProvider';
|
|
14
15
|
export { IPhase } from './api/CommandLineConfiguration';
|
|
@@ -25,7 +26,8 @@ export { RepoStateFile } from './logic/RepoStateFile';
|
|
|
25
26
|
export { LookupByPath, IPrefixMatch } from './logic/LookupByPath';
|
|
26
27
|
export { EventHooks, Event } from './api/EventHooks';
|
|
27
28
|
export { ChangeManager } from './api/ChangeManager';
|
|
28
|
-
export { LastInstallFlag as _LastInstallFlag, ILockfileValidityCheckOptions as _ILockfileValidityCheckOptions } from './api/LastInstallFlag';
|
|
29
|
+
export { LastInstallFlag as _LastInstallFlag, ILastInstallFlagJson as _ILastInstallFlagJson, ILockfileValidityCheckOptions as _ILockfileValidityCheckOptions } from './api/LastInstallFlag';
|
|
30
|
+
export { BaseFlag as _BaseFlag } from './api/base/BaseFlag';
|
|
29
31
|
export { VersionPolicyDefinitionName, BumpType, LockStepVersionPolicy, IndividualVersionPolicy, VersionPolicy } from './api/VersionPolicy';
|
|
30
32
|
export { VersionPolicyConfiguration } from './api/VersionPolicyConfiguration';
|
|
31
33
|
export { ILaunchOptions, Rush } from './api/Rush';
|
|
@@ -36,7 +38,7 @@ export { IOperationRunner, IOperationRunnerContext } from './logic/operations/IO
|
|
|
36
38
|
export { IExecutionResult, IOperationExecutionResult } from './logic/operations/IOperationExecutionResult';
|
|
37
39
|
export { IOperationOptions, Operation } from './logic/operations/Operation';
|
|
38
40
|
export { OperationStatus } from './logic/operations/OperationStatus';
|
|
39
|
-
export { RushSession, IRushSessionOptions, CloudBuildCacheProviderFactory } from './pluginFramework/RushSession';
|
|
41
|
+
export { RushSession, IRushSessionOptions, CloudBuildCacheProviderFactory, CobuildLockProviderFactory } from './pluginFramework/RushSession';
|
|
40
42
|
export { IRushCommand, IGlobalCommand, IPhasedCommand, RushLifecycleHooks } from './pluginFramework/RushLifeCycle';
|
|
41
43
|
export { ICreateOperationsContext, PhasedCommandHooks } from './pluginFramework/PhasedCommandHooks';
|
|
42
44
|
export { IRushPlugin } from './pluginFramework/IRushPlugin';
|
|
@@ -44,6 +46,7 @@ export { IBuiltInPluginConfiguration as _IBuiltInPluginConfiguration } from './p
|
|
|
44
46
|
export { IRushPluginConfigurationBase as _IRushPluginConfigurationBase } from './api/RushPluginsConfiguration';
|
|
45
47
|
export { ILogger } from './pluginFramework/logging/Logger';
|
|
46
48
|
export { ICloudBuildCacheProvider } from './logic/buildCache/ICloudBuildCacheProvider';
|
|
49
|
+
export { ICobuildLockProvider, ICobuildContext, ICobuildCompletedState } from './logic/cobuild/ICobuildLockProvider';
|
|
47
50
|
export { ICredentialCacheOptions, ICredentialCacheEntry, CredentialCache } from './logic/CredentialCache';
|
|
48
51
|
export type { ITelemetryData, ITelemetryMachineInfo, ITelemetryOperationResult } from './logic/Telemetry';
|
|
49
52
|
export { IStopwatchResult } from './utilities/Stopwatch';
|
|
@@ -9,6 +9,7 @@ export declare class PurgeManager {
|
|
|
9
9
|
private _rushGlobalFolder;
|
|
10
10
|
private _rushUserFolderRecycler;
|
|
11
11
|
readonly commonTempFolderRecycler: AsyncRecycler;
|
|
12
|
+
readonly commonTempSplitFolderRecycler: AsyncRecycler;
|
|
12
13
|
constructor(rushConfiguration: RushConfiguration, rushGlobalFolder: RushGlobalFolder);
|
|
13
14
|
/**
|
|
14
15
|
* Performs the AsyncRecycler.deleteAll() operation. This should be called before
|
|
@@ -43,6 +43,12 @@ export declare class RushConstants {
|
|
|
43
43
|
* Example: `C:\MyRepo\common\temp`
|
|
44
44
|
*/
|
|
45
45
|
static readonly rushTempFolderName: string;
|
|
46
|
+
/**
|
|
47
|
+
* The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
|
|
48
|
+
* temporary files will be stored.
|
|
49
|
+
* Example: `C:\MyRepo\common\temp-split`
|
|
50
|
+
*/
|
|
51
|
+
static readonly rushTempSplitFolderName: string;
|
|
46
52
|
/**
|
|
47
53
|
* The folder name ("projects") where temporary projects will be stored.
|
|
48
54
|
* Example: `C:\MyRepo\common\temp\projects`
|
|
@@ -148,6 +154,15 @@ export declare class RushConstants {
|
|
|
148
154
|
* Changing this ensures that cache entries generated by an old version will no longer register as a cache hit.
|
|
149
155
|
*/
|
|
150
156
|
static readonly buildCacheVersion: number;
|
|
157
|
+
/**
|
|
158
|
+
* Cobuild configuration file.
|
|
159
|
+
*/
|
|
160
|
+
static readonly cobuildFilename: string;
|
|
161
|
+
/**
|
|
162
|
+
* Cobuild version number, incremented when the logic to create cobuild lock changes.
|
|
163
|
+
* Changing this ensures that lock generated by an old version will no longer access as a cobuild lock.
|
|
164
|
+
*/
|
|
165
|
+
static readonly cobuildLockVersion: number;
|
|
151
166
|
/**
|
|
152
167
|
* Per-project configuration filename.
|
|
153
168
|
*/
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SelectionParameterSet } from '../../cli/parsing/SelectionParameterSet';
|
|
2
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
1
3
|
export interface IInstallManagerOptions {
|
|
2
4
|
/**
|
|
3
5
|
* Whether the global "--debug" flag was specified.
|
|
@@ -61,5 +63,26 @@ export interface IInstallManagerOptions {
|
|
|
61
63
|
* Callback to invoke between preparing the common/temp folder and running installation.
|
|
62
64
|
*/
|
|
63
65
|
beforeInstallAsync?: () => Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Whether to specify "--ignore-scripts" command-line parameter, which ignores
|
|
68
|
+
* install lifecycle scripts in package.json and its dependencies
|
|
69
|
+
*/
|
|
70
|
+
ignoreScripts: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether to install for projects in split workspace
|
|
73
|
+
*/
|
|
74
|
+
includeSplitWorkspace: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Filters to be passed to PNPM during installation for split workspace.
|
|
77
|
+
*/
|
|
78
|
+
splitWorkspacePnpmFilterArguments: string[];
|
|
79
|
+
/**
|
|
80
|
+
* Selected projects during partial install.
|
|
81
|
+
*/
|
|
82
|
+
selectedProjects?: Set<RushConfigurationProject>;
|
|
83
|
+
/**
|
|
84
|
+
* Selection parameters for partial install.
|
|
85
|
+
*/
|
|
86
|
+
selectionParameters?: SelectionParameterSet;
|
|
64
87
|
}
|
|
65
88
|
//# sourceMappingURL=BaseInstallManagerTypes.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
+
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
2
3
|
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
|
+
project: RushConfigurationProject;
|
|
8
8
|
projectOutputFolderNames: ReadonlyArray<string>;
|
|
9
9
|
additionalProjectOutputFilePaths?: ReadonlyArray<string>;
|
|
10
10
|
additionalContext?: Record<string, string>;
|
|
@@ -30,10 +30,11 @@ export declare class ProjectBuildCache {
|
|
|
30
30
|
private _cacheId;
|
|
31
31
|
private constructor();
|
|
32
32
|
private static _tryGetTarUtility;
|
|
33
|
+
get cacheId(): string | undefined;
|
|
33
34
|
static tryGetProjectBuildCache(options: IProjectBuildCacheOptions): Promise<ProjectBuildCache | undefined>;
|
|
34
35
|
private static _validateProject;
|
|
35
|
-
tryRestoreFromCacheAsync(terminal: ITerminal): Promise<boolean>;
|
|
36
|
-
trySetCacheEntryAsync(terminal: ITerminal): Promise<boolean>;
|
|
36
|
+
tryRestoreFromCacheAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
|
|
37
|
+
trySetCacheEntryAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
|
|
37
38
|
/**
|
|
38
39
|
* Walks the declared output folders of the project and collects a list of files.
|
|
39
40
|
* @returns The list of output files as project-relative paths, or `undefined` if a
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CobuildConfiguration } from '../../api/CobuildConfiguration';
|
|
2
|
+
import type { ProjectBuildCache } from '../buildCache/ProjectBuildCache';
|
|
3
|
+
import type { OperationStatus } from '../operations/OperationStatus';
|
|
4
|
+
import type { ICobuildContext } from './ICobuildLockProvider';
|
|
5
|
+
export interface ICobuildLockOptions {
|
|
6
|
+
cobuildConfiguration: CobuildConfiguration;
|
|
7
|
+
projectBuildCache: ProjectBuildCache;
|
|
8
|
+
}
|
|
9
|
+
export interface ICobuildCompletedState {
|
|
10
|
+
status: OperationStatus.Success | OperationStatus.SuccessWithWarning | OperationStatus.Failure;
|
|
11
|
+
cacheId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class CobuildLock {
|
|
14
|
+
readonly projectBuildCache: ProjectBuildCache;
|
|
15
|
+
readonly cobuildConfiguration: CobuildConfiguration;
|
|
16
|
+
private _cobuildContext;
|
|
17
|
+
constructor(options: ICobuildLockOptions);
|
|
18
|
+
setCompletedStateAsync(state: ICobuildCompletedState): Promise<void>;
|
|
19
|
+
getCompletedStateAsync(): Promise<ICobuildCompletedState | undefined>;
|
|
20
|
+
tryAcquireLockAsync(): Promise<boolean>;
|
|
21
|
+
renewLockAsync(): Promise<void>;
|
|
22
|
+
get cobuildContext(): ICobuildContext;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=CobuildLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/cobuild/CobuildLock");
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { OperationStatus } from '../operations/OperationStatus';
|
|
2
|
+
/**
|
|
3
|
+
* @beta
|
|
4
|
+
*/
|
|
5
|
+
export interface ICobuildContext {
|
|
6
|
+
/**
|
|
7
|
+
* The contextId is provided by the monorepo maintainer, it reads from environment variable {@link EnvironmentVariableNames.RUSH_COBUILD_CONTEXT_ID}.
|
|
8
|
+
* It ensure only the builds from the same given contextId cooperated. If user was more permissive,
|
|
9
|
+
* and wanted all PR and CI builds building anything with the same contextId to cooperate, then just
|
|
10
|
+
* set it to a static value.
|
|
11
|
+
*/
|
|
12
|
+
contextId: string;
|
|
13
|
+
/**
|
|
14
|
+
* The id of cache. It should be keep same as the normal cacheId from ProjectBuildCache.
|
|
15
|
+
* Otherwise, there is a discrepancy in the success case then turning on cobuilds will
|
|
16
|
+
* fail to populate the normal build cache.
|
|
17
|
+
*/
|
|
18
|
+
cacheId: string;
|
|
19
|
+
/**
|
|
20
|
+
* {@inheritdoc RushConstants.cobuildLockVersion}
|
|
21
|
+
*/
|
|
22
|
+
version: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @beta
|
|
26
|
+
*/
|
|
27
|
+
export interface ICobuildCompletedState {
|
|
28
|
+
status: OperationStatus.Success | OperationStatus.SuccessWithWarning | OperationStatus.Failure;
|
|
29
|
+
/**
|
|
30
|
+
* Completed state points to the cache id that was used to store the build cache.
|
|
31
|
+
* Note: Cache failed builds in a separate cache id
|
|
32
|
+
*/
|
|
33
|
+
cacheId: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @beta
|
|
37
|
+
*/
|
|
38
|
+
export interface ICobuildLockProvider {
|
|
39
|
+
connectAsync(): Promise<void>;
|
|
40
|
+
disconnectAsync(): Promise<void>;
|
|
41
|
+
acquireLockAsync(context: ICobuildContext): Promise<boolean>;
|
|
42
|
+
renewLockAsync(context: ICobuildContext): Promise<void>;
|
|
43
|
+
setCompletedStateAsync(context: ICobuildContext, state: ICobuildCompletedState): Promise<void>;
|
|
44
|
+
getCompletedStateAsync(context: ICobuildContext): Promise<ICobuildCompletedState | undefined>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=ICobuildLockProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/cobuild/ICobuildLockProvider");
|
|
@@ -3,6 +3,7 @@ import { RushConfiguration } from '../../api/RushConfiguration';
|
|
|
3
3
|
import { RushGlobalFolder } from '../../api/RushGlobalFolder';
|
|
4
4
|
export declare class InstallHelpers {
|
|
5
5
|
static generateCommonPackageJson(rushConfiguration: RushConfiguration, dependencies?: Map<string, string>): void;
|
|
6
|
+
static generateCommonSplitPackageJson(rushConfiguration: RushConfiguration): void;
|
|
6
7
|
static getPackageManagerEnvironment(rushConfiguration: RushConfiguration, options?: {
|
|
7
8
|
debug?: boolean;
|
|
8
9
|
}): NodeJS.ProcessEnv;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* When the queue returns an unassigned operation, it means there is at least one remote executing operation,
|
|
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 declare type IOperationIteratorResult = OperationExecutionRecord | typeof UNASSIGNED_OPERATION;
|
|
12
|
+
/**
|
|
13
|
+
* Implementation of the async iteration protocol for a collection of IOperation objects.
|
|
4
14
|
* The async iterator will wait for an operation to be ready for execution, or terminate if there are no more operations.
|
|
5
15
|
*
|
|
6
16
|
* @remarks
|
|
@@ -8,9 +18,12 @@ import { OperationExecutionRecord } from './OperationExecutionRecord';
|
|
|
8
18
|
* it must manually invoke `assignOperations()` after performing the updates, otherwise iterators will
|
|
9
19
|
* stall until another operations completes.
|
|
10
20
|
*/
|
|
11
|
-
export declare class AsyncOperationQueue implements AsyncIterable<
|
|
21
|
+
export declare class AsyncOperationQueue implements AsyncIterable<IOperationIteratorResult>, AsyncIterator<IOperationIteratorResult> {
|
|
12
22
|
private readonly _queue;
|
|
13
23
|
private readonly _pendingIterators;
|
|
24
|
+
private readonly _totalOperations;
|
|
25
|
+
private readonly _completedOperations;
|
|
26
|
+
private _isDone;
|
|
14
27
|
/**
|
|
15
28
|
* @param operations - The set of operations to be executed
|
|
16
29
|
* @param sortFn - A function that sorts operations in reverse priority order:
|
|
@@ -23,17 +36,23 @@ export declare class AsyncOperationQueue implements AsyncIterable<OperationExecu
|
|
|
23
36
|
* For use with `for await (const operation of taskQueue)`
|
|
24
37
|
* @see {AsyncIterator}
|
|
25
38
|
*/
|
|
26
|
-
next(): Promise<IteratorResult<
|
|
39
|
+
next(): Promise<IteratorResult<IOperationIteratorResult>>;
|
|
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;
|
|
27
45
|
/**
|
|
28
46
|
* Routes ready operations with 0 dependencies to waiting iterators. Normally invoked as part of `next()`, but
|
|
29
47
|
* if the caller does not update operation dependencies prior to calling `next()`, may need to be invoked manually.
|
|
30
48
|
*/
|
|
31
49
|
assignOperations(): void;
|
|
50
|
+
tryGetRemoteExecutingOperation(): OperationExecutionRecord | undefined;
|
|
32
51
|
/**
|
|
33
52
|
* Returns this queue as an async iterator, such that multiple functions iterating this object concurrently
|
|
34
53
|
* receive distinct iteration results.
|
|
35
54
|
*/
|
|
36
|
-
[Symbol.asyncIterator](): AsyncIterator<
|
|
55
|
+
[Symbol.asyncIterator](): AsyncIterator<IOperationIteratorResult>;
|
|
37
56
|
}
|
|
38
57
|
export interface IOperationSortFunction {
|
|
39
58
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CobuildLock } from '../cobuild/CobuildLock';
|
|
2
|
+
import { ProjectBuildCache } from '../buildCache/ProjectBuildCache';
|
|
3
|
+
import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
|
|
4
|
+
export interface IOperationBuildCacheContext {
|
|
5
|
+
isCacheWriteAllowed: boolean;
|
|
6
|
+
isCacheReadAllowed: boolean;
|
|
7
|
+
isSkipAllowed: boolean;
|
|
8
|
+
projectBuildCache: ProjectBuildCache | undefined;
|
|
9
|
+
cobuildLock: CobuildLock | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare class CacheableOperationPlugin implements IPhasedCommandPlugin {
|
|
12
|
+
private _buildCacheContextByOperationRunner;
|
|
13
|
+
apply(hooks: PhasedCommandHooks): void;
|
|
14
|
+
private _applyShellOperationRunner;
|
|
15
|
+
private _getBuildCacheContextByRunner;
|
|
16
|
+
private _getBuildCacheContextByRunnerOrThrow;
|
|
17
|
+
private _tryGetProjectBuildCacheAsync;
|
|
18
|
+
private _tryGetLogOnlyProjectBuildCacheAsync;
|
|
19
|
+
private _tryGetCobuildLockAsync;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=CacheableOperationPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/operations/CacheableOperationPlugin");
|
|
@@ -2,7 +2,7 @@ import type { StdioSummarizer } from '@rushstack/terminal';
|
|
|
2
2
|
import type { CollatedWriter } from '@rushstack/stream-collator';
|
|
3
3
|
import type { OperationStatus } from './OperationStatus';
|
|
4
4
|
import type { OperationMetadataManager } from './OperationMetadataManager';
|
|
5
|
-
import type {
|
|
5
|
+
import type { Stopwatch } from '../../utilities/Stopwatch';
|
|
6
6
|
/**
|
|
7
7
|
* Information passed to the executing `IOperationRunner`
|
|
8
8
|
*
|
|
@@ -34,7 +34,34 @@ export interface IOperationRunnerContext {
|
|
|
34
34
|
/**
|
|
35
35
|
* Object used to track elapsed time.
|
|
36
36
|
*/
|
|
37
|
-
stopwatch:
|
|
37
|
+
stopwatch: Stopwatch;
|
|
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
|
+
* The set of operations that depend on this operation.
|
|
52
|
+
*/
|
|
53
|
+
readonly consumers: Set<IOperationRunnerContext>;
|
|
54
|
+
/**
|
|
55
|
+
* The operation runner that is executing this operation.
|
|
56
|
+
*/
|
|
57
|
+
readonly runner: IOperationRunner;
|
|
58
|
+
/**
|
|
59
|
+
* Normally the incremental build logic will rebuild changed projects as well as
|
|
60
|
+
* any projects that directly or indirectly depend on a changed project.
|
|
61
|
+
* If true, then the incremental build logic will only rebuild changed projects and
|
|
62
|
+
* ignore dependent projects.
|
|
63
|
+
*/
|
|
64
|
+
readonly changedProjectsOnly: boolean;
|
|
38
65
|
}
|
|
39
66
|
/**
|
|
40
67
|
* The `Operation` class is a node in the dependency graph of work that needs to be scheduled by the
|
|
@@ -48,10 +75,6 @@ export interface IOperationRunner {
|
|
|
48
75
|
* Name of the operation, for logging.
|
|
49
76
|
*/
|
|
50
77
|
readonly name: string;
|
|
51
|
-
/**
|
|
52
|
-
* This flag determines if the operation is allowed to be skipped if up to date.
|
|
53
|
-
*/
|
|
54
|
-
isSkipAllowed: boolean;
|
|
55
78
|
/**
|
|
56
79
|
* Indicates that this runner's duration has meaning.
|
|
57
80
|
*/
|
|
@@ -65,10 +88,6 @@ export interface IOperationRunner {
|
|
|
65
88
|
* exit code
|
|
66
89
|
*/
|
|
67
90
|
warningsAreAllowed: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Indicates if the output of this operation may be written to the cache
|
|
70
|
-
*/
|
|
71
|
-
isCacheWriteAllowed: boolean;
|
|
72
91
|
/**
|
|
73
92
|
* Method to be executed for the operation.
|
|
74
93
|
*/
|
|
@@ -8,6 +8,8 @@ export interface IOperationExecutionManagerOptions {
|
|
|
8
8
|
parallelism: number;
|
|
9
9
|
changedProjectsOnly: boolean;
|
|
10
10
|
destination?: TerminalWritable;
|
|
11
|
+
beforeExecuteOperation?: (operation: OperationExecutionRecord) => Promise<void>;
|
|
12
|
+
afterExecuteOperation?: (operation: OperationExecutionRecord) => Promise<void>;
|
|
11
13
|
onOperationStatusChanged?: (record: OperationExecutionRecord) => void;
|
|
12
14
|
beforeExecuteOperations?: (records: Map<Operation, OperationExecutionRecord>) => Promise<void>;
|
|
13
15
|
}
|
|
@@ -27,11 +29,14 @@ export declare class OperationExecutionManager {
|
|
|
27
29
|
private readonly _colorsNewlinesTransform;
|
|
28
30
|
private readonly _streamCollator;
|
|
29
31
|
private readonly _terminal;
|
|
32
|
+
private readonly _beforeExecuteOperation?;
|
|
33
|
+
private readonly _afterExecuteOperation?;
|
|
30
34
|
private readonly _onOperationStatusChanged?;
|
|
31
35
|
private readonly _beforeExecuteOperations?;
|
|
32
36
|
private _hasAnyFailures;
|
|
33
37
|
private _hasAnyNonAllowedWarnings;
|
|
34
38
|
private _completedOperations;
|
|
39
|
+
private _executionQueue;
|
|
35
40
|
constructor(operations: Set<Operation>, options: IOperationExecutionManagerOptions);
|
|
36
41
|
private _streamCollator_onWriterActive;
|
|
37
42
|
/**
|
|
@@ -10,9 +10,12 @@ export interface IOperationExecutionRecordContext {
|
|
|
10
10
|
onOperationStatusChanged?: (record: OperationExecutionRecord) => void;
|
|
11
11
|
debugMode: boolean;
|
|
12
12
|
quietMode: boolean;
|
|
13
|
+
changedProjectsOnly: boolean;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Internal class representing everything about executing an operation
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
16
19
|
*/
|
|
17
20
|
export declare class OperationExecutionRecord implements IOperationRunnerContext {
|
|
18
21
|
/**
|
|
@@ -37,6 +40,7 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
|
|
|
37
40
|
* operation to execute, the operation with the highest criticalPathLength is chosen.
|
|
38
41
|
*
|
|
39
42
|
* Example:
|
|
43
|
+
* ```
|
|
40
44
|
* (0) A
|
|
41
45
|
* \
|
|
42
46
|
* (1) B C (0) (applications)
|
|
@@ -53,6 +57,7 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
|
|
|
53
57
|
* X has a score of 1, since the only package which depends on it is A
|
|
54
58
|
* Z has a score of 2, since only X depends on it, and X has a score of 1
|
|
55
59
|
* Y has a score of 2, since the chain Y->X->C is longer than Y->C
|
|
60
|
+
* ```
|
|
56
61
|
*
|
|
57
62
|
* The algorithm is implemented in AsyncOperationQueue.ts as calculateCriticalPathLength()
|
|
58
63
|
*/
|
|
@@ -76,8 +81,9 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
|
|
|
76
81
|
get name(): string;
|
|
77
82
|
get debugMode(): boolean;
|
|
78
83
|
get quietMode(): boolean;
|
|
84
|
+
get changedProjectsOnly(): boolean;
|
|
79
85
|
get collatedWriter(): CollatedWriter;
|
|
80
86
|
get nonCachedDurationMs(): number | undefined;
|
|
81
|
-
executeAsync(onResult: (record: OperationExecutionRecord) => void): Promise<void>;
|
|
87
|
+
executeAsync(onResult: (record: OperationExecutionRecord) => Promise<void>): Promise<void>;
|
|
82
88
|
}
|
|
83
89
|
//# sourceMappingURL=OperationExecutionRecord.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AsyncSeriesWaterfallHook } from 'tapable';
|
|
2
|
+
import type { ITerminal } from '@rushstack/node-core-library';
|
|
3
|
+
import type { IOperationRunnerContext } from './IOperationRunner';
|
|
4
|
+
import type { OperationStatus } from './OperationStatus';
|
|
5
|
+
import type { IProjectDeps, ShellOperationRunner } from './ShellOperationRunner';
|
|
6
|
+
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
7
|
+
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
8
|
+
/**
|
|
9
|
+
* A plugin tht interacts with a operation runner
|
|
10
|
+
*/
|
|
11
|
+
export interface IOperationRunnerPlugin {
|
|
12
|
+
/**
|
|
13
|
+
* Applies this plugin.
|
|
14
|
+
*/
|
|
15
|
+
apply(hooks: OperationRunnerHooks): void;
|
|
16
|
+
}
|
|
17
|
+
export interface IOperationRunnerBeforeExecuteContext {
|
|
18
|
+
context: IOperationRunnerContext;
|
|
19
|
+
runner: ShellOperationRunner;
|
|
20
|
+
earlyReturnStatus: OperationStatus | undefined;
|
|
21
|
+
terminal: ITerminal;
|
|
22
|
+
projectDeps: IProjectDeps | undefined;
|
|
23
|
+
lastProjectDeps: IProjectDeps | undefined;
|
|
24
|
+
trackedProjectFiles: string[] | undefined;
|
|
25
|
+
logPath: string;
|
|
26
|
+
errorLogPath: string;
|
|
27
|
+
rushProject: RushConfigurationProject;
|
|
28
|
+
phase: IPhase;
|
|
29
|
+
commandName: string;
|
|
30
|
+
commandToRun: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IOperationRunnerAfterExecuteContext {
|
|
33
|
+
context: IOperationRunnerContext;
|
|
34
|
+
terminal: ITerminal;
|
|
35
|
+
/**
|
|
36
|
+
* Exit code of the operation command
|
|
37
|
+
*/
|
|
38
|
+
exitCode: number;
|
|
39
|
+
status: OperationStatus;
|
|
40
|
+
taskIsSuccessful: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Hooks into the lifecycle of the operation runner
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export declare class OperationRunnerHooks {
|
|
47
|
+
beforeExecute: AsyncSeriesWaterfallHook<IOperationRunnerBeforeExecuteContext>;
|
|
48
|
+
afterExecute: AsyncSeriesWaterfallHook<IOperationRunnerAfterExecuteContext>;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=OperationRunnerHooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/operations/OperationRunnerHooks");
|
|
@@ -7,10 +7,18 @@ 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",
|
|
10
14
|
/**
|
|
11
15
|
* The Operation is currently executing
|
|
12
16
|
*/
|
|
13
17
|
Executing = "EXECUTING",
|
|
18
|
+
/**
|
|
19
|
+
* The Operation is currently executing by a remote process
|
|
20
|
+
*/
|
|
21
|
+
RemoteExecuting = "REMOTE EXECUTING",
|
|
14
22
|
/**
|
|
15
23
|
* The Operation completed successfully and did not write to standard output
|
|
16
24
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare type ICallbackFn = () => Promise<void> | void;
|
|
2
|
+
export interface IPeriodicCallbackOptions {
|
|
3
|
+
interval: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A help class to run callbacks in a loop with a specified interval.
|
|
7
|
+
*
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare class PeriodicCallback {
|
|
11
|
+
private _callbacks;
|
|
12
|
+
private _interval;
|
|
13
|
+
private _intervalId;
|
|
14
|
+
private _isRunning;
|
|
15
|
+
constructor(options: IPeriodicCallbackOptions);
|
|
16
|
+
addCallback(callback: ICallbackFn): void;
|
|
17
|
+
start(): void;
|
|
18
|
+
stop(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=PeriodicCallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/operations/PeriodicCallback");
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { OperationStatus } from './OperationStatus';
|
|
2
2
|
import { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
|
|
3
|
+
import { PeriodicCallback } from './PeriodicCallback';
|
|
4
|
+
import { OperationRunnerHooks } from './OperationRunnerHooks';
|
|
3
5
|
import type { RushConfiguration } from '../../api/RushConfiguration';
|
|
4
6
|
import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
|
|
5
7
|
import type { ProjectChangeAnalyzer } from '../ProjectChangeAnalyzer';
|
|
6
|
-
import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
|
|
7
8
|
import type { IPhase } from '../../api/CommandLineConfiguration';
|
|
8
9
|
export interface IProjectDeps {
|
|
9
10
|
files: {
|
|
@@ -14,9 +15,7 @@ export interface IProjectDeps {
|
|
|
14
15
|
export interface IOperationRunnerOptions {
|
|
15
16
|
rushProject: RushConfigurationProject;
|
|
16
17
|
rushConfiguration: RushConfiguration;
|
|
17
|
-
buildCacheConfiguration: BuildCacheConfiguration | undefined;
|
|
18
18
|
commandToRun: string;
|
|
19
|
-
isIncrementalBuildAllowed: boolean;
|
|
20
19
|
projectChangeAnalyzer: ProjectChangeAnalyzer;
|
|
21
20
|
displayName: string;
|
|
22
21
|
phase: IPhase;
|
|
@@ -32,31 +31,23 @@ export interface IOperationRunnerOptions {
|
|
|
32
31
|
*/
|
|
33
32
|
export declare class ShellOperationRunner implements IOperationRunner {
|
|
34
33
|
readonly name: string;
|
|
35
|
-
isCacheWriteAllowed: boolean;
|
|
36
|
-
isSkipAllowed: boolean;
|
|
37
34
|
readonly reportTiming: boolean;
|
|
38
35
|
readonly silent: boolean;
|
|
39
36
|
readonly warningsAreAllowed: boolean;
|
|
37
|
+
readonly hooks: OperationRunnerHooks;
|
|
38
|
+
readonly periodicCallback: PeriodicCallback;
|
|
40
39
|
private readonly _rushProject;
|
|
41
40
|
private readonly _phase;
|
|
42
41
|
private readonly _rushConfiguration;
|
|
43
|
-
private readonly _buildCacheConfiguration;
|
|
44
42
|
private readonly _commandName;
|
|
45
43
|
private readonly _commandToRun;
|
|
46
|
-
private readonly _isCacheReadAllowed;
|
|
47
44
|
private readonly _projectChangeAnalyzer;
|
|
48
45
|
private readonly _packageDepsFilename;
|
|
49
46
|
private readonly _logFilenameIdentifier;
|
|
50
47
|
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;
|
|
56
48
|
constructor(options: IOperationRunnerOptions);
|
|
57
49
|
executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
|
|
58
50
|
private _executeAsync;
|
|
59
|
-
private _tryGetProjectBuildCacheAsync;
|
|
60
51
|
}
|
|
61
52
|
/**
|
|
62
53
|
* When running a command from the "scripts" block in package.json, if the command
|