@rushstack/rush-sdk 5.77.1 → 5.77.2-pr3481.5

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 +6 -7
@@ -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.
@@ -875,6 +928,11 @@ export declare interface IExperimentsJson {
875
928
  * in common/config/rush/command-line.json.
876
929
  */
877
930
  phasedCommands?: boolean;
931
+ /**
932
+ * If true, rush install or rush update implicitly specify --ignore-scripts during pnpm install,
933
+ * and run install lifecycle scripts by pnpm rebuild --pending after pnpm install successfully.
934
+ */
935
+ deferredInstallationScripts?: boolean;
878
936
  }
879
937
 
880
938
  /**
@@ -941,6 +999,50 @@ declare interface IIndividualVersionJson extends IVersionPolicyJson {
941
999
  lockedMajor?: number;
942
1000
  }
943
1001
 
1002
+ /**
1003
+ * This represents the JSON data structure for the "last-install.flag" file.
1004
+ * @internal
1005
+ */
1006
+ export declare interface _ILastInstallFlagJson {
1007
+ /**
1008
+ * Current node version
1009
+ */
1010
+ node: string;
1011
+ /**
1012
+ * Current package manager name
1013
+ */
1014
+ packageManager: PackageManagerName;
1015
+ /**
1016
+ * Current package manager version
1017
+ */
1018
+ packageManagerVersion: string;
1019
+ /**
1020
+ * Current rush json folder
1021
+ */
1022
+ rushJsonFolder: string;
1023
+ /**
1024
+ * The content of package.json, used in the flag file of autoinstaller
1025
+ */
1026
+ packageJson?: IPackageJson;
1027
+ /**
1028
+ * Same with pnpmOptions.pnpmStorePath in rush.json
1029
+ */
1030
+ storePath?: string;
1031
+ /**
1032
+ * True when "useWorkspaces" is true in rush.json
1033
+ */
1034
+ workspaces?: true;
1035
+ /**
1036
+ * True when user explicitly specify "--ignore-scripts" CLI parameter or deferredInstallationScripts
1037
+ */
1038
+ ignoreScripts?: true;
1039
+ /**
1040
+ * When specified, it is a list of selected projects during partial install
1041
+ * It is undefined when full install
1042
+ */
1043
+ selectedProjectNames?: string[];
1044
+ }
1045
+
944
1046
  /**
945
1047
  * Options to pass to the rush "launch" functions.
946
1048
  *
@@ -1306,6 +1408,7 @@ declare interface IRushConfigurationProjectJson {
1306
1408
  skipRushCheck?: boolean;
1307
1409
  publishFolder?: string;
1308
1410
  tags?: string[];
1411
+ splitWorkspace?: boolean;
1309
1412
  }
1310
1413
 
1311
1414
  /**
@@ -1330,6 +1433,16 @@ declare interface IRushConfigurationProjectOptions {
1330
1433
  allowedProjectTags: Set<string> | undefined;
1331
1434
  }
1332
1435
 
1436
+ /**
1437
+ * The filter parameters to search from all projects.
1438
+ */
1439
+ declare interface IRushConfigurationProjectsFilter {
1440
+ /**
1441
+ * If true, filter out projects that specify splitWorkspace as true.
1442
+ */
1443
+ splitWorkspace: boolean;
1444
+ }
1445
+
1333
1446
  /**
1334
1447
  * Part of IRushConfigurationJson.
1335
1448
  */
@@ -1588,16 +1701,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1588
1701
  * it can invalidate the last install.
1589
1702
  * @internal
1590
1703
  */
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);
1704
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1600
1705
  /**
1706
+ * @override
1601
1707
  * Returns true if the file exists and the contents match the current state.
1602
1708
  */
1603
1709
  isValid(): boolean;
