@rushstack/rush-sdk 5.82.0 → 5.82.1-pr3481.7

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 +167 -21
  2. package/package.json +2 -2
@@ -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.
@@ -887,6 +940,11 @@ export declare interface IExperimentsJson {
887
940
  * in common/config/rush/command-line.json.
888
941
  */
889
942
  phasedCommands?: boolean;
943
+ /**
944
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
945
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
946
+ */
947
+ deferredInstallationScripts?: boolean;
890
948
  }
891
949
 
892
950
  /**
@@ -953,6 +1011,50 @@ declare interface IIndividualVersionJson extends IVersionPolicyJson {
953
1011
  lockedMajor?: number;
954
1012
  }
955
1013
 
1014
+ /**
1015
+ * This represents the JSON data structure for the "last-install.flag" file.
1016
+ * @internal
1017
+ */
1018
+ export declare interface _ILastInstallFlagJson {
1019
+ /**
1020
+ * Current node version
1021
+ */
1022
+ node: string;
1023
+ /**
1024
+ * Current package manager name
1025
+ */
1026
+ packageManager: PackageManagerName;
1027
+ /**
1028
+ * Current package manager version
1029
+ */
1030
+ packageManagerVersion: string;
1031
+ /**
1032
+ * Current rush json folder
1033
+ */
1034
+ rushJsonFolder: string;
1035
+ /**
1036
+ * The content of package.json, used in the flag file of autoinstaller
1037
+ */
1038
+ packageJson?: IPackageJson;
1039
+ /**
1040
+ * Same with pnpmOptions.pnpmStorePath in rush.json
1041
+ */
1042
+ storePath?: string;
1043
+ /**
1044
+ * True when "useWorkspaces" is true in rush.json
1045
+ */
1046
+ workspaces?: true;
1047
+ /**
1048
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
1049
+ */
1050
+ ignoreScripts?: true;
1051
+ /**
1052
+ * When specified, it is a list of selected projects during partial install
1053
+ * It is undefined when full install
1054
+ */
1055
+ selectedProjectNames?: string[];
1056
+ }
1057
+
956
1058
  /**
957
1059
  * Options to pass to the rush "launch" functions.
958
1060
  *
@@ -1393,6 +1495,7 @@ declare interface IRushConfigurationProjectJson {
1393
1495
  skipRushCheck?: boolean;
1394
1496
  publishFolder?: string;
1395
1497
  tags?: string[];
1498
+ splitWorkspace?: boolean;
1396
1499
  }
1397
1500
 
1398
1501
  /**
@@ -1417,6 +1520,16 @@ declare interface IRushConfigurationProjectOptions {
1417
1520
  allowedProjectTags: Set<string> | undefined;
1418
1521
  }
1419
1522
 
1523
+ /**
1524
+ * The filter parameters to search from all projects.
1525
+ */
1526
+ declare interface IRushConfigurationProjectsFilter {
1527
+ /**
1528
+ * If true, filter out projects that specify splitWorkspace as true.
1529
+ */
1530
+ splitWorkspace: boolean;
1531
+ }
1532
+
1420
1533
  /**
1421
1534
  * Part of IRushConfigurationJson.
1422
1535
  */
@@ -1680,16 +1793,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1680
1793
  * it can invalidate the last install.
1681
1794
  * @internal
1682
1795
  */
