mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
refactor: using a more semver-like prerelease version format
This commit is contained in:
parent
5ea53f706b
commit
d16bbc3287
@ -40,7 +40,9 @@ export class LowCodePluginManager implements ILowCodePluginManager {
|
|||||||
|
|
||||||
isEngineVersionMatched(versionExp: string): boolean {
|
isEngineVersionMatched(versionExp: string): boolean {
|
||||||
const engineVersion = engineConfig.get('ENGINE_VERSION');
|
const engineVersion = engineConfig.get('ENGINE_VERSION');
|
||||||
return semverSatisfies(engineVersion, versionExp);
|
// ref: https://github.com/npm/node-semver#functions
|
||||||
|
// 1.0.1-beta should match '^1.0.0'
|
||||||
|
return semverSatisfies(engineVersion, versionExp, { includePrerelease: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -17,7 +17,7 @@ function getVersion() {
|
|||||||
|
|
||||||
const [_, version, beta] = match;
|
const [_, version, beta] = match;
|
||||||
|
|
||||||
return beta && beta.endsWith('beta') ? `${version}(beta)` : version;
|
return beta && beta.endsWith('beta') ? `${version}-beta` : version;
|
||||||
}
|
}
|
||||||
|
|
||||||
const releaseVersion = getVersion();
|
const releaseVersion = getVersion();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user