@rushstack/rush-sdk 5.85.0 → 5.86.0-pr3481.10

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 +196 -21
  2. package/package.json +5 -5
@@ -136,6 +136,59 @@ export declare class ApprovedPackagesPolicy {
136
136
  get nonbrowserApprovedPackages(): ApprovedPackagesConfiguration;
137
137
  }
138
138
 
139
+ /**
140
+ * A base class for flag file.
141
+ * @internal
142
+ */
143
+ export declare class _BaseFlag<T extends object = JsonObject> {
144
+ /**
145
+ * Flag file path
146
+ */
147
+ protected _path: string;
148
+ /**
149
+ * Content of the flag
150
+ */
151
+ protected _state: T;
152
+ /**
153
+ * Whether the current state is modified
154
+ */
155
+ protected _isModified: boolean;
156
+ /**
157
+ * Creates a new flag file
158
+ * @param folderPath - the folder that this flag is managing
159
+ * @param state - optional, the state that should be managed or compared
160
+ */
161
+ constructor(folderPath: string, state?: Partial<T>);
162
+ /**
163
+ * Returns true if the file exists and the contents match the current state.
164
+ */
165
+ isValid(): boolean;
166
+ /**
167
+ * Writes the flag file to disk with the current state
168
+ */
169
+ create(): void;
170
+ /**
171
+ * Merge new data into current state by lodash "merge"
172
+ */
173
+ mergeFromObject(data: JsonObject): void;
174
+ /**
175
+ * Writes the flag file to disk with the current state if modified
176
+ */
177
+ saveIfModified(): void;
178
+ /**
179
+ * Removes the flag file
180
+ */
181
+ clear(): void;
182
+ /**
183
+ * Returns the full path to the flag file
184
+ */
185
+ get path(): string;
186
+ /**
187
+ * Returns the name of the flag file
188
+ */
189
+ protected get flagName(): string;
190
+ }
191
+
139
192
  /**
140
193
  * Use this class to load and save the "common/config/rush/build-cache.json" config file.
141
194
  * This file provides configuration options for cached project build output.
@@ -886,6 +939,11 @@ export declare interface IExperimentsJson {
886
939
  * in common/config/rush/command-line.json.
887
940
  */
888
941
  phasedCommands?: boolean;
942
+ /**
943
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
944
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
945
+ */
946
+ deferredInstallationScripts?: boolean;
889
947
  /**
890
948
  * If true, perform a clean install after when running `rush install` or `rush update` if the
891
949
  * `.npmrc` file has changed since the last install.
@@ -957,6 +1015,51 @@ declare interface IIndividualVersionJson extends IVersionPolicyJson {
957
1015
  lockedMajor?: number;
958
1016
  }
959
1017
 
1018
+ /**
1019
+ * This represents the JSON data structure for the "last-install.flag" file.
1020
+ * @internal
1021
+ */
1022
+ export declare interface _ILastInstallFlagJson {
1023
+ /**
1024
+ * Current node version
1025
+ */
1026
+ node: string;
1027
+ /**
1028
+ * Current package manager name
1029
+ */
1030
+ packageManager: PackageManagerName;
1031
+ /**
1032
+ * Current package manager version
1033
+ */
1034
+ packageManagerVersion: string;
1035
+ /**
1036
+ * Current rush json folder
1037
+ */
1038
+ rushJsonFolder: string;
1039
+ /**
1040
+ * The content of package.json, used in the flag file of autoinstaller
1041
+ */
1042
+ packageJson?: IPackageJson;
1043
+ /**
1044
+ * Same with pnpmOptions.pnpmStorePath in rush.json
1045
+ */
1046
+ storePath?: string;
1047
+ /**
1048
+ * True when "useWorkspaces" is true in rush.json
1049
+ */
1050
+ workspaces?: true;
1051
+ /**
1052
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
1053
+ */
1054
+ ignoreScripts?: true;
1055
+ /**
1056
+ * When specified, it is a list of selected projects during partial install
1057
+ * It is undefined when full install
1058
+ */
1059
+ selectedProjectNames?: string[];
1060
+ [key: string]: unknown;
1061
+ }
1062
+
960
1063
  /**
961
1064
  * Options to pass to the rush "launch" functions.
962
1065
  *
@@ -1317,6 +1420,10 @@ export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBas
1317
1420
  * {@inheritDoc PnpmOptionsConfiguration.globalAllowedDeprecatedVersions}
1318
1421
  */
