@rushstack/rush-sdk 5.89.0 → 5.90.0-pr3481.15

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 (2) hide show
  1. package/dist/rush-lib.d.ts +187 -26
  2. package/package.json +11 -11
@@ -131,6 +131,55 @@ export declare class ApprovedPackagesPolicy {
131
131
  constructor(rushConfiguration: RushConfiguration, rushConfigurationJson: IRushConfigurationJson);
132
132
  }
133
133
 
134
+ /**
135
+ * A base class for flag file.
136
+ * @internal
137
+ */
138
+ export declare class _BaseFlag<T extends object = JsonObject> {
139
+ /**
140
+ * Flag file path
141
+ */
142
+ readonly path: string;
143
+ /**
144
+ * Content of the flag
145
+ */
146
+ protected _state: T;
147
+ /**
148
+ * Whether the current state is modified
149
+ */
150
+ protected _isModified: boolean;
151
+ /**
152
+ * Creates a new flag file
153
+ * @param folderPath - the folder that this flag is managing
154
+ * @param state - optional, the state that should be managed or compared
155
+ */
156
+ constructor(folderPath: string, state?: Partial<T>);
157
+ /**
158
+ * Returns true if the file exists and the contents match the current state.
159
+ */
160
+ isValid(): boolean;
161
+ /**
162
+ * Writes the flag file to disk with the current state
163
+ */
164
+ create(): void;
165
+ /**
166
+ * Merge new data into current state by lodash "merge"
167
+ */
168
+ mergeFromObject(data: JsonObject): void;
169
+ /**
170
+ * Writes the flag file to disk with the current state if modified
171
+ */
172
+ saveIfModified(): void;
173
+ /**
174
+ * Removes the flag file
175
+ */
176
+ clear(): void;
177
+ /**
178
+ * Returns Name of the flag file
179
+ */
180
+ protected get flagName(): string;
181
+ }
182
+
134
183
  /**
135
184
  * Use this class to load and save the "common/config/rush/build-cache.json" config file.
136
185
  * This file provides configuration options for cached project build output.
@@ -878,6 +927,11 @@ export declare interface IExperimentsJson {
878
927
  * in common/config/rush/command-line.json.
879
928
  */
880
929
  phasedCommands?: boolean;
930
+ /**
931
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
932
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
933
+ */
934
+ deferredInstallationScripts?: boolean;
881
935
  /**
882
936
  * If true, perform a clean install after when running `rush install` or `rush update` if the
883
937
  * `.npmrc` file has changed since the last install.
@@ -949,6 +1003,51 @@ declare interface IIndividualVersionJson extends IVersionPolicyJson {
949
1003
  lockedMajor?: number;
950
1004
  }
951
1005
 
1006
+ /**
1007
+ * This represents the JSON data structure for the "last-install.flag" file.
1008
+ * @internal
1009
+ */
1010
+ export declare interface _ILastInstallFlagJson {
1011
+ /**
1012
+ * Current node version
1013
+ */
1014
+ node: string;
1015
+ /**
1016
+ * Current package manager name
1017
+ */
1018
+ packageManager: PackageManagerName;
1019
+ /**
1020
+ * Current package manager version
1021
+ */
1022
+ packageManagerVersion: string;
1023
+ /**
1024
+ * Current rush json folder
1025
+ */
1026
+ rushJsonFolder: string;
1027
+ /**
1028
+ * The content of package.json, used in the flag file of autoinstaller
1029
+ */
1030
+ packageJson?: IPackageJson;
1031
+ /**
1032
+ * Same with pnpmOptions.pnpmStorePath in rush.json
1033
+ */
1034
+ storePath?: string;
1035
+ /**
1036
+ * True when "useWorkspaces" is true in rush.json
1037
+ */
1038
+ workspaces?: true;
1039
+ /**
1040
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
1041
+ */
1042
+ ignoreScripts?: true;
1043
+ /**
1044
+ * When specified, it is a list of selected projects during partial install
1045
+ * It is undefined when full install
1046
+ */
1047
+ selectedProjectNames?: string[];
1048
+ [key: string]: unknown;
1049
+ }
1050
+
952
1051
  /**
953
1052
  * Options to pass to the rush "launch" functions.
954
1053
  *
@@ -1224,14 +1323,14 @@ export declare interface IPhase {
1224
1323
  */
