@rushstack/rush-sdk 5.162.0 → 5.164.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.
@@ -12,7 +12,10 @@ import { AsyncSeriesWaterfallHook } from 'tapable';
12
12
  import type { CollatedWriter } from '@rushstack/stream-collator';
13
13
  import type { CommandLineParameter } from '@rushstack/ts-command-line';
14
14
  import { CommandLineParameterKind } from '@rushstack/ts-command-line';
15
+ import { CredentialCache } from '@rushstack/credential-cache';
15
16
  import { HookMap } from 'tapable';
17
+ import { ICredentialCacheEntry } from '@rushstack/credential-cache';
18
+ import { ICredentialCacheOptions } from '@rushstack/credential-cache';
16
19
  import { IFileDiffStatus } from '@rushstack/package-deps-hash';
17
20
  import { IPackageJson } from '@rushstack/node-core-library';
18
21
  import { IPrefixMatch } from '@rushstack/lookup-by-path';
@@ -373,27 +376,7 @@ export declare class CommonVersionsConfiguration {
373
376
  private _serialize;
374
377
  }
375
378
 
376
- /**
377
- * @beta
378
- */
379
- export declare class CredentialCache {
380
- private readonly _cacheFilePath;
381
- private readonly _cacheEntries;
382
- private _modified;
383
- private _disposed;
384
- private _supportsEditing;
385
- private readonly _lockfile;
386
- private constructor();
387
- static initializeAsync(options: ICredentialCacheOptions): Promise<CredentialCache>;
388
- static usingAsync(options: ICredentialCacheOptions, doActionAsync: (credentialCache: CredentialCache) => Promise<void> | void): Promise<void>;
389
- setCacheEntry(cacheId: string, entry: ICredentialCacheEntry): void;
390
- tryGetCacheEntry(cacheId: string): ICredentialCacheEntry | undefined;
391
- deleteCacheEntry(cacheId: string): void;
392
- trimExpiredEntries(): void;
393
- saveIfModifiedAsync(): Promise<void>;
394
- dispose(): void;
395
- private _validate;
396
- }
379
+ export { CredentialCache }
397
380
 
398
381
  /**
399
382
  * An identifier representing a Rush message that can be customized by
@@ -1309,25 +1292,9 @@ export declare interface ICreateOperationsContext {
1309
1292
  readonly invalidateOperation?: ((operation: Operation, reason: string) => void) | undefined;
1310
1293
  }
1311
1294
 
1312
- /**
1313
- * @beta
1314
- */
1315
- export declare interface ICredentialCacheEntry {
1316
- expires?: Date;
1317
- credential: string;
1318
- credentialMetadata?: object;
1319
- }
1295
+ export { ICredentialCacheEntry }
1320
1296
 
1321
- /**
1322
- * @beta
1323
- */
1324
- export declare interface ICredentialCacheOptions {
1325
- supportEditing: boolean;
1326
- /**
1327
- * If specified, use the specified path instead of the default path of `~/.rush-user/credentials.json`
1328
- */
1329
- cacheFilePath?: string;
1330
- }
1297
+ export { ICredentialCacheOptions }
1331
1298
 
1332
1299
  /**
1333
1300
  * This represents the JSON data structure for the "current-variant.json" data file.
@@ -2102,6 +2069,13 @@ export declare interface IOperationSettings {
2102
2069
  * If true, this operation will never be skipped by the `--changed-projects-only` flag.
2103
2070
  */
2104
2071
  ignoreChangedProjectsOnlyFlag?: boolean;
2072
+ /**
2073
+ * An optional list of custom command-line parameter names (their `parameterLongName` values from
2074
+ * command-line.json) that should be ignored when invoking the command for this operation.
2075
+ * This allows a project to opt out of parameters that don't affect its operation, preventing
2076
+ * unnecessary cache invalidation for this operation and its consumers.
2077
+ */
2078
+ parameterNamesToIgnore?: string[];
2105
2079
  }
2106
2080
 
2107
2081
  /**
@@ -2303,6 +2277,10 @@ export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBas
2303
2277
  * {@inheritDoc PnpmOptionsConfiguration.pnpmLockfilePolicies}
2304
2278
  */
2305
2279
  pnpmLockfilePolicies?: IPnpmLockfilePolicies;
2280
+ /**
2281
+ * {@inheritDoc PnpmOptionsConfiguration.globalCatalogs}
2282
+ */
2283
+ globalCatalogs?: Record<string, Record<string, string>>;
2306
2284
  }