1319
1422
  globalAllowedDeprecatedVersions?: Record<string, string>;
1423
+ /**
1424
+ * {@inheritDoc PnpmOptionsConfiguration.globalPatchedDependencies}
1425
+ */
1426
+ globalPatchedDependencies?: Record<string, string>;
1320
1427
  /**
1321
1428
  * {@inheritDoc PnpmOptionsConfiguration.unsupportedPackageJsonSettings}
1322
1429
  */
@@ -1405,6 +1512,7 @@ declare interface IRushConfigurationProjectJson {
1405
1512
  skipRushCheck?: boolean;
1406
1513
  publishFolder?: string;
1407
1514
  tags?: string[];
1515
+ splitWorkspace?: boolean;
1408
1516
  }
1409
1517
 
1410
1518
  /**
@@ -1429,6 +1537,16 @@ declare interface IRushConfigurationProjectOptions {
1429
1537
  allowedProjectTags: Set<string> | undefined;
1430
1538
  }
1431
1539
 
1540
+ /**
1541
+ * The filter parameters to search from all projects.
1542
+ */
1543
+ declare interface IRushConfigurationProjectsFilter {
1544
+ /**
1545
+ * If true, filter out projects that specify splitWorkspace as true.
1546
+ */
1547
+ splitWorkspace: boolean;
1548
+ }
1549
+
1432
1550
  /**
1433
1551
  * Part of IRushConfigurationJson.
1434
1552
  */
@@ -1692,16 +1810,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1692
1810
  * it can invalidate the last install.
1693
1811
  * @internal
1694
1812
  */
1695
- export declare class _LastInstallFlag {
1696
- private _path;
1697
- private _state;
1698
- /**
1699
- * Creates a new LastInstall flag
1700
- * @param folderPath - the folder that this flag is managing
1701
- * @param state - optional, the state that should be managed or compared
1702
- */
1703
- constructor(folderPath: string, state?: JsonObject);
1813
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1704
1814
  /**
1815
+ * @override
1705
1816
  * Returns true if the file exists and the contents match the current state.
1706
1817
  */
1707
1818
  isValid(options?: _ILockfileValidityCheckOptions): boolean;
@@ -1715,18 +1826,6 @@ export declare class _LastInstallFlag {
1715
1826
  rushVerb: string;
1716
1827
  }): boolean;
1717
1828
  private _isValid;
1718
- /**
1719
- * Writes the flag file to disk with the current state
1720
- */
1721
- create(): void;
1722
- /**
1723
- * Removes the flag file
1724
- */
1725
- clear(): void;
1726
- /**
1727
- * Returns the full path to the flag file
1728
- */
1729
- get path(): string;
1730
1829
  /**
1731
1830
  * Returns the name of the flag file
1732
1831
  */
