chore: add version check (#6240)

This commit is contained in:
ClarkXia 2023-05-16 18:15:09 +08:00 committed by GitHub
parent d173faeef4
commit 8176bce92e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -4,8 +4,7 @@ import semver from 'semver';
const require = createRequire(import.meta.url);
// Only change this when you release a version which break the usage of runtime generation.
// TODO modify valid version to 1.2.0 after version is updated, otherwise it will cause build error.
const RUNTIME_VALID_VERSION = '>=1.1.0';
const RUNTIME_VALID_VERSION = '>=1.2.0';
try {
// @ice/runtime has defined package.json exports, so we can use require.resolve to get the package.json path.
const packageJsonPath = require.resolve('@ice/runtime/package.json');

View File

@ -5,8 +5,7 @@ import semver from 'semver';
const require = createRequire(import.meta.url);
// Only change this when you release a version which break the usage of runtime generation.
// TODO modify valid version to 3.2.0 after version is updated, otherwise it will cause build error.
const ICE_VALID_VERSION = '>=3.1.6';
const ICE_VALID_VERSION = '>=3.2.0';
try {
const packagePath = require.resolve('@ice/app', { paths: [process.cwd()] });
const packageJsonPath = path.join(path.dirname(packagePath),'../package.json');