@rushstack/rush-sdk 5.71.0 → 5.75.0-pr3481.2

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 +199 -27
  2. package/package.json +9 -9
@@ -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.
@@ -869,6 +922,11 @@ export declare interface IExperimentsJson {
869
922
  * in common/config/rush/command-line.json.
870
923
  */
871
924
  phasedCommands?: boolean;
925
+ /**
926
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
927
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
928
+ */
929
+ deferredInstallationScripts?: boolean;
872
930
  }
873
931
 
874
932
  /**
@@ -935,6 +993,50 @@ declare interface IIndividualVersionJson extends IVersionPolicyJson {
935
993
  lockedMajor?: number;
936
994
  }
937
995
 
996
+ /**
997
+ * This represents the JSON data structure for the "last-install.flag" file.
998
+ * @internal
999
+ */
1000
+ export declare interface _ILastInstallFlagJson {
1001
+ /**
1002
+ * Current node version
1003
+ */
1004
+ node: string;
1005
+ /**
1006
+ * Current package manager name
1007
+ */
1008
+ packageManager: PackageManagerName;
1009
+ /**
1010
+ * Current package manager version
1011
+ */
1012
+ packageManagerVersion: string;
1013
+ /**
1014
+ * Current rush json folder
1015
+ */
1016
+ rushJsonFolder: string;
1017
+ /**
1018
+ * The content of package.json, used in the flag file of autoinstaller
1019
+ */
1020
+ packageJson?: IPackageJson;
1021
+ /**
1022
+ * Same with pnpmOptions.pnpmStorePath in rush.json
1023
+ */
1024
+ storePath?: string;
1025
+ /**
1026
+ * True when "useWorkspaces" is true in rush.json
1027
+ */
1028
+ workspaces?: true;
1029
+ /**
1030
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
1031
+ */
1032
+ ignoreScripts?: true;
1033
+ /**
1034
+ * When specified, it is a list of selected projects during partial install
1035
+ * It is undefined when full install
1036
+ */
1037
+ selectedProjectNames?: string[];
1038
+ }
1039
+
938
1040
  /**
939
1041
  * Options to pass to the rush "launch" functions.
940
1042
  *
@@ -958,6 +1060,10 @@ export declare interface ILaunchOptions {
958
1060
  * @internal
959
1061
  */
960
1062
  builtInPluginConfigurations?: _IBuiltInPluginConfiguration[];
1063
+ /**
1064
+ * Used to specify terminal how to write a message
1065
+ */
1066
+ terminalProvider?: ITerminalProvider;
961
1067
  }
962
1068
 
963
1069
  /**
@@ -1236,6 +1342,11 @@ export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBas
1236
1342
  useWorkspaces?: boolean;
1237
1343
  }
1238
1344
 
1345
+ declare interface IRawRepoState {
1346
+ projectState: Map<RushConfigurationProject, Map<string, string>> | undefined;
1347
+ rootDir: string;
1348
+ }
1349
+
1239
1350
  /**
1240
1351
  * Information about the currently executing command provided to plugins.
1241
1352
  * @beta
@@ -1284,12 +1395,14 @@ declare interface IRushConfigurationProjectJson {
1284
1395
  packageName: string;
1285
1396
  projectFolder: string;
1286
1397
  reviewCategory?: string;
1287
- cyclicDependencyProjects: string[];
1398
+ decoupledLocalDependencies: string[];
1399
+ cyclicDependencyProjects?: string[];
1288
1400
  versionPolicyName?: string;
1289
1401
  shouldPublish?: boolean;
1290
1402
  skipRushCheck?: boolean;
1291
1403
  publishFolder?: string;
1292
1404
  tags?: string[];
1405
+ splitWorkspace?: boolean;
1293
1406
  }
1294
1407
 
1295
1408
  /**
@@ -1314,6 +1427,16 @@ declare interface IRushConfigurationProjectOptions {
1314
1427
  allowedProjectTags: Set<string> | undefined;
1315
1428
  }
1316
1429
 
1430
+ /**
1431
+ * The filter parameters to search from all projects.
1432
+ */
1433
+ declare interface IRushConfigurationProjectsFilter {
1434
+ /**
1435
+ * If true, filter out projects that specify splitWorkspace as true.
1436
+ */
1437
+ splitWorkspace: boolean;
1438
+ }
1439
+
1317
1440
  /**
1318
1441
  * Part of IRushConfigurationJson.
1319
1442
  */