@@ -2174,6 +2273,9 @@ export declare class PhasedCommandHooks {
2174
2273
  */
2175
2274
  export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfigurationBase {
2176
2275
  private static _jsonSchema;
2276
+ private _json;
2277
+ private _jsonFilename;
2278
+ private _globalPatchedDependencies;
2177
2279
  /**
2178
2280
  * The method used to resolve the store used by PNPM.
2179
2281
  *
@@ -2304,11 +2406,26 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
2304
2406
  * strategy that is known to provide a good experience for large teams with lots of projects.
2305
2407
  */
2306
2408
  readonly unsupportedPackageJsonSettings: unknown | undefined;
2409
+ /**
2410
+ * (GENERATED BY RUSH-PNPM PATCH-COMMIT) When modifying this property, make sure you know what you are doing.
2411
+ *
2412
+ * The `globalPatchedDependencies` is added/updated automatically when you run pnpm patch-commit
2413
+ * command. It is a dictionary where the key should be the package name and exact version. The value
2414
+ * should be a relative path to a patch file.
2415
+ *
2416
+ * PNPM documentation: https://pnpm.io/package_json#pnpmpatcheddependencies
2417
+ */
2418
+ get globalPatchedDependencies(): Record<string, string> | undefined;
2307
2419
  private constructor();
2308
2420
  /** @internal */
2309
2421
  static loadFromJsonFileOrThrow(jsonFilename: string, commonTempFolder: string): PnpmOptionsConfiguration;
2310
2422
  /** @internal */
2311
2423
  static loadFromJsonObject(json: _IPnpmOptionsJson, commonTempFolder: string): PnpmOptionsConfiguration;
2424
+ /**
2425
+ * Updates patchedDependencies field of the PNPM options in the common/config/rush/pnpm-config.json file.
2426
+ */
2427
+ updateGlobalPatchedDependencies(patchedDependencies: Record<string, string> | undefined): void;
2428
+ get jsonFilename(): string | undefined;
2312
2429
  }
2313
2430
 
2314
2431
  /**
@@ -2490,6 +2607,7 @@ export declare class RushConfiguration {
2490
2607
  private _changesFolder;
2491
2608
  private _commonFolder;
2492
2609
  private _commonTempFolder;
2610
+ private _commonTempSplitFolder;
2493
2611
  private _commonScriptsFolder;
2494
2612
  private _commonRushConfigFolder;
2495
2613
  private _packageManager;
@@ -2498,8 +2616,10 @@ export declare class RushConfiguration {
2498
2616
  private _npmTmpFolder;
2499
2617
  private _yarnCacheFolder;
2500
2618
  private _shrinkwrapFilename;
2619
+ private _splitWorkspaceShrinkwrapFilename;
2501
2620
  private _tempShrinkwrapFilename;
2502
2621
  private _tempShrinkwrapPreinstallFilename;
2622
+ private _tempSplitWorkspaceShrinkwrapFilename;
2503
2623
  private _currentVariantJsonFilename;
2504
2624
  private _packageManagerToolVersion;
2505
2625
  private _packageManagerToolFilename;
@@ -2531,6 +2651,8 @@ export declare class RushConfiguration {
2531
2651
  private _projects;
2532
2652
  private _projectsByName;
2533
2653
  private _projectsByTag;
2654
+ private _filteredProjectsCache;
2655
+ private _hasSplitWorkspaceProject;
2534
2656
  private _commonVersionsConfigurationsByVariant;
2535
2657
  private _versionPolicyConfiguration;
2536
2658
  private _versionPolicyConfigurationFilePath;
@@ -2623,6 +2745,12 @@ export declare class RushConfiguration {
2623
2745
  * Example: `C:\MyRepo\common\temp`
2624
2746
  */
2625
2747
  get commonTempFolder(): string;
2748
+ /**
2749
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
2750
+ * under the common folder.
2751
+ * Example: `C:\MyRepo\common\temp-split`
2752
+ */
2753
+ get commonTempSplitFolder(): string;
2626
2754
  /**
2627
2755
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2628
2756
  * under the common folder.
@@ -2680,6 +2808,7 @@ export declare class RushConfiguration {
2680
2808
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
2681
2809
  */
2682
2810
  get shrinkwrapFilename(): string;
2811
+ get splitWorkspaceShrinkwrapFilename(): string;
2683
2812
  /**
2684
2813
  * The full path of the temporary shrinkwrap file that is used during "rush install".
2685
2814
  * This file may get rewritten by the package manager during installation.
@@ -2688,6 +2817,14 @@ export declare class RushConfiguration {
2688
2817
  * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
2689
2818
  */
2690
2819
  get tempShrinkwrapFilename(): string;
2820
+ /**
2821
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
2822
+ * "rush install". This file may get rewritten by the package manager during installation.
2823
+ * @remarks
2824
+ * This property merely reports the filename; the file itself may not actually exist.
2825
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
2826
+ */
2827
+ get tempSplitWorkspaceShrinkwrapFilename(): string;
2691
2828
  /**
2692
2829
  * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
2693
2830
  * before installation begins, and can be compared to determine how the package manager
@@ -2852,6 +2989,11 @@ export declare class RushConfiguration {
2852
2989
  * @beta
2853
2990
  */
2854
2991
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2992
+ /**
2993
+ * Search for projects according to filter
2994
+ * @beta
2995
+ */
2996
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2855
2997
  /**
2856
2998
  * {@inheritDoc NpmOptionsConfiguration}
2857
2999
  */
@@ -2898,6 +3040,10 @@ export declare class RushConfiguration {
2898
3040
  * The rush hooks. It allows customized scripts to run at the specified point.
2899
3041
  */
2900
3042
  get packageNameParser(): PackageNameParser;
3043
+ /**
3044
+ * Is there any split workspace project.
3045
+ */
3046
+ get hasSplitWorkspaceProject(): boolean;
2901
3047
  /**
2902
3048
  * Gets the path to the common-versions.json config file for a specific variant.
2903
3049
  * @param variant - The name of the current variant in use by the active command.
@@ -2930,6 +3076,11 @@ export declare class RushConfiguration {
2930
3076
  * @param variant - The name of the current variant in use by the active command.
2931
3077
  */
2932
3078
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
3079
+ /**
3080
+ * Gets the committed shrinkwrap file name for split workspace.
3081
+ * @param variant - The name of the current variant in use by the active command.
3082
+ */
3083
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
2933
3084
  /**
2934
3085
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2935
3086
  * @param variant - The name of the current variant in use by the active command.
@@ -2984,6 +3135,12 @@ export declare class RushConfiguration {
2984
3135
  */
2985
3136
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2986
3137
  private _getVariantConfigFolderPath;
3138
+ /**
3139
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
3140
+ * The workspace project can NOT depend on a split workspace project.
3141
+ * The split workspace project CAN depend on a workspace project.
3142
+ */
3143
+ private _validateSplitWorkspaceRelationships;
2987
3144
  }
2988
3145
 
2989
3146
  /**
@@ -3009,6 +3166,7 @@ export declare class RushConfigurationProject {
3009
3166
  private readonly _publishFolder;
3010
3167
  private readonly _rushConfiguration;
3011
3168
  private readonly _tags;
3169
+ private readonly _splitWorkspace;
3012
3170
  private _versionPolicy;
3013
3171
  private _dependencyProjects;
3014
3172
  private _consumingProjects;
@@ -3176,6 +3334,11 @@ export declare class RushConfigurationProject {
3176
3334
  * @beta
3177
3335
  */
3178
3336
  get tags(): ReadonlySet<string>;
3337
+ /**
3338
+ * Whether this project is a split workspace project.
3339
+ * @beta
3340
+ */
3341
+ get splitWorkspace(): boolean;
3179
3342
  }
