@rushstack/rush-sdk 5.74.0 → 5.75.0-pr3481.3

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 +189 -23
  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
  *
@@ -1240,6 +1342,11 @@ export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBas
1240
1342
  useWorkspaces?: boolean;
1241
1343
  }
1242
1344
 
1345
+ declare interface IRawRepoState {
1346
+ projectState: Map<RushConfigurationProject, Map<string, string>> | undefined;
1347
+ rootDir: string;
1348
+ }
1349
+
1243
1350
  /**
1244
1351
  * Information about the currently executing command provided to plugins.
1245
1352
  * @beta
@@ -1288,12 +1395,14 @@ declare interface IRushConfigurationProjectJson {
1288
1395
  packageName: string;
1289
1396
  projectFolder: string;
1290
1397
  reviewCategory?: string;
1291
- cyclicDependencyProjects: string[];
1398
+ decoupledLocalDependencies: string[];
1399
+ cyclicDependencyProjects?: string[];
1292
1400
  versionPolicyName?: string;
1293
1401
  shouldPublish?: boolean;
1294
1402
  skipRushCheck?: boolean;
1295
1403
  publishFolder?: string;
1296
1404
  tags?: string[];
1405
+ splitWorkspace?: boolean;
1297
1406
  }
1298
1407
 
1299
1408
  /**
@@ -1318,6 +1427,16 @@ declare interface IRushConfigurationProjectOptions {
1318
1427
  allowedProjectTags: Set<string> | undefined;
1319
1428
  }
1320
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
+
1321
1440
  /**
1322
1441
  * Part of IRushConfigurationJson.
1323
1442
  */
@@ -1515,16 +1634,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1515
1634
  * it can invalidate the last install.
1516
1635
  * @internal
1517
1636
  */