@@ -1609,18 +1715,6 @@ export declare class _LastInstallFlag {
1609
1715
  */
1610
1716
  checkValidAndReportStoreIssues(): boolean;
1611
1717
  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
1718
  /**
1625
1719
  * Returns the name of the flag file
1626
1720
  */
@@ -2273,6 +2367,7 @@ export declare class RushConfiguration {
2273
2367
  private _changesFolder;
2274
2368
  private _commonFolder;
2275
2369
  private _commonTempFolder;
2370
+ private _commonTempSplitFolder;
2276
2371
  private _commonScriptsFolder;
2277
2372
  private _commonRushConfigFolder;
2278
2373
  private _packageManager;
@@ -2281,8 +2376,10 @@ export declare class RushConfiguration {
2281
2376
  private _npmTmpFolder;
2282
2377
  private _yarnCacheFolder;
2283
2378
  private _shrinkwrapFilename;
2379
+ private _splitWorkspaceShrinkwrapFilename;
2284
2380
  private _tempShrinkwrapFilename;
2285
2381
  private _tempShrinkwrapPreinstallFilename;
2382
+ private _tempSplitWorkspaceShrinkwrapFilename;
2286
2383
  private _currentVariantJsonFilename;
2287
2384
  private _packageManagerToolVersion;
2288
2385
  private _packageManagerToolFilename;
@@ -2313,6 +2410,8 @@ export declare class RushConfiguration {
2313
2410
  private _projects;
2314
2411
  private _projectsByName;
2315
2412
  private _projectsByTag;
2413
+ private _filteredProjectsCache;
2414
+ private _hasSplitWorkspaceProject;
2316
2415
  private _commonVersionsConfigurationsByVariant;
2317
2416
  private _versionPolicyConfiguration;
2318
2417
  private _versionPolicyConfigurationFilePath;
@@ -2405,6 +2504,12 @@ export declare class RushConfiguration {
2405
2504
  * Example: `C:\MyRepo\common\temp`
2406
2505
  */
2407
2506
  get commonTempFolder(): string;
2507
+ /**
2508
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
2509
+ * under the common folder.
2510
+ * Example: `C:\MyRepo\common\temp-split`
2511
+ */
2512
+ get commonTempSplitFolder(): string;
2408
2513
  /**
2409
2514
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2410
2515
  * under the common folder.
@@ -2462,6 +2567,7 @@ export declare class RushConfiguration {
2462
2567
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
2463
2568
  */
2464
2569
  get shrinkwrapFilename(): string;
2570
+ get splitWorkspaceShrinkwrapFilename(): string;
2465
2571
  /**
2466
2572
  * The full path of the temporary shrinkwrap file that is used during "rush install".
2467
2573
  * This file may get rewritten by the package manager during installation.
@@ -2470,6 +2576,14 @@ export declare class RushConfiguration {
2470
2576
  * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
2471
2577
  */
2472
2578
  get tempShrinkwrapFilename(): string;
2579
+ /**
2580
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
2581
+ * "rush install". This file may get rewritten by the package manager during installation.
2582
+ * @remarks
2583
+ * This property merely reports the filename; the file itself may not actually exist.
2584
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
2585
+ */
2586
+ get tempSplitWorkspaceShrinkwrapFilename(): string;
2473
2587
  /**
2474
2588
  * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
2475
2589
  * before installation begins, and can be compared to determine how the package manager
@@ -2629,6 +2743,11 @@ export declare class RushConfiguration {
2629
2743
  * @beta
2630
2744
  */
2631
2745
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2746
+ /**
2747
+ * Search for projects according to filter
2748
+ * @beta
2749
+ */
2750
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2632
2751
  /**
2633
2752
  * {@inheritDoc NpmOptionsConfiguration}
2634
2753
  */
@@ -2675,6 +2794,10 @@ export declare class RushConfiguration {
2675
2794
  * The rush hooks. It allows customized scripts to run at the specified point.
2676
2795
  */
2677
2796
  get packageNameParser(): PackageNameParser;
2797
+ /**
2798
+ * Is there any split workspace project.
2799
+ */
2800
+ get hasSplitWorkspaceProject(): boolean;
2678
2801
  /**
2679
2802
  * Gets the path to the common-versions.json config file for a specific variant.
2680
2803
  * @param variant - The name of the current variant in use by the active command.
@@ -2707,6 +2830,11 @@ export declare class RushConfiguration {
2707
2830
  * @param variant - The name of the current variant in use by the active command.
2708
2831
  */
2709
2832
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
2833
+ /**
2834
+ * Gets the committed shrinkwrap file name for split workspace.
2835
+ * @param variant - The name of the current variant in use by the active command.
2836
+ */
2837
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
2710
2838
  /**
2711
2839
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2712
2840
  * @param variant - The name of the current variant in use by the active command.
@@ -2761,6 +2889,12 @@ export declare class RushConfiguration {
2761
2889
  */
2762
2890
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2763
2891
  private _getVariantConfigFolderPath;
2892
+ /**
2893
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
2894
+ * The workspace project can NOT depend on a split workspace project.
2895
+ * The split workspace project CAN depend on a workspace project.
2896
+ */
2897
+ private _validateSplitWorkspaceRelationships;
2764
2898
  }
2765
2899
 
2766
2900
  /**
@@ -2786,6 +2920,7 @@ export declare class RushConfigurationProject {
2786
2920
  private readonly _publishFolder;
2787
2921
  private readonly _rushConfiguration;
2788
2922
  private readonly _tags;
2923
+ private readonly _splitWorkspace;
2789
2924
  private _versionPolicy;
2790
2925
  private _dependencyProjects;
2791
2926
  private _consumingProjects;
@@ -2953,6 +3088,11 @@ export declare class RushConfigurationProject {
2953
3088
  * @beta
2954
3089
  */
2955
3090
  get tags(): ReadonlySet<string>;
3091
+ /**
3092
+ * Whether this project is a split workspace project.
3093
+ * @beta
3094
+ */
3095
+ get splitWorkspace(): boolean;
2956
3096
  }
2957
3097
 
2958
3098
  /**
@@ -3000,6 +3140,12 @@ export declare class RushConstants {
3000
3140
  * Example: `C:\MyRepo\common\temp`
3001
3141
  */
3002
3142
  static readonly rushTempFolderName: string;
3143
+ /**
3144
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
3145
+ * temporary files will be stored.
3146
+ * Example: `C:\MyRepo\common\temp-split`
3147
+ */
3148
+ static readonly rushTempSplitFolderName: string;
3003
3149
  /**
3004
3150
  * The folder name ("projects") where temporary projects will be stored.
3005
3151
  * 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.77.1",
3
+ "version": "5.77.2-pr3481.5",
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.77.1",
20
+ "@microsoft/rush-lib": "5.77.2-pr3481.5",
21
21
  "@rushstack/eslint-config": "3.0.0",
22
22
  "@rushstack/heft": "0.47.5",
23
- "@rushstack/heft-node-rig": "1.10.5",
24
- "@rushstack/stream-collator": "4.0.198",
23
+ "@rushstack/heft-node-rig": "1.10.7",
24
+ "@rushstack/stream-collator": "4.0.200",
25
25
  "@rushstack/ts-command-line": "4.12.2",
26
- "@rushstack/terminal": "0.3.67",
26
+ "@rushstack/terminal": "0.3.69",
27
27
  "@types/heft-jest": "1.0.1",
28
28
  "@types/semver": "7.3.5",
29
29
  "@types/webpack-env": "1.13.0"
@@ -32,6 +32,5 @@
32
32
  "build": "heft build --clean",
33
33
  "_phase:build": "heft build --clean",
34
34
  "_phase:test": "heft test --no-build"
35
- },
36
- "readme": "## @rushstack/rush-sdk\n\nThis is a companion package for the Rush tool. See the [@microsoft/rush](https://www.npmjs.com/package/@microsoft/rush) package for details.\n\n⚠ ***THIS PACKAGE IS EXPERIMENTAL*** ⚠\n\nThe **@rushstack/rush-sdk** package acts as a lightweight proxy for accessing the APIs of the **@microsoft/rush-lib** engine. It is intended to support three different use cases:\n\n1. Rush plugins should import from **@rushstack/rush-sdk** instead of **@microsoft/rush-lib**. This gives plugins full access to Rush APIs while avoiding a redundant installation of those packages. At runtime, the APIs will be bound to the correct `rushVersion` from **rush.json**, and guaranteed to be the same **@microsoft/rush-lib** module instance as the plugin host.\n\n2. When authoring unit tests for a Rush plugin, developers should add **@microsoft/rush-lib** to their **package.json** `devDependencies`. In this context, **@rushstack/rush-sdk** will resolve to that instance for testing purposes.\n\n3. For scripts and tools that are designed to be used in a Rush monorepo, in the future **@rushstack/rush-sdk** will automatically invoke **install-run-rush.js** and load the local installation. This ensures that tools load a compatible version of the Rush engine for the given branch. Once this is implemented, **@rushstack/rush-sdk** can replace **@microsoft/rush-lib** entirely as the official API interface, with the latter serving as the underlying implementation.\n\n\nThe **@rushstack/rush-sdk** API declarations are identical to the corresponding version of **@microsoft/rush-lib**.\n\n## Debugging\n\nVerbose logging can be turn on by set environment variable `RUSH_SDK_DEBUG` to `1`\n\n\n## Links\n\n- [CHANGELOG.md](\n https://github.com/microsoft/rushstack/blob/main/apps/rush/CHANGELOG.md) - Find\n out what's new in the latest version\n- [API Reference](https://api.rushstack.io/pages/rush-lib/)\n\nRush is part of the [Rush Stack](https://rushstack.io/) family of projects.\n"
35
+ }
37
36
  }