@rushstack/rush-sdk 5.108.0 → 5.109.1-pr3481.21

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 (42) hide show
  1. package/dist/rush-lib.d.ts +215 -28
  2. package/lib/api/EnvironmentConfiguration.d.ts +16 -1
  3. package/lib/api/EventHooks.d.ts +9 -1
  4. package/lib/api/ExperimentsConfiguration.d.ts +5 -0
  5. package/lib/api/LastInstallFlag.d.ts +58 -21
  6. package/lib/api/LastLinkFlag.d.ts +2 -6
  7. package/lib/api/Rush.d.ts +13 -6
  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/RushXCommandLine.d.ts +4 -6
  14. package/lib/cli/actions/InstallAction.d.ts +7 -0
  15. package/lib/cli/actions/ListAction.d.ts +4 -0
  16. package/lib/cli/actions/UpdateAction.d.ts +7 -0
  17. package/lib/cli/parsing/SelectionParameterSet.d.ts +17 -3
  18. package/lib/index.d.ts +2 -1
  19. package/lib/logic/PurgeManager.d.ts +1 -0
  20. package/lib/logic/RushConstants.d.ts +6 -0
  21. package/lib/logic/UnlinkManager.d.ts +2 -2
  22. package/lib/logic/base/BaseInstallManagerTypes.d.ts +23 -0
  23. package/lib/logic/installManager/InstallHelpers.d.ts +1 -0
  24. package/lib/logic/pnpm/IPnpmfile.d.ts +16 -0
  25. package/lib/logic/pnpm/PnpmOptionsConfiguration.d.ts +11 -0
  26. package/lib/logic/pnpm/PnpmProjectShrinkwrapFile.d.ts +8 -1
  27. package/lib/logic/pnpm/PnpmShrinkwrapFile.d.ts +17 -0
  28. package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.d.ts +3 -0
  29. package/lib/logic/pnpm/SplitWorkspaceGlobalPnpmfileShim.js +1 -0
  30. package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.d.ts +23 -0
  31. package/lib/logic/pnpm/SplitWorkspacePnpmfileConfiguration.js +1 -0
  32. package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.d.ts +10 -0
  33. package/lib/logic/selectors/SplitWorkspaceProjectSelectorParser.js +1 -0
  34. package/lib/logic/versionMismatch/VersionMismatchFinderProject.d.ts +2 -0
  35. package/lib/utilities/PathConstants.d.ts +1 -0
  36. package/lib/utilities/Utilities.d.ts +10 -0
  37. package/lib/utilities/npmrcUtilities.d.ts +1 -1
  38. package/lib/utilities/objectUtilities.d.ts +5 -0
  39. package/lib-shim/helpers.d.ts +1 -1
  40. package/lib-shim/helpers.d.ts.map +1 -1
  41. package/lib-shim/helpers.js.map +1 -1
  42. package/package.json +2 -2
@@ -132,6 +132,55 @@ export declare class ApprovedPackagesPolicy {
132
132
  constructor(rushConfiguration: RushConfiguration, rushConfigurationJson: IRushConfigurationJson);
133
133
  }
134
134
 
135
+ /**
136
+ * A base class for flag file.
137
+ * @internal
138
+ */
139
+ export declare class _BaseFlag<T extends object = JsonObject> {
140
+ /**
141
+ * Flag file path
142
+ */
143
+ readonly path: string;
144
+ /**
145
+ * Content of the flag
146
+ */
147
+ protected _state: T;
148
+ /**
149
+ * Whether the current state is modified
150
+ */
151
+ protected _isModified: boolean;
152
+ /**
153
+ * Creates a new flag file
154
+ * @param folderPath - the folder that this flag is managing
155
+ * @param state - optional, the state that should be managed or compared
156
+ */
157
+ constructor(folderPath: string, state?: Partial<T>);
158
+ /**
159
+ * Returns true if the file exists and the contents match the current state.
160
+ */
161
+ isValid(): boolean;
162
+ /**
163
+ * Writes the flag file to disk with the current state
164
+ */
165
+ create(): void;
166
+ /**
167
+ * Merge new data into current state by "merge"
168
+ */
169
+ mergeFromObject(data: JsonObject): void;
170
+ /**
171
+ * Writes the flag file to disk with the current state if modified
172
+ */
173
+ saveIfModified(): void;
174
+ /**
175
+ * Removes the flag file
176
+ */
177
+ clear(): void;
178
+ /**
179
+ * Returns Name of the flag file
180
+ */
181
+ protected get flagName(): string;
182
+ }
183
+
135
184
  /**
136
185
  * Use this class to load and save the "common/config/rush/build-cache.json" config file.
137
186
  * This file provides configuration options for cached project build output.
@@ -771,11 +820,16 @@ export declare const EnvironmentVariableNames: {
771
820
  * Explicitly specifies the path for the `tar` binary that is invoked by certain Rush operations.
772
821
  */