1225
1324
  name: string;
1226
1325
  /**
1227
- * If set to "true," this this phase was generated from a bulk command, and
1326
+ * If set to `true,` this this phase was generated from a bulk command, and
1228
1327
  * was not explicitly defined in the command-line.json file.
1229
1328
  */
1230
1329
  isSynthetic: boolean;
1231
1330
  /**
1232
1331
  * This property is used in the name of the filename for the logs generated by this
1233
1332
  * phase. This is a filesystem-safe version of the phase name. For example,
1234
- * a phase with name "_phase:compile" has a `logFilenameIdentifier` of "_phase_compile".
1333
+ * a phase with name `_phase:compile` has a `logFilenameIdentifier` of `_phase_compile`.
1235
1334
  */
1236
1335
  logFilenameIdentifier: string;
1237
1336
  /**
@@ -1246,13 +1345,24 @@ export declare interface IPhase {
1246
1345
  upstream: Set<IPhase>;
1247
1346
  };
1248
1347
  /**
1249
- * Normally Rush requires that each project's package.json has a \"scripts\" entry matching the phase name. To disable this check, set \"ignoreMissingScript\" to true.
1348
+ * Normally Rush requires that each project's package.json has a `"scripts"` entry matching the phase name.
1349
+ * To disable this check, set `ignoreMissingScript` to true.
1250
1350
  */
1251
1351
  ignoreMissingScript: boolean;
1252
1352
  /**
1253
- * By default, Rush returns a nonzero exit code if errors or warnings occur during a command. If this option is set to \"true\", Rush will return a zero exit code if warnings occur during the execution of this phase.
1353
+ * By default, Rush returns a nonzero exit code if errors or warnings occur during a command. If this option is
1354
+ * set to `true`, Rush will return a zero exit code if warnings occur during the execution of this phase.
1254
1355
  */
1255
1356
  allowWarningsOnSuccess: boolean;
1357
+ /**
1358
+ * (Optional) If the `shellCommand` field is set for a bulk command, Rush will invoke it for each
1359
+ * selected project; otherwise, Rush will invoke the package.json `"scripts"` entry matching Rush command/phase name.
1360
+ *
1361
+ * This string is the path to a script that will be invoked using the OS shell. The working directory will be
1362
+ * the folder that contains rush.json. If custom parameters are associated with this command, their
1363
+ * values will be appended to the end of this string.
1364
+ */
1365
+ shellCommand?: string;
1256
1366
  }
1257
1367
 
1258
1368
  /**
@@ -1405,6 +1515,7 @@ declare interface IRushConfigurationProjectJson {
1405
1515
  skipRushCheck?: boolean;
1406
1516
  publishFolder?: string;
1407
1517
  tags?: string[];
1518
+ splitWorkspace?: boolean;
1408
1519
  }
1409
1520
 
1410
1521
  /**
@@ -1429,6 +1540,16 @@ declare interface IRushConfigurationProjectOptions {
1429
1540
  allowedProjectTags: Set<string> | undefined;
1430
1541
  }
1431
1542
 
1543
+ /**
1544
+ * The filter parameters to search from all projects.
1545
+ */
1546
+ declare interface IRushConfigurationProjectsFilter {
1547
+ /**
1548
+ * If true, filter out projects that specify splitWorkspace as true.
1549
+ */
1550
+ splitWorkspace: boolean;
1551
+ }
1552
+
1432
1553
  /**
1433
1554
  * Part of IRushConfigurationJson.
1434
1555
  */
@@ -1692,19 +1813,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1692
1813
  * it can invalidate the last install.
1693
1814
  * @internal
1694
1815
  */
1695
- export declare class _LastInstallFlag {
1696
- private _state;
1697
- /**
1698
- * Returns the full path to the flag file
1699
- */
1700
- readonly path: string;
1701
- /**
1702
- * Creates a new LastInstall flag
1703
- * @param folderPath - the folder that this flag is managing
1704
- * @param state - optional, the state that should be managed or compared
1705
- */
1706
- constructor(folderPath: string, state?: JsonObject);
1816
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1707
1817
  /**
1818
+ * @override
1708
1819
  * Returns true if the file exists and the contents match the current state.
1709
1820
  */
1710
1821
  isValid(options?: _ILockfileValidityCheckOptions): boolean;
@@ -1718,14 +1829,6 @@ export declare class _LastInstallFlag {
1718
1829
  rushVerb: string;
1719
1830
  }): boolean;
