Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib

rush-lib package

A library for writing scripts that interact with the Rush tool.

Classes

Class

Description

ApprovedPackagesConfiguration

This represents the JSON file specified via the "approvedPackagesFile" option in rush.json.

ApprovedPackagesItem

An item returned by ApprovedPackagesConfiguration

ApprovedPackagesPolicy

This is a helper object for RushConfiguration. It exposes the "approvedPackagesPolicy" feature from rush.json.

BuildCacheConfiguration

(BETA) Use this class to load and save the "common/config/rush/build-cache.json" config file. This file provides configuration options for cached project build output.

ChangeManager

A class that helps with programmatically interacting with Rush's change files.

CobuildConfiguration

(BETA) Use this class to load and save the "common/config/rush/cobuild.json" config file. This file provides configuration options for the Rush Cobuild feature.

CommonVersionsConfiguration

Use this class to load and save the "common/config/rush/common-versions.json" config file. This config file stores dependency version information that affects all projects in the repo.

CustomTipsConfiguration

(BETA) Used to access the common/config/rush/custom-tips.json config file, which allows repo maintainers to configure extra details to be printed alongside certain Rush messages.

EnvironmentConfiguration

(BETA) Provides Rush-specific environment variable data. All Rush environment variables must start with "RUSH_". This class is designed to be used by RushConfiguration.

EventHooks

(BETA) This class represents Rush event hooks configured for this repo. Hooks are customized script actions that Rush executes when specific events occur. The actions are expressed as a command-line that is executed using the operating system shell.

ExperimentsConfiguration

Use this class to load the "common/config/rush/experiments.json" config file. This file allows repo maintainers to enable and disable experimental Rush features.

FileSystemBuildCacheProvider

(BETA) A build cache provider using the local file system. Required by all cloud cache providers.

IndividualVersionPolicy

This policy indicates all related projects get version bump driven by their own changes.

LockStepVersionPolicy

This policy indicates all related projects should use the same version.

NpmOptionsConfiguration

Options that are only used when the NPM package manager is selected.

Operation

(ALPHA) The Operation class is a node in the dependency graph of work that needs to be scheduled by the OperationExecutionManager. Each Operation has a runner member of type IOperationRunner, whose implementation manages the actual process of running a single operation.

The graph of Operation instances will be cloned into a separate execution graph after processing.

PackageJsonDependency

PackageJsonDependencyMeta

PackageJsonEditor

PhasedCommandHooks

(ALPHA) Hooks into the execution process for phased commands

PnpmOptionsConfiguration

Options that are only used when the PNPM package manager is selected. Use this class to load "common/config/rush/pnpm-config.json" file, or, load json from "pnpmOptions" field in "rush.json" for legacy support.

ProjectChangeAnalyzer

(BETA)

RepoStateFile

This file is used to track the state of various Rush-related features. It is generated and updated by Rush.

Rush

General operations for the Rush engine.

RushCommandLine

(BETA) Information about the available CLI commands

RushConfiguration

This represents the Rush configuration for a repository, based on the "rush.json" configuration file.

RushConfigurationProject

This represents the configuration of a project that is built by Rush, based on the Rush.json configuration file.

RushConstants

(BETA) Constants used by the Rush tool.

RushLifecycleHooks

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

RushProjectConfiguration

(ALPHA) Use this class to load the "config/rush-project.json" config file.

This file provides project-specific configuration options.

RushSession

(BETA)

RushUserConfiguration

(BETA) Rush per-user configuration data.

Subspace

This represents the subspace configurations for a repository, based on the "subspaces.json" configuration file.

SubspacesConfiguration

(BETA) This represents the subspace configurations for a repository, based on the "subspaces.json" configuration file.

VersionPolicyConfiguration

Use this class to load and save the "common/config/rush/version-policies.json" config file. This config file configures how different groups of projects will be published by Rush, and how their version numbers will be determined.

YarnOptionsConfiguration

Options that are only used when the yarn package manager is selected.

Abstract Classes

Abstract Class

Description

PackageManager

An abstraction for controlling the supported package managers: PNPM, NPM, and Yarn.

PackageManagerOptionsConfigurationBase

Options that all package managers share.

VersionPolicy

This is the base class for version policy which controls how versions get bumped.

Enumerations

Enumeration

Description

BumpType

Type of version bumps

CustomTipId

(BETA) An identifier representing a Rush message that can be customized by defining a custom tip in common/config/rush/custom-tips.json.

CustomTipSeverity

(BETA) The severity of a custom tip. It determines the printing severity ("Error" = red, "Warning" = yellow, "Info" = normal).

CustomTipType

(BETA) The type of the custom tip.

DependencyType

Event_2

(BETA) Events happen during Rush runs.

OperationStatus

(BETA) Enumeration defining potential states of an operation

VersionPolicyDefinitionName

Version policy base type names

Interfaces

Interface

Description

ICloudBuildCacheProvider

(BETA)

ICobuildCompletedState

(BETA)

ICobuildContext

(BETA)

ICobuildJson

(BETA)

ICobuildLockProvider

(BETA)

IConfigurationEnvironment