3180
3343
 
3181
3344
  /**
@@ -3223,6 +3386,12 @@ export declare class RushConstants {
3223
3386
  * Example: `C:\MyRepo\common\temp`
3224
3387
  */
3225
3388
  static readonly rushTempFolderName: string;
3389
+ /**
3390
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
3391
+ * temporary files will be stored.
3392
+ * Example: `C:\MyRepo\common\temp-split`
3393
+ */
3394
+ static readonly rushTempSplitFolderName: string;
3226
3395
  /**
3227
3396
  * The folder name ("projects") where temporary projects will be stored.
3228
3397
  * Example: `C:\MyRepo\common\temp\projects`
@@ -3255,6 +3424,12 @@ export declare class RushConstants {
3255
3424
  * The filename (".pnpmfile.cjs") used to add custom configuration to PNPM (PNPM version 6.x and later).
3256
3425
  */
3257
3426
  static readonly pnpmfileV6Filename: string;
3427
+ /**
3428
+ * The folder name used to store patch files for pnpm
3429
+ * Example: `C:\MyRepo\common\config\pnpm-patches`
3430
+ * Example: `C:\MyRepo\common\temp\patches`
3431
+ */
3432
+ static readonly pnpmPatchesFolderName: string;
3258
3433
  /**
3259
3434
  * The filename ("shrinkwrap.yaml") used to store state for pnpm
3260
3435
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.85.0",
3
+ "version": "5.86.0-pr3481.10",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,13 +17,13 @@
17
17
  "tapable": "2.2.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@microsoft/rush-lib": "5.85.0",
20
+ "@microsoft/rush-lib": "5.86.0-pr3481.10",
21
21
  "@rushstack/eslint-config": "3.1.1",
22
22
  "@rushstack/heft": "0.48.8",
23
- "@rushstack/heft-node-rig": "1.11.8",
24
- "@rushstack/stream-collator": "4.0.215",
23
+ "@rushstack/heft-node-rig": "1.11.9",
24
+ "@rushstack/stream-collator": "4.0.216",
25
25
  "@rushstack/ts-command-line": "4.13.1",
26
- "@rushstack/terminal": "0.3.84",
26
+ "@rushstack/terminal": "0.3.85",
27
27
  "@types/heft-jest": "1.0.1",
28
28
  "@types/semver": "7.3.5",
29
29
  "@types/webpack-env": "1.13.0"