773
822
  readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH";
823
+ /**
824
+ * Internal variable used by `rushx` when recursively invoking another `rushx` process, to avoid
825
+ * nesting event hooks.
826
+ */
827
+ readonly _RUSH_RECURSIVE_RUSHX_CALL: "_RUSH_RECURSIVE_RUSHX_CALL";
774
828
  /**
775
829
  * Internal variable that explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.
776
830
  * Will be set upon loading Rush.
777
831
  */
778
- readonly RUSH_LIB_PATH: "_RUSH_LIB_PATH";
832
+ readonly _RUSH_LIB_PATH: "_RUSH_LIB_PATH";
779
833
  /**
780
834
  * When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or
781
835
  * the repository root folder. The original working directory (where the Rush command was invoked) is assigned
@@ -786,6 +840,16 @@ export declare const EnvironmentVariableNames: {
786
840
  * assign when they execute lifecycle scripts.
787
841
  */
788
842
  readonly RUSH_INVOKED_FOLDER: "RUSH_INVOKED_FOLDER";
843
+ /**
844
+ * When running a hook script, this environment variable communicates the original arguments
845
+ * passed to the `rush` or `rushx` command.
846
+ *
847
+ * @remarks
848
+ * Unlike `RUSH_INVOKED_FOLDER`, the `RUSH_INVOKED_ARGS` variable is only available for hook scripts.
849
+ * Other lifecycle scripts should not make assumptions about Rush's command line syntax
850
+ * if Rush did not explicitly pass along command-line parameters to their process.
851
+ */
852
+ readonly RUSH_INVOKED_ARGS: "RUSH_INVOKED_ARGS";
789
853
  };
790
854
 
791
855
  /**
@@ -808,7 +872,15 @@ declare enum Event_2 {
808
872
  /**
809
873
  * Post Rush build event
810
874
  */
811
- postRushBuild = 4
875
+ postRushBuild = 4,
876
+ /**
877
+ * Start of rushx execution event
878
+ */
879
+ preRushx = 5,
880
+ /**
881
+ * End of rushx execution event
882
+ */
883
+ postRushx = 6
812
884
  }
813
885
  export { Event_2 as Event }
814
886
 
