Home > @microsoft/rush-lib > VersionPolicy

VersionPolicy class

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

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

Signature:

export declare abstract class VersionPolicy 

Properties

Property Modifiers Type Description
definitionName   VersionPolicyDefinitionName (BETA) Version policy definition name
exemptFromRushChange   boolean (BETA) Determines if a version policy wants to opt out of changelog files.
isLockstepped   boolean (BETA) Whether it is a lockstepped version policy
policyName   string (BETA) Version policy name

Methods

Method Modifiers Description
bump(bumpType, identifier)   (BETA) Bumps version based on the policy
ensure(project, force)   (BETA) Returns an updated package json that satisfies the policy.
setDependenciesBeforeCommit(packageName, configuration)   (BETA) Tells the version policy to modify any dependencies in the target package to values used for checked-in source.
setDependenciesBeforePublish(packageName, configuration)   (BETA) Tells the version policy to modify any dependencies in the target package to values used for publishing.
validate(versionString, packageName)   (BETA) Validates the specified version and throws if the version does not satisfy the policy.

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the VersionPolicy class.