1683
- export declare class _LastInstallFlag {
1684
- private _path;
1685
- private _state;
1686
- /**
1687
- * Creates a new LastInstall flag
1688
- * @param folderPath - the folder that this flag is managing
1689
- * @param state - optional, the state that should be managed or compared
1690
- */
1691
- constructor(folderPath: string, state?: JsonObject);
1796
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1692
1797
  /**
1798
+ * @override
1693
1799
  * Returns true if the file exists and the contents match the current state.
1694
1800
  */
1695
1801
  isValid(): boolean;
@@ -1701,18 +1807,6 @@ export declare class _LastInstallFlag {
1701
1807
  */
1702
1808
  checkValidAndReportStoreIssues(rushVerb: string): boolean;
1703
1809
  private _isValid;
1704
- /**
1705
- * Writes the flag file to disk with the current state
1706
- */
1707
- create(): void;
1708
- /**
1709
- * Removes the flag file
1710
- */
1711
- clear(): void;
1712
- /**
1713
- * Returns the full path to the flag file
1714
- */
1715
- get path(): string;
1716
1810
  /**
1717
1811
  * Returns the name of the flag file
1718
1812
  */
@@ -2476,6 +2570,7 @@ export declare class RushConfiguration {
2476
2570
  private _changesFolder;
2477
2571
  private _commonFolder;
2478
2572
  private _commonTempFolder;
2573
+ private _commonTempSplitFolder;
2479
2574
  private _commonScriptsFolder;
2480
2575
  private _commonRushConfigFolder;
2481
2576
  private _packageManager;
@@ -2484,8 +2579,10 @@ export declare class RushConfiguration {
2484
2579
  private _npmTmpFolder;
2485
2580
  private _yarnCacheFolder;
2486
2581
  private _shrinkwrapFilename;
2582
+ private _splitWorkspaceShrinkwrapFilename;
2487
2583
  private _tempShrinkwrapFilename;
2488
2584
  private _tempShrinkwrapPreinstallFilename;
2585
+ private _tempSplitWorkspaceShrinkwrapFilename;
2489
2586
  private _currentVariantJsonFilename;
2490
2587
  private _packageManagerToolVersion;
2491
2588
  private _packageManagerToolFilename;
@@ -2517,6 +2614,8 @@ export declare class RushConfiguration {
2517
2614
  private _projects;
2518
2615
  private _projectsByName;
2519
2616
  private _projectsByTag;
2617
+ private _filteredProjectsCache;
2618
+ private _hasSplitWorkspaceProject;
2520
2619
  private _commonVersionsConfigurationsByVariant;
2521
2620
  private _versionPolicyConfiguration;
2522
2621
  private _versionPolicyConfigurationFilePath;
@@ -2609,6 +2708,12 @@ export declare class RushConfiguration {
2609
2708
  * Example: `C:\MyRepo\common\temp`
2610
2709
  */
2611
2710
  get commonTempFolder(): string;
2711
+ /**
2712
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
2713
+ * under the common folder.
2714
+ * Example: `C:\MyRepo\common\temp-split`
2715
+ */
2716
+ get commonTempSplitFolder(): string;
2612
2717
  /**
2613
2718
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2614
2719
  * under the common folder.
@@ -2666,6 +2771,7 @@ export declare class RushConfiguration {
2666
2771
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
2667
2772
  */
2668
2773
  get shrinkwrapFilename(): string;
2774
+ get splitWorkspaceShrinkwrapFilename(): string;
2669
2775
  /**
2670
2776
  * The full path of the temporary shrinkwrap file that is used during "rush install".
2671
2777
  * This file may get rewritten by the package manager during installation.
@@ -2674,6 +2780,14 @@ export declare class RushConfiguration {
2674
2780
  * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
2675
2781
  */
2676
2782
  get tempShrinkwrapFilename(): string;
2783
+ /**
2784
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
2785
+ * "rush install". This file may get rewritten by the package manager during installation.
2786
+ * @remarks
2787
+ * This property merely reports the filename; the file itself may not actually exist.
2788
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
2789
+ */
2790
+ get tempSplitWorkspaceShrinkwrapFilename(): string;
2677
2791
  /**
2678
2792
  * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
2679
2793
  * before installation begins, and can be compared to determine how the package manager
@@ -2838,6 +2952,11 @@ export declare class RushConfiguration {
2838
2952
  * @beta
2839
2953
  */
2840
2954
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2955
+ /**
2956
+ * Search for projects according to filter
2957
+ * @beta
2958
+ */
2959
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2841
2960
  /**
2842
2961
  * {@inheritDoc NpmOptionsConfiguration}
2843
2962
  */
@@ -2884,6 +3003,10 @@ export declare class RushConfiguration {
2884
3003
  * The rush hooks. It allows customized scripts to run at the specified point.
2885
3004
  */
2886
3005
  get packageNameParser(): PackageNameParser;
3006
+ /**
3007
+ * Is there any split workspace project.
3008
+ */
3009
+ get hasSplitWorkspaceProject(): boolean;
2887
3010
  /**
2888
3011
  * Gets the path to the common-versions.json config file for a specific variant.
2889
3012
  * @param variant - The name of the current variant in use by the active command.
@@ -2916,6 +3039,11 @@ export declare class RushConfiguration {
2916
3039
  * @param variant - The name of the current variant in use by the active command.
2917
3040
  */
2918
3041
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
3042
+ /**
3043
+ * Gets the committed shrinkwrap file name for split workspace.
3044
+ * @param variant - The name of the current variant in use by the active command.
3045
+ */
3046
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
2919
3047
  /**
2920
3048
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2921
3049
  * @param variant - The name of the current variant in use by the active command.
@@ -2970,6 +3098,12 @@ export declare class RushConfiguration {
2970
3098
  */
2971
3099
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2972
3100
  private _getVariantConfigFolderPath;
3101
+ /**
3102
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
3103
+ * The workspace project can NOT depend on a split workspace project.
3104
+ * The split workspace project CAN depend on a workspace project.
3105
+ */
3106
+ private _validateSplitWorkspaceRelationships;
2973
3107
  }
2974
3108
 
2975
3109
  /**
@@ -2995,6 +3129,7 @@ export declare class RushConfigurationProject {
2995
3129
  private readonly _publishFolder;
2996
3130
  private readonly _rushConfiguration;
2997
3131
  private readonly _tags;
3132
+ private readonly _splitWorkspace;
2998
3133
  private _versionPolicy;
2999
3134
  private _dependencyProjects;
3000
3135
  private _consumingProjects;
@@ -3162,6 +3297,11 @@ export declare class RushConfigurationProject {
3162
3297
  * @beta
3163
3298
  */
3164
3299
  get tags(): ReadonlySet<string>;
3300
+ /**
3301
+ * Whether this project is a split workspace project.
3302
+ * @beta
3303
+ */
3304
+ get splitWorkspace(): boolean;
3165
3305
  }
3166
3306
 
3167
3307
  /**
@@ -3209,6 +3349,12 @@ export declare class RushConstants {
3209
3349
  * Example: `C:\MyRepo\common\temp`
3210
3350
  */
3211
3351
  static readonly rushTempFolderName: string;
3352
+ /**
3353
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
3354
+ * temporary files will be stored.
3355
+ * Example: `C:\MyRepo\common\temp-split`
3356
+ */
3357
+ static readonly rushTempSplitFolderName: string;
3212
3358
  /**
3213
3359
  * The folder name ("projects") where temporary projects will be stored.
3214
3360
  * 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.82.0",
3
+ "version": "5.82.1-pr3481.7",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "tapable": "2.2.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@microsoft/rush-lib": "5.82.0",
20
+ "@microsoft/rush-lib": "5.82.1-pr3481.7",
21
21
  "@rushstack/eslint-config": "3.1.1",
22
22
  "@rushstack/heft": "0.48.6",
23
23
  "@rushstack/heft-node-rig": "1.11.6",