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

ClassDescription
ApprovedPackagesConfigurationThis represents the JSON file specified via the "approvedPackagesFile" option in rush.json.
ApprovedPackagesItemAn item returned by ApprovedPackagesConfiguration
ApprovedPackagesPolicyThis 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.
ChangeManagerA class that helps with programmatically interacting with Rush's change files.
CommonVersionsConfigurationUse 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.
CredentialCache(BETA)
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.
ExperimentsConfigurationUse 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.
IndividualVersionPolicyThis policy indicates all related projects get version bump driven by their own changes.
LockStepVersionPolicyThis policy indicates all related projects should use the same version.
LookupByPath

(BETA) This class is used to associate POSIX relative paths, such as those returned by git commands, with entities that correspond with ancestor folders, such as Rush Projects.

It is optimized for efficiently locating the nearest ancestor path with an associated value.

NpmOptionsConfigurationOptions that are only used when the NPM package manager is selected.
PackageJsonDependency
PackageJsonEditor
PnpmOptionsConfigurationOptions 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)
RepoStateFileThis file is used to track the state of various Rush-related features. It is generated and updated by Rush.
RushGeneral operations for the Rush engine.
RushConfigurationThis represents the Rush configuration for a repository, based on the "rush.json" configuration file.
RushConfigurationProjectThis 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.
RushSession(BETA)
RushUserConfiguration(BETA) Rush per-user configuration data.
VersionPolicyConfigurationUse 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.
YarnOptionsConfigurationOptions that are only used when the yarn package manager is selected.

Abstract Classes

Abstract ClassDescription
PackageManagerAn abstraction for controlling the supported package managers: PNPM, NPM, and Yarn.
PackageManagerOptionsConfigurationBaseOptions that all package managers share.
VersionPolicyThis is the base class for version policy which controls how versions get bumped.

Enumerations

EnumerationDescription
BumpTypeType of version bumps
DependencyType
Event(BETA) Events happen during Rush runs.
OperationStatus(BETA) Enumeration defining potential states of an operation
VersionPolicyDefinitionNameVersion policy base type names

Interfaces

InterfaceDescription
ICloudBuildCacheProvider(BETA)
IConfigurationEnvironmentA collection of environment variables
IConfigurationEnvironmentVariableRepresents the value of an environment variable, and if the value should be overridden if the variable is set in the parent environment.
ICredentialCacheEntry(BETA)
ICredentialCacheOptions(BETA)
IEnvironmentConfigurationInitializeOptions(BETA)
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.
ILaunchOptionsOptions to pass to the rush "launch" functions.
ILogger(BETA)
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
IPackageManagerOptionsJsonBaseOptions for the package manager.
IPhasedCommand(BETA) Information about the currently executing phased script command (as defined in command-line.json, or default "build" or "rebuild") provided to plugins.
IPrefixMatch(BETA) Object containing both the matched item and the start index of the remainder of the query.
IRushCommand(BETA) Information about the currently executing command provided to plugins.
IRushPlugin(BETA)
IRushSessionOptions(BETA)
IStopwatchResult(BETA) Represents a readonly view of a Stopwatch.
ITelemetryData(BETA)
ITelemetryMachineInfo(BETA)
ITelemetryOperationResult(BETA)
ITryFindRushJsonLocationOptionsOptions for RushConfiguration.tryFindRushJsonLocation.

Variables

VariableDescription
EnvironmentVariableNames(BETA) Names of environment variables used by Rush.

Type Aliases

Type AliasDescription
CloudBuildCacheProviderFactory(BETA)
GetCacheEntryIdFunction(BETA) Calculates the cache entry id string for an operation.
PackageManagerNameThis represents the available Package Manager tools as a string
PnpmStoreOptionsThis represents the available PNPM store options