react-native-update-cli 1.29.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundle.js +14 -3
- package/lib/utils/index.js +4 -5
- package/package.json +1 -1
- package/src/bundle.js +14 -3
- package/src/utils/index.js +3 -4
- package/src/.DS_Store +0 -0
- package/src/utils/.DS_Store +0 -0
package/lib/bundle.js
CHANGED
|
@@ -65,9 +65,20 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
|
|
|
65
65
|
|
|
66
66
|
fs.emptyDirSync(outputFolder);
|
|
67
67
|
|
|
68
|
-
let cliPath
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
let cliPath;
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
// rn >= 0.75
|
|
72
|
+
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
|
|
73
|
+
paths: [process.cwd()]
|
|
74
|
+
});
|
|
75
|
+
} catch (e) {
|
|
76
|
+
// rn < 0.75
|
|
77
|
+
cliPath = require.resolve('react-native/local-cli/cli.js', {
|
|
78
|
+
paths: [process.cwd()]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
71
82
|
let usingExpo = false;
|
|
72
83
|
try {
|
|
73
84
|
require.resolve('expo-router', {
|
package/lib/utils/index.js
CHANGED
|
@@ -35,9 +35,9 @@ var _appInfoParser = require('./app-info-parser');
|
|
|
35
35
|
|
|
36
36
|
var _appInfoParser2 = _interopRequireDefault(_appInfoParser);
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _satisfies = require('semver/functions/satisfies');
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _satisfies2 = _interopRequireDefault(_satisfies);
|
|
41
41
|
|
|
42
42
|
var _read = require('read');
|
|
43
43
|
|
|
@@ -157,10 +157,9 @@ function printVersionCommand() {
|
|
|
157
157
|
console.log('react-native-update: 无法获取版本号,请在项目目录中运行命令');
|
|
158
158
|
}
|
|
159
159
|
if (pushyVersion) {
|
|
160
|
-
if ((0,
|
|
160
|
+
if ((0, _satisfies2.default)(pushyVersion, '<8.5.1')) {
|
|
161
161
|
console.warn('当前版本已不再支持,请至少升级到 v8 的最新小版本后重新打包(代码无需改动): npm i react-native-update@8');
|
|
162
|
-
}
|
|
163
|
-
if ((0, _lt2.default)(pushyVersion, '9.2.1')) {
|
|
162
|
+
} else if ((0, _satisfies2.default)(pushyVersion, '9.0.0 - 9.2.0')) {
|
|
164
163
|
console.warn('当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动): npm i react-native-update@9');
|
|
165
164
|
}
|
|
166
165
|
}
|
package/package.json
CHANGED
package/src/bundle.js
CHANGED
|
@@ -51,9 +51,20 @@ async function runReactNativeBundleCommand(
|
|
|
51
51
|
|
|
52
52
|
fs.emptyDirSync(outputFolder);
|
|
53
53
|
|
|
54
|
-
let cliPath
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
let cliPath;
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
// rn >= 0.75
|
|
58
|
+
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
|
|
59
|
+
paths: [process.cwd()],
|
|
60
|
+
});
|
|
61
|
+
} catch (e) {
|
|
62
|
+
// rn < 0.75
|
|
63
|
+
cliPath = require.resolve('react-native/local-cli/cli.js', {
|
|
64
|
+
paths: [process.cwd()],
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
57
68
|
let usingExpo = false;
|
|
58
69
|
try {
|
|
59
70
|
require.resolve('expo-router', {
|
package/src/utils/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import os from 'os';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import pkg from '../../package.json';
|
|
5
5
|
import AppInfoParser from './app-info-parser';
|
|
6
|
-
import
|
|
6
|
+
import semverSatisfies from 'semver/functions/satisfies';
|
|
7
7
|
|
|
8
8
|
import read from 'read';
|
|
9
9
|
|
|
@@ -152,12 +152,11 @@ export function printVersionCommand() {
|
|
|
152
152
|
console.log('react-native-update: 无法获取版本号,请在项目目录中运行命令');
|
|
153
153
|
}
|
|
154
154
|
if (pushyVersion) {
|
|
155
|
-
if (
|
|
155
|
+
if (semverSatisfies(pushyVersion, '<8.5.1')) {
|
|
156
156
|
console.warn(
|
|
157
157
|
'当前版本已不再支持,请至少升级到 v8 的最新小版本后重新打包(代码无需改动): npm i react-native-update@8',
|
|
158
158
|
);
|
|
159
|
-
}
|
|
160
|
-
if (semverLt(pushyVersion, '9.2.1')) {
|
|
159
|
+
} else if (semverSatisfies(pushyVersion, '9.0.0 - 9.2.0')) {
|
|
161
160
|
console.warn(
|
|
162
161
|
'当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动): npm i react-native-update@9',
|
|
163
162
|
);
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/utils/.DS_Store
DELETED
|
Binary file
|