@rushstack/rush-sdk 5.77.3 → 5.78.0-pr3481.6

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 +183 -21
  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.
@@ -341,6 +394,7 @@ export declare class EnvironmentConfiguration {
341
394
  private static _allowUnsupportedNodeVersion;
342
395
  private static _allowWarningsInSuccessfulBuild;
343
396
  private static _pnpmStorePathOverride;
397
+ private static _pnpmVerifyStoreIntegrity;
344
398
  private static _rushGlobalFolderOverride;
345
399
  private static _buildCacheCredential;
346
400
  private static _buildCacheEnabled;
@@ -375,6 +429,11 @@ export declare class EnvironmentConfiguration {
375
429
  * See {@link EnvironmentVariableNames.RUSH_PNPM_STORE_PATH}
376
430
  */
377
431
  static get pnpmStorePathOverride(): string | undefined;
432
+ /**
433
+ * If specified, enables or disables integrity verification of the pnpm store during install.
434
+ * See {@link EnvironmentVariableNames.RUSH_PNPM_VERIFY_STORE_INTEGRITY}
435
+ */
436
+ static get pnpmVerifyStoreIntegrity(): boolean | undefined;
378
437
  /**
379
438
  * Overrides the location of the `~/.rush` global folder where Rush stores temporary files.
380
439
  * See {@link EnvironmentVariableNames.RUSH_GLOBAL_FOLDER}
@@ -494,6 +553,12 @@ export declare enum EnvironmentVariableNames {
494
553
  * current working directory. An absolute path is recommended.
495
554
  */
496
555
  RUSH_PNPM_STORE_PATH = "RUSH_PNPM_STORE_PATH",
556
+ /**
557
+ * When using PNPM as the package manager, this variable can be used to control whether or not PNPM
558
+ * validates the integrity of the PNPM store during installation. The value of this environment variable must be
559
+ * `1` (for true) or `0` (for false). If not specified, defaults to the value in .npmrc.
560
+ */
561
+ RUSH_PNPM_VERIFY_STORE_INTEGRITY = "RUSH_PNPM_VERIFY_STORE_INTEGRITY",
497
562
  /**
498
563
  * This environment variable can be used to specify the `--target-folder` parameter
499
564
  * for the "rush deploy" command.
@@ -875,6 +940,11 @@ export declare interface IExperimentsJson {
875
940
  * in common/config/rush/command-line.json.
876
941
  */
877
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;
878
948
  }
879
949
 
880
950
  /**
@@ -941,6 +1011,50 @@ declare interface IIndividualVersionJson extends IVersionPolicyJson {
941
1011
  lockedMajor?: number;
942
1012
  }
943
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
+
944
1058
  /**
945
1059
  * Options to pass to the rush "launch" functions.
946
1060
  *
@@ -1306,6 +1420,7 @@ declare interface IRushConfigurationProjectJson {
1306
1420
  skipRushCheck?: boolean;
1307
1421
  publishFolder?: string;
1308
1422
  tags?: string[];
1423
+ splitWorkspace?: boolean;
1309
1424
  }
1310
1425
 
1311
1426
  /**
@@ -1330,6 +1445,16 @@ declare interface IRushConfigurationProjectOptions {
1330
1445
  allowedProjectTags: Set<string> | undefined;
1331
1446
  }
1332
1447
 
1448
+ /**
1449
+ * The filter parameters to search from all projects.
1450
+ */
1451
+ declare interface IRushConfigurationProjectsFilter {
1452
+ /**
1453
+ * If true, filter out projects that specify splitWorkspace as true.
1454
+ */
1455
+ splitWorkspace: boolean;
1456
+ }
1457
+
1333
1458
  /**
1334
1459
  * Part of IRushConfigurationJson.
1335
1460
  */
@@ -1588,16 +1713,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1588
1713
  * it can invalidate the last install.
1589
1714
  * @internal
1590
1715
  */
1591
- export declare class _LastInstallFlag {
1592
- private _path;
1593
- private _state;
1594
- /**
1595
- * Creates a new LastInstall flag
1596
- * @param folderPath - the folder that this flag is managing
1597
- * @param state - optional, the state that should be managed or compared
1598
- */
1599
- constructor(folderPath: string, state?: JsonObject);
1716
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1600
1717
  /**
1718
+ * @override
1601
1719
  * Returns true if the file exists and the contents match the current state.
1602
1720
  */
1603
1721
  isValid(): boolean;
@@ -1609,18 +1727,6 @@ export declare class _LastInstallFlag {
1609
1727
  */
1610
1728
  checkValidAndReportStoreIssues(): boolean;
1611
1729
  private _isValid;
1612
- /**
1613
- * Writes the flag file to disk with the current state
1614
- */
1615
- create(): void;
1616
- /**
1617
- * Removes the flag file
1618
- */
1619
- clear(): void;
1620
- /**
1621
- * Returns the full path to the flag file
1622
- */
1623
- get path(): string;
1624
1730
  /**
1625
1731
  * Returns the name of the flag file
1626
1732
  */
@@ -2273,6 +2379,7 @@ export declare class RushConfiguration {
2273
2379
  private _changesFolder;
2274
2380
  private _commonFolder;
2275
2381
  private _commonTempFolder;
2382
+ private _commonTempSplitFolder;
2276
2383
  private _commonScriptsFolder;
2277
2384
  private _commonRushConfigFolder;
2278
2385
  private _packageManager;
@@ -2281,8 +2388,10 @@ export declare class RushConfiguration {
2281
2388
  private _npmTmpFolder;
2282
2389
  private _yarnCacheFolder;
2283
2390
  private _shrinkwrapFilename;
2391
+ private _splitWorkspaceShrinkwrapFilename;
2284
2392
  private _tempShrinkwrapFilename;
2285
2393
  private _tempShrinkwrapPreinstallFilename;
2394
+ private _tempSplitWorkspaceShrinkwrapFilename;
2286
2395
  private _currentVariantJsonFilename;
2287
2396
  private _packageManagerToolVersion;
2288
2397
  private _packageManagerToolFilename;
@@ -2313,6 +2422,8 @@ export declare class RushConfiguration {
2313
2422
  private _projects;
2314
2423
  private _projectsByName;
2315
2424
  private _projectsByTag;
2425
+ private _filteredProjectsCache;
2426
+ private _hasSplitWorkspaceProject;
2316
2427
  private _commonVersionsConfigurationsByVariant;
2317
2428
  private _versionPolicyConfiguration;
2318
2429
  private _versionPolicyConfigurationFilePath;
@@ -2405,6 +2516,12 @@ export declare class RushConfiguration {
2405
2516
  * Example: `C:\MyRepo\common\temp`
2406
2517
  */
2407
2518
  get commonTempFolder(): string;
2519
+ /**
2520
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
2521
+ * under the common folder.
2522
+ * Example: `C:\MyRepo\common\temp-split`
2523
+ */
2524
+ get commonTempSplitFolder(): string;
2408
2525
  /**
2409
2526
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2410
2527
  * under the common folder.
@@ -2462,6 +2579,7 @@ export declare class RushConfiguration {
2462
2579
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
2463
2580
  */
2464
2581
  get shrinkwrapFilename(): string;
2582
+ get splitWorkspaceShrinkwrapFilename(): string;
2465
2583
  /**
2466
2584
  * The full path of the temporary shrinkwrap file that is used during "rush install".
2467
2585
  * This file may get rewritten by the package manager during installation.
@@ -2470,6 +2588,14 @@ export declare class RushConfiguration {
2470
2588
  * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
2471
2589
  */
2472
2590
  get tempShrinkwrapFilename(): string;
2591
+ /**
2592
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
2593
+ * "rush install". This file may get rewritten by the package manager during installation.
2594
+ * @remarks
2595
+ * This property merely reports the filename; the file itself may not actually exist.
2596
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
2597
+ */
2598
+ get tempSplitWorkspaceShrinkwrapFilename(): string;
2473
2599
  /**
2474
2600
  * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
2475
2601
  * before installation begins, and can be compared to determine how the package manager
@@ -2629,6 +2755,11 @@ export declare class RushConfiguration {
2629
2755
  * @beta
2630
2756
  */
2631
2757
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2758
+ /**
2759
+ * Search for projects according to filter
2760
+ * @beta
2761
+ */
2762
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2632
2763
  /**
2633
2764
  * {@inheritDoc NpmOptionsConfiguration}
2634
2765
  */
@@ -2675,6 +2806,10 @@ export declare class RushConfiguration {
2675
2806
  * The rush hooks. It allows customized scripts to run at the specified point.
2676
2807
  */
2677
2808
  get packageNameParser(): PackageNameParser;
2809
+ /**
2810
+ * Is there any split workspace project.
2811
+ */
2812
+ get hasSplitWorkspaceProject(): boolean;
2678
2813
  /**
2679
2814
  * Gets the path to the common-versions.json config file for a specific variant.
2680
2815
  * @param variant - The name of the current variant in use by the active command.
@@ -2707,6 +2842,11 @@ export declare class RushConfiguration {
2707
2842
  * @param variant - The name of the current variant in use by the active command.
2708
2843
  */
2709
2844
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
2845
+ /**
2846
+ * Gets the committed shrinkwrap file name for split workspace.
2847
+ * @param variant - The name of the current variant in use by the active command.
2848
+ */
2849
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
2710
2850
  /**
2711
2851
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2712
2852
  * @param variant - The name of the current variant in use by the active command.
@@ -2761,6 +2901,12 @@ export declare class RushConfiguration {
2761
2901
  */
2762
2902
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2763
2903
  private _getVariantConfigFolderPath;
2904
+ /**
2905
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
2906
+ * The workspace project can NOT depend on a split workspace project.
2907
+ * The split workspace project CAN depend on a workspace project.
2908
+ */
2909
+ private _validateSplitWorkspaceRelationships;
2764
2910
  }
2765
2911
 
2766
2912
  /**
@@ -2786,6 +2932,7 @@ export declare class RushConfigurationProject {
2786
2932
  private readonly _publishFolder;
2787
2933
  private readonly _rushConfiguration;
2788
2934
  private readonly _tags;
2935
+ private readonly _splitWorkspace;
2789
2936
  private _versionPolicy;
2790
2937
  private _dependencyProjects;
2791
2938
  private _consumingProjects;
@@ -2953,6 +3100,11 @@ export declare class RushConfigurationProject {
2953
3100
  * @beta
2954
3101
  */
2955
3102
  get tags(): ReadonlySet<string>;
3103
+ /**
3104
+ * Whether this project is a split workspace project.
3105
+ * @beta
3106
+ */
3107
+ get splitWorkspace(): boolean;
2956
3108
  }
2957
3109
 
2958
3110
  /**
@@ -3000,6 +3152,12 @@ export declare class RushConstants {
3000
3152
  * Example: `C:\MyRepo\common\temp`
3001
3153
  */
3002
3154
  static readonly rushTempFolderName: string;
3155
+ /**
3156
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
3157
+ * temporary files will be stored.
3158
+ * Example: `C:\MyRepo\common\temp-split`
3159
+ */
3160
+ static readonly rushTempSplitFolderName: string;
3003
3161
  /**
3004
3162
  * The folder name ("projects") where temporary projects will be stored.
3005
3163
  * Example: `C:\MyRepo\common\temp\projects`
@@ -3218,6 +3376,10 @@ export declare class RushLifecycleHooks {
3218
3376
  * A hook map to allow plugins to hook specific named phased commands (defined in command-line.json) before execution.
3219
3377
  */
3220
3378
  runPhasedCommand: HookMap<AsyncSeriesHook<IPhasedCommand>>;
3379
+ /**
3380
+ * The hook to run between preparing the common/temp folder and invoking the package manager during "rush install" or "rush update".
3381
+ */
3382
+ beforeInstall: AsyncSeriesHook<IGlobalCommand>;
3221
3383
  /**
3222
3384
  * A hook to allow plugins to hook custom logic to process telemetry data.
3223
3385
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.77.3",
3
+ "version": "5.78.0-pr3481.6",
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.51.1",
15
+ "@rushstack/node-core-library": "3.51.2",
16
16
  "@types/node-fetch": "1.6.9",
17
17
  "tapable": "2.2.1"
18
18
  },
19
19
  "devDependencies": {
20
- "@microsoft/rush-lib": "5.77.3",
21
- "@rushstack/eslint-config": "3.0.0",
22
- "@rushstack/heft": "0.47.6",
23
- "@rushstack/heft-node-rig": "1.10.8",
24
- "@rushstack/stream-collator": "4.0.201",
25
- "@rushstack/ts-command-line": "4.12.2",
26
- "@rushstack/terminal": "0.3.70",
20
+ "@microsoft/rush-lib": "5.78.0-pr3481.6",
21
+ "@rushstack/eslint-config": "3.0.1",
22
+ "@rushstack/heft": "0.47.9",
23
+ "@rushstack/heft-node-rig": "1.10.11",
24
+ "@rushstack/stream-collator": "4.0.204",
25
+ "@rushstack/ts-command-line": "4.12.3",
26
+ "@rushstack/terminal": "0.3.73",
27
27
  "@types/heft-jest": "1.0.1",
28
28
  "@types/semver": "7.3.5",
29
29
  "@types/webpack-env": "1.13.0"