XpmPackage.checkMinimumXpmRequired() method
Validates the minimum required xpm version against the installed CLI.
Signature
checkMinimumXpmRequired({ xpmRootFolderPath, }: {
xpmRootFolderPath: string;
}): Promise<string | undefined>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
{ xpmRootFolderPath, } |
{ xpmRootFolderPath: string; } |
Returns
Promise<string | undefined>
The cleaned minimum required version, or undefined if no check is required.
Exceptions
XpmPrerequisitesError If the installed xpm version is lower than the required minimum.
Remarks
This method ensures that packages requiring specific xpm features or bug fixes can enforce a minimum version requirement, preventing runtime errors or unexpected behavior with older xpm versions.
Validation workflow:
- Check if package is an xpm package with
minimumXpmRequiredset. - Clean the required version by removing pre-release suffixes.
- Load the xpm CLI's
package.jsonfrom the provided root folder. - Extract and clean the installed xpm version.
- Compare versions using semver to determine if upgrade is needed.
- Throw
XpmPrerequisitesErrorif installed version is too old.
Pre-release suffixes are stripped from both versions to ensure that pre-release builds satisfy version requirements (e.g., 1.0.0-beta satisfies minimumXpmRequired: 1.0.0).
Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.