2307
2285
 
2308
2286
  /**
@@ -3569,6 +3547,15 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
3569
3547
  * The default value is false.
3570
3548
  */
3571
3549
  readonly alwaysFullInstall: boolean | undefined;
3550
+ /**
3551
+ * The `globalCatalogs` setting provides named catalogs for organizing dependency versions.
3552
+ * Each catalog can be referenced using the `catalog:catalogName` protocol in package.json files
3553
+ * (e.g., `catalog:react18`). The settings are written to the `catalogs` field of the
3554
+ * `pnpm-workspace.yaml` file that is generated by Rush during installation.
3555
+ *
3556
+ * PNPM documentation: https://pnpm.io/catalogs
3557
+ */
3558
+ readonly globalCatalogs: Record<string, Record<string, string>> | undefined;
3572
3559
  /**
3573
3560
  * (GENERATED BY RUSH-PNPM PATCH-COMMIT) When modifying this property, make sure you know what you are doing.
3574
3561
  *
@@ -3650,6 +3637,7 @@ export declare class RepoStateFile {
3650
3637
  private _pnpmShrinkwrapHash;
3651
3638
  private _preferredVersionsHash;
3652
3639
  private _packageJsonInjectedDependenciesHash;
3640
+ private _pnpmCatalogsHash;
3653
3641
  private _isValid;
3654
3642
  private _modified;
3655
3643
  /**
@@ -3669,6 +3657,10 @@ export declare class RepoStateFile {
3669
3657
  * The hash of all preferred versions at the end of the last update.
3670
3658
  */
3671
3659
  get packageJsonInjectedDependenciesHash(): string | undefined;
3660
+ /**
3661
+ * The hash of the PNPM catalog definitions at the end of the last update.
3662
+ */
3663
+ get pnpmCatalogsHash(): string | undefined;
3672
3664
  /**
3673
3665
  * If false, the repo-state.json file is not valid and its values cannot be relied upon
3674
3666
  */
@@ -5125,6 +5117,11 @@ export declare class Subspace {
5125
5117
  contains(project: RushConfigurationProject): boolean;
5126
5118
  /** @internal */
5127
5119
  _addProject(project: RushConfigurationProject): void;
5120
+ /**
5121
+ * Computes a hash of the PNPM catalog definitions for this subspace.
5122
+ * Returns undefined if no catalogs are defined.
5123
+ */
5124
+ getPnpmCatalogsHash(): string | undefined;
5128
5125
  /**
5129
5126
  * Returns hash value of injected dependencies in related package.json.
5130
5127
  * @beta
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.53.1"
8
+ "packageVersion": "7.55.2"
9
9
  }
10
10
  ]
11
11
  }
@@ -117,6 +117,13 @@ export interface IOperationSettings {
117
117
  * If true, this operation will never be skipped by the `--changed-projects-only` flag.
118
118
  */
119
119
  ignoreChangedProjectsOnlyFlag?: boolean;
120
+ /**
121
+ * An optional list of custom command-line parameter names (their `parameterLongName` values from
122
+ * command-line.json) that should be ignored when invoking the command for this operation.
123
+ * This allows a project to opt out of parameters that don't affect its operation, preventing
124
+ * unnecessary cache invalidation for this operation and its consumers.
125
+ */
126
+ parameterNamesToIgnore?: string[];
120
127
  }
121
128
  /**
122
129
  * Use this class to load the "config/rush-project.json" config file.
@@ -168,6 +168,11 @@ export declare class Subspace {
168
168
  contains(project: RushConfigurationProject): boolean;
169
169
  /** @internal */
170
170
  _addProject(project: RushConfigurationProject): void;
171
+ /**
172
+ * Computes a hash of the PNPM catalog definitions for this subspace.
173
+ * Returns undefined if no catalogs are defined.
174
+ */
175
+ getPnpmCatalogsHash(): string | undefined;
171
176
  /**
172
177
  * Returns hash value of injected dependencies in related package.json.
173
178
  * @beta
@@ -27,6 +27,10 @@ export declare class RushCommandLineParser extends CommandLineParser {
27
27
  private readonly _terminalProvider;
28
28
  private readonly _terminal;
29
29
  private readonly _autocreateBuildCommand;
30
+ /**
31
+ * The current working directory that was used to find the Rush configuration.
32
+ */
33
+ get cwd(): string;
30
34
  constructor(options?: Partial<IRushCommandLineParserOptions>);
31
35
  get isDebug(): boolean;
32
36
  get isQuiet(): boolean;
