@rushstack/rush-sdk 5.79.0 → 5.80.0-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 +228 -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.
@@ -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
  *
@@ -1086,6 +1188,10 @@ export declare interface IOperationExecutionResult {
1086
1188
  * Object used to report a summary at the end of the Rush invocation.
1087
1189
  */
1088
1190
  readonly stdioSummarizer: StdioSummarizer;
1191
+ /**
1192
+ * The value indicates the duration of the same operation without cache hit.
1193
+ */
1194
+ readonly nonCachedDurationMs: number | undefined;
1089
1195
  }
1090
1196
 
1091
1197
  /**
@@ -1169,6 +1275,31 @@ export declare interface IOperationRunnerContext {
1169
1275
  * Object used to report a summary at the end of the Rush invocation.
1170
1276
  */
1171
1277
  stdioSummarizer: StdioSummarizer;
1278
+ /**
1279
+ * Object used to record state of the operation.
1280
+ *
1281
+ * @internal
1282
+ */
1283
+ _operationStateFile?: _OperationStateFile;
1284
+ /**
1285
+ * Object used to track elapsed time.
1286
+ */
1287
+ stopwatch: IStopwatchResult;
1288
+ }
1289
+
1290
+ /**
1291
+ * @internal
1292
+ */
1293
+ export declare interface _IOperationStateFileOptions {
1294
+ rushProject: RushConfigurationProject;
1295
+ phase: IPhase;
1296
+ }
1297
+
1298
+ /**
1299
+ * @internal
1300
+ */
1301
+ export declare interface _IOperationStateJson {
1302
+ nonCachedDurationMs: number;
1172
1303
  }
1173
1304
 
1174
1305
  /**
@@ -1364,6 +1495,7 @@ declare interface IRushConfigurationProjectJson {
1364
1495
  skipRushCheck?: boolean;
1365
1496
  publishFolder?: string;
1366
1497
  tags?: string[];
1498
+ splitWorkspace?: boolean;
1367
1499
  }
1368
1500
 
1369
1501
  /**
@@ -1388,6 +1520,16 @@ declare interface IRushConfigurationProjectOptions {
1388
1520
  allowedProjectTags: Set<string> | undefined;
1389
1521
  }
1390
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
+
1391
1533
  /**
1392
1534
  * Part of IRushConfigurationJson.
1393
1535
  */
