@rushstack/rush-sdk 5.97.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.
Files changed (53) hide show
  1. package/dist/rush-lib.d.ts +425 -29
  2. package/lib/api/CobuildConfiguration.d.ts +63 -0
  3. package/lib/api/CobuildConfiguration.js +1 -0
  4. package/lib/api/EnvironmentConfiguration.d.ts +41 -0
  5. package/lib/api/ExperimentsConfiguration.d.ts +5 -0
  6. package/lib/api/LastInstallFlag.d.ts +58 -21
  7. package/lib/api/LastLinkFlag.d.ts +3 -7
  8. package/lib/api/RushConfiguration.d.ts +52 -0
  9. package/lib/api/RushConfigurationProject.d.ts +6 -0
  10. package/lib/api/base/BaseFlag.d.ts +50 -0
  11. package/lib/api/base/BaseFlag.js +1 -0
  12. package/lib/api/packageManager/PnpmPackageManager.d.ts +14 -0
  13. package/lib/cli/actions/InstallAction.d.ts +7 -0
  14. package/lib/cli/actions/ListAction.d.ts +4 -0
  15. package/lib/cli/actions/UpdateAction.d.ts +7 -0
  16. package/lib/cli/parsing/SelectionParameterSet.d.ts +17 -3
  17. package/lib/index.d.ts +5 -2
  18. package/lib/logic/PurgeManager.d.ts +1 -0
  19. package/lib/logic/RushConstants.d.ts +15 -0
  20. package/lib/logic/base/BaseInstallManagerTypes.d.ts +23 -0
  21. package/lib/logic/buildCache/ProjectBuildCache.d.ts +5 -4
  22. package/lib/logic/cobuild/CobuildLock.d.ts +24 -0
  23. package/lib/logic/cobuild/CobuildLock.js +1 -0
  24. package/lib/logic/cobuild/ICobuildLockProvider.d.ts +46 -0
  25. package/lib/logic/cobuild/ICobuildLockProvider.js +1 -0
  26. package/lib/logic/installManager/InstallHelpers.d.ts +1 -0
  27. package/lib/logic/operations/AsyncOperationQueue.d.ts +23 -4
  28. package/lib/logic/operations/CacheableOperationPlugin.d.ts +21 -0
  29. package/lib/logic/operations/CacheableOperationPlugin.js +1 -0
  30. package/lib/logic/operations/IOperationRunner.d.ts +29 -10
  31. package/lib/logic/operations/OperationExecutionManager.d.ts +5 -0
  32. package/lib/logic/operations/OperationExecutionRecord.d.ts +7 -1
  33. package/lib/logic/operations/OperationRunnerHooks.d.ts +50 -0
  34. package/lib/logic/operations/OperationRunnerHooks.js +1 -0
  35. package/lib/logic/operations/OperationStatus.d.ts +8 -0
  36. package/lib/logic/operations/PeriodicCallback.d.ts +20 -0
  37. package/lib/logic/operations/PeriodicCallback.js +1 -0
  38. package/lib/logic/operations/ShellOperationRunner.d.ts +4 -13
  39. package/lib/logic/pnpm/IPnpmfile.d.ts +16 -0
  40. package/lib/logic/pnpm/PnpmProjectShrinkwrapFile.d.ts +7 -0
  41. package/lib/logic/pnpm/PnpmShrinkwrapFile.d.ts +26 -0
  42. package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.d.ts +3 -0
  43. package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.js +1 -0
  44. package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.d.ts +23 -0
  45. package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.js +1 -0
  46. package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.d.ts +10 -0
  47. package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.js +1 -0
  48. package/lib/logic/versionMismatch/VersionMismatchFinderProject.d.ts +2 -0
  49. package/lib/pluginFramework/PhasedCommandHooks.d.ts +15 -1
  50. package/lib/pluginFramework/RushSession.d.ts +11 -2
  51. package/lib/utilities/PathConstants.d.ts +1 -0
  52. package/lib/utilities/npmrcUtilities.d.ts +1 -1
  53. package/package.json +2 -2
