Home > @microsoft/rush-lib > CommonVersionsConfiguration

CommonVersionsConfiguration class

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.


export declare class CommonVersionsConfiguration 


Property Modifiers Type Description
allowedAlternativeVersions   Map<string, ReadonlyArray<string>> A table that stores, for a given dependency, a list of SemVer ranges that will be accepted by “rush check” in addition to the normal version range.
filePath   string Get the absolute file path of the common-versions.json file.
preferredVersions   Map<string, string> A table that specifies a “preferred version” for a dependency package.
xstitchPreferredVersions   Map<string, string> A table of specifies preferred versions maintained by the XStitch tool.


Method Modifiers Description
getAllPreferredVersions()   Returns the union of preferredVersions and xstitchPreferredVersions.
loadFromFile(jsonFilename) static Loads the common-versions.json data from the specified file path. If the file has not been created yet, then an empty object is returned.
save()   Writes the “common-versions.json” file to disk, using the filename that was passed to loadFromFile().