@rushstack/rush-sdk 5.148.0 → 5.149.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.
@@ -24,6 +24,7 @@ import { LookupByPath } from '@rushstack/lookup-by-path';
24
24
  import { PackageNameParser } from '@rushstack/node-core-library';
25
25
  import type { StdioSummarizer } from '@rushstack/terminal';
26
26
  import { SyncHook } from 'tapable';
27
+ import { SyncWaterfallHook } from 'tapable';
27
28
  import { Terminal } from '@rushstack/terminal';
28
29
 
29
30
  /**
@@ -1910,6 +1911,11 @@ export declare interface IOperationRunnerContext {
1910
1911
  * 'failure'.
1911
1912
  */
1912
1913
  status: OperationStatus;
1914
+ /**
1915
+ * The environment in which the operation is being executed.
1916
+ * A return value of `undefined` indicates that it should inherit the environment from the parent process.
1917
+ */
1918
+ environment: IEnvironment | undefined;
1913
1919
  /**
1914
1920
  * Error which occurred while executing this operation, this is stored in case we need
1915
1921
  * it later (for example to re-print errors at end of execution).
@@ -3096,6 +3102,14 @@ export declare class PhasedCommandHooks {
3096
3102
  readonly beforeExecuteOperation: AsyncSeriesBailHook<[
3097
3103
  IOperationRunnerContext & IOperationExecutionResult
3098
3104
  ], OperationStatus | undefined>;
3105
+ /**
3106
+ * Hook invoked to define environment variables for an operation.
3107
+ * May be invoked by the runner to get the environment for the operation.
3108
+ */
3109
+ readonly createEnvironmentForOperation: SyncWaterfallHook<[
3110
+ IEnvironment,
3111
+ IOperationRunnerContext & IOperationExecutionResult
3112
+ ]>;
3099
3113
  /**
3100
3114
  * Hook invoked after executing a operation.
3101
3115
  */
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.49.1"
8
+ "packageVersion": "7.50.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -53,6 +53,7 @@ export declare class PhasedScriptAction extends BaseScriptAction<IPhasedCommandC
53
53
  private readonly _installParameter;
54
54
  private readonly _variantParameter;
55
55
  private readonly _noIPCParameter;
56
+ private readonly _nodeDiagnosticDirParameter;
56
57
  constructor(options: IPhasedScriptActionOptions);
57
58
  runAsync(): Promise<void>;
58
59
  private _runInitialPhasesAsync;
@@ -3,6 +3,7 @@ import type { CollatedWriter } from '@rushstack/stream-collator';
3
3
  import type { OperationStatus } from './OperationStatus';
4
4
  import type { OperationMetadataManager } from './OperationMetadataManager';
5
5
  import type { IStopwatchResult } from '../../utilities/Stopwatch';
6
+ import type { IEnvironment } from '../../utilities/Utilities';
6
7
  /**
7
8
  * Information passed to the executing `IOperationRunner`
8
9
  *
@@ -38,6 +39,11 @@ export interface IOperationRunnerContext {
38
39
  * 'failure'.
39
40
  */
40
41
  status: OperationStatus;
42
+ /**
43
+ * The environment in which the operation is being executed.
44
+ * A return value of `undefined` indicates that it should inherit the environment from the parent process.
45
+ */
46
+ environment: IEnvironment | undefined;
41
47
  /**
42
48
  * Error which occurred while executing this operation, this is stored in case we need
43
49
  * it later (for example to re-print errors at end of execution).
@@ -6,7 +6,8 @@ export interface IIPCOperationRunnerOptions {
6
6
  phase: IPhase;
7
7
  project: RushConfigurationProject;
8
8
  name: string;
9
- shellCommand: string;
9
+ commandToRun: string;
10
+ commandForHash: string;
10
11
  persist: boolean;
11
12
  requestRun: (requestor?: string) => void;
12
13
  }
@@ -19,9 +20,9 @@ export declare class IPCOperationRunner implements IOperationRunner {
19
20
  readonly reportTiming: boolean;
20
21
  readonly silent: boolean;
21
22
  readonly warningsAreAllowed: boolean;
22
- private readonly _rushConfiguration;
23
- private readonly _shellCommand;
24
- private readonly _workingDirectory;
23
+ private readonly _rushProject;
24
+ private readonly _commandToRun;
25
+ private readonly _commandForHash;
25
26
  private readonly _persist;
26
27
  private readonly _requestRun;
27
28
  private _ipcProcess;
@@ -0,0 +1,13 @@
1
+ import type { IPhasedCommandPlugin, PhasedCommandHooks } from '../../pluginFramework/PhasedCommandHooks';
2
+ export interface INodeDiagnosticDirPluginOptions {
3
+ diagnosticDir: string;
4
+ }
5
+ /**
6
+ * Phased command plugin that configures the NodeJS --diagnostic-dir option to contain the project and phase name.
7
+ */
8
+ export declare class NodeDiagnosticDirPlugin implements IPhasedCommandPlugin {
9
+ private readonly _diagnosticsDir;
10
+ constructor(options: INodeDiagnosticDirPluginOptions);
11
+ apply(hooks: PhasedCommandHooks): void;
12
+ }
13
+ //# sourceMappingURL=NodeDiagnosticDirPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ module.exports = require("../../../lib-shim/index")._rushSdk_loadInternalModule("logic/operations/NodeDiagnosticDirPlugin");
@@ -3,6 +3,7 @@ import type { Operation } from './Operation';
3
3
  import { OperationStatus } from './OperationStatus';
