@rushstack/rush-sdk 5.162.0 → 5.163.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
  /**
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.53.1"
8
+ "packageVersion": "7.55.1"
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.
@@ -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';
@@ -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
@@ -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
  /**