@@ -1284,6 +1356,11 @@ export declare interface IExperimentsJson {
1284
1356
  * in common/config/rush/command-line.json.
1285
1357
  */
1286
1358
  phasedCommands?: boolean;
1359
+ /**
1360
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
1361
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
1362
+ */
1363
+ deferredInstallationScripts?: boolean;
1287
1364
  /**
1288
1365
  * If true, perform a clean install after when running `rush install` or `rush update` if the
1289
1366
  * `.npmrc` file has changed since the last install.
@@ -1363,6 +1440,51 @@ declare interface IIndividualVersionJson extends IVersionPolicyJson {
1363
1440
  lockedMajor?: number;
1364
1441
  }
1365
1442
 
1443
+ /**
1444
+ * This represents the JSON data structure for the "last-install.flag" file.
1445
+ * @internal
1446
+ */
1447
+ export declare interface _ILastInstallFlagJson {
1448
+ /**
1449
+ * Current node version
1450
+ */
1451
+ node: string;
1452
+ /**
1453
+ * Current package manager name
1454
+ */
1455
+ packageManager: PackageManagerName;
1456
+ /**
1457
+ * Current package manager version
1458
+ */
1459
+ packageManagerVersion: string;
1460
+ /**
1461
+ * Current rush json folder
1462
+ */
1463
+ rushJsonFolder: string;
1464
+ /**
1465
+ * The content of package.json, used in the flag file of autoinstaller
1466
+ */
1467
+ packageJson?: IPackageJson;
1468
+ /**
1469
+ * Same with pnpmOptions.pnpmStorePath in rush.json
1470
+ */
1471
+ storePath?: string;
1472
+ /**
1473
+ * True when "useWorkspaces" is true in rush.json
1474
+ */
1475
+ workspaces?: true;
1476
+ /**
1477
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
1478
+ */
1479
+ ignoreScripts?: true;
1480
+ /**
1481
+ * When specified, it is a list of selected projects during partial install
1482
+ * It is undefined when full install
1483
+ */
1484
+ selectedProjectNames?: string[];
1485
+ [key: string]: unknown;
1486
+ }
1487
+
1366
1488
  /**
1367
1489
  * Options to pass to the rush "launch" functions.
1368
1490
  *
@@ -1381,15 +1503,22 @@ export declare interface ILaunchOptions {
1381
1503
  */
1382
1504
  alreadyReportedNodeTooNewError?: boolean;
1383
1505
  /**
1384
- * Used to specify Rush plugins that are dependencies of the "\@microsoft/rush" package.
1506
+ * Pass along the terminal provider from the CLI version selector.
1385
1507
  *
1386
- * @internal
1508
+ * @privateRemarks
1509
+ * We should remove this. The version selector package can be very old. It's unwise for
1510
+ * `rush-lib` to rely on a potentially ancient `ITerminalProvider` implementation.
1387
1511
  */
1388
- builtInPluginConfigurations?: _IBuiltInPluginConfiguration[];
1512
+ terminalProvider?: ITerminalProvider;
1389
1513
  /**
1390
- * Used to specify terminal how to write a message
1514
+ * Used only by `@microsoft/rush/lib/start-dev.js` during development.
1515
+ * Specifies Rush devDependencies of the `@microsoft/rush` to be manually loaded.
1516
+ *
1517
+ * @remarks
1518
+ * Marked as `@internal` because `IBuiltInPluginConfiguration` is internal.
1519
+ * @internal
1391
1520
  */
1392
- terminalProvider?: ITerminalProvider;
1521
+ builtInPluginConfigurations?: _IBuiltInPluginConfiguration[];
1393
1522
  }
1394
1523
 
1395
1524
  /**
@@ -1851,6 +1980,10 @@ export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBas
1851
1980
  * {@inheritDoc PnpmOptionsConfiguration.resolutionMode}
1852
1981
  */
1853
1982
  resolutionMode?: PnpmResolutionMode;
1983
+ /**
1984
+ * {@inheritDoc PnpmOptionsConfiguration.autoInstallPeers}
1985
+ */
1986
+ autoInstallPeers?: boolean;
1854
1987
  }
1855
1988
 
