Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > PhasedCommandHooks

PhasedCommandHooks class

This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Hooks into the execution process for phased commands

Signature:

export declare class PhasedCommandHooks 

Properties

Property

Modifiers

Type

Description

afterExecuteOperation

readonly

AsyncSeriesHook<[ IOperationRunnerContext & IOperationExecutionResult ]>

(ALPHA) Hook invoked after executing a operation.

afterExecuteOperations

readonly

AsyncSeriesHook<[IExecutionResult, IExecuteOperationsContext]>

(ALPHA) Hook invoked after executing a set of operations. Use the context to distinguish between the initial run and phased runs. Hook is series for stable output.

beforeExecuteOperation

readonly

AsyncSeriesBailHook<[ IOperationRunnerContext & IOperationExecutionResult ], OperationStatus | undefined>

(ALPHA) Hook invoked before executing a operation.

beforeExecuteOperations

readonly

AsyncSeriesHook<[ Map<Operation, IOperationExecutionResult>, IExecuteOperationsContext ]>

(ALPHA) Hook invoked before operation start Hook is series for stable output.

beforeLog

readonly

SyncHook<ITelemetryData, void>

(ALPHA) Hook invoked after executing operations and before waitingForChanges. Allows the caller to augment or modify the log entry about to be written.

createEnvironmentForOperation

readonly

SyncWaterfallHook<[ IEnvironment, IOperationRunnerContext & IOperationExecutionResult ]>

(ALPHA) Hook invoked to define environment variables for an operation. May be invoked by the runner to get the environment for the operation.

createOperations

readonly

AsyncSeriesWaterfallHook<[Set<Operation>, ICreateOperationsContext]>

(ALPHA) Hook invoked to create operations for execution. Use the context to distinguish between the initial run and phased runs.

onOperationStatusChanged

readonly

SyncHook<[IOperationExecutionResult]>

(ALPHA) Hook invoked when operation status changed Hook is series for stable output.

shutdownAsync

readonly

AsyncParallelHook<void>

(ALPHA) Hook invoked to shutdown long-lived work in plugins.

waitingForChanges

readonly

SyncHook<void>

(ALPHA) Hook invoked after a run has finished and the command is watching for changes. May be used to display additional relevant data to the user. Only relevant when running in watch mode.