Home > @microsoft/rush-lib

rush-lib package

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


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.
ChangeManager A class that helps with programmatically interacting with Rush’s change files.
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.
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 (BETA) 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.
IndividualVersionPolicy (BETA) This policy indicates all related projects get version bump driven by their own changes.
LockStepVersionPolicy (BETA) This policy indicates all related projects should use the same version.
NpmOptionsConfiguration Options that are only used when the NPM package manager is selected.
PackageJsonDependency (BETA)
PackageJsonEditor (BETA)
PackageManager (BETA) An abstraction for controlling the supported package managers: PNPM, NPM, and Yarn.
PackageManagerOptionsConfigurationBase Options that all package managers share.
PnpmOptionsConfiguration Options that are only used when the PNPM package manager is selected.
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.
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.
VersionPolicy (BETA) This is the base class for version policy which controls how versions get bumped.
VersionPolicyConfiguration (BETA) 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.


Enumeration Description
BumpType (BETA) Type of version bumps
DependencyType (BETA)
EnvironmentVariableNames Names of environment variables used by Rush.
Event (BETA) Events happen during Rush runs.
VersionPolicyDefinitionName (BETA) Version policy base type names


Interface Description
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.
IExperimentsJson (BETA) This interface represents the raw experiments.json file which allows repo maintainers to enable and disable experimental Rush features.
ILaunchOptions Options to pass to the rush “launch” functions.
IPackageManagerOptionsJsonBase Options for the package manager.
ITryFindRushJsonLocationOptions Options for RushConfiguration.tryFindRushJsonLocation.

Type Aliases

Type Alias Description
PackageManagerName This represents the available Package Manager tools as a string
PnpmStoreOptions This represents the available PNPM store options
ResolutionStrategy This represents the available PNPM resolution strategies as a string