Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/rush-lib > VersionPolicy

VersionPolicy class

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

Signature:

export declare abstract class VersionPolicy 

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.

Properties

PropertyModifiersTypeDescription
definitionNamereadonlyVersionPolicyDefinitionNameVersion policy definition name
exemptFromRushChangereadonlybooleanDetermines if a version policy wants to opt out of changelog files.
includeEmailInChangeFilereadonlybooleanDetermines if a version policy wants to opt in to including email.
isLocksteppedreadonlybooleanWhether it is a lockstepped version policy
policyNamereadonlystringVersion policy name

Methods

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