@rushstack/rush-sdk 5.78.1 → 5.80.0

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 +206 -6
  2. package/package.json +9 -9
@@ -1086,6 +1086,10 @@ export declare interface IOperationExecutionResult {
1086
1086
  * Object used to report a summary at the end of the Rush invocation.
1087
1087
  */
1088
1088
  readonly stdioSummarizer: StdioSummarizer;
1089
+ /**
1090
+ * The value indicates the duration of the same operation without cache hit.
1091
+ */
1092
+ readonly nonCachedDurationMs: number | undefined;
1089
1093
  }
1090
1094
 
1091
1095
  /**
@@ -1169,6 +1173,31 @@ export declare interface IOperationRunnerContext {
1169
1173
  * Object used to report a summary at the end of the Rush invocation.
1170
1174
  */
1171
1175
  stdioSummarizer: StdioSummarizer;
1176
+ /**
1177
+ * Object used to record state of the operation.
1178
+ *
1179
+ * @internal
1180
+ */
1181
+ _operationStateFile?: _OperationStateFile;
1182
+ /**
1183
+ * Object used to track elapsed time.
1184
+ */
1185
+ stopwatch: IStopwatchResult;
1186
+ }
1187
+
1188
+ /**
1189
+ * @internal
1190
+ */
1191
+ export declare interface _IOperationStateFileOptions {
1192
+ rushProject: RushConfigurationProject;
1193
+ phase: IPhase;
1194
+ }
1195
+
1196
+ /**
1197
+ * @internal
1198
+ */
1199
+ export declare interface _IOperationStateJson {
1200
+ nonCachedDurationMs: number;
1172
1201
  }
1173
1202
 
1174
1203
  /**
@@ -1241,11 +1270,11 @@ export declare interface IPhasedCommand extends IRushCommand {
1241
1270
  */
1242
1271
  export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBase {
1243
1272
  /**
1244
- * The store resolution method for PNPM to use
1273
+ * {@inheritDoc PnpmOptionsConfiguration.pnpmStore}
1245
1274
  */
1246
1275
  pnpmStore?: PnpmStoreOptions;
1247
1276
  /**
1248
- * Should PNPM fail if peer dependencies aren't installed?
1277
+ * {@inheritDoc PnpmOptionsConfiguration.strictPeerDependencies}
1249
1278
  */
1250
1279
  strictPeerDependencies?: boolean;
1251
1280
  /**
@@ -1256,6 +1285,52 @@ export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBas
1256
1285
  * {@inheritDoc PnpmOptionsConfiguration.useWorkspaces}
1257
1286
  */
1258
1287
  useWorkspaces?: boolean;
1288
+ /**
1289
+ * {@inheritDoc PnpmOptionsConfiguration.globalOverrides}
1290
+ */
1291
+ globalOverrides?: Record<string, string>;
1292
+ /**
1293
+ * {@inheritDoc PnpmOptionsConfiguration.globalPeerDependencyRules}
1294
+ */
1295
+ globalPeerDependencyRules?: IPnpmPeerDependencyRules;
1296
+ /**
1297
+ * {@inheritDoc PnpmOptionsConfiguration.globalPackageExtensions}
1298
+ */
1299
+ globalPackageExtensions?: Record<string, IPnpmPackageExtension>;
1300
+ /**
1301
+ * {@inheritDoc PnpmOptionsConfiguration.globalNeverBuiltDependencies}
1302
+ */
1303
+ globalNeverBuiltDependencies?: string[];
1304
+ /**
1305
+ * {@inheritDoc PnpmOptionsConfiguration.globalAllowedDeprecatedVersions}
1306
+ */
1307
+ globalAllowedDeprecatedVersions?: Record<string, string>;
1308
+ /**
1309
+ * {@inheritDoc PnpmOptionsConfiguration.unsupportedPackageJsonSettings}
1310
+ */
1311
+ unsupportedPackageJsonSettings?: unknown;
1312
+ }
1313
+
1314
+ declare interface IPnpmPackageExtension {
1315
+ dependencies?: Record<string, string>;
1316
+ optionalDependencies?: Record<string, string>;
1317
+ peerDependencies?: Record<string, string>;
1318
+ peerDependenciesMeta?: IPnpmPeerDependenciesMeta;
1319
+ }
1320
+
1321
+ declare interface IPnpmPeerDependenciesMeta {
1322
+ [packageName: string]: {
1323
+ optional?: boolean;
1324
+ };
1325
+ }
1326
+
1327
+ /**
1328
+ * @beta
1329
+ */
1330
+ declare interface IPnpmPeerDependencyRules {
1331
+ ignoreMissing?: string[];
1332
+ allowAny?: string[];
1333
+ allowedVersions?: Record<string, string>;
1259
1334
  }