@@ -1511,16 +1634,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1511
1634
  * it can invalidate the last install.
1512
1635
  * @internal
1513
1636
  */
1514
- export declare class _LastInstallFlag {
1515
- private _path;
1516
- private _state;
1517
- /**
1518
- * Creates a new LastInstall flag
1519
- * @param folderPath - the folder that this flag is managing
1520
- * @param state - optional, the state that should be managed or compared
1521
- */
1522
- constructor(folderPath: string, state?: JsonObject);
1637
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1523
1638
  /**
1639
+ * @override
1524
1640
  * Returns true if the file exists and the contents match the current state.
1525
1641
  */
1526
1642
  isValid(): boolean;
@@ -1532,18 +1648,6 @@ export declare class _LastInstallFlag {
1532
1648
  */
1533
1649
  checkValidAndReportStoreIssues(): boolean;
1534
1650
  private _isValid;
1535
- /**
1536
- * Writes the flag file to disk with the current state
1537
- */
1538
- create(): void;
1539
- /**
1540
- * Removes the flag file
1541
- */
1542
- clear(): void;
1543
- /**
1544
- * Returns the full path to the flag file
1545
- */
1546
- get path(): string;
1547
1651
  /**
1548
1652
  * Returns the name of the flag file
1549
1653
  */
@@ -2046,6 +2150,10 @@ export declare class ProjectChangeAnalyzer {
2046
2150
  * @internal
2047
2151
  */
2048
2152
  _tryGetProjectDependenciesAsync(project: RushConfigurationProject, terminal: ITerminal): Promise<Map<string, string> | undefined>;
2153
+ /**
2154
+ * @internal
2155
+ */
2156
+ _ensureInitialized(terminal: ITerminal): IRawRepoState | undefined;
2049
2157
  /**
2050
2158
  * The project state hash is calculated in the following way:
2051
2159
  * - Project dependencies are collected (see ProjectChangeAnalyzer.getPackageDeps)
@@ -2138,8 +2246,6 @@ export declare class Rush {
2138
2246
  * Third-party tools should not use this API. Instead, they should execute the "rush" binary
2139
2247
  * and start a new Node.js process.
2140
2248
  *
2141
- * @param launcherVersion - The version of the `@microsoft/rush` wrapper used to call invoke the CLI.
2142
- *
2143
2249
  * @remarks
2144
2250
  * Earlier versions of the rush frontend used a different API contract. In the old contract,
2145
2251
  * the second argument was the `isManaged` value of the {@link ILaunchOptions} object.
@@ -2151,10 +2257,14 @@ export declare class Rush {
2151
2257
  * This API is used by the `@microsoft/rush` front end to launch the "rushx" command-line.
2152
2258
  * Third-party tools should not use this API. Instead, they should execute the "rushx" binary
2153
2259
  * and start a new Node.js process.
2154
- *
2155
- * @param launcherVersion - The version of the `@microsoft/rush` wrapper used to call invoke the CLI.
2156
2260
  */
2157
2261
  static launchRushX(launcherVersion: string, options: ILaunchOptions): void;
2262
+ /**
2263
+ * This API is used by the `@microsoft/rush` front end to launch the "rush-pnpm" command-line.
2264
+ * Third-party tools should not use this API. Instead, they should execute the "rush-pnpm" binary
2265
+ * and start a new Node.js process.
2266
+ */
2267
+ static launchRushPnpm(launcherVersion: string, options: ILaunchOptions): void;
2158
2268
  /**
2159
2269
  * The currently executing version of the "rush-lib" library.
2160
2270
  * This is the same as the Rush tool version for that release.
@@ -2190,6 +2300,7 @@ export declare class RushConfiguration {
2190
2300
  private _changesFolder;
2191
2301
  private _commonFolder;
2192
2302
  private _commonTempFolder;
2303
+ private _commonTempSplitFolder;
2193
2304
  private _commonScriptsFolder;
2194
2305
  private _commonRushConfigFolder;
2195
2306
  private _packageManager;
@@ -2198,8 +2309,10 @@ export declare class RushConfiguration {
2198
2309
  private _npmTmpFolder;
2199
2310
  private _yarnCacheFolder;
2200
2311
  private _shrinkwrapFilename;
2312
+ private _splitWorkspaceShrinkwrapFilename;
2201
2313
  private _tempShrinkwrapFilename;
2202
2314
  private _tempShrinkwrapPreinstallFilename;
2315
+ private _tempSplitWorkspaceShrinkwrapFilename;
2203
2316
  private _currentVariantJsonFilename;
2204
2317
  private _packageManagerToolVersion;
2205
2318
  private _packageManagerToolFilename;
@@ -2230,6 +2343,8 @@ export declare class RushConfiguration {
2230
2343
  private _projects;
2231
2344
  private _projectsByName;
2232
2345
  private _projectsByTag;
2346
+ private _filteredProjectsCache;
2347
+ private _hasSplitWorkspaceProject;
2233
2348
  private _commonVersionsConfigurationsByVariant;
2234
2349
  private _versionPolicyConfiguration;
2235
2350
  private _versionPolicyConfigurationFilePath;
@@ -2322,6 +2437,12 @@ export declare class RushConfiguration {
2322
2437
  * Example: `C:\MyRepo\common\temp`
2323
2438
  */
2324
2439
  get commonTempFolder(): string;
2440
+ /**
2441
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
2442
+ * under the common folder.
2443
+ * Example: `C:\MyRepo\common\temp-split`
2444
+ */
2445
+ get commonTempSplitFolder(): string;
2325
2446
  /**
2326
2447
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2327
2448
  * under the common folder.
@@ -2379,6 +2500,7 @@ export declare class RushConfiguration {
2379
2500
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
2380
2501
  */
2381
2502
  get shrinkwrapFilename(): string;
2503
+ get splitWorkspaceShrinkwrapFilename(): string;
2382
2504
  /**
2383
2505
  * The full path of the temporary shrinkwrap file that is used during "rush install".
2384
2506
  * This file may get rewritten by the package manager during installation.
@@ -2387,6 +2509,14 @@ export declare class RushConfiguration {
2387
2509
  * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
2388
2510
  */
2389
2511
  get tempShrinkwrapFilename(): string;
2512
+ /**
2513
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
2514
+ * "rush install". This file may get rewritten by the package manager during installation.
2515
+ * @remarks
2516
+ * This property merely reports the filename; the file itself may not actually exist.
2517
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
2518
+ */
2519
+ get tempSplitWorkspaceShrinkwrapFilename(): string;
2390
2520
  /**
2391
2521
  * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
2392
2522
  * before installation begins, and can be compared to determine how the package manager
@@ -2546,6 +2676,11 @@ export declare class RushConfiguration {
2546
2676
  * @beta
2547
2677
  */
2548
2678
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2679
+ /**
2680
+ * Search for projects according to filter
2681
+ * @beta
2682
+ */
2683
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2549
2684
  /**
2550
2685
  * {@inheritDoc NpmOptionsConfiguration}
2551
2686
  */
@@ -2592,6 +2727,10 @@ export declare class RushConfiguration {
2592
2727
  * The rush hooks. It allows customized scripts to run at the specified point.
2593
2728
  */
2594
2729
  get packageNameParser(): PackageNameParser;
2730
+ /**
2731
+ * Is there any split workspace project.
2732
+ */
2733
+ get hasSplitWorkspaceProject(): boolean;
2595
2734
  /**
2596
2735
  * Gets the path to the common-versions.json config file for a specific variant.
2597
2736
  * @param variant - The name of the current variant in use by the active command.
@@ -2624,6 +2763,11 @@ export declare class RushConfiguration {
2624
2763
  * @param variant - The name of the current variant in use by the active command.
2625
2764
  */
2626
2765
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
2766
+ /**
2767
+ * Gets the committed shrinkwrap file name for split workspace.
2768
+ * @param variant - The name of the current variant in use by the active command.
2769
+ */
2770
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
2627
2771
  /**
2628
2772
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2629
2773
  * @param variant - The name of the current variant in use by the active command.
@@ -2678,6 +2822,12 @@ export declare class RushConfiguration {
2678
2822
  */
2679
2823
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2680
2824
  private _getVariantConfigFolderPath;
2825
+ /**
2826
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
2827
+ * The workspace project can NOT depend on a split workspace project.
2828
+ * The split workspace project CAN depend on a workspace project.
2829
+ */
2830
+ private _validateSplitWorkspaceRelationships;
2681
2831
  }
2682
2832
 
2683
2833
  /**
@@ -2696,13 +2846,14 @@ export declare class RushConfigurationProject {
2696
2846
  private readonly _packageJsonEditor;
2697
2847
  private readonly _tempProjectName;
2698
2848
  private readonly _unscopedTempProjectName;
2699
- private readonly _cyclicDependencyProjects;
2849
+ private readonly _decoupledLocalDependencies;
2700
2850
  private readonly _versionPolicyName;
2701
2851
  private readonly _shouldPublish;
2702
2852
  private readonly _skipRushCheck;
2703
2853
  private readonly _publishFolder;
2704
2854
  private readonly _rushConfiguration;
2705
2855
  private readonly _tags;
2856
+ private readonly _splitWorkspace;
2706
2857
  private _versionPolicy;
2707
2858
  private _dependencyProjects;
2708
2859
  private _consumingProjects;
@@ -2755,6 +2906,16 @@ export declare class RushConfigurationProject {
2755
2906
  *
2756
2907
  * These are package names that would be found by RushConfiguration.getProjectByName().
2757
2908
  */
2909
+ get decoupledLocalDependencies(): Set<string>;
2910
+ /**
2911
+ * A list of local projects that appear as devDependencies for this project, but cannot be
2912
+ * locally linked because it would create a cyclic dependency; instead, the last published
2913
+ * version will be installed in the Common folder.
2914
+ *
2915
+ * These are package names that would be found by RushConfiguration.getProjectByName().
2916
+ *
2917
+ * @deprecated Use `decoupledLocalDependencies` instead, as it better describes the purpose of the data.
2918
+ */
2758
2919
  get cyclicDependencyProjects(): Set<string>;
2759
2920
  /**
2760
2921
  * An array of projects within the Rush configuration which directly depend on this package.
@@ -2854,6 +3015,11 @@ export declare class RushConfigurationProject {
2854
3015
  * @beta
2855
3016
  */
2856
3017
  get tags(): ReadonlySet<string>;
3018
+ /**
3019
+ * Whether this project is a split workspace project.
3020
+ * @beta
3021
+ */
3022
+ get splitWorkspace(): boolean;
2857
3023
  }
2858
3024
 
2859
3025
  /**
@@ -2901,6 +3067,12 @@ export declare class RushConstants {
2901
3067
  * Example: `C:\MyRepo\common\temp`
2902
3068
  */
2903
3069
  static readonly rushTempFolderName: string;
3070
+ /**
3071
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
3072
+ * temporary files will be stored.
3073
+ * Example: `C:\MyRepo\common\temp-split`
3074
+ */
3075
+ static readonly rushTempSplitFolderName: string;
2904
3076
  /**
2905
3077
  * The folder name ("projects") where temporary projects will be stored.
2906
3078
  * 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.71.0",
3
+ "version": "5.75.0-pr3481.2",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,18 +12,18 @@
12
12
  "typings": "dist/rush-lib.d.ts",
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@rushstack/node-core-library": "3.45.5",
15
+ "@rushstack/node-core-library": "3.49.0",
16
16
  "@types/node-fetch": "1.6.9",
17
17
  "tapable": "2.2.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@microsoft/rush-lib": "5.71.0",
21
- "@rushstack/eslint-config": "2.6.0",
22
- "@rushstack/heft": "0.45.5",
23
- "@rushstack/heft-node-rig": "1.9.6",
24
- "@rushstack/stream-collator": "4.0.175",
25
- "@rushstack/ts-command-line": "4.11.0",
26
- "@rushstack/terminal": "0.3.44",
20
+ "@microsoft/rush-lib": "5.75.0-pr3481.2",
21
+ "@rushstack/eslint-config": "2.6.2",
22
+ "@rushstack/heft": "0.46.4",
23
+ "@rushstack/heft-node-rig": "1.9.20",
24
+ "@rushstack/stream-collator": "4.0.189",
25
+ "@rushstack/ts-command-line": "4.12.1",
26
+ "@rushstack/terminal": "0.3.58",
27
27
  "@types/heft-jest": "1.0.1",
28
28
  "@types/semver": "7.3.5",
29
29
  "@types/webpack-env": "1.13.0"