@rushstack/rush-sdk 5.122.1 → 5.123.1

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.
@@ -907,6 +907,39 @@ export declare class FileSystemBuildCacheProvider {
907
907
  trySetCacheEntryBufferAsync(terminal: ITerminal, cacheId: string, entryBuffer: Buffer): Promise<string>;
908
908
  }
909
909
 
910
+ /**
911
+ * A base class for flag file.
912
+ * @internal
913
+ */
914
+ export declare class _FlagFile<T extends object = JsonObject> {
915
+ /**
916
+ * Flag file path
917
+ */
918
+ readonly path: string;
919
+ /**
920
+ * Content of the flag
921
+ */
922
+ protected _state: T | {};
923
+ /**
924
+ * Creates a new flag file
925
+ * @param folderPath - the folder that this flag is managing
926
+ * @param state - optional, the state that should be managed or compared
927
+ */
928
+ constructor(folderPath: string, flagName: string, initialState?: T);
929
+ /**
930
+ * Returns true if the file exists and the contents match the current state.
931
+ */
932
+ isValidAsync(): Promise<boolean>;
933
+ /**
934
+ * Writes the flag file to disk with the current state
935
+ */
936
+ createAsync(): Promise<void>;
937
+ /**
938
+ * Removes the flag file
939
+ */
940
+ clearAsync(): Promise<void>;
941
+ }
942
+
910
943
  /**
911
944
  * Calculates the cache entry id string for an operation.
912
945
  * @beta
@@ -1497,14 +1530,6 @@ declare interface ILocalBuildCacheJson extends IBaseBuildCacheJson {
1497
1530
  readonly cacheProvider: 'local-only';
1498
1531
  }
1499
1532
 
1500
- /**
1501
- * @internal
1502
- */
1503
- export declare interface _ILockfileValidityCheckOptions {
1504
- statePropertiesToIgnore?: string[];
1505
- rushVerb?: string;
1506
- }
1507
-
1508
1533
  declare interface ILockStepVersionJson extends IVersionPolicyJson {
1509
1534
  version: string;
1510
1535
  nextBump?: string;
@@ -1795,6 +1820,11 @@ export declare interface IOperationSettings {
1795
1820
  * calculating final hash value when reading and writing the build cache
1796
1821
  */
1797
1822
  dependsOnAdditionalFiles?: string[];
1823
+ /**
1824
+ * How many concurrency units this operation should take up during execution. The maximum concurrent units is
1825
+ * determined by the -p flag.
1826
+ */
1827
+ weight?: number;
1798
1828
  }
1799
1829
 
1800
1830
  /**
@@ -2442,53 +2472,6 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
2442
2472
  ignoreEngines?: boolean;
2443
2473
  }
2444
2474
 
2445
- /**
2446
- * A helper class for managing last-install flags, which are persistent and
2447
- * indicate that something installed in the folder was successfully completed.
2448
- * It also compares state, so that if something like the Node.js version has changed,
2449
- * it can invalidate the last install.
2450
- * @internal
2451
- */
2452
- export declare class _LastInstallFlag {
2453
- private _state;
2454
- /**
2455
- * Returns the full path to the flag file
2456
- */
2457
- readonly path: string;
2458
- /**
2459
- * Creates a new LastInstall flag
2460
- * @param folderPath - the folder that this flag is managing
2461
- * @param state - optional, the state that should be managed or compared
2462
- */
2463
- constructor(folderPath: string, state?: JsonObject);
2464
- /**
2465
- * Returns true if the file exists and the contents match the current state.
2466
- */
2467
- isValid(options?: _ILockfileValidityCheckOptions): boolean;
2468
- /**
2469
- * Same as isValid(), but with an additional check: If the current state is not equal to the previous
2470
- * state, and an the current state causes an error, then throw an exception with a friendly message.
2471
- *
2472
- * @internal
2473
- */
2474
- checkValidAndReportStoreIssues(options: _ILockfileValidityCheckOptions & {
2475
- rushVerb: string;
2476
- }): boolean;
2477
- private _isValid;
2478
- /**
2479
- * Writes the flag file to disk with the current state
2480
- */
2481
- create(): void;
2482
- /**
2483
- * Removes the flag file
2484
- */
2485
- clear(): void;
2486
- /**
2487
- * Returns the name of the flag file
2488
- */
2489
- protected get flagName(): string;
2490
- }
2491
-
2492
2475
  /**
2493
2476
  * This policy indicates all related projects should use the same version.
2494
2477
  * @public
@@ -4369,6 +4352,10 @@ export declare class RushConstants {
4369
4352
  * The filename ("project-impact-graph.yaml") for the project impact graph file.
4370
4353
  */
4371
4354
  static readonly projectImpactGraphFilename: 'project-impact-graph.yaml';
4355
+ /**
4356
+ * The filename for the last link flag
4357
+ */
4358
+ static readonly lastLinkFlagFilename: 'last-link';
4372
4359
  }