1720
1831
  private _isValid;
1721
- /**
1722
- * Writes the flag file to disk with the current state
1723
- */
1724
- create(): void;
1725
- /**
1726
- * Removes the flag file
1727
- */
1728
- clear(): void;
1729
1832
  /**
1730
1833
  * Returns the name of the flag file
1731
1834
  */
@@ -2041,7 +2144,10 @@ export declare class PackageJsonEditor {
2041
2144
  private _modified;
2042
2145
  private _sourceData;
2043
2146
  readonly filePath: string;
2044
- private constructor();
2147
+ /**
2148
+ * @internal
2149
+ */
2150
+ protected constructor(filepath: string, data: IPackageJson);
2045
2151
  static load(filePath: string): PackageJsonEditor;
2046
2152
  static fromObject(object: IPackageJson, filename: string): PackageJsonEditor;
2047
2153
  get name(): string;
@@ -2501,6 +2607,8 @@ export declare class RushConfiguration {
2501
2607
  private _projects;
2502
2608
  private _projectsByName;
2503
2609
  private _projectsByTag;
2610
+ private _filteredProjectsCache;
2611
+ private _hasSplitWorkspaceProject;
2504
2612
  private _commonVersionsConfigurationsByVariant;
2505
2613
  /**
2506
2614
  * The name of the package manager being used to install dependencies
@@ -2555,6 +2663,12 @@ export declare class RushConfiguration {
2555
2663
  * Example: `C:\MyRepo\common\temp`
2556
2664
  */
2557
2665
  readonly commonTempFolder: string;
2666
+ /**
2667
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
2668
+ * under the common folder.
2669
+ * Example: `C:\MyRepo\common\temp-split`
2670
+ */
2671
+ readonly commonTempSplitFolder: string;
2558
2672
  /**
2559
2673
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2560
2674
  * under the common folder.
@@ -2609,6 +2723,21 @@ export declare class RushConfiguration {
2609
2723
  * or `C:\MyRepo\common\temp\pnpm-lock-preinstall.yaml`
2610
2724
  */
2611
2725
  readonly tempShrinkwrapPreinstallFilename: string;
2726
+ /**
2727
+ * The filename (without any path) of the shrinkwrap file for split workspace that is used by the package manager.
2728
+ * @remarks
2729
+ * This property merely reports the filename; the file itself may not actually exist.
2730
+ * Example: `pnpm-lock.yaml`
2731
+ */
2732
+ readonly splitWorkspaceShrinkwrapFilename: string;
2733
+ /**
2734
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
2735
+ * "rush install". This file may get rewritten by the package manager during installation.
2736
+ * @remarks
2737
+ * This property merely reports the filename; the file itself may not actually exist.
2738
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
2739
+ */
2740
+ readonly tempSplitWorkspaceShrinkwrapFilename: string;
2612
2741
  /**
2613
2742
  * The filename of the variant dependency data file. By default this is
2614
2743
  * called 'current-variant.json' resides in the Rush common folder.
@@ -2864,6 +2993,11 @@ export declare class RushConfiguration {
2864
2993
  * @beta
2865
2994
  */
2866
2995
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2996
+ /**
2997
+ * Search for projects according to filter
2998
+ * @beta
2999
+ */
3000
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2867
3001
  /**
2868
3002
  * Settings from the common-versions.json config file.
2869
3003
  * @remarks
@@ -2882,6 +3016,10 @@ export declare class RushConfiguration {
2882
3016
  * or "rush update".
2883
3017
  */
2884
3018
  get currentInstalledVariant(): string | undefined;
3019
+ /**
3020
+ * Is there any split workspace project.
3021
+ */
3022
+ get hasSplitWorkspaceProject(): boolean;
2885
3023
  /**
2886
3024
  * Gets the path to the common-versions.json config file for a specific variant.
2887
3025
  * @param variant - The name of the current variant in use by the active command.
@@ -2914,6 +3052,11 @@ export declare class RushConfiguration {
2914
3052
  * @param variant - The name of the current variant in use by the active command.
2915
3053
  */
2916
3054
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
3055
+ /**
3056
+ * Gets the committed shrinkwrap file name for split workspace.
3057
+ * @param variant - The name of the current variant in use by the active command.
3058
+ */
3059
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
2917
3060
  /**
2918
3061
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2919
3062
  * @param variant - The name of the current variant in use by the active command.
@@ -2949,6 +3092,12 @@ export declare class RushConfiguration {
2949
3092
  */
2950
3093
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2951
3094
  private _getVariantConfigFolderPath;
3095
+ /**
3096
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
3097
+ * The workspace project can NOT depend on a split workspace project.
3098
+ * The split workspace project CAN depend on a workspace project.
3099
+ */
3100
+ private _validateSplitWorkspaceRelationships;
2952
3101
  }
2953
3102
 
2954
3103
  /**
@@ -2961,6 +3110,7 @@ export declare class RushConfigurationProject {
2961
3110
  private _versionPolicy;
2962
3111
  private _dependencyProjects;
2963
3112
  private _consumingProjects;
3113
+ private _packageJson;
2964
3114
  /**
2965
3115
  * The name of the NPM package. An error is reported if this name is not
2966
3116
  * identical to packageJson.name.
@@ -3012,7 +3162,7 @@ export declare class RushConfigurationProject {
3012
3162
  /**
3013
3163
  * The parsed NPM "package.json" file from projectFolder.
3014
3164
  */
3015
- readonly packageJson: IPackageJson;
3165
+ get packageJson(): IPackageJson;
3016
3166
  /**
3017
3167
  * A useful wrapper around the package.json file for making modifications
3018
3168
  * @beta
@@ -3063,6 +3213,11 @@ export declare class RushConfigurationProject {
3063
3213
  * @beta
3064
3214
  */
3065
3215
  readonly tags: ReadonlySet<string>;
3216
+ /**
3217
+ * Whether this project is a split workspace project.
3218
+ * @beta
3219
+ */
3220
+ readonly splitWorkspace: boolean;
3066
3221
  /** @internal */
3067
3222
  constructor(options: IRushConfigurationProjectOptions);
3068
3223
  /**
@@ -3172,6 +3327,12 @@ export declare class RushConstants {
3172
3327
  * Example: `C:\MyRepo\common\temp`
3173
3328
  */
3174
3329
  static readonly rushTempFolderName: string;
3330
+ /**
3331
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
3332
+ * temporary files will be stored.
3333
+ * Example: `C:\MyRepo\common\temp-split`
3334
+ */
3335
+ static readonly rushTempSplitFolderName: string;
3175
3336
  /**
3176
3337
  * The folder name ("projects") where temporary projects will be stored.
3177
3338
  * Example: `C:\MyRepo\common\temp\projects`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.89.0",
3
+ "version": "5.90.0-pr3481.15",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,21 +12,21 @@
12
12
  "typings": "dist/rush-lib.d.ts",
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@rushstack/node-core-library": "3.53.3",
16
15
  "@types/node-fetch": "1.6.9",
17
- "tapable": "2.2.1"
16
+ "tapable": "2.2.1",
17
+ "@rushstack/node-core-library": "3.53.3"
18
18
  },
19
19
  "devDependencies": {
20
- "@microsoft/rush-lib": "5.89.0",
21
- "@rushstack/eslint-config": "3.1.1",
22
- "@rushstack/heft": "0.49.1",
23
- "@rushstack/heft-node-rig": "1.11.12",
24
- "@rushstack/stream-collator": "4.0.220",
25
- "@rushstack/ts-command-line": "4.13.1",
26
- "@rushstack/terminal": "0.3.89",
20
+ "@microsoft/rush-lib": "5.90.0-pr3481.15",
27
21
  "@types/heft-jest": "1.0.1",
28
22
  "@types/semver": "7.3.5",
29
- "@types/webpack-env": "1.13.0"
23
+ "@types/webpack-env": "1.13.0",
24
+ "@rushstack/eslint-config": "3.1.1",
25
+ "@rushstack/heft-node-rig": "1.12.0",
26
+ "@rushstack/stream-collator": "4.0.223",
27
+ "@rushstack/heft": "0.49.3",
28
+ "@rushstack/ts-command-line": "4.13.1",
29
+ "@rushstack/terminal": "0.3.92"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "heft build --clean",