1856
1989
  declare interface IPnpmPackageExtension {
@@ -1950,6 +2083,7 @@ declare interface IRushConfigurationProjectJson {
1950
2083
  skipRushCheck?: boolean;
1951
2084
  publishFolder?: string;
1952
2085
  tags?: string[];
2086
+ splitWorkspace?: boolean;
1953
2087
  }
1954
2088
 
1955
2089
  /**
@@ -1974,6 +2108,16 @@ declare interface IRushConfigurationProjectOptions {
1974
2108
  allowedProjectTags: Set<string> | undefined;
1975
2109
  }
1976
2110
 
2111
+ /**
2112
+ * The filter parameters to search from all projects.
2113
+ */
2114
+ declare interface IRushConfigurationProjectsFilter {
2115
+ /**
2116
+ * If true, filter out projects that specify splitWorkspace as true.
2117
+ */
2118
+ splitWorkspace: boolean;
2119
+ }
2120
+
1977
2121
  /**
1978
2122
  * Part of IRushConfigurationJson.
1979
2123
  */
@@ -2264,19 +2408,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
2264
2408
  * it can invalidate the last install.
2265
2409
  * @internal
2266
2410
  */
2267
- export declare class _LastInstallFlag {
2268
- private _state;
2269
- /**
2270
- * Returns the full path to the flag file
2271
- */
2272
- readonly path: string;
2273
- /**
2274
- * Creates a new LastInstall flag
2275
- * @param folderPath - the folder that this flag is managing
2276
- * @param state - optional, the state that should be managed or compared
2277
- */
2278
- constructor(folderPath: string, state?: JsonObject);
2411
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
2279
2412
  /**
2413
+ * @override
2280
2414
  * Returns true if the file exists and the contents match the current state.
2281
2415
  */
2282
2416
  isValid(options?: _ILockfileValidityCheckOptions): boolean;
@@ -2290,14 +2424,6 @@ export declare class _LastInstallFlag {
2290
2424
  rushVerb: string;
2291
2425
  }): boolean;
2292
2426
  private _isValid;
2293
- /**
2294
- * Writes the flag file to disk with the current state
2295
- */
2296
- create(): void;
2297
- /**
2298
- * Removes the flag file
2299
- */
2300
- clear(): void;
2301
2427
  /**
2302
2428
  * Returns the name of the flag file
2303
2429
  */
@@ -2917,6 +3043,13 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
2917
3043
  * The default value is true. (For now.)
2918
3044
  */
2919
3045
  readonly useWorkspaces: boolean;
3046
+ /**
3047
+ * When true, any missing non-optional peer dependencies are automatically installed.
3048
+ *
3049
+ * @remarks
3050
+ * The default value is same as PNPM default value. (In PNPM 8.x, this value is true)
3051
+ */
3052
+ readonly autoInstallPeers: boolean | undefined;
2920
3053
  /**
2921
3054
  * The "globalOverrides" setting provides a simple mechanism for overriding version selections
2922
3055
  * for all dependencies of all projects in the monorepo workspace. The settings are copied
@@ -3164,7 +3297,7 @@ export declare class Rush {
3164
3297
  *
3165
3298
  * Even though this API isn't documented, it is still supported for legacy compatibility.
3166
3299
  */
3167
- static launch(launcherVersion: string, arg: ILaunchOptions): void;
3300
+ static launch(launcherVersion: string, options: ILaunchOptions): void;
3168
3301
  /**
3169
3302
  * This API is used by the `@microsoft/rush` front end to launch the "rushx" command-line.
3170
3303
  * Third-party tools should not use this API. Instead, they should execute the "rushx" binary
@@ -3218,6 +3351,8 @@ export declare class RushConfiguration {
3218
3351
  private _projects;
3219
3352
  private _projectsByName;
3220
3353
  private _projectsByTag;
3354
+ private _filteredProjectsCache;
3355
+ private _hasSplitWorkspaceProject;
3221
3356
  private _commonVersionsConfigurationsByVariant;
3222
3357
  /**
3223
3358
  * The name of the package manager being used to install dependencies
@@ -3272,6 +3407,12 @@ export declare class RushConfiguration {
3272
3407
  * Example: `C:\MyRepo\common\temp`
3273
3408
  */
3274
3409
  readonly commonTempFolder: string;
3410
+ /**
3411
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
3412
+ * under the common folder.
3413
+ * Example: `C:\MyRepo\common\temp-split`
3414
+ */
3415
+ readonly commonTempSplitFolder: string;
3275
3416
  /**
3276
3417
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
3277
3418
  * under the common folder.
@@ -3326,6 +3467,21 @@ export declare class RushConfiguration {
3326
3467
  * or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
3327
3468
  */
3328
3469
  readonly tempShrinkwrapPreinstallFilename: string;
3470
+ /**
3471
+ * The filename (without any path) of the shrinkwrap file for split workspace that is used by the package manager.
3472
+ * @remarks
3473
+ * This property merely reports the filename; the file itself may not actually exist.
3474
+ * Example: `pnpm-lock.yaml`
3475
+ */
3476
+ readonly splitWorkspaceShrinkwrapFilename: string;
3477
+ /**
3478
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
3479
+ * "rush install". This file may get rewritten by the package manager during installation.
3480
+ * @remarks
3481
+ * This property merely reports the filename; the file itself may not actually exist.
3482
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
3483
+ */
3484
+ readonly tempSplitWorkspaceShrinkwrapFilename: string;
3329
3485
  /**
3330
3486
  * The filename of the variant dependency data file. By default this is
3331
3487
  * called 'current-variant.json' resides in the Rush common folder.
@@ -3592,6 +3748,11 @@ export declare class RushConfiguration {
3592
3748
  * @beta
3593
3749
  */
3594
3750
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
3751
+ /**
3752
+ * Search for projects according to filter
3753
+ * @beta
3754
+ */
3755
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
3595
3756
  /**
3596
3757
  * Settings from the common-versions.json config file.
3597
3758
  * @remarks
@@ -3610,6 +3771,10 @@ export declare class RushConfiguration {
3610
3771
  * or "rush update".
3611
3772
  */
3612
3773
  get currentInstalledVariant(): string | undefined;
3774
+ /**
3775
+ * Is there any split workspace project.
3776
+ */
3777
+ get hasSplitWorkspaceProject(): boolean;
3613
3778
  /**
3614
3779
  * Gets the path to the common-versions.json config file for a specific variant.
3615
3780
  * @param variant - The name of the current variant in use by the active command.
@@ -3642,6 +3807,11 @@ export declare class RushConfiguration {
3642
3807
  * @param variant - The name of the current variant in use by the active command.
3643
3808
  */
3644
3809
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
3810
+ /**
3811
+ * Gets the committed shrinkwrap file name for split workspace.
3812
+ * @param variant - The name of the current variant in use by the active command.
3813
+ */
3814
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
3645
3815
  /**
3646
3816
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
3647
3817
  * @param variant - The name of the current variant in use by the active command.
@@ -3677,6 +3847,12 @@ export declare class RushConfiguration {
3677
3847
  */
3678
3848
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
3679
3849
  private _getVariantConfigFolderPath;
3850
+ /**
3851
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
3852
+ * The workspace project can NOT depend on a split workspace project.
3853
+ * The split workspace project CAN depend on a workspace project.
3854
+ */
3855
+ private _validateSplitWorkspaceRelationships;
3680
3856
  }