4373
4360
 
4374
4361
  /**
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.43.1"
8
+ "packageVersion": "7.43.2"
9
9
  }
10
10
  ]
11
11
  }
@@ -0,0 +1,34 @@
1
+ import { type JsonObject } from '@rushstack/node-core-library';
2
+ /**
3
+ * A base class for flag file.
4
+ * @internal
5
+ */
6
+ export declare class FlagFile<T extends object = JsonObject> {
7
+ /**
8
+ * Flag file path
9
+ */
10
+ readonly path: string;
11
+ /**
12
+ * Content of the flag
13
+ */
14
+ protected _state: T | {};
15
+ /**
16
+ * Creates a new flag file
17
+ * @param folderPath - the folder that this flag is managing
18
+ * @param state - optional, the state that should be managed or compared
19
+ */
20
+ constructor(folderPath: string, flagName: string, initialState?: T);
21
+ /**
22
+ * Returns true if the file exists and the contents match the current state.
23
+ */
24
+ isValidAsync(): Promise<boolean>;
25
+ /**
26
+ * Writes the flag file to disk with the current state
27
+ */
28
+ createAsync(): Promise<void>;
29
+ /**
30
+ * Removes the flag file
31
+ */
32
+ clearAsync(): Promise<void>;
33
+ }
34
+ //# sourceMappingURL=FlagFile.d.ts.map
@@ -1 +1 @@
1
- module.exports = require("../../lib-shim/index")._rushSdk_loadInternalModule("api/LastLinkFlag");
1
+ module.exports = require("../../lib-shim/index")._rushSdk_loadInternalModule("api/FlagFile");
@@ -1,12 +1,56 @@
1
- import { type JsonObject } from '@rushstack/node-core-library';
1
+ import { type JsonObject, type IPackageJson } from '@rushstack/node-core-library';
2
+ import type { PackageManagerName } from './packageManager/PackageManager';
2
3
  import type { RushConfiguration } from './RushConfiguration';
3
4
  import type { Subspace } from './Subspace';
4
5
  export declare const LAST_INSTALL_FLAG_FILE_NAME: string;
5
6
  /**
6
- * @internal
7
+ * This represents the JSON data structure for the "last-install.flag" file.
7
8
  */