@@ -1478,7 +1620,7 @@ declare interface IRushVariantOptionsJson {
1478
1620
 
1479
1621
  /**
1480
1622
  * Represents a readonly view of a `Stopwatch`.
1481
- * @alpha
1623
+ * @beta
1482
1624
  */
1483
1625
  export declare interface IStopwatchResult {
1484
1626
  /**
@@ -1595,6 +1737,10 @@ export declare interface ITelemetryOperationResult {
1595
1737
  * If the operation was blocked, will be `undefined`.
1596
1738
  */
1597
1739
  endTimestampMs?: number;
1740
+ /**
1741
+ * Duration in milliseconds when the operation does not hit cache
1742
+ */
1743
+ nonCachedDurationMs?: number;
1598
1744
  }
1599
1745
 
1600
1746
  /**
@@ -1647,16 +1793,9 @@ export declare interface _IYarnOptionsJson extends IPackageManagerOptionsJsonBas
1647
1793
  * it can invalidate the last install.
1648
1794
  * @internal
1649
1795
  */
1650
- export declare class _LastInstallFlag {
1651
- private _path;
1652
- private _state;
1653
- /**
1654
- * Creates a new LastInstall flag
1655
- * @param folderPath - the folder that this flag is managing
1656
- * @param state - optional, the state that should be managed or compared
1657
- */
1658
- constructor(folderPath: string, state?: JsonObject);
1796
+ export declare class _LastInstallFlag extends _BaseFlag<_ILastInstallFlagJson> {
1659
1797
  /**
1798
+ * @override
1660
1799
  * Returns true if the file exists and the contents match the current state.
1661
1800
  */
1662
1801
  isValid(): boolean;
@@ -1666,20 +1805,8 @@ export declare class _LastInstallFlag {
1666
1805
  *
1667
1806
  * @internal
1668
1807
  */
1669
- checkValidAndReportStoreIssues(): boolean;
1808
+ checkValidAndReportStoreIssues(rushVerb: string): boolean;
1670
1809
  private _isValid;
1671
- /**
1672
- * Writes the flag file to disk with the current state
1673
- */
1674
- create(): void;
1675
- /**
1676
- * Removes the flag file
1677
- */
1678
- clear(): void;
1679
- /**
1680
- * Returns the full path to the flag file
1681
- */
1682
- get path(): string;
1683
1810
  /**
1684
1811
  * Returns the name of the flag file
1685
1812
  */
@@ -1907,6 +2034,32 @@ export declare class Operation {
1907
2034
  deleteDependency(dependency: Operation): void;
1908
2035
  }
1909
2036
 
2037
+ /**
2038
+ * A helper class for managing the state file of a operation.
2039
+ *
2040
+ * @internal
2041
+ */
2042
+ export declare class _OperationStateFile {
2043
+ private readonly _rushProject;
2044
+ private readonly _filename;
2045
+ private _state;
2046
+ constructor(options: _IOperationStateFileOptions);
2047
+ private static _getFilename;
2048
+ /**
2049
+ * ProjectBuildCache expects the relative path for better logging
2050
+ *
2051
+ * @internal
2052
+ */
2053
+ static getFilenameRelativeToProjectRoot(phase: IPhase): string;
2054
+ /**
2055
+ * Returns the filename of the metadata file.
2056
+ */
2057
+ get filename(): string;
2058
+ get state(): _IOperationStateJson | undefined;
2059
+ writeAsync(json: _IOperationStateJson): Promise<void>;
2060
+ tryRestoreAsync(): Promise<_IOperationStateJson | undefined>;
2061
+ }
2062
+
1910
2063
  /**
1911
2064
  * Enumeration defining potential states of an operation
1912
2065
  * @beta
@@ -2416,6 +2569,7 @@ export declare class RushConfiguration {
2416
2569
  private _changesFolder;
2417
2570
  private _commonFolder;
2418
2571
  private _commonTempFolder;
2572
+ private _commonTempSplitFolder;
2419
2573
  private _commonScriptsFolder;
2420
2574
  private _commonRushConfigFolder;
2421
2575
  private _packageManager;
@@ -2424,8 +2578,10 @@ export declare class RushConfiguration {
2424
2578
  private _npmTmpFolder;
2425
2579
  private _yarnCacheFolder;
2426
2580
  private _shrinkwrapFilename;
2581
+ private _splitWorkspaceShrinkwrapFilename;
2427
2582
  private _tempShrinkwrapFilename;
2428
2583
  private _tempShrinkwrapPreinstallFilename;
2584
+ private _tempSplitWorkspaceShrinkwrapFilename;
2429
2585
  private _currentVariantJsonFilename;
2430
2586
  private _packageManagerToolVersion;
2431
2587
  private _packageManagerToolFilename;
@@ -2457,6 +2613,8 @@ export declare class RushConfiguration {
2457
2613
  private _projects;
2458
2614
  private _projectsByName;
2459
2615
  private _projectsByTag;
2616
+ private _filteredProjectsCache;
2617
+ private _hasSplitWorkspaceProject;
2460
2618
  private _commonVersionsConfigurationsByVariant;
2461
2619
  private _versionPolicyConfiguration;
2462
2620
  private _versionPolicyConfigurationFilePath;
@@ -2549,6 +2707,12 @@ export declare class RushConfiguration {
2549
2707
  * Example: `C:\MyRepo\common\temp`
2550
2708
  */
2551
2709
  get commonTempFolder(): string;
2710
+ /**
2711
+ * The folder where temporary files will be stored. This is always a subfolder called "temp"
2712
+ * under the common folder.
2713
+ * Example: `C:\MyRepo\common\temp-split`
2714
+ */
2715
+ get commonTempSplitFolder(): string;
2552
2716
  /**
2553
2717
  * The folder where automation scripts are stored. This is always a subfolder called "scripts"
2554
2718
  * under the common folder.
@@ -2606,6 +2770,7 @@ export declare class RushConfiguration {
2606
2770
  * Example: `npm-shrinkwrap.json` or `pnpm-lock.yaml`
2607
2771
  */
2608
2772
  get shrinkwrapFilename(): string;
2773
+ get splitWorkspaceShrinkwrapFilename(): string;
2609
2774
  /**
2610
2775
  * The full path of the temporary shrinkwrap file that is used during "rush install".
2611
2776
  * This file may get rewritten by the package manager during installation.
@@ -2614,6 +2779,14 @@ export declare class RushConfiguration {
2614
2779
  * Example: `C:\MyRepo\common\temp\npm-shrinkwrap.json` or `C:\MyRepo\common\temp\pnpm-lock.yaml`
2615
2780
  */
2616
2781
  get tempShrinkwrapFilename(): string;
2782
+ /**
2783
+ * The full path of the temporary shrinkwrap file for split workspace that is used during
2784
+ * "rush install". This file may get rewritten by the package manager during installation.
2785
+ * @remarks
2786
+ * This property merely reports the filename; the file itself may not actually exist.
2787
+ * Example: `C:\MyRepo\common\temp-split\pnpm-lock.yaml`
2788
+ */
2789
+ get tempSplitWorkspaceShrinkwrapFilename(): string;
2617
2790
  /**
2618
2791
  * The full path of a backup copy of tempShrinkwrapFilename. This backup copy is made
2619
2792
  * before installation begins, and can be compared to determine how the package manager
@@ -2778,6 +2951,11 @@ export declare class RushConfiguration {
2778
2951
  * @beta
2779
2952
  */
2780
2953
  get projectsByTag(): ReadonlyMap<string, ReadonlySet<RushConfigurationProject>>;
2954
+ /**
2955
+ * Search for projects according to filter
2956
+ * @beta
2957
+ */
2958
+ getFilteredProjects(filter: IRushConfigurationProjectsFilter): RushConfigurationProject[];
2781
2959
  /**
2782
2960
  * {@inheritDoc NpmOptionsConfiguration}
2783
2961
  */
@@ -2824,6 +3002,10 @@ export declare class RushConfiguration {
2824
3002
  * The rush hooks. It allows customized scripts to run at the specified point.
2825
3003
  */
2826
3004
  get packageNameParser(): PackageNameParser;
3005
+ /**
3006
+ * Is there any split workspace project.
3007
+ */
3008
+ get hasSplitWorkspaceProject(): boolean;
2827
3009
  /**
2828
3010
  * Gets the path to the common-versions.json config file for a specific variant.
2829
3011
  * @param variant - The name of the current variant in use by the active command.
@@ -2856,6 +3038,11 @@ export declare class RushConfiguration {
2856
3038
  * @param variant - The name of the current variant in use by the active command.
2857
3039
  */
2858
3040
  getCommittedShrinkwrapFilename(variant?: string | undefined): string;
3041
+ /**
3042
+ * Gets the committed shrinkwrap file name for split workspace.
3043
+ * @param variant - The name of the current variant in use by the active command.
3044
+ */
3045
+ getCommittedSplitWorkspaceShrinkwrapFilename(): string;
2859
3046
  /**
2860
3047
  * Gets the absolute path for "pnpmfile.js" for a specific variant.
2861
3048
  * @param variant - The name of the current variant in use by the active command.
@@ -2910,6 +3097,12 @@ export declare class RushConfiguration {
2910
3097
  */
2911
3098
  tryGetProjectForPath(currentFolderPath: string): RushConfigurationProject | undefined;
2912
3099
  private _getVariantConfigFolderPath;
3100
+ /**
3101
+ * Split workspace can only works on PNPM with "useWorkspaces" enabled.
3102
+ * The workspace project can NOT depend on a split workspace project.
3103
+ * The split workspace project CAN depend on a workspace project.
3104
+ */
3105
+ private _validateSplitWorkspaceRelationships;
2913
3106
  }
2914
3107
 
2915
3108
  /**
@@ -2935,6 +3128,7 @@ export declare class RushConfigurationProject {
2935
3128
  private readonly _publishFolder;
2936
3129
  private readonly _rushConfiguration;
2937
3130
  private readonly _tags;
3131
+ private readonly _splitWorkspace;
2938
3132
  private _versionPolicy;
2939
3133
  private _dependencyProjects;
2940
3134
  private _consumingProjects;
@@ -3102,6 +3296,11 @@ export declare class RushConfigurationProject {
3102
3296
  * @beta
3103
3297
  */
3104
3298
  get tags(): ReadonlySet<string>;
3299
+ /**
3300
+ * Whether this project is a split workspace project.
3301
+ * @beta
3302
+ */
3303
+ get splitWorkspace(): boolean;
3105
3304
  }
3106
3305
 
3107
3306
  /**
@@ -3149,6 +3348,12 @@ export declare class RushConstants {
3149
3348
  * Example: `C:\MyRepo\common\temp`
3150
3349
  */
3151
3350
  static readonly rushTempFolderName: string;
3351
+ /**
3352
+ * The folder name ("temp-split") under the common folder, or under the .rush folder in each project's directory where
3353
+ * temporary files will be stored.
3354
+ * Example: `C:\MyRepo\common\temp-split`
3355
+ */
3356
+ static readonly rushTempSplitFolderName: string;
3152
3357
  /**
3153
3358
  * The folder name ("projects") where temporary projects will be stored.
3154
3359
  * 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.79.0",
3
+ "version": "5.80.0-pr3481.7",
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.52.0",
15
+ "@rushstack/node-core-library": "3.53.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.79.0",
21
- "@rushstack/eslint-config": "3.0.1",
22
- "@rushstack/heft": "0.47.10",
23
- "@rushstack/heft-node-rig": "1.10.12",
24
- "@rushstack/stream-collator": "4.0.205",
25
- "@rushstack/ts-command-line": "4.12.3",
26
- "@rushstack/terminal": "0.3.74",
20
+ "@microsoft/rush-lib": "5.80.0-pr3481.7",
21
+ "@rushstack/eslint-config": "3.1.0",
22
+ "@rushstack/heft": "0.48.0",
23
+ "@rushstack/heft-node-rig": "1.11.0",
24
+ "@rushstack/stream-collator": "4.0.207",
25
+ "@rushstack/ts-command-line": "4.12.4",
26
+ "@rushstack/terminal": "0.3.76",
27
27
  "@types/heft-jest": "1.0.1",
28
28
  "@types/semver": "7.3.5",
29
29
  "@types/webpack-env": "1.13.0"