3681
3857
 
3682
3858
  /**
@@ -3792,6 +3968,11 @@ export declare class RushConfigurationProject {
3792
3968
  * @beta
3793
3969
  */
3794
3970
  readonly tags: ReadonlySet<string>;
3971
+ /**
3972
+ * Whether this project is a split workspace project.
3973
+ * @beta
3974
+ */
3975
+ readonly splitWorkspace: boolean;
3795
3976
  /** @internal */
3796
3977
  constructor(options: IRushConfigurationProjectOptions);
3797
3978
  /**
@@ -3901,6 +4082,12 @@ export declare class RushConstants {
3901
4082
  * Example: `C:\MyRepo\common\temp`
3902
4083
  */
3903
4084
  static readonly rushTempFolderName: string;
4085
+ /**
4086
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
4087
+ * temporary files will be stored.
4088
+ * Example: `C:\MyRepo\common\temp-split`
4089
+ */
4090
+ static readonly rushTempSplitFolderName: string;
3904
4091
  /**
3905
4092
  * The folder name ("projects") where temporary projects will be stored.
3906
4093
  * Example: `C:\MyRepo\common\temp\projects`
@@ -155,11 +155,16 @@ export declare const EnvironmentVariableNames: {
155
155
  * Explicitly specifies the path for the `tar` binary that is invoked by certain Rush operations.
156
156
  */
157
157
  readonly RUSH_TAR_BINARY_PATH: "RUSH_TAR_BINARY_PATH";
158
+ /**
159
+ * Internal variable used by `rushx` when recursively invoking another `rushx` process, to avoid
160
+ * nesting event hooks.
161
+ */
162
+ readonly _RUSH_RECURSIVE_RUSHX_CALL: "_RUSH_RECURSIVE_RUSHX_CALL";
158
163
  /**
159
164
  * Internal variable that explicitly specifies the path for the version of `@microsoft/rush-lib` being executed.
160
165
  * Will be set upon loading Rush.
161
166
  */
162
- readonly RUSH_LIB_PATH: "_RUSH_LIB_PATH";
167
+ readonly _RUSH_LIB_PATH: "_RUSH_LIB_PATH";
163
168
  /**
164
169
  * When Rush executes shell scripts, it sometimes changes the working directory to be a project folder or
165
170
  * the repository root folder. The original working directory (where the Rush command was invoked) is assigned
@@ -170,6 +175,16 @@ export declare const EnvironmentVariableNames: {
170
175
  * assign when they execute lifecycle scripts.
171
176
  */