@@ -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
- projectConfiguration: RushProjectConfiguration;
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
- * Implmentation of the async iteration protocol for a collection of IOperation objects.
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<OperationExecutionRecord>, AsyncIterator<OperationExecutionRecord> {
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<OperationExecutionRecord>>;
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<OperationExecutionRecord>;
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 { IStopwatchResult } from '../../utilities/Stopwatch';
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: IStopwatchResult;
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
@@ -1,5 +1,6 @@
1
1
  import type { LogBase } from '@pnpm/logger';
2
2
  import type { IPackageJson } from '@rushstack/node-core-library';
3
+ import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
3
4
  import type { IPnpmShrinkwrapYaml } from './PnpmShrinkwrapFile';
4
5
  /**
5
6
  * The `settings` parameter passed to {@link IPnpmfileShim.hooks.readPackage} and
@@ -19,6 +20,20 @@ export interface IPnpmfileShimSettings {
19
20
  workspaceVersions: Record<string, string>;
20
21
  userPnpmfilePath?: string;
21
22
  }
23
+ export interface IWorkspaceProjectInfo extends Pick<RushConfigurationProject, 'packageName' | 'projectRelativeFolder'> {
24
+ packageVersion: RushConfigurationProject['packageJson']['version'];
25
+ }
26
+ /**
27
+ * The `settings` parameter passed to {@link IPnpmfileShim.hooks.readPackage} and
28
+ * {@link IPnpmfileShim.hooks.afterAllResolved}.
29
+ */
30
+ export interface ISplitWorkspacePnpmfileShimSettings {
31
+ semverPath: string;
32
+ pathNormalizerPath: string;
33
+ workspaceProjects: Record<string, IWorkspaceProjectInfo>;
34
+ splitWorkspaceProjects: Record<string, IWorkspaceProjectInfo>;
35
+ userPnpmfilePath?: string;
36
+ }
22
37
  /**
23
38
  * The `context` parameter passed to {@link IPnpmfile.hooks.readPackage}, as defined by the
24
39
  * pnpmfile API contract.
@@ -26,6 +41,7 @@ export interface IPnpmfileShimSettings {
26
41
  export interface IPnpmfileContext {
27
42
  log: (message: string) => void;
28
43
  pnpmfileShimSettings?: IPnpmfileShimSettings;
44
+ splitWorkspacePnpmfileShimSettings?: ISplitWorkspacePnpmfileShimSettings;
29
45
  }
30
46
  /**
31
47
  * The `log` parameter passed to {@link IPnpmfile.hooks.filterLog}.
@@ -1,9 +1,15 @@
1
1
  import { BaseProjectShrinkwrapFile } from '../base/BaseProjectShrinkwrapFile';
2
2
  import { PnpmShrinkwrapFile } from './PnpmShrinkwrapFile';
3
+ import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
3
4
  /**
4
5
  *
5
6
  */
6
7
  export declare class PnpmProjectShrinkwrapFile extends BaseProjectShrinkwrapFile<PnpmShrinkwrapFile> {
8
+ /**
9
+ * When split workspace projects turn off shared-workspace-lockfiles, Pnpm creates individual
10
+ * shrinkwrap files for each project.
11
+ */
12
+ static generateIndividualProjectShrinkwrapAsync(project: RushConfigurationProject): Promise<void>;
7
13
  /**
8
14
  * Generate and write the project shrinkwrap file to <project>/.rush/temp/shrinkwrap-deps.json.
9
15
  * @returns True if the project shrinkwrap was created or updated, false otherwise.
@@ -16,6 +22,7 @@ export declare class PnpmProjectShrinkwrapFile extends BaseProjectShrinkwrapFile
16
22
  protected generateProjectShrinkwrapMap(): Map<string, string> | undefined;
17
23
  protected generateWorkspaceProjectShrinkwrapMap(): Map<string, string> | undefined;
18
24
  protected generateLegacyProjectShrinkwrapMap(): Map<string, string>;
25
+ protected generateIndividualProjectShrinkwrapMap(): Map<string, string>;
19
26
  private _addDependencyRecursive;
20
27
  private _resolveAndAddPeerDependencies;
21
28
  /**
@@ -4,6 +4,7 @@ import { RushConfiguration } from '../../api/RushConfiguration';
4
4
  import { IShrinkwrapFilePolicyValidatorOptions } from '../policy/ShrinkwrapFilePolicy';
5
5
  import { IExperimentsJson } from '../../api/ExperimentsConfiguration';
6
6
  import { RushConfigurationProject } from '../../api/RushConfigurationProject';
7
+ import { SplitWorkspacePnpmfileConfiguration } from './SplitWorkspacePnpmfileConfiguration';
7
8
  import { PnpmProjectShrinkwrapFile } from './PnpmProjectShrinkwrapFile';
8
9
  import { PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
9
10
  export interface IPeerDependenciesMetaYaml {
@@ -91,6 +92,14 @@ export interface IPnpmShrinkwrapYaml {
91
92
  dependencies: {
92
93
  [dependency: string]: string;
93
94
  };
95
+ /** The list of resolved version numbers for develop dependencies */
96
+ devDependencies: {
97
+ [dependency: string]: string;
98
+ };
99
+ /** The list of resolved version numbers for optional dependencies */
100
+ optionalDependencies: {
101
+ [dependency: string]: string;
102
+ };
94
103
  /** The list of importers for local workspace projects */
95
104
  importers: {
96
105
  [relativePath: string]: IPnpmShrinkwrapImporterYaml;
@@ -105,6 +114,10 @@ export interface IPnpmShrinkwrapYaml {
105
114
  specifiers: {
106
115
  [dependency: string]: string;
107
116
  };
117
+ /** The list of override version number for dependencies */
118
+ overrides: {
119
+ [dependency: string]: string;
120
+ };
108
121
  }
109
122
  /**
110
123
  * Given an encoded "dependency key" from the PNPM shrinkwrap file, this parses it into an equivalent
@@ -117,15 +130,23 @@ export declare class PnpmShrinkwrapFile extends BaseShrinkwrapFile {
117
130
  readonly isWorkspaceCompatible: boolean;
118
131
  readonly registry: string;
119
132
  readonly dependencies: ReadonlyMap<string, string>;
133
+ readonly devDependencies: ReadonlyMap<string, string>;
134
+ readonly optionalDependencies: ReadonlyMap<string, string>;
120
135
  readonly importers: ReadonlyMap<string, IPnpmShrinkwrapImporterYaml>;
121
136
  readonly specifiers: ReadonlyMap<string, string>;
122
137
  readonly packages: ReadonlyMap<string, IPnpmShrinkwrapDependencyYaml>;
138
+ readonly overrides: ReadonlyMap<string, string>;
123
139
  private readonly _shrinkwrapJson;
124
140
  private readonly _integrities;
125
141
  private _pnpmfileConfiguration;
142
+ private _splitWorkspaceGlobalPnpmfileConfiguration;
143
+ private _individualPackageName;
144
+ private _individualShrinkwrapImporter;
126
145
  private constructor();
127
146
  static loadFromFile(shrinkwrapYamlFilename: string): PnpmShrinkwrapFile | undefined;
128
147
  static loadFromString(shrinkwrapContent: string): PnpmShrinkwrapFile;
148
+ setIndividualPackage(packageName: string, splitWorkspaceGlobalPnpmfileConfiguration?: SplitWorkspacePnpmfileConfiguration): void;
149
+ get isIndividual(): boolean;
129
150
  getShrinkwrapHash(experimentsConfig?: IExperimentsJson): string;
130
151
  /** @override */
131
152
  validate(packageManagerOptionsConfig: PackageManagerOptionsConfigurationBase, policyOptions: IShrinkwrapFilePolicyValidatorOptions, experimentsConfig?: IExperimentsJson): void;
@@ -192,8 +213,12 @@ export declare class PnpmShrinkwrapFile extends BaseShrinkwrapFile {
192
213
  getImporterKeyByPath(workspaceRoot: string, projectFolder: string): string;
193
214
  getImporter(importerKey: string): IPnpmShrinkwrapImporterYaml | undefined;
194
215
  getIntegrityForImporter(importerKey: string): Map<string, string> | undefined;
216
+ getIntegrityForIndividualProject(): Map<string, string>;
195
217
  /** @override */
196
218
  isWorkspaceProjectModifiedAsync(project: RushConfigurationProject, variant?: string): Promise<boolean>;
219
+ isSplitWorkspaceProjectModified(project: RushConfigurationProject): boolean;
220
+ isSplitWorkspaceIndividualProjectModified(project: RushConfigurationProject): boolean;
221
+ private _isProjectModified;
197
222
  private _getIntegrityForPackage;
198
223
  private _addIntegrities;
199
224
  /**
@@ -203,5 +228,6 @@ export declare class PnpmShrinkwrapFile extends BaseShrinkwrapFile {
203
228
  private _getPackageId;
204
229
  private _parsePnpmDependencyKey;
205
230
  private _serializeInternal;
231
+ private _getIndividualShrinkwrapImporter;
206
232
  }
207
233
  //# sourceMappingURL=PnpmShrinkwrapFile.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { IPnpmfileHooks } from './IPnpmfile';
2
+ export declare const hooks: IPnpmfileHooks;
3
+ //# sourceMappingURL=SplitWorkspaceGlobalPnpmfileShim.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/pnpm/SplitWorkspaceGlobalPnpmfileShim");
@@ -0,0 +1,23 @@
1
+ import { IPackageJson } from '@rushstack/node-core-library';
2
+ import type { RushConfiguration } from '../../api/RushConfiguration';
3
+ /**
4
+ * Loads PNPM's pnpmfile.js configuration, and invokes it to preprocess package.json files,
5
+ * optionally utilizing a pnpmfile shim to inject preferred versions.
6
+ */
7
+ export declare class SplitWorkspacePnpmfileConfiguration {
8
+ private _context;
9
+ constructor(rushConfiguration: RushConfiguration);
10
+ /**
11
+ * Split workspace use global pnpmfile, because in split workspace, user may set `shared-workspace-lockfile=false`.
12
+ * That means each project owns their individual pnpmfile under project folder. While the global pnpmfile could be
13
+ * under the common/temp-split/ folder and be used by all split workspace projects.
14
+ */
15
+ static writeCommonTempSplitGlobalPnpmfileAsync(rushConfiguration: RushConfiguration): Promise<void>;
16
+ private static _getSplitWorkspacePnpmfileShimSettings;
17
+ /**
18
+ * Transform a package.json file using the pnpmfile.js hook.
19
+ * @returns the tranformed object, or the original input if pnpmfile.js was not found.
20
+ */
21
+ transform(packageJson: IPackageJson): IPackageJson;
22
+ }
23
+ //# sourceMappingURL=SplitWorkspacePnpmfileConfiguration.d.ts.map