@rushstack/rush-sdk 5.158.1 → 5.160.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.
@@ -16,6 +16,7 @@ import { HookMap } from 'tapable';
16
16
  import { IFileDiffStatus } from '@rushstack/package-deps-hash';
17
17
  import { IPackageJson } from '@rushstack/node-core-library';
18
18
  import { IPrefixMatch } from '@rushstack/lookup-by-path';
19
+ import type { IProblemCollector } from '@rushstack/terminal';
19
20
  import { ITerminal } from '@rushstack/terminal';
20
21
  import { ITerminalProvider } from '@rushstack/terminal';
21
22
  import { JsonNull } from '@rushstack/node-core-library';
@@ -1428,6 +1429,10 @@ export declare interface IExecuteOperationsContext extends ICreateOperationsCont
1428
1429
  * Not part of the creation context to avoid the overhead of Git calls when initializing the graph.
1429
1430
  */
1430
1431
  readonly inputsSnapshot?: IInputsSnapshot;
1432
+ /**
1433
+ * An abort controller that can be used to abort the current set of queued operations.
1434
+ */
1435
+ readonly abortController: AbortController;
1431
1436
  }
1432
1437
 
1433
1438
  /**
@@ -1855,6 +1860,10 @@ export declare interface IOperationExecutionResult {
1855
1860
  * Object used to report a summary at the end of the Rush invocation.
1856
1861
  */
1857
1862
  readonly stdioSummarizer: StdioSummarizer;
1863
+ /**
1864
+ * Object used to collect problems (errors/warnings/info) encountered during the operation.
1865
+ */
1866
+ readonly problemCollector: IProblemCollector;
1858
1867
  /**
1859
1868
  * The value indicates the duration of the same operation without cache hit.
1860
1869
  */
@@ -2189,6 +2198,12 @@ export declare interface IPhasedCommand extends IRushCommand {
2189
2198
  * @alpha
2190
2199
  */
2191
2200
  readonly hooks: PhasedCommandHooks;
2201
+ /**
2202
+ * An abort controller that can be used to abort the command.
2203
+ * Long-lived plugins should listen to the signal to handle any cleanup logic.
2204
+ * @alpha
2205
+ */
2206
+ readonly sessionAbortController: AbortController;
2192
2207
  }
2193
2208
 
2194
2209
  /**
@@ -2210,6 +2225,7 @@ export declare interface IPnpmLockfilePolicies {
2210
2225
  * @internal
2211
2226
  */
