react-native-update-cli 1.34.1 → 1.35.0
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 +17 -23
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
- package/src/bundle.js +13 -19
- package/src/utils/index.js +1 -1
package/lib/bundle.js
CHANGED
|
@@ -86,37 +86,31 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
|
|
|
86
86
|
}
|
|
87
87
|
_fsextra.emptyDirSync(outputFolder);
|
|
88
88
|
let cliPath;
|
|
89
|
-
try {
|
|
90
|
-
// rn >= 0.75
|
|
91
|
-
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
|
|
92
|
-
paths: [
|
|
93
|
-
process.cwd()
|
|
94
|
-
]
|
|
95
|
-
});
|
|
96
|
-
} catch (e) {
|
|
97
|
-
// rn < 0.75
|
|
98
|
-
cliPath = require.resolve('react-native/local-cli/cli.js', {
|
|
99
|
-
paths: [
|
|
100
|
-
process.cwd()
|
|
101
|
-
]
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
89
|
let usingExpo = false;
|
|
105
90
|
try {
|
|
106
|
-
require.resolve('expo-router', {
|
|
107
|
-
paths: [
|
|
108
|
-
process.cwd()
|
|
109
|
-
]
|
|
110
|
-
});
|
|
111
|
-
console.log(`expo-router detected, will use @expo/cli to bundle.\n`);
|
|
112
|
-
// if using expo-router, use expo-cli
|
|
113
91
|
cliPath = require.resolve('@expo/cli', {
|
|
114
92
|
paths: [
|
|
115
93
|
process.cwd()
|
|
116
94
|
]
|
|
117
95
|
});
|
|
118
96
|
usingExpo = true;
|
|
119
|
-
} catch (e) {
|
|
97
|
+
} catch (e) {
|
|
98
|
+
try {
|
|
99
|
+
// rn >= 0.75
|
|
100
|
+
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
|
|
101
|
+
paths: [
|
|
102
|
+
process.cwd()
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
} catch (e) {
|
|
106
|
+
// rn < 0.75
|
|
107
|
+
cliPath = require.resolve('react-native/local-cli/cli.js', {
|
|
108
|
+
paths: [
|
|
109
|
+
process.cwd()
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
120
114
|
const bundleCommand = usingExpo ? 'export:embed' : 'bundle';
|
|
121
115
|
Array.prototype.push.apply(reactNativeBundleArgs, [
|
|
122
116
|
cliPath,
|
package/lib/utils/index.js
CHANGED
|
@@ -181,7 +181,7 @@ async function printVersionCommand() {
|
|
|
181
181
|
} else if ((0, _satisfies.default)(pushyVersion, '9.0.0 - 9.2.1')) {
|
|
182
182
|
console.warn(`当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动,可直接热更): npm i react-native-update@9 .
|
|
183
183
|
如有使用安装 apk 的功能,请注意添加所需权限 https://pushy.reactnative.cn/docs/api#async-function-downloadandinstallapkurl`);
|
|
184
|
-
} else if ((0, _satisfies.default)(pushyVersion, '10.0.0 - 10.
|
|
184
|
+
} else if ((0, _satisfies.default)(pushyVersion, '10.0.0 - 10.17.0')) {
|
|
185
185
|
console.warn(`当前版本已不再支持,请升级到 v10 的最新小版本(代码无需改动,可直接热更): npm i react-native-update@10`);
|
|
186
186
|
}
|
|
187
187
|
}
|
package/package.json
CHANGED
package/src/bundle.js
CHANGED
|
@@ -53,31 +53,25 @@ async function runReactNativeBundleCommand(
|
|
|
53
53
|
|
|
54
54
|
let cliPath;
|
|
55
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
|
-
|
|
68
56
|
let usingExpo = false;
|
|
69
57
|
try {
|
|
70
|
-
require.resolve('expo-router', {
|
|
71
|
-
paths: [process.cwd()],
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
console.log(`expo-router detected, will use @expo/cli to bundle.\n`);
|
|
75
|
-
// if using expo-router, use expo-cli
|
|
76
58
|
cliPath = require.resolve('@expo/cli', {
|
|
77
59
|
paths: [process.cwd()],
|
|
78
60
|
});
|
|
79
61
|
usingExpo = true;
|
|
80
|
-
} catch (e) {
|
|
62
|
+
} catch (e) {
|
|
63
|
+
try {
|
|
64
|
+
// rn >= 0.75
|
|
65
|
+
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
|
|
66
|
+
paths: [process.cwd()],
|
|
67
|
+
});
|
|
68
|
+
} catch (e) {
|
|
69
|
+
// rn < 0.75
|
|
70
|
+
cliPath = require.resolve('react-native/local-cli/cli.js', {
|
|
71
|
+
paths: [process.cwd()],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
81
75
|
const bundleCommand = usingExpo ? 'export:embed' : 'bundle';
|
|
82
76
|
|
|
83
77
|
Array.prototype.push.apply(reactNativeBundleArgs, [
|
package/src/utils/index.js
CHANGED
|
@@ -178,7 +178,7 @@ export async function printVersionCommand() {
|
|
|
178
178
|
`当前版本已不再支持,请至少升级到 v9 的最新小版本后重新打包(代码无需改动,可直接热更): npm i react-native-update@9 .
|
|
179
179
|
如有使用安装 apk 的功能,请注意添加所需权限 https://pushy.reactnative.cn/docs/api#async-function-downloadandinstallapkurl`,
|
|
180
180
|
);
|
|
181
|
-
} else if (semverSatisfies(pushyVersion, '10.0.0 - 10.
|
|
181
|
+
} else if (semverSatisfies(pushyVersion, '10.0.0 - 10.17.0')) {
|
|
182
182
|
console.warn(
|
|
183
183
|
`当前版本已不再支持,请升级到 v10 的最新小版本(代码无需改动,可直接热更): npm i react-native-update@10`,
|
|
184
184
|
);
|