Skip to content

Commit d16bbc3

Browse files
committed
refactor: using a more semver-like prerelease version format
1 parent 5ea53f7 commit d16bbc3

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/designer/src/plugin/plugin-manager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ export class LowCodePluginManager implements ILowCodePluginManager {
4040

4141
isEngineVersionMatched(versionExp: string): boolean {
4242
const engineVersion = engineConfig.get('ENGINE_VERSION');
43-
return semverSatisfies(engineVersion, versionExp);
43+
// ref: https://github.com/npm/node-semver#functions
44+
// 1.0.1-beta should match '^1.0.0'
45+
return semverSatisfies(engineVersion, versionExp, { includePrerelease: true });
4446
}
4547

4648
/**

packages/engine/build.plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function getVersion() {
1717

1818
const [_, version, beta] = match;
1919

20-
return beta && beta.endsWith('beta') ? `${version}(beta)` : version;
20+
return beta && beta.endsWith('beta') ? `${version}-beta` : version;
2121
}
2222

2323
const releaseVersion = getVersion();

0 commit comments

Comments
 (0)