172
177
  readonly RUSH_INVOKED_FOLDER: "RUSH_INVOKED_FOLDER";
178
+ /**
179
+ * When running a hook script, this environment variable communicates the original arguments
180
+ * passed to the `rush` or `rushx` command.
181
+ *
182
+ * @remarks
183
+ * Unlike `RUSH_INVOKED_FOLDER`, the `RUSH_INVOKED_ARGS` variable is only available for hook scripts.
184
+ * Other lifecycle scripts should not make assumptions about Rush's command line syntax
185
+ * if Rush did not explicitly pass along command-line parameters to their process.
186
+ */
187
+ readonly RUSH_INVOKED_ARGS: "RUSH_INVOKED_ARGS";
173
188
  };
174
189
  /**
175
190
  * Provides Rush-specific environment variable data. All Rush environment variables must start with "RUSH_". This class
@@ -19,7 +19,15 @@ export declare enum Event {
19
19
  /**
20
20
  * Post Rush build event
21
21
  */
22
- postRushBuild = 4
22
+ postRushBuild = 4,
23
+ /**
24
+ * Start of rushx execution event
25
+ */
26
+ preRushx = 5,
27
+ /**
28
+ * End of rushx execution event
29
+ */
30
+ postRushx = 6
23
31
  }
24
32
  /**
25
33
  * This class represents Rush event hooks configured for this repo.
@@ -41,6 +41,11 @@ export interface IExperimentsJson {
41
41
  * in common/config/rush/command-line.json.
42
42
  */
43
43
  phasedCommands?: boolean;
44
+ /**
45
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
46
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
47
+ */
48
+ deferredInstallationScripts?: boolean;
44
49
  /**
45
50
  * If true, perform a clean install after when running `rush install` or `rush update` if the
46
51
  * `.npmrc` file has changed since the last install.
@@ -1,6 +1,52 @@
1
- import { type JsonObject } from '@rushstack/node-core-library';
1
+ import { type IPackageJson } from '@rushstack/node-core-library';
2
+ import { BaseFlag } from './base/BaseFlag';
3
+ import type { PackageManagerName } from './packageManager/PackageManager';
2
4
  import type { RushConfiguration } from './RushConfiguration';
3
5
  export declare const LAST_INSTALL_FLAG_FILE_NAME: string;
6
+ /**
7
+ * This represents the JSON data structure for the "last-install.flag" file.
8
+ * @internal
9
+ */
10
+ export interface ILastInstallFlagJson {
11
+ /**
12
+ * Current node version
13
+ */
14
+ node: string;
15
+ /**
16
+ * Current package manager name
17
+ */
18
+ packageManager: PackageManagerName;
19
+ /**
20
+ * Current package manager version
21
+ */
22
+ packageManagerVersion: string;
23
+ /**
24
+ * Current rush json folder
25
+ */
26
+ rushJsonFolder: string;
27
+ /**
28
+ * The content of package.json, used in the flag file of autoinstaller
29
+ */
30
+ packageJson?: IPackageJson;
31
+ /**
32
+ * Same with pnpmOptions.pnpmStorePath in rush.json
33
+ */
34
+ storePath?: string;
35
+ /**
36
+ * True when "useWorkspaces" is true in rush.json
37
+ */
38
+ workspaces?: true;
39
+ /**
40
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
41
+ */
42
+ ignoreScripts?: true;
43
+ /**
44
+ * When specified, it is a list of selected projects during partial install
45
+ * It is undefined when full install
46
+ */
47
+ selectedProjectNames?: string[];
48
+ [key: string]: unknown;
49
+ }
4
50
  /**
5
51
  * @internal
6
52
  */