1518
- export declare class _LastInstallFlag {
1519
- private _path;
1520
- private _state;
1521
- /**
1522
- * Creates a new LastInstall flag
1523
- * @param folderPath - the folder that this flag is managing
1524
- * @param state - optional, the state that should be managed or compared
1525
- */
1526
- constructor(folderPath: string, state?: JsonObject);
1637
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1527
1638
  /**
1639
+ * @override
1528
1640
  * Returns true if the file exists and the contents match the current state.
1529
1641
  */
1530
1642
  isValid(): boolean;
@@ -1536,18 +1648,6 @@ export declare class _LastInstallFlag {
1536
1648
  */
1537
1649
  checkValidAndReportStoreIssues(): boolean;
1538
1650
  private _isValid;
1539
- /**
1540
- * Writes the flag file to disk with the current state
1541
- */
1542
- create(): void;
1543
- /**
1544
- * Removes the flag file
1545
- */
1546
- clear(): void;
1547
- /**
1548
- * Returns the full path to the flag file
1549
- */
1550
- get path(): string;
1551
1651
  /**
1552
1652
  * Returns the name of the flag file
1553
1653
  */
@@ -2050,6 +2150,10 @@ export declare class ProjectChangeAnalyzer {
2050
2150
  * @internal
2051
2151
  */
2052
2152
  _tryGetProjectDependenciesAsync(project: RushConfigurationProject, terminal: ITerminal): Promise<Map<string, string> | undefined>;
2153
+ /**
2154
+ * @internal
2155
+ */
2156
+ _ensureInitialized(terminal: ITerminal): IRawRepoState | undefined;
2053
2157
  /**
2054
2158
  * The project state hash is calculated in the following way:
2055
2159
  * - Project dependencies are collected (see ProjectChangeAnalyzer.getPackageDeps)
@@ -2196,6 +2300,7 @@ export declare class RushConfiguration {
2196
2300
  private _changesFolder;
2197
2301
  private _commonFolder;
2198
2302
  private _commonTempFolder;
2303
+ private _commonTempSplitFolder;
2199
2304
  private _commonScriptsFolder;
2200
2305
  private _commonRushConfigFolder;
2201
2306
  private _packageManager;
@@ -2204,8 +2309,10 @@ export declare class RushConfiguration {
2204
2309
  private _npmTmpFolder;
2205
2310
  private _yarnCacheFolder;
2206
2311
  private _shrinkwrapFilename;
2312
+ private _splitWorkspaceShrinkwrapFilename;
2207
2313
  private _tempShrinkwrapFilename;
2208
2314
  private _tempShrinkwrapPreinstallFilename;
2315
+ private _tempSplitWorkspaceShrinkwrapFilename;
2209
2316
  private _currentVariantJsonFilename;
2210
2317
  private _packageManagerToolVersion;
2211
2318
  private _packageManagerToolFilename;
@@ -2236,6 +2343,8 @@ export declare class RushConfiguration {
2236
2343
  private _projects;
2237
2344
  private _projectsByName;
2238
2345
  private _projectsByTag;
2346
+ private _filteredProjectsCache;
2347
+ private _hasSplitWorkspaceProject;
2239
2348
  private _commonVersionsConfigurationsByVariant;
2240
2349
  private _versionPolicyConfiguration;
2241
2350
  private _versionPolicyConfigurationFilePath;
@@ -2328,6 +2437,12 @@ export declare class RushConfiguration {
2328
2437
  * Example: `C:\MyRepo\common\temp`
2329
2438
  */
2330
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;
2331
2446
  /**
2332
2447
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2333
2448
  * under the common folder.
@@ -2385,6 +2500,7 @@ export declare class RushConfiguration {
2385
2500
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
2386
2501
  */
2387
2502
  get shrinkwrapFilename(): string;
2503
+ get splitWorkspaceShrinkwrapFilename(): string;
2388
2504
  /**
2389
2505
  * The full path of the temporary shrinkwrap file that is used during "rush install".
2390
2506
  * This file may get rewritten by the package manager during installation.
@@ -2393,6 +2509,14 @@ export declare class RushConfiguration {
2393
2509
  * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
2394
2510
  */
2395
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;
2396
2520
  /**
2397
2521
  * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
2398
2522
  * before installation begins, and can be compared to determine how the package manager
@@ -2552,6 +2676,11 @@ export declare class RushConfiguration {
2552
2676
  * @beta
2553
2677
  */
2554
2678
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2679
+ /**
2680
+ * Search for projects according to filter
2681
+ * @beta
2682
+ */
2683
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2555
2684
  /**
2556
2685
  * {@inheritDoc NpmOptionsConfiguration}
2557
2686
  */
@@ -2598,6 +2727,10 @@ export declare class RushConfiguration {
2598
2727
  * The rush hooks. It allows customized scripts to run at the specified point.
2599
2728
  */
2600
2729
  get packageNameParser(): PackageNameParser;
2730
+ /**
2731
+ * Is there any split workspace project.
2732
+ */
2733
+ get hasSplitWorkspaceProject(): boolean;
2601
2734
  /**
2602
2735
  * Gets the path to the common-versions.json config file for a specific variant.
2603
2736
  * @param variant - The name of the current variant in use by the active command.
@@ -2630,6 +2763,11 @@ export declare class RushConfiguration {
2630
2763
  * @param variant - The name of the current variant in use by the active command.
2631
2764
  */
2632
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;
2633
2771
  /**
2634
2772
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2635
2773
  * @param variant - The name of the current variant in use by the active command.
@@ -2684,6 +2822,12 @@ export declare class RushConfiguration {
2684
2822
  */
2685
2823
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2686
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;
2687
2831
  }
2688
2832
 
2689
2833
  /**
@@ -2702,13 +2846,14 @@ export declare class RushConfigurationProject {
2702
2846
  private readonly _packageJsonEditor;
2703
2847
  private readonly _tempProjectName;
2704
2848
  private readonly _unscopedTempProjectName;
2705
- private readonly _cyclicDependencyProjects;
2849
+ private readonly _decoupledLocalDependencies;
2706
2850
  private readonly _versionPolicyName;
2707
2851
  private readonly _shouldPublish;
2708
2852
  private readonly _skipRushCheck;
2709
2853
  private readonly _publishFolder;
2710
2854
  private readonly _rushConfiguration;
2711
2855
  private readonly _tags;
2856
+ private readonly _splitWorkspace;
2712
2857
  private _versionPolicy;
2713
2858
  private _dependencyProjects;
2714
2859
  private _consumingProjects;
@@ -2761,6 +2906,16 @@ export declare class RushConfigurationProject {
2761
2906
  *
2762
2907
  * These are package names that would be found by RushConfiguration.getProjectByName().
2763
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
+ */
2764
2919
  get cyclicDependencyProjects(): Set<string>;
2765
2920
  /**
2766
2921
  * An array of projects within the Rush configuration which directly depend on this package.
@@ -2860,6 +3015,11 @@ export declare class RushConfigurationProject {
2860
3015
  * @beta
2861
3016
  */
2862
3017
  get tags(): ReadonlySet<string>;
3018
+ /**
3019
+ * Whether this project is a split workspace project.
3020
+ * @beta
3021
+ */
3022
+ get splitWorkspace(): boolean;
2863
3023
  }
2864
3024
 
2865
3025
  /**
@@ -2907,6 +3067,12 @@ export declare class RushConstants {
2907
3067
  * Example: `C:\MyRepo\common\temp`
2908
3068
  */
2909
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;
2910
3076
  /**
2911
3077
  * The folder name ("projects") where temporary projects will be stored.
2912
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.74.0",
3
+ "version": "5.75.0-pr3481.3",
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.74.0",
21
- "@rushstack/eslint-config": "2.6.0",
22
- "@rushstack/heft": "0.45.6",
23
- "@rushstack/heft-node-rig": "1.9.7",
24
- "@rushstack/stream-collator": "4.0.176",
25
- "@rushstack/ts-command-line": "4.11.0",
26
- "@rushstack/terminal": "0.3.45",
20
+ "@microsoft/rush-lib": "5.75.0-pr3481.3",
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"