2212
2227
  export declare interface _IPnpmOptionsJson extends IPackageManagerOptionsJsonBase {
2228
+ $schema?: string;
2213
2229
  /**
2214
2230
  * {@inheritDoc PnpmOptionsConfiguration.pnpmStore}
2215
2231
  */
@@ -3103,7 +3119,11 @@ export declare enum OperationStatus {
3103
3119
  /**
3104
3120
  * The Operation was a no-op (for example, it had an empty script)
3105
3121
  */
3106
- NoOp = "NO OP"
3122
+ NoOp = "NO OP",
3123
+ /**
3124
+ * The Operation was aborted before it could execute.
3125
+ */
3126
+ Aborted = "ABORTED"
3107
3127
  }
3108
3128
 
3109
3129
  /**
@@ -3527,7 +3547,7 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
3527
3547
  get globalPatchedDependencies(): Record<string, string> | undefined;
3528
3548
  private constructor();
3529
3549
  /** @internal */
3530
- static loadFromJsonFileOrThrow(jsonFilename: string, commonTempFolder: string): PnpmOptionsConfiguration;
3550
+ static loadFromJsonFileOrThrow(jsonFilePath: string, commonTempFolder: string): PnpmOptionsConfiguration;
3531
3551
  /** @internal */
3532
3552
  static loadFromJsonObject(json: _IPnpmOptionsJson, commonTempFolder: string): PnpmOptionsConfiguration;
3533
3553
  /**
@@ -4944,7 +4964,10 @@ export declare class Subspace {
4944
4964
  * Returns the full path of the folder containing this subspace's variant-dependent configuration files
4945
4965
  * such as `pnpm-lock.yaml`.
4946
4966
  *
4947
- * Example: `common/config/subspaces/my-subspace` or `common/config/subspaces/my-subspace/variants/my-variant`
4967
+ * Example (variants): `C:\MyRepo\common\config\rush\variants\my-variant`
4968
+ * Example (variants and subspaces): `C:\MyRepo\common\config\subspaces\my-subspace\variants\my-variant`
4969
+ * Example (subspaces): `C:\MyRepo\common\config\subspaces\my-subspace`
4970
+ * Example (neither): `C:\MyRepo\common\config\rush`
4948
4971
  * @beta
4949
4972
  *
4950
4973
  * @remarks
@@ -4957,22 +4980,24 @@ export declare class Subspace {
4957
4980
  /**
4958
4981
  * Returns the full path of the folder containing this subspace's configuration files such as `pnpm-lock.yaml`.
4959
4982
  *
4960
- * Example: `common/config/subspaces/my-subspace`
4983
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace`
4984
+ * Example (subspaces feature disabled): `C:\MyRepo\common\config\rush`
4961
4985
  * @beta
4962
4986
  */
4963
4987
  getSubspaceConfigFolderPath(): string;
4964
4988
  /**
4965
4989
  * Returns the full path of the folder containing this subspace's configuration files such as `pnpm-lock.yaml`.
4966
4990
  *
4967
- * Example: `common/config/subspaces/my-subspace/pnpm-patches` (subspaces feature enabled)
4968
- * Example: `common/config/pnpm-patches` (subspaces feature disabled)
4991
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace\pnpm-patches`
4992
+ * Example (subspaces feature disabled): `C:\MyRepo\common\pnpm-patches`
4969
4993
  * @beta
4970
4994
  */
4971
4995
  getSubspacePnpmPatchesFolderPath(): string;
4972
4996
  /**
4973
- * The folder where the subspace's node_modules and other temporary files will be stored.
4997
+ * The full path of the folder where the subspace's node_modules and other temporary files will be stored.
4974
4998
  *
4975
- * Example: `common/temp/subspaces/my-subspace`
4999
+ * Example (subspaces feature enabled): `C:\MyRepo\common\temp\subspaces\my-subspace`
5000
+ * Example (subspaces feature disabled): `C:\MyRepo\common\temp`
4976
5001
  * @beta
4977
5002
  */
4978
5003
  getSubspaceTempFolderPath(): string;
@@ -5004,16 +5029,18 @@ export declare class Subspace {
5004
5029
  */
5005
5030
  getTempShrinkwrapPreinstallFilePath(): string;
5006
5031
  /**
5007
- * Gets the path to the common-versions.json config file for this subspace.
5032
+ * Gets the full path to the common-versions.json config file for this subspace.
5008
5033
  *
5009
- * Example: `C:\MyRepo\common\subspaces\my-subspace\common-versions.json`
5034
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace\common-versions.json`
5035
+ * Example (subspaces feature disabled): `C:\MyRepo\common\config\rush\common-versions.json`
5010
5036
  * @beta
5011
5037
  */
5012
5038
  getCommonVersionsFilePath(variant?: string): string;
5013
5039
  /**
5014
- * Gets the path to the pnpm-config.json config file for this subspace.
5040
+ * Gets the full path to the pnpm-config.json config file for this subspace.
5015
5041
  *
5016
- * Example: `C:\MyRepo\common\subspaces\my-subspace\pnpm-config.json`
5042
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace\pnpm-config.json`
5043
+ * Example (subspaces feature disabled): `C:\MyRepo\common\config\rush\pnpm-config.json`
5017
5044
  * @beta
5018
5045
  */
5019
5046
  getPnpmConfigFilePath(): string;
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.11"
8
+ "packageVersion": "7.52.15"
9
9
  }
10
10
  ]
11
11
  }
