Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > RushLifecycleHooks

RushLifecycleHooks class

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

Hooks into the lifecycle of the Rush process invocation that plugins may tap into.

Signature:

export declare class RushLifecycleHooks 

Properties

Property

Modifiers

Type

Description

afterInstall

readonly

AsyncSeriesHook<[ command: IRushCommand, subspace: Subspace, variant: string | undefined ]>

(BETA) The hook to run after a successful install.

beforeInstall

readonly

AsyncSeriesHook<[ command: IGlobalCommand, subspace: Subspace, variant: string | undefined ]>

(BETA) The hook to run between preparing the common/temp folder and invoking the package manager during "rush install" or "rush update".

flushTelemetry

readonly

AsyncParallelHook<[ReadonlyArray<ITelemetryData>]>

(BETA) A hook to allow plugins to hook custom logic to process telemetry data.

initialize

readonly

AsyncSeriesHook<IRushCommand>

(BETA) The hook to run before executing any Rush CLI Command.

runAnyGlobalCustomCommand

readonly

AsyncSeriesHook<IGlobalCommand>

(BETA) The hook to run before executing any global Rush CLI Command (defined in command-line.json).

runAnyPhasedCommand

readonly

AsyncSeriesHook<IPhasedCommand>

(BETA) The hook to run before executing any phased Rush CLI Command (defined in command-line.json, or the default "build" or "rebuild").

runGlobalCustomCommand

readonly

HookMap<AsyncSeriesHook<IGlobalCommand>>

(BETA) A hook map to allow plugins to hook specific named global commands (defined in command-line.json) before execution.

runPhasedCommand

readonly

HookMap<AsyncSeriesHook<IPhasedCommand>>

(BETA) A hook map to allow plugins to hook specific named phased commands (defined in command-line.json) before execution.