react-native-update-cli 2.30.1 → 2.30.2
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/locales/en.d.ts +1 -0
- package/lib/locales/en.js +1 -0
- package/lib/locales/zh.d.ts +1 -0
- package/lib/locales/zh.js +1 -0
- package/lib/utils/index.js +13 -8
- package/package.json +1 -1
package/lib/locales/en.d.ts
CHANGED
package/lib/locales/en.js
CHANGED
|
@@ -25,6 +25,7 @@ exports.default = {
|
|
|
25
25
|
autoUpdateSuccess: 'CLI was automatically updated in the background: {{from}} -> {{to}}',
|
|
26
26
|
apkUploadSuccess: 'Successfully uploaded APK native package (id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
27
27
|
boundTo: ', bound to: {{name}} ({{id}})',
|
|
28
|
+
buildTimeIsDebug: 'The build timestamp of this package is 0, which means it is a debug build. Please build it in release mode and upload again.',
|
|
28
29
|
buildTimeNotFound: 'Cannot get the build timestamp of this package. Please update `react-native-update` to the latest version and re-package and upload.',
|
|
29
30
|
bundleCommandError: '"react-native bundle" command exited with code {{code}}.',
|
|
30
31
|
bundleNotFound: 'Bundle file not found. Please ensure that this {{packageType}} is a release version and the bundle file name is the default `{{entryFile}}`',
|
package/lib/locales/zh.d.ts
CHANGED
package/lib/locales/zh.js
CHANGED
|
@@ -25,6 +25,7 @@ exports.default = {
|
|
|
25
25
|
autoUpdateSuccess: 'CLI 已在后台自动更新:{{from}} -> {{to}}',
|
|
26
26
|
apkUploadSuccess: '已成功上传apk原生包(id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
27
27
|
boundTo: ', 已绑定:{{name}} ({{id}})',
|
|
28
|
+
buildTimeIsDebug: '此包的编译时间戳为 0,说明它是 debug 构建。请用 release 构建打包后再上传。',
|
|
28
29
|
buildTimeNotFound: '无法获取此包的编译时间戳。请更新 `react-native-update` 到最新版本后重新打包上传。',
|
|
29
30
|
bundleCommandError: '"react-native bundle" 命令退出,代码为 {{code}}。',
|
|
30
31
|
bundleNotFound: '找不到 bundle 文件。请确保此 {{packageType}} 为 release 版本,且 bundle 文件名为默认的 `{{entryFile}}`',
|
package/lib/utils/index.js
CHANGED
|
@@ -91,9 +91,17 @@ function requireBundle(bundleFile, packageType, entryFile) {
|
|
|
91
91
|
}
|
|
92
92
|
return bundleFile;
|
|
93
93
|
}
|
|
94
|
+
// Android and Harmony stamp debug builds with "0" on purpose (a debug rebuild
|
|
95
|
+
// must not look like a new binary), so a present-but-zero value means a debug
|
|
96
|
+
// package, not an outdated react-native-update.
|
|
94
97
|
function requireBuildTime(value) {
|
|
95
|
-
const buildTime =
|
|
96
|
-
|
|
98
|
+
const buildTime = value === undefined || value === null || value === ''
|
|
99
|
+
? Number.NaN
|
|
100
|
+
: Number(value);
|
|
101
|
+
if (buildTime === 0) {
|
|
102
|
+
throw new Error((0, i18n_1.t)('buildTimeIsDebug'));
|
|
103
|
+
}
|
|
104
|
+
if (!Number.isFinite(buildTime)) {
|
|
97
105
|
throw new Error((0, i18n_1.t)('buildTimeNotFound'));
|
|
98
106
|
}
|
|
99
107
|
return buildTime;
|
|
@@ -201,7 +209,7 @@ async function getAabInfo(fn) {
|
|
|
201
209
|
versionName = attr.value;
|
|
202
210
|
}
|
|
203
211
|
}
|
|
204
|
-
let buildTime
|
|
212
|
+
let buildTime;
|
|
205
213
|
const appCredential = {};
|
|
206
214
|
// Find application node
|
|
207
215
|
const applicationNode = manifestElement.child.find((child) => child.element?.name === 'application');
|
|
@@ -237,13 +245,10 @@ async function getAabInfo(fn) {
|
|
|
237
245
|
value = resolvedValue;
|
|
238
246
|
}
|
|
239
247
|
}
|
|
240
|
-
buildTime =
|
|
248
|
+
buildTime = value;
|
|
241
249
|
}
|
|
242
250
|
}
|
|
243
251
|
}
|
|
244
|
-
if (!Number.isFinite(buildTime) || buildTime === 0) {
|
|
245
|
-
throw new Error((0, i18n_1.t)('buildTimeNotFound'));
|
|
246
|
-
}
|
|
247
252
|
// The JS bundle lives in the base module; these are the same bytes the
|
|
248
253
|
// extracted APK carries (extractApk copies entries verbatim), so the hash
|
|
249
254
|
// matches what uploadAab ends up registering via getApkInfo. Lenient on
|
|
@@ -258,7 +263,7 @@ async function getAabInfo(fn) {
|
|
|
258
263
|
}
|
|
259
264
|
return {
|
|
260
265
|
versionName,
|
|
261
|
-
buildTime,
|
|
266
|
+
buildTime: requireBuildTime(buildTime),
|
|
262
267
|
...(bundleHash ? { bundleHash } : {}),
|
|
263
268
|
...appCredential,
|
|
264
269
|
};
|
package/package.json
CHANGED