4
4
  import { OperationExecutionRecord } from './OperationExecutionRecord';
5
5
  import type { IExecutionResult } from './IOperationExecutionResult';
6
+ import type { IEnvironment } from '../../utilities/Utilities';
6
7
  export interface IOperationExecutionManagerOptions {
7
8
  quietMode: boolean;
8
9
  debugMode: boolean;
@@ -11,6 +12,7 @@ export interface IOperationExecutionManagerOptions {
11
12
  destination?: TerminalWritable;
12
13
  beforeExecuteOperationAsync?: (operation: OperationExecutionRecord) => Promise<OperationStatus | undefined>;
13
14
  afterExecuteOperationAsync?: (operation: OperationExecutionRecord) => Promise<void>;
15
+ createEnvironmentForOperation?: (operation: OperationExecutionRecord) => IEnvironment;
14
16
  onOperationStatusChangedAsync?: (record: OperationExecutionRecord) => void;
15
17
  beforeExecuteOperationsAsync?: (records: Map<Operation, OperationExecutionRecord>) => Promise<void>;
16
18
  }
@@ -34,6 +36,7 @@ export declare class OperationExecutionManager {
34
36
  private readonly _afterExecuteOperation?;
35
37
  private readonly _onOperationStatusChanged?;
36
38
  private readonly _beforeExecuteOperations?;
39
+ private readonly _createEnvironmentForOperation?;
37
40
  private _hasAnyFailures;
38
41
  private _hasAnyNonAllowedWarnings;
39
42
  private _completedOperations;
@@ -11,9 +11,11 @@ import { type ILogFilePaths } from './ProjectLogWritable';
11
11
  import type { IOperationExecutionResult } from './IOperationExecutionResult';
12
12
  import type { IInputsSnapshot } from '../incremental/InputsSnapshot';
13
13
  import type { BuildCacheConfiguration } from '../../api/BuildCacheConfiguration';
14
+ import type { IEnvironment } from '../../utilities/Utilities';
14
15
  export interface IOperationExecutionRecordContext {
15
16
  streamCollator: StreamCollator;
16
17
  onOperationStatusChanged?: (record: OperationExecutionRecord) => void;
18
+ createEnvironment?: (record: OperationExecutionRecord) => IEnvironment;
17
19
  debugMode: boolean;
18
20
  quietMode: boolean;
19
21
  }
@@ -91,6 +93,7 @@ export declare class OperationExecutionRecord implements IOperationRunnerContext
91
93
  get collatedWriter(): CollatedWriter;
92
94
  get nonCachedDurationMs(): number | undefined;
93
95
  get cobuildRunnerId(): string | undefined;
96
+ get environment(): IEnvironment | undefined;
94
97
  get metadataFolderPath(): string | undefined;
95
98
  get isTerminal(): boolean;
96
99
  /**
@@ -1,17 +1,13 @@
1
1
  import type { IPhase } from '../../api/CommandLineConfiguration';
2
- import type { RushConfiguration } from '../../api/RushConfiguration';
3
2
  import type { RushConfigurationProject } from '../../api/RushConfigurationProject';
4
- import { type IEnvironment } from '../../utilities/Utilities';
5
3
  import type { IOperationRunner, IOperationRunnerContext } from './IOperationRunner';
6
4
  import { OperationStatus } from './OperationStatus';
7
- export interface IOperationRunnerOptions {
5
+ export interface IShellOperationRunnerOptions {
6
+ phase: IPhase;
8
7
  rushProject: RushConfigurationProject;
9
- rushConfiguration: RushConfiguration;
8
+ displayName: string;
10
9
  commandToRun: string;
11
10
  commandForHash: string;
12
- displayName: string;
13
- phase: IPhase;
14
- environment?: IEnvironment;
15
11
  }
16
12
  /**
17
13
  * An `IOperationRunner` subclass that performs an operation via a shell command.
@@ -24,12 +20,10 @@ export declare class ShellOperationRunner implements IOperationRunner {
24
20
  readonly silent: boolean;
25
21
  readonly cacheable: boolean;
26
22
  readonly warningsAreAllowed: boolean;
27
- private readonly _commandToRun;
23
+ readonly commandToRun: string;
28
24
  private readonly _commandForHash;
29
25
  private readonly _rushProject;
30
- private readonly _rushConfiguration;
31
- private readonly _environment?;
32
- constructor(options: IOperationRunnerOptions);
26
+ constructor(options: IShellOperationRunnerOptions);
33
27
  executeAsync(context: IOperationRunnerContext): Promise<OperationStatus>;
34
28
  getConfigHash(): string;
35
29
  private _executeAsync;
@@ -1,4 +1,4 @@
1
- import { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, AsyncSeriesWaterfallHook, SyncHook } from 'tapable';
1
+ import { AsyncParallelHook, AsyncSeriesBailHook, AsyncSeriesHook, AsyncSeriesWaterfallHook, SyncHook, SyncWaterfallHook } from 'tapable';
2
2
  import type { CommandLineParameter } from '@rushstack/ts-command-line';
3
3
  import type { BuildCacheConfiguration } from '../api/BuildCacheConfiguration';
4
4
  import type { IPhase } from '../api/CommandLineConfiguration';
@@ -12,6 +12,7 @@ import type { IOperationRunnerContext } from '../logic/operations/IOperationRunn
12
12
  import type { ITelemetryData } from '../logic/Telemetry';
13
13
  import type { OperationStatus } from '../logic/operations/OperationStatus';
14
14
  import type { IInputsSnapshot } from '../logic/incremental/InputsSnapshot';
15
+ import type { IEnvironment } from '../utilities/Utilities';
15
16
  /**
16
17
  * A plugin that interacts with a phased commands.
17
18
  * @alpha
@@ -132,6 +133,14 @@ export declare class PhasedCommandHooks {
132
133
  readonly beforeExecuteOperation: AsyncSeriesBailHook<[
133
134
  IOperationRunnerContext & IOperationExecutionResult
134
135
  ], OperationStatus | undefined>;
136
+ /**
137
+ * Hook invoked to define environment variables for an operation.
138
+ * May be invoked by the runner to get the environment for the operation.
139
+ */
140
+ readonly createEnvironmentForOperation: SyncWaterfallHook<[
141
+ IEnvironment,
142
+ IOperationRunnerContext & IOperationExecutionResult
143
+ ]>;
135
144
  /**
136
145
  * Hook invoked after executing a operation.
137
146
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/rush-sdk",
3
- "version": "5.148.0",
3
+ "version": "5.149.0",
4
4
  "description": "An API for interacting with the Rush engine",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,22 +35,22 @@
35
35
  "dependencies": {
36
36
  "@pnpm/lockfile.types": "~1.0.3",
37
37
  "tapable": "2.2.1",
38
- "@rushstack/lookup-by-path": "0.5.2",
39
- "@rushstack/node-core-library": "5.10.2",
40
- "@rushstack/package-deps-hash": "4.3.3",
41
- "@rushstack/terminal": "0.14.5"
38
+ "@rushstack/lookup-by-path": "0.5.5",
39
+ "@rushstack/package-deps-hash": "4.3.6",
40
+ "@rushstack/terminal": "0.15.0",
41
+ "@rushstack/node-core-library": "5.11.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/semver": "7.5.0",
45
45
  "@types/webpack-env": "1.18.0",
46
46
  "webpack": "~5.95.0",
47
- "@microsoft/rush-lib": "5.148.0",
48
- "@rushstack/heft": "0.68.13",
49
- "@rushstack/heft-webpack5-plugin": "0.11.11",
50
- "@rushstack/stream-collator": "4.1.81",
47
+ "@microsoft/rush-lib": "5.149.0",
48
+ "@rushstack/heft": "0.68.16",
51
49
  "local-node-rig": "1.0.0",
52
- "@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.80",
53
- "@rushstack/ts-command-line": "4.23.3"
50
+ "@rushstack/heft-webpack5-plugin": "0.11.14",
51
+ "@rushstack/ts-command-line": "4.23.5",
52
+ "@rushstack/stream-collator": "4.1.84",
53
+ "@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.83"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "heft build --clean",