@@ -34,6 +34,10 @@ export interface IJsonEntry {
34
34
  * @see {@link ../../api/RushConfigurationProject#RushConfigurationProject.tags | RushConfigurationProject.tags}
35
35
  */
36
36
  tags: string[];
37
+ /**
38
+ * @see {@link ../../api/Subspace#Subspace.subspaceName | Subspace.subspaceName}
39
+ */
40
+ subspaceName: string | undefined;
37
41
  }
38
42
  export interface IJsonOutput {
39
43
  projects: IJsonEntry[];
@@ -7,6 +7,11 @@ export declare const SUBSPACE_LONG_ARG_NAME: '--subspace';
7
7
  interface ISelectionParameterSetOptions {
8
8
  gitOptions: IGitSelectorParserOptions;
9
9
  includeSubspaceSelector: boolean;
10
+ /**
11
+ * The working directory used to resolve relative paths.
12
+ * This should be the same directory that was used to find the Rush configuration.
13
+ */
14
+ cwd: string;
10
15
  }
11
16
  /**
12
17
  * This class is provides the set of command line parameters used to select projects
@@ -0,0 +1,12 @@
1
+ import type { CommandLineParameter } from '@rushstack/ts-command-line';
2
+ import type { IParameterJson, IPhase } from '../../api/CommandLineConfiguration';
3
+ /**
4
+ * Associates command line parameters with their associated phases.
5
+ * This helper is used to populate the `associatedParameters` set on each phase
6
+ * based on the `associatedPhases` property of each parameter.
7
+ *
8
+ * @param customParameters - Map of parameter definitions to their CommandLineParameter instances
9
+ * @param knownPhases - Map of phase names to IPhase objects
10
+ */
11
+ export declare function associateParametersByPhase(customParameters: ReadonlyMap<IParameterJson, CommandLineParameter>, knownPhases: ReadonlyMap<string, IPhase>): void;
12
+ //# sourceMappingURL=associateParametersByPhase.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("cli/parsing/associateParametersByPhase");
@@ -0,0 +1,12 @@
1
+ import type { CommandLineAction, CommandLineParameter } from '@rushstack/ts-command-line';
2
+ import type { IParameterJson } from '../../api/CommandLineConfiguration';
3
+ /**
4
+ * Helper function to create CommandLineParameter instances from parameter definitions.
5
+ * This centralizes the logic for defining parameters based on their kind.
6
+ *
7
+ * @param action - The CommandLineAction to define the parameters on
8
+ * @param associatedParameters - The set of parameter definitions
9
+ * @param targetMap - The map to populate with parameter definitions to CommandLineParameter instances
10
+ */
11
+ export declare function defineCustomParameters(action: CommandLineAction, associatedParameters: Iterable<IParameterJson>, targetMap: Map<IParameterJson, CommandLineParameter>): void;
12
+ //# sourceMappingURL=defineCustomParameters.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("cli/parsing/defineCustomParameters");
package/lib/index.d.ts CHANGED
@@ -4,6 +4,7 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  export { LookupByPath as LookupByPath, type IPrefixMatch } from '@rushstack/lookup-by-path';
7
+ export { type ICredentialCacheOptions, type ICredentialCacheEntry, CredentialCache } from '@rushstack/credential-cache';
7
8
  export { ApprovedPackagesPolicy } from './api/ApprovedPackagesPolicy';
8
9
  export { RushConfiguration, type ITryFindRushJsonLocationOptions } from './api/RushConfiguration';
9
10
  export { Subspace } from './api/Subspace';
@@ -53,7 +54,6 @@ export type { IRushPluginConfigurationBase as _IRushPluginConfigurationBase } fr
53
54
  export type { ILogger } from './pluginFramework/logging/Logger';
54
55
  export type { ICloudBuildCacheProvider } from './logic/buildCache/ICloudBuildCacheProvider';
55
56
  export type { ICobuildLockProvider, ICobuildContext, ICobuildCompletedState } from './logic/cobuild/ICobuildLockProvider';
56
- export { type ICredentialCacheOptions, type ICredentialCacheEntry, CredentialCache } from './logic/CredentialCache';
57
57
  export type { ITelemetryData, ITelemetryMachineInfo, ITelemetryOperationResult } from './logic/Telemetry';
58
58
  export type { IStopwatchResult } from './utilities/Stopwatch';
59
59
  export { OperationStateFile as _OperationStateFile, type IOperationStateFileOptions as _IOperationStateFileOptions, type IOperationStateJson as _IOperationStateJson } from './logic/operations/OperationStateFile';
@@ -37,7 +37,11 @@ export declare enum DependencySpecifierType {
37
37
  /**
38
38
  * A package specified using workspace protocol, e.g. "workspace:^1.2.3"
39
39
  */
40
- Workspace = "Workspace"
40
+ Workspace = "Workspace",
41
+ /**
42
+ * A package specified using catalog protocol, e.g. "catalog:" or "catalog:react18"
43
+ */
44
+ Catalog = "Catalog"
41
45
  }
42
46
  /**
43
47
  * An NPM "version specifier" is a string that can appear as a package.json "dependencies" value.
@@ -11,6 +11,7 @@ export declare class RepoStateFile {
11
11
  private _pnpmShrinkwrapHash;
12
12
  private _preferredVersionsHash;
13
13
  private _packageJsonInjectedDependenciesHash;
14
+ private _pnpmCatalogsHash;
14
15
  private _isValid;
15
16
  private _modified;
16
17
  /**
@@ -30,6 +31,10 @@ export declare class RepoStateFile {
30
31
  * The hash of all preferred versions at the end of the last update.
31
32
  */
32
33
  get packageJsonInjectedDependenciesHash(): string | undefined;
34
+ /**
35
+ * The hash of the PNPM catalog definitions at the end of the last update.
36
+ */
37
+ get pnpmCatalogsHash(): string | undefined;
33
38
  /**
34
39
  * If false, the repo-state.json file is not valid and its values cannot be relied upon
35
40
  */
@@ -11,6 +11,7 @@ export interface IIPCOperationRunnerOptions {
11
11
  commandForHash: string;
12
12
  persist: boolean;
13
13
  requestRun: OperationRequestRunCallback;
14
+ ignoredParameterValues: ReadonlyArray<string>;
14
15
  }
15
16
  /**
16
17
  * Runner that hosts a long-lived process to which it communicates via IPC.
@@ -26,6 +27,7 @@ export declare class IPCOperationRunner implements IOperationRunner {
26
27
  private readonly _commandForHash;
27
28
  private readonly _persist;
28
29
  private readonly _requestRun;
30
+ private readonly _ignoredParameterValues;
29
31
  private _ipcProcess;
30
32
  private _processReadyPromise;
31
33
  constructor(options: IIPCOperationRunnerOptions);
@@ -8,6 +8,7 @@ export interface IShellOperationRunnerOptions {
8
8
  displayName: string;
9
9
  commandToRun: string;
10
10
  commandForHash: string;
11
+ ignoredParameterValues: ReadonlyArray<string>;
11
12
  }
12
13
  /**
13
14
  * An `IOperationRunner` implementation that performs an operation via a shell command.
@@ -27,6 +28,7 @@ export declare class ShellOperationRunner implements IOperationRunner {
27
28
  readonly isNoOp: boolean;
28
29
  private readonly _commandForHash;
29
30
  private readonly _rushProject;
31
+ private readonly _ignoredParameterValues;
30
32
  constructor(options: IShellOperationRunnerOptions);
31
33
  executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
32
34
  getConfigHash(): string;
@@ -1,6 +1,7 @@
1
1
  import type { IPhase } from '../../api/CommandLineConfiguration';
2
2
  import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
3
3
  import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
4
+ import type { Operation } from './Operation';
4
5
  import type { RushConfiguration } from '../../api/RushConfiguration';
5
6
  import type { IOperationRunner } from './IOperationRunner';
6
7
  export declare const PLUGIN_NAME: 'ShellOperationRunnerPlugin';
@@ -18,12 +19,32 @@ export declare function initializeShellOperationRunner(options: {
18
19
  commandToRun: string | undefined;
19
20
  commandForHash?: string;
20
21
  customParameterValues: ReadonlyArray<string>;
22
+ ignoredParameterValues: ReadonlyArray<string>;
21
23
  }): IOperationRunner;
24
+ /**
25
+ * Result of filtering custom parameters for an operation
26
+ */
27
+ export interface ICustomParameterValuesForOperation {
28
+ /**
29
+ * The serialized custom parameter values that should be included in the command
30
+ */
31
+ parameterValues: ReadonlyArray<string>;
32
+ /**
33
+ * The serialized custom parameter values that were ignored for this operation
34
+ */
35
+ ignoredParameterValues: ReadonlyArray<string>;
36
+ }
22
37
  /**
23
38
  * Memoizer for custom parameter values by phase
24
39
  * @returns A function that returns the custom parameter values for a given phase
25
40
  */
26
41
  export declare function getCustomParameterValuesByPhase(): (phase: IPhase) => ReadonlyArray<string>;
42
+ /**
43
+ * Gets custom parameter values for an operation, filtering out any parameters that should be ignored
44
+ * based on the operation's settings.
45
+ * @returns A function that returns the filtered custom parameter values and ignored parameter values for a given operation
46
+ */
47
+ export declare function getCustomParameterValuesByOperation(): (operation: Operation) => ICustomParameterValuesForOperation;
27
48
  export declare function formatCommand(rawCommand: string, customParameterValues: ReadonlyArray<string>): string;
28
49
  export declare function getDisplayName(phase: IPhase, project: RushConfigurationProject): string;
29
50
  //# sourceMappingURL=ShellOperationRunnerPlugin.d.ts.map
@@ -138,6 +138,10 @@ export interface IPnpmOptionsJson extends IPackageManagerOptionsJsonBase {
138
138
  * {@inheritDoc PnpmOptionsConfiguration.pnpmLockfilePolicies}
139
139
  */
140
140
  pnpmLockfilePolicies?: IPnpmLockfilePolicies;
141
+ /**
142
+ * {@inheritDoc PnpmOptionsConfiguration.globalCatalogs}
143
+ */
144
+ globalCatalogs?: Record<string, Record<string, string>>;
141
145
  }
142
146
  /**
143
147
  * Options that are only used when the PNPM package manager is selected.
@@ -378,6 +382,15 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
378
382
  * The default value is false.
379
383
  */
380
384
  readonly alwaysFullInstall: boolean | undefined;
385
+ /**
386
+ * The `globalCatalogs` setting provides named catalogs for organizing dependency versions.
387
+ * Each catalog can be referenced using the `catalog:catalogName` protocol in package.json files
388
+ * (e.g., `catalog:react18`). The settings are written to the `catalogs` field of the
389
+ * `pnpm-workspace.yaml` file that is generated by Rush during installation.
390
+ *
391
+ * PNPM documentation: https://pnpm.io/catalogs
392
+ */
393
+ readonly globalCatalogs: Record<string, Record<string, string>> | undefined;
381
394
  /**
382
395
  * (GENERATED BY RUSH-PNPM PATCH-COMMIT) When modifying this property, make sure you know what you are doing.
383
396
  *
@@ -5,11 +5,17 @@ export declare class PnpmWorkspaceFile extends BaseWorkspaceFile {
5
5
  */
6
6
  readonly workspaceFilename: string;
7
7
  private _workspacePackages;
8
+ private _catalogs;
8
9
  /**
9
10
  * The PNPM workspace file is used to specify the location of workspaces relative to the root
10
11
  * of your PNPM install.
11
12
  */
12
13
  constructor(workspaceYamlFilename: string);
14
+ /**
15
+ * Sets the catalog definitions for the workspace.
16
+ * @param catalogs - A map of catalog name to package versions
17
+ */
18
+ setCatalogs(catalogs: Record<string, Record<string, string>> | undefined): void;
13
19
  /** @override */
14
20
  addPackage(packagePath: string): void;
15
21
  /** @override */
@@ -0,0 +1,11 @@
1
+ import type { RushConfiguration } from '../../api/RushConfiguration';
2
+ import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
3
+ import type { IEvaluateSelectorOptions, ISelectorParser } from './ISelectorParser';
4
+ export declare class PathProjectSelectorParser implements ISelectorParser<RushConfigurationProject> {
5
+ private readonly _rushConfiguration;
6
+ private readonly _workingDirectory;
7
+ constructor(rushConfiguration: RushConfiguration, workingDirectory: string);
8
+ evaluateSelectorAsync({ unscopedSelector, terminal, parameterName }: IEvaluateSelectorOptions): Promise<Iterable<RushConfigurationProject>>;
9
+ getCompletions(): Iterable<string>;
10
+ }
11
+ //# sourceMappingURL=PathProjectSelectorParser.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/selectors/PathProjectSelectorParser");
@@ -1,7 +1,3 @@
1
- /**
2
- * Determines if two objects are deeply equal.
3
- */
4
- export declare function objectsAreDeepEqual<TObject>(a: TObject, b: TObject): boolean;
5
1
  export declare function cloneDeep<TObject>(obj: TObject): TObject;
6
2
  export declare function merge<TBase extends object, TOther>(base: TBase, other: TOther): (TBase & TOther) | TOther;
7
3
  /**