A collection of environment variables

IConfigurationEnvironmentVariable

Represents the value of an environment variable, and if the value should be overridden if the variable is set in the parent environment.

ICreateOperationsContext

(ALPHA) Context used for creating operations to be executed.

ICustomTipInfo

(BETA) Metadata for a custom tip.

ICustomTipItemJson

(BETA) An item from the ICustomTipsJson.customTips list.

ICustomTipsJson

(BETA) This interface represents the raw custom-tips.json file which allows repo maintainers to configure extra details to be printed alongside certain Rush messages.

IEnvironmentConfigurationInitializeOptions

(BETA)

IExecuteOperationsContext

(ALPHA) Context used for executing operations.

IExecutionResult

(ALPHA) The IExecutionResult interface represents the results of executing a set of Operations.

IExperimentsJson

(BETA) This interface represents the raw experiments.json file which allows repo maintainers to enable and disable experimental Rush features.

IFileSystemBuildCacheProviderOptions

(BETA) Options for creating a file system build cache provider.

IGenerateCacheEntryIdOptions

(BETA) Options for generating the cache id for an operation.

IGetChangedProjectsOptions

(BETA)

IGlobalCommand

(BETA) Information about the currently executing global script command (as defined in command-line.json) provided to plugins.

IIndividualVersionJson

This interface represents the raw individual version policy JSON object which extends the base version policy with additional fields specific to individual versioning.

IInputsSnapshot

(BETA) Represents a synchronously-queryable in-memory snapshot of the state of the inputs to a Rush repository.

The methods on this interface are idempotent and will return the same result regardless of when they are executed.

ILaunchOptions

Options to pass to the rush "launch" functions.

ILockStepVersionJson

This interface represents the raw lock-step version policy JSON object which extends the base version policy with additional fields specific to lock-step versioning.

ILogFilePaths

(ALPHA) Information about the log files for an operation.

ILogger

(BETA)

IOperationExecutionResult

(ALPHA) The IOperationExecutionResult interface represents the results of executing an Operation.

IOperationOptions

(ALPHA) Options for constructing a new Operation.

IOperationRunner

(BETA) The Operation class is a node in the dependency graph of work that needs to be scheduled by the OperationExecutionManager. Each Operation has a runner member of type IOperationRunner, whose implementation manages the actual process for running a single operation.

IOperationRunnerContext

(BETA) Information passed to the executing IOperationRunner

IOperationSettings

(ALPHA)

IPackageManagerOptionsJsonBase

Options for the package manager.

IPhase

(ALPHA) Metadata about a phase.

IPhasedCommand

(BETA) Information about the currently executing phased script command (as defined in command-line.json, or default "build" or "rebuild") provided to plugins.

IPnpmLockfilePolicies

Possible values for the pnpmLockfilePolicies setting in Rush's pnpm-config.json file.

IPnpmPackageExtension

IPnpmPeerDependenciesMeta

IPnpmPeerDependencyRules

IRushCommand

(BETA) Information about the currently executing command provided to plugins.

IRushCommandLineAction

(BETA) The full spec of an available Rush command line action

IRushCommandLineParameter

(BETA) Information about the available parameters associated with a Rush action

IRushCommandLineSpec

(BETA) The full spec of a Rush CLI

IRushPhaseSharding

(ALPHA)

IRushPlugin

(BETA)

IRushSessionOptions

(BETA)

IStopwatchResult

(BETA) Represents a readonly view of a Stopwatch.

ITelemetryData

(BETA)

ITelemetryMachineInfo

(BETA)

ITelemetryOperationResult

(BETA)

ITryFindRushJsonLocationOptions

Options for RushConfiguration.tryFindRushJsonLocation.

IVersionPolicyJson

This interface represents the raw version policy JSON object which allows repo maintainers to define how different groups of projects will be published by Rush, and how their version numbers will be determined.

Variables

Variable

Description

EnvironmentVariableNames

(BETA) Names of environment variables used by Rush.

Type Aliases

Type Alias

Description

CloudBuildCacheProviderFactory

(BETA)

CobuildLockProviderFactory

(BETA)

GetCacheEntryIdFunction

(BETA) Calculates the cache entry id string for an operation.

GetInputsSnapshotAsyncFn

(BETA) Function that computes a new snapshot of the current state of the repository as of the current moment. Rush-level configuration state will have been bound during creation of the function. Captures the state of the environment, tracked files, and additional files.

IPhaseBehaviorForMissingScript

(ALPHA) The set of valid behaviors for a missing script in a project's package.json scripts for a given phase.

IRushConfigurationProjectForSnapshot

(BETA)

NodeVersionGranularity

(ALPHA) The granularity at which the Node.js version is included in the build cache hash.

  • "major" — includes only the major version (e.g. 18) - "minor" — includes the major and minor version (e.g. 18.17) - "patch" — includes the full version (e.g. 18.17.1)

PackageManagerName

This represents the available Package Manager tools as a string

PnpmResolutionMode

Possible values for the resolutionMode setting in Rush's pnpm-config.json file.

PnpmStoreLocation

This represents the available PNPM store options

PnpmStoreOptions