@@ -15,19 +61,9 @@ export interface ILockfileValidityCheckOptions {
15
61
  * it can invalidate the last install.
16
62
  * @internal
17
63
  */
18
- export declare class LastInstallFlag {
19
- private _state;
20
- /**
21
- * Returns the full path to the flag file
22
- */
23
- readonly path: string;
24
- /**
25
- * Creates a new LastInstall flag
26
- * @param folderPath - the folder that this flag is managing
27
- * @param state - optional, the state that should be managed or compared
28
- */
29
- constructor(folderPath: string, state?: JsonObject);
64
+ export declare class LastInstallFlag extends BaseFlag<ILastInstallFlagJson> {
30
65
  /**
66
+ * @override
31
67
  * Returns true if the file exists and the contents match the current state.
32
68
  */
33
69
  isValid(options?: ILockfileValidityCheckOptions): boolean;
@@ -41,14 +77,6 @@ export declare class LastInstallFlag {
41
77
  rushVerb: string;
42
78
  }): boolean;
43
79
  private _isValid;
44
- /**
45
- * Writes the flag file to disk with the current state
46
- */
47
- create(): void;
48
- /**
49
- * Removes the flag file
50
- */
51
- clear(): void;
52
80
  /**
53
81
  * Returns the name of the flag file
54
82
  */
@@ -69,5 +97,14 @@ export declare class LastInstallFlagFactory {
69
97
  * @internal
70
98
  */
71
99
  static getCommonTempFlag(rushConfiguration: RushConfiguration, extraState?: Record<string, string>): LastInstallFlag;
100
+ /**
101
+ * Gets the LastInstall flag and sets the current state. This state is used to compare
102
+ * against the last-known-good state tracked by the LastInstall flag.
103
+ * @param rushConfiguration - the configuration of the Rush repo to get the install
104
+ * state from
105
+ *
106
+ * @internal
107
+ */
108
+ static getCommonTempSplitFlag(rushConfiguration: RushConfiguration): LastInstallFlag;
72
109
  }
73
110
  //# sourceMappingURL=LastInstallFlag.d.ts.map
@@ -1,4 +1,4 @@
1
- import { LastInstallFlag } from './LastInstallFlag';
1
+ import { BaseFlag } from './base/BaseFlag';
2
2
  import type { RushConfiguration } from './RushConfiguration';
3
3
  export declare const LAST_LINK_FLAG_FILE_NAME: string;
4
4
  /**
@@ -6,11 +6,7 @@ export declare const LAST_LINK_FLAG_FILE_NAME: string;
6
6
  * indicates that linking was completed successfully.
7
7
  * @internal
8
8
  */
9
- export declare class LastLinkFlag extends LastInstallFlag {
10
- /**
11
- * @override
12
- */
13
- isValid(): boolean;
9
+ export declare class LastLinkFlag extends BaseFlag {
14
10
  /**
15
11
  * @override
16
12
  */
package/lib/api/Rush.d.ts CHANGED
@@ -19,15 +19,22 @@ export interface ILaunchOptions {
19
19
  */
20
20
  alreadyReportedNodeTooNewError?: boolean;
21
21
  /**
22
- * Used to specify Rush plugins that are dependencies of the "\@microsoft/rush" package.
22
+ * Pass along the terminal provider from the CLI version selector.
23
23
  *
24
- * @internal
24
+ * @privateRemarks
25
+ * We should remove this. The version selector package can be very old. It's unwise for
26
+ * `rush-lib` to rely on a potentially ancient `ITerminalProvider` implementation.
25
27
  */
26
- builtInPluginConfigurations?: IBuiltInPluginConfiguration[];
28
+ terminalProvider?: ITerminalProvider;
27
29
  /**
28
- * Used to specify terminal how to write a message
30
+ * Used only by `@microsoft/rush/lib/start-dev.js` during development.
31
+ * Specifies Rush devDependencies of the `@microsoft/rush` to be manually loaded.
32
+ *
33
+ * @remarks
34
+ * Marked as `@internal` because `IBuiltInPluginConfiguration` is internal.
35
+ * @internal
29
36
  */
30
- terminalProvider?: ITerminalProvider;
37
+ builtInPluginConfigurations?: IBuiltInPluginConfiguration[];
31
38
  }
32
39
  /**
33
40
  * General operations for the Rush engine.
@@ -48,7 +55,7 @@ export declare class Rush {
48
55
  *
49
56
  * Even though this API isn't documented, it is still supported for legacy compatibility.
50
57
  */
51
- static launch(launcherVersion: string, arg: ILaunchOptions): void;
58
+ static launch(launcherVersion: string, options: ILaunchOptions): void;
52
59
  /**
53
60
  * This API is used by the `@microsoft/rush` front end to launch the "rushx" command-line.
54
61
  * Third-party tools should not use this API. Instead, they should execute the "rushx" binary