@rushstack/rush-sdk 5.153.2 → 5.155.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.
@@ -1274,6 +1274,10 @@ export declare interface ICredentialCacheEntry {
1274
1274
  */
1275
1275
  export declare interface ICredentialCacheOptions {
1276
1276
  supportEditing: boolean;
1277
+ /**
1278
+ * If specified, use the specified path instead of the default path of `~/.rush-user/credentials.json`
1279
+ */
1280
+ cacheFilePath?: string;
1277
1281
  }
1278
1282
 
1279
1283
  /**
@@ -1749,6 +1753,20 @@ export declare class IndividualVersionPolicy extends VersionPolicy {
1749
1753
  export declare interface _INpmOptionsJson extends IPackageManagerOptionsJsonBase {
1750
1754
  }
1751
1755
 
1756
+ /**
1757
+ * @internal
1758
+ */
1759
+ export declare interface _IOperationBuildCacheOptions {
1760
+ /**
1761
+ * The repo-wide configuration for the build cache.
1762
+ */
1763
+ buildCacheConfiguration: BuildCacheConfiguration;
1764
+ /**
1765
+ * The terminal to use for logging.
1766
+ */
1767
+ terminal: ITerminal;
1768
+ }
1769
+
1752
1770
  /**
1753
1771
  * The `IOperationExecutionResult` interface represents the results of executing an {@link Operation}.
1754
1772
  * @alpha
@@ -2237,6 +2255,28 @@ export declare interface IPnpmPeerDependencyRules {
2237
2255
 
2238
2256
  export { IPrefixMatch }
2239
2257
 
2258
+ /**
2259
+ * @internal
2260
+ */
2261
+ export declare type _IProjectBuildCacheOptions = _IOperationBuildCacheOptions & {
2262
+ /**
2263
+ * Value from rush-project.json
2264
+ */
2265
+ projectOutputFolderNames: ReadonlyArray<string>;
2266
+ /**
2267
+ * The project to be cached.
2268
+ */
2269
+ project: RushConfigurationProject;
2270
+ /**
2271
+ * The hash of all relevant inputs and configuration that uniquely identifies this execution.
2272
+ */
2273
+ operationStateHash: string;
2274
+ /**
2275
+ * The name of the phase that is being cached.
2276
+ */
2277
+ phaseName: string;
2278
+ };
2279
+
2240
2280
  /**
2241
2281
  * Information about the currently executing command provided to plugins.
2242
2282
  * @beta
@@ -2857,6 +2897,35 @@ export declare class Operation {
2857
2897
  deleteDependency(dependency: Operation): void;
2858
2898
  }
2859
2899
 
2900
+ /**
2901
+ * @internal
2902
+ */
2903
+ export declare class _OperationBuildCache {
2904
+ private static _tarUtilityPromise;
2905
+ private readonly _project;
2906
+ private readonly _localBuildCacheProvider;
2907
+ private readonly _cloudBuildCacheProvider;
2908
+ private readonly _buildCacheEnabled;
2909
+ private readonly _cacheWriteEnabled;
2910
+ private readonly _projectOutputFolderNames;
2911
+ private readonly _cacheId;
2912
+ private constructor();
2913
+ private static _tryGetTarUtility;
2914
+ get cacheId(): string | undefined;
2915
+ static getOperationBuildCache(options: _IProjectBuildCacheOptions): _OperationBuildCache;
2916
+ static forOperation(executionResult: IOperationExecutionResult, options: _IOperationBuildCacheOptions): _OperationBuildCache;
2917
+ tryRestoreFromCacheAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
2918
+ trySetCacheEntryAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
2919
+ /**
2920
+ * Walks the declared output folders of the project and collects a list of files.
2921
+ * @returns The list of output files as project-relative paths, or `undefined` if a
2922
+ * symbolic link was encountered.
2923
+ */
2924
+ private _tryCollectPathsToCacheAsync;
2925
+ private _getTarLogFilePath;
2926
+ private static _getCacheId;
2927
+ }
2928
+
2860
2929
  /**
2861
2930
  * A helper class for managing the meta files of a operation.
2862
2931
  *
package/lib/index.d.ts CHANGED
@@ -59,4 +59,6 @@ export type { IStopwatchResult } from './utilities/Stopwatch';
59
59
  export { OperationStateFile as _OperationStateFile, type IOperationStateFileOptions as _IOperationStateFileOptions, type IOperationStateJson as _IOperationStateJson } from './logic/operations/OperationStateFile';
60
60
  export { OperationMetadataManager as _OperationMetadataManager, type IOperationMetadataManagerOptions as _IOperationMetadataManagerOptions, type IOperationMetaData as _IOperationMetadata } from './logic/operations/OperationMetadataManager';
61
61
  export { RushCommandLine, type IRushCommandLineSpec, type IRushCommandLineParameter, type IRushCommandLineAction } from './api/RushCommandLine';
62
+ export { OperationBuildCache as _OperationBuildCache } from './logic/buildCache/OperationBuildCache';
63
+ export type { IOperationBuildCacheOptions as _IOperationBuildCacheOptions, IProjectBuildCacheOptions as _IProjectBuildCacheOptions } from './logic/buildCache/OperationBuildCache';
62
64
  //# sourceMappingURL=index.d.ts.map
@@ -11,6 +11,10 @@ export interface ICredentialCacheEntry {
11
11
  */
12
12
  export interface ICredentialCacheOptions {
13
13
  supportEditing: boolean;
14
+ /**
15
+ * If specified, use the specified path instead of the default path of `~/.rush-user/credentials.json`
16
+ */
17
+ cacheFilePath?: string;
14
18
  }
15
19
  /**
16
20
  * @beta
@@ -1,7 +1,10 @@
1
1
  import type { ITerminal } from '@rushstack/terminal';
2
2
  import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
3
3
  import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
4
- import type { OperationExecutionRecord } from '../operations/OperationExecutionRecord';
4
+ import type { IOperationExecutionResult } from '../operations/IOperationExecutionResult';
5
+ /**
6
+ * @internal
7
+ */
5
8
  export interface IOperationBuildCacheOptions {
6
9
  /**
7
10
  * The repo-wide configuration for the build cache.
@@ -12,6 +15,9 @@ export interface IOperationBuildCacheOptions {
12
15
  */
13
16
  terminal: ITerminal;
14
17
  }
18
+ /**
19
+ * @internal
20
+ */
15
21
  export type IProjectBuildCacheOptions = IOperationBuildCacheOptions & {
16
22
  /**
17
23
  * Value from rush-project.json
@@ -30,7 +36,10 @@ export type IProjectBuildCacheOptions = IOperationBuildCacheOptions & {
30
36
  */
31
37
  phaseName: string;
32
38
  };
33
- export declare class ProjectBuildCache {
39
+ /**
40
+ * @internal
41
+ */
42
+ export declare class OperationBuildCache {
34
43
  private static _tarUtilityPromise;
35
44
  private readonly _project;
36
45
  private readonly _localBuildCacheProvider;
@@ -42,8 +51,8 @@ export declare class ProjectBuildCache {
42
51
  private constructor();
43
52
  private static _tryGetTarUtility;
44
53
  get cacheId(): string | undefined;
45
- static getProjectBuildCache(options: IProjectBuildCacheOptions): ProjectBuildCache;
46
- static forOperation(operation: OperationExecutionRecord, options: IOperationBuildCacheOptions): ProjectBuildCache;
54
+ static getOperationBuildCache(options: IProjectBuildCacheOptions): OperationBuildCache;
55
+ static forOperation(executionResult: IOperationExecutionResult, options: IOperationBuildCacheOptions): OperationBuildCache;
47
56
  tryRestoreFromCacheAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
48
57
  trySetCacheEntryAsync(terminal: ITerminal, specifiedCacheId?: string): Promise<boolean>;
49
58
  /**
@@ -55,4 +64,4 @@ export declare class ProjectBuildCache {
55
64
  private _getTarLogFilePath;
56
65
  private static _getCacheId;
57
66
  }
58
- //# sourceMappingURL=ProjectBuildCache.d.ts.map
67
+ //# sourceMappingURL=OperationBuildCache.d.ts.map
@@ -1 +1 @@
1
- module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/buildCache/ProjectBuildCache");
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/buildCache/OperationBuildCache");
@@ -1,7 +1,7 @@
1
1
  import type { CobuildConfiguration } from '../../api/CobuildConfiguration';
2
2
  import type { OperationStatus } from '../operations/OperationStatus';
3
3
  import type { ICobuildContext } from './ICobuildLockProvider';
4
- import type { ProjectBuildCache } from '../buildCache/ProjectBuildCache';
4
+ import type { OperationBuildCache } from '../buildCache/OperationBuildCache';
5
5
  export interface ICobuildLockOptions {
6
6
  /**
7
7
  * {@inheritdoc CobuildConfiguration}
@@ -19,7 +19,7 @@ export interface ICobuildLockOptions {
19
19
  * {@inheritdoc ICobuildContext.phaseName}
20
20
  */
21
21
  phaseName: string;
22
- projectBuildCache: ProjectBuildCache;
22
+ operationBuildCache: OperationBuildCache;
23
23
  /**
24
24
  * The expire time of the lock in seconds.
25
25
  */
@@ -31,7 +31,7 @@ export interface ICobuildCompletedState {
31
31
  }
32
32
  export declare class CobuildLock {
33
33
  readonly cobuildConfiguration: CobuildConfiguration;
34
- readonly projectBuildCache: ProjectBuildCache;
34
+ readonly operationBuildCache: OperationBuildCache;
35
35
  private _cobuildContext;
36
36
  constructor(options: ICobuildLockOptions);
37
37
  setCompletedStateAsync(state: ICobuildCompletedState): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { type TerminalWritable, type ITerminal } from '@rushstack/terminal';
2
2
  import { CobuildLock } from '../cobuild/CobuildLock';
3
- import { ProjectBuildCache } from '../buildCache/ProjectBuildCache';
3
+ import { OperationBuildCache } from '../buildCache/OperationBuildCache';
4
4
  import type { CobuildConfiguration } from '../../api/CobuildConfiguration';
5
5
  import { DisjointSet } from '../cobuild/DisjointSet';
6
6
  import { PeriodicCallback } from './PeriodicCallback';
@@ -16,7 +16,7 @@ export interface IProjectDeps {
16
16
  export interface IOperationBuildCacheContext {
17
17
  isCacheWriteAllowed: boolean;
18
18
  isCacheReadAllowed: boolean;
19
- operationBuildCache: ProjectBuildCache | undefined;
19
+ operationBuildCache: OperationBuildCache | undefined;
20
20
  cacheDisabledReason: string | undefined;
21
21
  outputFolderNames: ReadonlyArray<string>;
22
22
  cobuildLock: CobuildLock | undefined;
@@ -40,8 +40,8 @@ export declare class CacheableOperationPlugin implements IPhasedCommandPlugin {
40
40
  apply(hooks: PhasedCommandHooks): void;
41
41
  private _getBuildCacheContextByOperation;
42
42
  private _getBuildCacheContextByOperationOrThrow;
43
- private _tryGetProjectBuildCache;
44
- private _tryGetLogOnlyProjectBuildCacheAsync;
43
+ private _tryGetOperationBuildCache;
44
+ private _tryGetLogOnlyOperationBuildCacheAsync;
45
45
  private _tryGetCobuildLockAsync;
46
46
  private _createBuildCacheTerminalAsync;
47
47
  private _tryGetBuildCacheTerminalWritableAsync;
@@ -11,6 +11,9 @@ import type { IOperationExecutionResult } from './IOperationExecutionResult';
11
11
  import type { IInputsSnapshot } from '../incremental/InputsSnapshot';
12
12
  import type { IEnvironment } from '../../utilities/Utilities';
13
13
  import { type ILogFilePaths } from './ProjectLogWritable';
14
+ /**
15
+ * @internal
16
+ */
14
17
  export interface IOperationExecutionRecordContext {
15
18
  streamCollator: StreamCollator;
16
19
  onOperationStatusChanged?: (record: OperationExecutionRecord) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.153.2",
3
+ "version": "5.155.0",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,21 +37,21 @@
37
37
  "@pnpm/lockfile.types": "~1.0.3",
38
38
  "tapable": "2.2.1",
39
39
  "@rushstack/lookup-by-path": "0.7.0",
40
+ "@rushstack/package-deps-hash": "4.4.1",
40
41
  "@rushstack/node-core-library": "5.13.1",
41
- "@rushstack/terminal": "0.15.3",
42
- "@rushstack/package-deps-hash": "4.4.1"
42
+ "@rushstack/terminal": "0.15.3"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/semver": "7.5.0",
46
46
  "@types/webpack-env": "1.18.8",
47
47
  "webpack": "~5.98.0",
48
- "@microsoft/rush-lib": "5.153.2",
48
+ "@microsoft/rush-lib": "5.155.0",
49
49
  "@rushstack/heft": "0.73.6",
50
- "local-node-rig": "1.0.0",
51
- "@rushstack/heft-webpack5-plugin": "0.11.33",
52
50
  "@rushstack/stream-collator": "4.1.103",
53
- "@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.102",
54
- "@rushstack/ts-command-line": "5.0.1"
51
+ "@rushstack/heft-webpack5-plugin": "0.11.33",
52
+ "@rushstack/ts-command-line": "5.0.1",
53
+ "local-node-rig": "1.0.0",
54
+ "@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.102"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "heft build --clean",