@@ -41,7 +41,10 @@ export declare class Subspace {
41
41
  * Returns the full path of the folder containing this subspace's variant-dependent configuration files
42
42
  * such as `pnpm-lock.yaml`.
43
43
  *
44
- * Example: `common/config/subspaces/my-subspace` or `common/config/subspaces/my-subspace/variants/my-variant`
44
+ * Example (variants): `C:\MyRepo\common\config\rush\variants\my-variant`
45
+ * Example (variants and subspaces): `C:\MyRepo\common\config\subspaces\my-subspace\variants\my-variant`
46
+ * Example (subspaces): `C:\MyRepo\common\config\subspaces\my-subspace`
47
+ * Example (neither): `C:\MyRepo\common\config\rush`
45
48
  * @beta
46
49
  *
47
50
  * @remarks
@@ -54,22 +57,24 @@ export declare class Subspace {
54
57
  /**
55
58
  * Returns the full path of the folder containing this subspace's configuration files such as `pnpm-lock.yaml`.
56
59
  *
57
- * Example: `common/config/subspaces/my-subspace`
60
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace`
61
+ * Example (subspaces feature disabled): `C:\MyRepo\common\config\rush`
58
62
  * @beta
59
63
  */
60
64
  getSubspaceConfigFolderPath(): string;
61
65
  /**
62
66
  * Returns the full path of the folder containing this subspace's configuration files such as `pnpm-lock.yaml`.
63
67
  *
64
- * Example: `common/config/subspaces/my-subspace/pnpm-patches` (subspaces feature enabled)
65
- * Example: `common/config/pnpm-patches` (subspaces feature disabled)
68
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace\pnpm-patches`
69
+ * Example (subspaces feature disabled): `C:\MyRepo\common\pnpm-patches`
66
70
  * @beta
67
71
  */
68
72
  getSubspacePnpmPatchesFolderPath(): string;
69
73
  /**
70
- * The folder where the subspace's node_modules and other temporary files will be stored.
74
+ * The full path of the folder where the subspace's node_modules and other temporary files will be stored.
71
75
  *
72
- * Example: `common/temp/subspaces/my-subspace`
76
+ * Example (subspaces feature enabled): `C:\MyRepo\common\temp\subspaces\my-subspace`
77
+ * Example (subspaces feature disabled): `C:\MyRepo\common\temp`
73
78
  * @beta
74
79
  */
75
80
  getSubspaceTempFolderPath(): string;
@@ -101,16 +106,18 @@ export declare class Subspace {
101
106
  */
102
107
  getTempShrinkwrapPreinstallFilePath(): string;
103
108
  /**
104
- * Gets the path to the common-versions.json config file for this subspace.
109
+ * Gets the full path to the common-versions.json config file for this subspace.
105
110
  *
106
- * Example: `C:\MyRepo\common\subspaces\my-subspace\common-versions.json`
111
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace\common-versions.json`
112
+ * Example (subspaces feature disabled): `C:\MyRepo\common\config\rush\common-versions.json`
107
113
  * @beta
108
114
  */
109
115
  getCommonVersionsFilePath(variant?: string): string;
110
116
  /**
111
- * Gets the path to the pnpm-config.json config file for this subspace.
117
+ * Gets the full path to the pnpm-config.json config file for this subspace.
112
118
  *
113
- * Example: `C:\MyRepo\common\subspaces\my-subspace\pnpm-config.json`
119
+ * Example (subspaces feature enabled): `C:\MyRepo\common\config\subspaces\my-subspace\pnpm-config.json`
120
+ * Example (subspaces feature disabled): `C:\MyRepo\common\config\rush\pnpm-config.json`
114
121
  * @beta
115
122
  */
116
123
  getPnpmConfigFilePath(): string;
@@ -1,3 +1,4 @@
1
+ import type { IPhasedCommand } from '../../pluginFramework/RushLifeCycle';
1
2
  import { PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
2
3
  import { BaseScriptAction, type IBaseScriptActionOptions } from './BaseScriptAction';
3
4
  import type { IPhase, IPhasedCommandConfig } from '../../api/CommandLineConfiguration';
@@ -25,12 +26,13 @@ export interface IPhasedScriptActionOptions extends IBaseScriptActionOptions<IPh
25
26
  * and "rebuild" commands are also modeled as phased commands with a single phase that invokes the npm
26
27
  * "build" script for each project.
27
28
  */
28
- export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandConfig> {
29
+ export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandConfig> implements IPhasedCommand {
29
30
  /**
30
31
  * @internal
31
32
  */
32
33
  _runsBeforeInstall: boolean | undefined;
33
34
  readonly hooks: PhasedCommandHooks;
35
+ readonly sessionAbortController: AbortController;
34
36
  private readonly _enableParallelism;
35
37
  private readonly _isIncrementalBuildAllowed;
36
38
  private readonly _disableBuildCache;
@@ -43,6 +45,7 @@ export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandC
43
45
  private readonly _knownPhases;
44
46
  private readonly _terminal;
45
47
  private _changedProjectsOnly;
48
+ private _executionAbortController;
46
49
  private readonly _changedProjectsOnlyParameter;
47
50
  private readonly _selectionParameters;
48
51
  private readonly _verboseParameter;
@@ -1,5 +1,5 @@
1
- import type { RushConfiguration } from '../api/RushConfiguration';
2
1
  import { type ITerminal } from '@rushstack/terminal';
2
+ import type { RushConfiguration } from '../api/RushConfiguration';
3
3
  /**
4
4
  * Project property configuration
5
5
  */
@@ -30,7 +30,6 @@ export declare class WorkspaceInstallManager extends BaseInstallManager {
30
30
  shrinkwrapIsUpToDate: boolean;
31
31
  shrinkwrapWarnings: string[];
32
32
  }>;
33
- private _getPackageExtensionChecksum;
34
33
  protected canSkipInstallAsync(lastModifiedDate: Date, subspace: Subspace, variant: string | undefined): Promise<boolean>;
35
34
  /**
36
35
  * Runs "pnpm install" in the common folder.
@@ -1,4 +1,4 @@
1
- import type { StdioSummarizer } from '@rushstack/terminal';
1
+ import type { StdioSummarizer, IProblemCollector } from '@rushstack/terminal';
2
2
  import type { OperationStatus } from './OperationStatus';
3
3
  import type { Operation } from './Operation';
4
4
  import type { IStopwatchResult } from '../../utilities/Stopwatch';
@@ -36,6 +36,10 @@ export interface IOperationExecutionResult {
36
36
  * Object used to report a summary at the end of the Rush invocation.
37
37
  */
38
38
  readonly stdioSummarizer: StdioSummarizer;
39
+ /**
40
+ * Object used to collect problems (errors/warnings/info) encountered during the operation.
41
+ */
42
+ readonly problemCollector: IProblemCollector;
39
43
  /**
40
44
  * The value indicates the duration of the same operation without cache hit.
41
45
  */
@@ -1,3 +1,4 @@
1
+ import type { OperationRequestRunCallback } from '@rushstack/operation-graph';
1
2
  import type { IPhase } from '../../api/CommandLineConfiguration';
2
3
  import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
3
4
  import type { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
@@ -9,7 +10,7 @@ export interface IIPCOperationRunnerOptions {
9
10
  commandToRun: string;
10
11
  commandForHash: string;
11
12
  persist: boolean;
12
- requestRun: (requestor?: string) => void;
13
+ requestRun: OperationRequestRunCallback;
13
14
  }
14
15
  /**
15
16
  * Runner that hosts a long-lived process to which it communicates via IPC.
@@ -39,6 +39,7 @@ export declare class OperationExecutionManager {
39
39
  private readonly _createEnvironmentForOperation?;
40
40
  private _hasAnyFailures;
41
41
  private _hasAnyNonAllowedWarnings;
42
+ private _hasAnyAborted;
42
43
  private _completedOperations;
43
44
  private _executionQueue;
44
45
  constructor(operations: Set<Operation>, options: IOperationExecutionManagerOptions);
@@ -47,7 +48,7 @@ export declare class OperationExecutionManager {
47
48
  * Executes all operations which have been registered, returning a promise which is resolved when all the
48
49
  * operations are completed successfully, or rejects when any operation fails.
49
50
  */
50
- executeAsync(): Promise<IExecutionResult>;
51
+ executeAsync(abortController: AbortController): Promise<IExecutionResult>;
51
52
  private _reportOperationErrorIfAny;
52
53
  /**
53
54
  * Handles the result of the operation and propagates any relevant effects.
@@ -1,4 +1,4 @@
1
- import { type ITerminal, type ITerminalProvider, StdioSummarizer } from '@rushstack/terminal';
1
+ import { type ITerminal, type ITerminalProvider, StdioSummarizer, ProblemCollector } from '@rushstack/terminal';
2
2
  import { type CollatedWriter, type StreamCollator } from '@rushstack/stream-collator';
3
3
  import { OperationStatus } from './OperationStatus';
4
4
  import type { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
@@ -79,6 +79,7 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
79
79
  readonly consumers: Set<OperationExecutionRecord>;
80
80
  readonly stopwatch: Stopwatch;
81
81
  readonly stdioSummarizer: StdioSummarizer;
82
+ readonly problemCollector: ProblemCollector;
82
83
  readonly runner: IOperationRunner;
83
84
  readonly associatedPhase: IPhase;
84
85
  readonly associatedProject: RushConfigurationProject;
@@ -46,7 +46,11 @@ export declare enum OperationStatus {
46
46
  /**
47
47
  * The Operation was a no-op (for example, it had an empty script)
48
48
  */
49
- NoOp = "NO OP"
49
+ NoOp = "NO OP",
50
+ /**
51
+ * The Operation was aborted before it could execute.
52
+ */
53
+ Aborted = "ABORTED"
50
54
  }
51
55
  /**
52
56
  * The set of statuses that are considered terminal.
@@ -1,5 +1,5 @@
1
- import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
2
1
  import type { ITerminal } from '@rushstack/terminal';
2
+ import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
3
3
  /**
4
4
  * Core phased command plugin that provides the functionality for generating a base operation graph
5
5
  * from the set of selected projects and phases.
@@ -61,6 +61,7 @@ export interface IPnpmPackageExtension {
61
61
  * @internal
62
62
  */
63
63
  export interface IPnpmOptionsJson extends IPackageManagerOptionsJsonBase {
64
+ $schema?: string;
64
65
  /**
65
66
  * {@inheritDoc PnpmOptionsConfiguration.pnpmStore}
66
67
  */
@@ -356,7 +357,7 @@ export declare class PnpmOptionsConfiguration extends PackageManagerOptionsConfi
356
357
  get globalPatchedDependencies(): Record<string, string> | undefined;
357
358
  private constructor();
358
359
  /** @internal */
359
- static loadFromJsonFileOrThrow(jsonFilename: string, commonTempFolder: string): PnpmOptionsConfiguration;
360
+ static loadFromJsonFileOrThrow(jsonFilePath: string, commonTempFolder: string): PnpmOptionsConfiguration;
360
361
  /** @internal */
361
362
  static loadFromJsonObject(json: IPnpmOptionsJson, commonTempFolder: string): PnpmOptionsConfiguration;
362
363
  /**
@@ -1,3 +1,4 @@
1
+ import type { Lockfile, PackageSnapshot, ProjectSnapshot } from '@pnpm/lockfile.types';
1
2
  import { type ITerminal } from '@rushstack/terminal';
2
3
  import { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile';
3
4
  import { DependencySpecifier } from '../DependencySpecifier';
@@ -8,7 +9,6 @@ import type { RushConfigurationProject } from '../../api/RushConfigurationProjec
8
9
  import { PnpmProjectShrinkwrapFile } from './PnpmProjectShrinkwrapFile';
9
10
  import type { PackageManagerOptionsConfigurationBase } from '../base/BasePackageManagerOptionsConfiguration';
10
11
  import type { Subspace } from '../../api/Subspace';
11
- import type { Lockfile, PackageSnapshot, ProjectSnapshot } from '@pnpm/lockfile.types';
12
12
  export declare enum ShrinkwrapFileMajorVersion {
13
13
  V6 = 6,
14
14
  V9 = 9
@@ -1,4 +1,4 @@
1
- import * as readline from 'readline';
1
+ import * as readline from 'node:readline';
2
2
  export declare class KeyboardLoop {
3
3
  protected stdin: NodeJS.ReadStream;
4
4
  protected stderr: NodeJS.WriteStream;
@@ -114,6 +114,10 @@ export interface IExecuteOperationsContext extends ICreateOperationsContext {
114
114
  * Not part of the creation context to avoid the overhead of Git calls when initializing the graph.
115
115
  */
116
116
  readonly inputsSnapshot?: IInputsSnapshot;
117
+ /**
118
+ * An abort controller that can be used to abort the current set of queued operations.
119
+ */
120
+ readonly abortController: AbortController;
117
121
  }
118
122
  /**
119
123
  * Hooks into the execution process for phased commands
@@ -28,6 +28,12 @@ export interface IPhasedCommand extends IRushCommand {
28
28
  * @alpha
29
29
  */
30
30
  readonly hooks: PhasedCommandHooks;
31
+ /**
32
+ * An abort controller that can be used to abort the command.
33
+ * Long-lived plugins should listen to the signal to handle any cleanup logic.
34
+ * @alpha
35
+ */
36
+ readonly sessionAbortController: AbortController;
31
37
  }
32
38
  /**
33
39
  * Hooks into the lifecycle of the Rush process invocation that plugins may tap into.
@@ -1,5 +1,5 @@
1
- import { type ITerminal } from '@rushstack/terminal';
2
1
  import { type ILogMessageCallbackOptions } from 'pnpm-sync-lib';
2
+ import { type ITerminal } from '@rushstack/terminal';
3
3
  export declare class PnpmSyncUtilities {
4
4
  private static _addLinePrefix;
5
5
  static processLogMessage(options: ILogMessageCallbackOptions, terminal: ITerminal): void;
@@ -1,4 +1,4 @@
1
- import * as child_process from 'child_process';
1
+ import * as child_process from 'node:child_process';
2
2
  import { type IWaitForExitResult } from '@rushstack/node-core-library';
3
3
  import type { RushConfiguration } from '../api/RushConfiguration';
4
4
  import { syncNpmrc } from './npmrcUtilities';