8
- export interface ILockfileValidityCheckOptions {
9
- statePropertiesToIgnore?: string[];
9
+ export interface ILastInstallFlagJson {
10
+ /**
11
+ * Current node version
12
+ */
13
+ node?: string;
14
+ /**
15
+ * Current package manager name
16
+ */
17
+ packageManager?: PackageManagerName;
18
+ /**
19
+ * Current package manager version
20
+ */
21
+ packageManagerVersion: string;
22
+ /**
23
+ * Current rush json folder
24
+ */
25
+ rushJsonFolder: string;
26
+ /**
27
+ * The content of package.json, used in the flag file of autoinstaller
28
+ */
29
+ packageJson?: IPackageJson;
30
+ /**
31
+ * Same with pnpmOptions.pnpmStorePath in rush.json
32
+ */
33
+ storePath?: string;
34
+ /**
35
+ * An experimental flag used by cleanInstallAfterNpmrcChanges
36
+ */
37
+ npmrcHash?: string;
38
+ /**
39
+ * True when "useWorkspaces" is true in rush.json
40
+ */
41
+ workspaces?: boolean;
42
+ /**
43
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
44
+ */
45
+ ignoreScripts?: boolean;
46
+ /**
47
+ * When specified, it is a list of selected projects during partial install
48
+ * It is undefined when full install
49
+ */
50
+ selectedProjectNames?: string[];
51
+ }
52
+ interface ILockfileValidityCheckOptions {
53
+ statePropertiesToIgnore?: (keyof ILastInstallFlagJson)[];
10
54
  rushVerb?: string;
11
55
  }
12
56
  /**
@@ -14,7 +58,6 @@ export interface ILockfileValidityCheckOptions {
14
58
  * indicate that something installed in the folder was successfully completed.
15
59
  * It also compares state, so that if something like the Node.js version has changed,
16
60
  * it can invalidate the last install.
17
- * @internal
18
61
  */
19
62
  export declare class LastInstallFlag {
20
63
  private _state;
@@ -27,29 +70,33 @@ export declare class LastInstallFlag {
27
70
  * @param folderPath - the folder that this flag is managing
28
71
  * @param state - optional, the state that should be managed or compared
29
72
  */
30
- constructor(folderPath: string, state?: JsonObject);
73
+ constructor(folderPath: string, state?: Partial<ILastInstallFlagJson>);
31
74
  /**
32
75
  * Returns true if the file exists and the contents match the current state.
33
76
  */
34
- isValid(options?: ILockfileValidityCheckOptions): boolean;
77
+ isValidAsync(options?: ILockfileValidityCheckOptions): Promise<boolean>;
35
78
  /**
36
79
  * Same as isValid(), but with an additional check: If the current state is not equal to the previous
37
80
  * state, and an the current state causes an error, then throw an exception with a friendly message.
38
81
  *
39
82
  * @internal
40
83
  */
41
- checkValidAndReportStoreIssues(options: ILockfileValidityCheckOptions & {
84
+ checkValidAndReportStoreIssuesAsync(options: ILockfileValidityCheckOptions & {
42
85
  rushVerb: string;
43
- }): boolean;
44
- private _isValid;
86
+ }): Promise<boolean>;
87
+ private _isValidAsync;
45
88
  /**
46
89
  * Writes the flag file to disk with the current state
47
90
  */
48
- create(): void;
91
+ createAsync(): Promise<void>;
92
+ /**
93
+ * Merge new data into current state by "merge"
94
+ */
95
+ mergeFromObject(data: JsonObject): void;
49
96
  /**
50
97
  * Removes the flag file
51
98
  */
52
- clear(): void;
99
+ clearAsync(): Promise<void>;
53
100
  /**
54
101
  * Returns the name of the flag file
55
102
  */
@@ -71,4 +118,5 @@ export declare class LastInstallFlagFactory {
71
118
  */
72
119
  static getCommonTempFlag(rushConfiguration: RushConfiguration, subspace: Subspace, extraState?: Record<string, string>): LastInstallFlag;
73
120
  }
121
+ export {};
74
122
  //# sourceMappingURL=LastInstallFlag.d.ts.map
@@ -73,6 +73,11 @@ export interface IOperationSettings {
73
73
  * calculating final hash value when reading and writing the build cache
74
74
  */
75
75
  dependsOnAdditionalFiles?: string[];
76
+ /**
77
+ * How many concurrency units this operation should take up during execution. The maximum concurrent units is
78
+ * determined by the -p flag.
79
+ */
80
+ weight?: number;
76
81
  }
77
82
  /**
78
83
  * Use this class to load the "config/rush-project.json" config file.
package/lib/index.d.ts CHANGED
@@ -29,7 +29,7 @@ export { RepoStateFile } from './logic/RepoStateFile';
29
29
  export { LookupByPath, IPrefixMatch } from './logic/LookupByPath';
30
30
  export { EventHooks, Event } from './api/EventHooks';
31
31
  export { ChangeManager } from './api/ChangeManager';
32
- export { LastInstallFlag as _LastInstallFlag, ILockfileValidityCheckOptions as _ILockfileValidityCheckOptions } from './api/LastInstallFlag';
32
+ export { FlagFile as _FlagFile } from './api/FlagFile';
33
33
  export { VersionPolicyDefinitionName, BumpType, LockStepVersionPolicy, IndividualVersionPolicy, VersionPolicy } from './api/VersionPolicy';
34
34
  export { VersionPolicyConfiguration } from './api/VersionPolicyConfiguration';
35
35
  export { ILaunchOptions, Rush } from './api/Rush';
@@ -256,5 +256,9 @@ export declare class RushConstants {
256
256
  * The filename ("project-impact-graph.yaml") for the project impact graph file.
257
257
  */
258
258
  static readonly projectImpactGraphFilename: 'project-impact-graph.yaml';
259
+ /**
260
+ * The filename for the last link flag
261
+ */
262
+ static readonly lastLinkFlagFilename: 'last-link';
259
263
  }
260
264
  //# sourceMappingURL=RushConstants.d.ts.map
@@ -11,7 +11,7 @@ export declare class UnlinkManager {
11
11
  *
12
12
  * Returns true if anything was deleted.
13
13
  */
14
- unlink(force?: boolean): boolean;
14
+ unlinkAsync(force?: boolean): Promise<boolean>;
15
15
  /**
16
16
  * Delete:
17
17
  * - all the node_modules symlinks of configured Rush projects
@@ -1,5 +1,6 @@
1
1
  import type { ITerminal } from '@rushstack/terminal';
2
2
  import type { Subspace } from '../../api/Subspace';
3
+ import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
3
4
  export interface IInstallManagerOptions {
4
5
  /**
5
6
  * Whether the global "--debug" flag was specified.
@@ -67,7 +68,7 @@ export interface IInstallManagerOptions {
67
68
  * Filters to be passed to PNPM during installation, if applicable.
68
69
  * These restrict the scope of a workspace installation.
69
70
  */
70
- pnpmFilterArguments: string[];
71
+ filteredProjects: RushConfigurationProject[];
71
72
  /**
72
73
  * Callback to invoke between preparing the common/temp folder and running installation.
73
74
  */
@@ -8,7 +8,10 @@ import type { OperationExecutionRecord } from './OperationExecutionRecord';
8
8
  * NOTE: the caller must wait for some time to avoid busy loop and burn CPU cycles.
9
9
  */
10
10
  export declare const UNASSIGNED_OPERATION: 'UNASSIGNED_OPERATION';
11
- export type IOperationIteratorResult = OperationExecutionRecord | typeof UNASSIGNED_OPERATION;
11
+ export type IOperationIteratorResult = OperationExecutionRecord | {
12
+ weight: 0;
13
+ status: typeof UNASSIGNED_OPERATION;
14
+ };
12
15
  /**
13
16
  * Implementation of the async iteration protocol for a collection of IOperation objects.
14
17
  * The async iterator will wait for an operation to be ready for execution, or terminate if there are no more operations.
@@ -0,0 +1,10 @@
1
+ import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
2
+ /**
3
+ * Add weights to operations based on the operation settings in rush-project.json.
4
+ *
5
+ * This also sets the weight of no-op operations to 0.
6
+ */
7
+ export declare class WeightedOperationPlugin implements IPhasedCommandPlugin {
8
+ apply(hooks: PhasedCommandHooks): void;
9
+ }
10
+ //# sourceMappingURL=WeightedOperationPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/operations/WeightedOperationPlugin");
@@ -4,4 +4,9 @@
4
4
  export declare function objectsAreDeepEqual<TObject>(a: TObject, b: TObject): boolean;
5
5
  export declare function cloneDeep<TObject>(obj: TObject): TObject;
6
6
  export declare function merge<TBase extends object, TOther>(base: TBase, other: TOther): (TBase & TOther) | TOther;
7
+ /**
8
+ * Performs a partial deep comparison between `obj` and `source` to
9
+ * determine if `obj` contains equivalent property values.
10
+ */
11
+ export declare function isMatch<TObject>(obj: TObject, source: TObject): boolean;
7
12
  //# sourceMappingURL=objectUtilities.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.122.1",
3
+ "version": "5.123.1",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,17 +25,17 @@
25
25
  "dependencies": {
26
26
  "@types/node-fetch": "2.6.2",
27
27
  "tapable": "2.2.1",
28
- "@rushstack/node-core-library": "4.1.0",
29
- "@rushstack/terminal": "0.10.1"
28
+ "@rushstack/node-core-library": "4.2.0",
29
+ "@rushstack/terminal": "0.10.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/semver": "7.5.0",
33
33
  "@types/webpack-env": "1.18.0",
34
+ "@microsoft/rush-lib": "5.123.1",
34
35
  "local-node-rig": "1.0.0",
35
- "@microsoft/rush-lib": "5.122.1",
36
- "@rushstack/stream-collator": "4.1.41",
37
- "@rushstack/heft": "0.66.3",
38
- "@rushstack/ts-command-line": "4.19.2"
36
+ "@rushstack/ts-command-line": "4.19.3",
37
+ "@rushstack/stream-collator": "4.1.42",
38
+ "@rushstack/heft": "0.66.4"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "heft build --clean",
@@ -1,41 +0,0 @@
1
- import { LastInstallFlag } from './LastInstallFlag';
2
- import type { Subspace } from './Subspace';
3
- export declare const LAST_LINK_FLAG_FILE_NAME: string;
4
- /**
5
- * A helper class for managing the last-link flag, which is persistent and
6
- * indicates that linking was completed successfully.
7
- * @internal
8
- */
9
- export declare class LastLinkFlag extends LastInstallFlag {
10
- /**
11
- * @override
12
- */
13
- isValid(): boolean;
14
- /**
15
- * @override
16
- */
17
- checkValidAndReportStoreIssues(): boolean;
18
- /**
19
- * Returns the name of the flag file
20
- *
21
- * @override
22
- */
23
- protected get flagName(): string;
24
- }
25
- /**
26
- * A helper class for LastLinkFlag
27
- *
28
- * @internal
29
- */
30
- export declare class LastLinkFlagFactory {
31
- /**
32
- * Gets the LastLink flag and sets the current state. This state is used to compare
33
- * against the last-known-good state tracked by the LastLink flag.
34
- * @param rushConfiguration - the configuration of the Rush repo to get the install
35
- * state from
36
- *
37
- * @internal
38
- */
39
- static getCommonTempFlag(subspace: Subspace): LastLinkFlag;
40
- }
41
- //# sourceMappingURL=LastLinkFlag.d.ts.map