1260
1335
 
1261
1336
  declare interface IRawRepoState {
@@ -1350,6 +1425,7 @@ declare interface IRushGitPolicyJson {
1350
1425
  sampleEmail?: string;
1351
1426
  versionBumpCommitMessage?: string;
1352
1427
  changeLogUpdateCommitMessage?: string;
1428
+ changefilesCommitMessage?: string;
1353
1429
  tagSeparator?: string;
1354
1430
  }
1355
1431
 
@@ -1431,7 +1507,7 @@ declare interface IRushVariantOptionsJson {
1431
1507
 
1432
1508
  /**
1433
1509
  * Represents a readonly view of a `Stopwatch`.
1434
- * @alpha
1510
+ * @beta
1435
1511
  */
1436
1512
  export declare interface IStopwatchResult {
1437
1513
  /**
@@ -1548,6 +1624,10 @@ export declare interface ITelemetryOperationResult {
1548
1624
  * If the operation was blocked, will be `undefined`.
1549
1625
  */
1550
1626
  endTimestampMs?: number;
1627
+ /**
1628
+ * Duration in milliseconds when the operation does not hit cache
1629
+ */
1630
+ nonCachedDurationMs?: number;
1551
1631
  }
1552
1632
 
1553
1633
  /**
@@ -1619,7 +1699,7 @@ export declare class _LastInstallFlag {
1619
1699
  *
1620
1700
  * @internal
1621
1701
  */
1622
- checkValidAndReportStoreIssues(): boolean;
1702
+ checkValidAndReportStoreIssues(rushVerb: string): boolean;
1623
1703
  private _isValid;
1624
1704
  /**
1625
1705
  * Writes the flag file to disk with the current state
@@ -1860,6 +1940,32 @@ export declare class Operation {
1860
1940
  deleteDependency(dependency: Operation): void;
1861
1941
  }
1862
1942
 
1943
+ /**
1944
+ * A helper class for managing the state file of a operation.
1945
+ *
1946
+ * @internal
1947
+ */
1948
+ export declare class _OperationStateFile {
1949
+ private readonly _rushProject;
1950
+ private readonly _filename;
1951
+ private _state;
1952
+ constructor(options: _IOperationStateFileOptions);
1953
+ private static _getFilename;
1954
+ /**
1955
+ * ProjectBuildCache expects the relative path for better logging
1956
+ *
1957
+ * @internal
1958
+ */
1959
+ static getFilenameRelativeToProjectRoot(phase: IPhase): string;
1960
+ /**
1961
+ * Returns the filename of the metadata file.
1962
+ */
1963
+ get filename(): string;
1964
+ get state(): _IOperationStateJson | undefined;
1965
+ writeAsync(json: _IOperationStateJson): Promise<void>;
1966
+ tryRestoreAsync(): Promise<_IOperationStateJson | undefined>;
1967
+ }
1968
+
1863
1969
  /**
1864
1970
  * Enumeration defining potential states of an operation
1865
1971
  * @beta
@@ -2042,6 +2148,8 @@ export declare class PhasedCommandHooks {
2042
2148
 
2043
2149
  /**
2044
2150
  * Options that are only used when the PNPM package manager is selected.
2151
+ * Use this class to load "common/config/rush/pnpm-config.json" file,
2152
+ * or, load json from "pnpmOptions" field in "rush.json" for legacy support.
2045
2153
  *
2046
2154
  * @remarks
2047
2155
  * It is valid to define these options in rush.json even if the PNPM package manager
@@ -2050,6 +2158,7 @@ export declare class PhasedCommandHooks {
2050
2158
  * @public
2051
2159
  */
2052
2160
  export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfigurationBase {
2161
+ private static _jsonSchema;
2053
2162
  /**
2054
2163
  * The method used to resolve the store used by PNPM.
2055
2164
  *
@@ -2099,11 +2208,92 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
2099
2208
  * If true, then Rush will use the workspaces feature to install and link packages when invoking PNPM.
2100
2209
  *
2101
2210
  * @remarks
2102
- * The default value is false. (For now.)
2211
+ * The default value is true. (For now.)
2103
2212
  */
2104
2213
  readonly useWorkspaces: boolean;
2214
+ /**
2215
+ * The "globalOverrides" setting provides a simple mechanism for overriding version selections
2216
+ * for all dependencies of all projects in the monorepo workspace. The settings are copied
2217
+ * into the `pnpm.overrides` field of the `common/temp/package.json` file that is generated
2218
+ * by Rush during installation.
2219
+ *
2220
+ * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by
2221
+ * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`,
2222
+ * and `globalOverrides` has lowest precedence.
2223
+ *
2224
+ * PNPM documentation: https://pnpm.io/package_json#pnpmoverrides
2225
+ */
2226
+ readonly globalOverrides: Record<string, string> | undefined;
2227
+ /**
2228
+ * The `globalPeerDependencyRules` setting provides various settings for suppressing validation errors
2229
+ * that are reported during installation with `strictPeerDependencies=true`. The settings are copied
2230
+ * into the `pnpm.peerDependencyRules` field of the `common/temp/package.json` file that is generated
2231
+ * by Rush during installation.
2232
+ *
2233
+ * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by
2234
+ * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`,
2235
+ * and `globalOverrides` has lowest precedence.
2236
+ *
2237
+ * https://pnpm.io/package_json#pnpmpeerdependencyrules
2238
+ */
2239
+ readonly globalPeerDependencyRules: IPnpmPeerDependencyRules | undefined;
2240
+ /**
2241
+ * The `globalPackageExtension` setting provides a way to patch arbitrary package.json fields
2242
+ * for any PNPM dependency of the monorepo. The settings are copied into the `pnpm.packageExtensions`
2243
+ * field of the `common/temp/package.json` file that is generated by Rush during installation.
2244
+ * The `globalPackageExtension` setting has similar capabilities as `.pnpmfile.cjs` but without
2245
+ * the downsides of an executable script (nondeterminism, unreliable caching, performance concerns).
2246
+ *
2247
+ * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by
2248
+ * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`,
2249
+ * and `globalOverrides` has lowest precedence.
2250
+ *
2251
+ * PNPM documentation: https://pnpm.io/package_json#pnpmpackageextensions
2252
+ */
2253
+ readonly globalPackageExtensions: Record<string, IPnpmPackageExtension> | undefined;
2254
+ /**
2255
+ * The `globalNeverBuiltDependencies` setting suppresses the `preinstall`, `install`, and `postinstall`
2256
+ * lifecycle events for the specified NPM dependencies. This is useful for scripts with poor practices
2257
+ * such as downloading large binaries without retries or attempting to invoke OS tools such as
2258
+ * a C++ compiler. (PNPM's terminology refers to these lifecycle events as "building" a package;
2259
+ * it has nothing to do with build system operations such as `rush build` or `rushx build`.)
2260
+ * The settings are copied into the `pnpm.neverBuiltDependencies` field of the `common/temp/package.json`
2261
+ * file that is generated by Rush during installation.
2262
+ *
2263
+ * PNPM documentation: https://pnpm.io/package_json#pnpmneverbuiltdependencies
2264
+ */
2265
+ readonly globalNeverBuiltDependencies: string[] | undefined;
2266
+ /**
2267
+ * The `globalAllowedDeprecatedVersions` setting suppresses installation warnings for package
2268
+ * versions that the NPM registry reports as being deprecated. This is useful if the
2269
+ * deprecated package is an indirect dependency of an external package that has not released a fix.
2270
+ * The settings are copied into the `pnpm.allowedDeprecatedVersions` field of the `common/temp/package.json`
2271
+ * file that is generated by Rush during installation.
2272
+ *
2273
+ * PNPM documentation: https://pnpm.io/package_json#pnpmalloweddeprecatedversions
2274
+ *
2275
+ * If you are working to eliminate a deprecated version, it's better to specify `allowedDeprecatedVersions`
2276
+ * in the package.json file for individual Rush projects.
2277
+ */
2278
+ readonly globalAllowedDeprecatedVersions: Record<string, string> | undefined;
2279
+ /**
2280
+ * (USE AT YOUR OWN RISK) This is a free-form property bag that will be copied into
2281
+ * the `common/temp/package.json` file that is generated by Rush during installation.
2282
+ * This provides a way to experiment with new PNPM features. These settings will override
2283
+ * any other Rush configuration associated with a given JSON field except for `.pnpmfile.cjs`.
2284
+ *
2285
+ * USAGE OF THIS SETTING IS NOT SUPPORTED BY THE RUSH MAINTAINERS AND MAY CAUSE RUSH
2286
+ * TO MALFUNCTION. If you encounter a missing PNPM setting that you believe should
2287
+ * be supported, please create a GitHub issue or PR. Note that Rush does not aim to
2288
+ * support every possible PNPM setting, but rather to promote a battle-tested installation
2289
+ * strategy that is known to provide a good experience for large teams with lots of projects.
2290
+ */
2291
+ readonly unsupportedPackageJsonSettings: unknown | undefined;
2292
+ private constructor();
2293
+ /** @internal */
2294
+ static loadFromJsonFileOrThrow(jsonFilename: string, commonTempFolder: string): PnpmOptionsConfiguration;
2105
2295
  /** @internal */
2106
- constructor(json: _IPnpmOptionsJson, commonTempFolder: string);
2296
+ static loadFromJsonObject(json: _IPnpmOptionsJson, commonTempFolder: string): PnpmOptionsConfiguration;
2107
2297
  }
2108
2298
 
2109
2299
  /**
@@ -2310,6 +2500,7 @@ export declare class RushConfiguration {
2310
2500
  private _gitSampleEmail;
2311
2501
  private _gitVersionBumpCommitMessage;
2312
2502
  private _gitChangeLogUpdateCommitMessage;
2503
+ private _gitChangefilesCommitMessage;
2313
2504
  private _gitTagSeparator;
2314
2505
  private _hotfixChangeEnabled;
2315
2506
  private _repositoryUrls;
@@ -2582,6 +2773,11 @@ export declare class RushConfiguration {
2582
2773
  * The commit message to use when committing change log files 'rush version'
2583
2774
  */
2584
2775
  get gitChangeLogUpdateCommitMessage(): string | undefined;
2776
+ /**
2777
+ * [Part of the "gitPolicy" feature.]
2778
+ * The commit message to use when committing change log files 'rush version'
2779
+ */
2780
+ get gitChangefilesCommitMessage(): string | undefined;
2585
2781
  /**
2586
2782
  * [Part of the "gitPolicy" feature.]
2587
2783
  * The separator between package name and version in git tag.
@@ -3086,6 +3282,10 @@ export declare class RushConstants {
3086
3282
  * Experiments configuration file.
3087
3283
  */
3088
3284
  static readonly experimentsFilename: string;
3285
+ /**
3286
+ * Pnpm configuration file
3287
+ */
3288
+ static readonly pnpmConfigFilename: string;
3089
3289
  /**
3090
3290
  * Rush plugins configuration file name.
3091
3291
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.78.1",
3
+ "version": "5.80.0",
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.78.1",
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",
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"