react-native-update-cli 1.44.1 → 1.44.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/cli.json +13 -1
- package/lib/bundle.js +37 -18
- package/lib/index.js +0 -1
- package/lib/locales/en.js +80 -61
- package/lib/locales/zh.js +79 -61
- package/lib/package.js +49 -18
- package/lib/utils/i18n.js +3 -0
- package/lib/versions.js +1 -1
- package/package.json +1 -1
- package/src/bundle.ts +74 -35
- package/src/index.ts +0 -1
- package/src/locales/en.ts +102 -72
- package/src/locales/zh.ts +96 -67
- package/src/package.ts +18 -35
- package/src/utils/i18n.ts +3 -0
- package/src/versions.ts +9 -7
package/src/locales/en.ts
CHANGED
|
@@ -1,10 +1,60 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'
|
|
2
|
+
addedToGitignore: 'Added {{line}} to .gitignore',
|
|
3
|
+
androidCrunchPngsWarning:
|
|
4
|
+
'The crunchPngs option of android seems not disabled (Please ignore this warning if already disabled), which may cause abnormal consumption of mobile network traffic. Please refer to https://cresc.dev/docs/getting-started#disable-crunchpngs-on-android \n',
|
|
5
|
+
appId: 'App ID',
|
|
6
|
+
appIdMismatchApk:
|
|
7
|
+
'App ID mismatch! Current APK: {{appIdInPkg}}, current update.json: {{appId}}',
|
|
8
|
+
appIdMismatchApp:
|
|
9
|
+
'App ID mismatch! Current APP: {{appIdInPkg}}, current update.json: {{appId}}',
|
|
10
|
+
appIdMismatchIpa:
|
|
11
|
+
'App ID mismatch! Current IPA: {{appIdInPkg}}, current update.json: {{appId}}',
|
|
12
|
+
appKeyMismatchApk:
|
|
13
|
+
'App Key mismatch! Current APK: {{appKeyInPkg}}, current update.json: {{appKey}}',
|
|
14
|
+
appKeyMismatchApp:
|
|
15
|
+
'App Key mismatch! Current APP: {{appKeyInPkg}}, current update.json: {{appKey}}',
|
|
16
|
+
appKeyMismatchIpa:
|
|
17
|
+
'App Key mismatch! Current IPA: {{appKeyInPkg}}, current update.json: {{appKey}}',
|
|
18
|
+
appName: 'App Name',
|
|
19
|
+
appNameQuestion: 'App Name:',
|
|
20
|
+
appNotSelected:
|
|
21
|
+
'App not selected. run `cresc selectApp --platform {{platform}}` first!',
|
|
22
|
+
appUploadSuccess:
|
|
23
|
+
'Successfully uploaded APP native package (id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
24
|
+
apkUploadSuccess:
|
|
25
|
+
'Successfully uploaded APK native package (id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
26
|
+
boundTo: ', bound to: {{name}} ({{id}})',
|
|
27
|
+
buildTimeNotFound:
|
|
28
|
+
'Cannot get the build timestamp of this package. Please update `react-native-update` to the latest version and re-package and upload.',
|
|
29
|
+
bundleCommandError:
|
|
30
|
+
'"react-native bundle" command exited with code {{code}}.',
|
|
31
|
+
bundleNotFound:
|
|
32
|
+
'Bundle file not found. Please ensure that this {{packageType}} is a release version and the bundle file name is the default `{{entryFile}}`',
|
|
33
|
+
bundlingWithRN: 'Bundling with react-native: {{version}}',
|
|
34
|
+
cancelled: 'Cancelled',
|
|
35
|
+
composingSourceMap: 'Composing source map',
|
|
36
|
+
copyFileFailed: 'Failed to copy file: {{error}}',
|
|
37
|
+
copyHarmonyBundleError: 'Error copying Harmony bundle: {{error}}',
|
|
38
|
+
copyingDebugId: 'Copying debugid',
|
|
39
|
+
createAppSuccess: 'App created successfully (id: {{id}})',
|
|
40
|
+
deleteFile: 'Delete {{- file}}',
|
|
41
|
+
deletingFile: 'Delete {{- file}}',
|
|
42
|
+
enterAppIdQuestion: 'Enter AppId:',
|
|
43
|
+
enterNativePackageId: 'Enter native package ID:',
|
|
44
|
+
errorInHarmonyApp: 'Error in getEntryFromHarmonyApp: {{error}}',
|
|
45
|
+
expiredStatus: '(Expired)',
|
|
46
|
+
failedToParseIcon: '[Warning] failed to parse icon: {{error}}',
|
|
47
|
+
failedToParseUpdateJson:
|
|
48
|
+
'Failed to parse file `update.json`. Try to remove it manually.',
|
|
49
|
+
fileGenerated: '{{- file}} generated.',
|
|
50
|
+
fileSizeExceeded:
|
|
51
|
+
'This file size is {{fileSize}} , exceeding the current quota {{maxSize}} . You may consider upgrading to a higher plan to increase this quota. Details can be found at: {{- pricingPageUrl}}',
|
|
52
|
+
hermesDisabled: 'Hermes disabled',
|
|
53
|
+
hermesEnabledCompiling: 'Hermes enabled, now compiling to hermes bytecode:\n',
|
|
54
|
+
ipaUploadSuccess:
|
|
55
|
+
'Successfully uploaded IPA native package (id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
56
|
+
keyStrings: 'Key strings:',
|
|
57
|
+
latestVersionTag: '(latest: {{version}})',
|
|
8
58
|
lockBestPractice: `
|
|
9
59
|
Best practices for lock files:
|
|
10
60
|
1. All members of the development team should use the same package manager to maintain a single lock file.
|
|
@@ -12,84 +62,64 @@ Best practices for lock files:
|
|
|
12
62
|
3. Pay attention to changes in the lock file during code review.
|
|
13
63
|
This can reduce the risk of inconsistent dependencies and supply chain attacks.
|
|
14
64
|
`,
|
|
65
|
+
lockNotFound:
|
|
66
|
+
'No lock file detected, which may cause inconsistent dependencies and hot-updating issues.',
|
|
67
|
+
loggedOut: 'Logged out',
|
|
15
68
|
loginExpired:
|
|
16
69
|
'Login information has expired. Please use `cresc login` command to re-login',
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
'
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
70
|
+
loginFirst:
|
|
71
|
+
'Not logged in.\nPlease run `cresc login` in the project directory to login.',
|
|
72
|
+
multipleLocksFound:
|
|
73
|
+
'Multiple lock files detected ({{- lockFiles}}), which may cause inconsistent dependencies and hot-updating issues.',
|
|
74
|
+
nativePackageId: 'Native Package ID',
|
|
75
|
+
nativeVersion: 'Native Version',
|
|
76
|
+
nativeVersionNotFound: 'No native version found >= {{version}}',
|
|
77
|
+
nativeVersionNotFoundLess: 'No native version found <= {{version}}',
|
|
78
|
+
nativeVersionNotFoundMatch: 'No matching native version found: {{version}}',
|
|
79
|
+
offset: 'Offset {{offset}}',
|
|
80
|
+
operationComplete: 'Operation complete, bound to {{count}} native versions',
|
|
81
|
+
operationSuccess: 'Operation successful',
|
|
82
|
+
packageIdRequired: 'Please provide packageId or packageVersion parameter',
|
|
83
|
+
packageUploadSuccess:
|
|
84
|
+
'Successfully uploaded new hot update package (id: {{id}})',
|
|
85
|
+
packing: 'Packing',
|
|
86
|
+
pausedStatus: '(Paused)',
|
|
29
87
|
platform: 'Platform',
|
|
30
|
-
|
|
31
|
-
appNotSelected:
|
|
32
|
-
'App not selected. run `cresc selectApp --platform {{platform}}` first!',
|
|
33
|
-
enterAppIdQuestion: 'Enter AppId:',
|
|
34
|
-
appNameQuestion: 'App Name:',
|
|
88
|
+
platformPrompt: 'Platform (ios/android/harmony):',
|
|
35
89
|
platformQuestion: 'Platform(ios/android/harmony):',
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
failedToParseUpdateJson:
|
|
40
|
-
'Failed to parse file `update.json`. Try to remove it manually.',
|
|
90
|
+
platformRequired: 'Platform must be specified.',
|
|
91
|
+
pluginDetectionError: 'error while detecting {{name}} plugin: {{error}}',
|
|
92
|
+
pluginDetected: 'detected {{name}} plugin',
|
|
41
93
|
ppkPackageGenerated: 'ppk package generated and saved to: {{- output}}',
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
94
|
+
processingError: 'Error processing file: {{error}}',
|
|
95
|
+
processingPackage: 'Processing the package {{count}} ...',
|
|
96
|
+
processingStringPool: 'Processing the string pool ...',
|
|
97
|
+
publishUsage:
|
|
98
|
+
'Usage: pushy publish <ppk file> --platform ios|android|harmony',
|
|
99
|
+
rnuVersionNotFound:
|
|
100
|
+
'react-native-update: Cannot get the version number. Please run the command in the project directory',
|
|
101
|
+
rolloutConfigSet:
|
|
102
|
+
'Set {{rollout}}% rollout for version {{version}} on native version(s) {{versions}}',
|
|
103
|
+
rolloutRangeError: 'rollout must be an integer between 1-100',
|
|
104
|
+
runningHermesc: 'Running hermesc: {{- command}} {{- args}}',
|
|
50
105
|
sentryCliNotFound:
|
|
51
106
|
'Cannot find Sentry CLI tool, please make sure @sentry/cli is properly installed',
|
|
52
107
|
sentryReleaseCreated: 'Sentry release created for version: {{version}}',
|
|
108
|
+
totalApps: 'Total {{count}} {{platform}} apps',
|
|
109
|
+
totalPackages: 'Total {{count}} packages',
|
|
110
|
+
typeStrings: 'Type strings:',
|
|
111
|
+
unsupportedPlatform: 'Unsupported platform `{{platform}}`',
|
|
112
|
+
uploadBundlePrompt: 'Upload this bundle now?(Y/N)',
|
|
53
113
|
uploadingSourcemap: 'Uploading sourcemap',
|
|
54
|
-
packing: 'Packing',
|
|
55
|
-
deletingFile: 'Delete {{- file}}',
|
|
56
|
-
bundlingWithRN: 'Bundling with react-native: {{version}}',
|
|
57
|
-
fileGenerated: '{{- file}} generated.',
|
|
58
|
-
processingError: 'Error processing file: {{error}}',
|
|
59
114
|
usageDiff: 'Usage: cresc {{command}} <origin> <next>',
|
|
60
|
-
|
|
61
|
-
pluginDetectionError: 'error while detecting {{name}} plugin: {{error}}',
|
|
62
|
-
addedToGitignore: 'Added {{line}} to .gitignore',
|
|
63
|
-
processingStringPool: 'Processing the string pool ...',
|
|
64
|
-
processingPackage: 'Processing the package {{count}} ...',
|
|
65
|
-
typeStrings: 'Type strings:',
|
|
66
|
-
keyStrings: 'Key strings:',
|
|
67
|
-
failedToParseIcon: '[Warning] failed to parse icon: {{error}}',
|
|
68
|
-
errorInHarmonyApp: 'Error in getEntryFromHarmonyApp: {{error}}',
|
|
69
|
-
totalPackages: 'Total {{count}} packages',
|
|
70
|
-
usageUploadIpa: 'Usage: cresc uploadIpa <ipa file>',
|
|
71
|
-
usageUploadApk: 'Usage: cresc uploadApk <apk file>',
|
|
72
|
-
usageUploadApp: 'Usage: cresc uploadApp <app file>',
|
|
115
|
+
usageParseApk: 'Usage: cresc parseApk <apk file>',
|
|
73
116
|
usageParseApp: 'Usage: cresc parseApp <app file>',
|
|
74
117
|
usageParseIpa: 'Usage: cresc parseIpa <ipa file>',
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
rolloutRangeError: 'rollout must be an integer between 1-100',
|
|
80
|
-
nativeVersionNotFound: 'No native version found >= {{version}}',
|
|
81
|
-
nativeVersionNotFoundLess: 'No native version found <= {{version}}',
|
|
82
|
-
nativeVersionNotFoundMatch: 'No matching native version found: {{version}}',
|
|
83
|
-
packageIdRequired: 'Please provide packageId or packageVersion parameter',
|
|
84
|
-
operationComplete: 'Operation complete, bound to {{count}} native versions',
|
|
85
|
-
platformRequired: 'Platform must be specified.',
|
|
86
|
-
bundleCommandError:
|
|
87
|
-
'"react-native bundle" command exited with code {{code}}.',
|
|
88
|
-
copyHarmonyBundleError: 'Error copying Harmony bundle: {{error}}',
|
|
89
|
-
copyFileFailed: 'Failed to copy file: {{error}}',
|
|
90
|
-
deleteFile: 'Delete {{- file}}',
|
|
91
|
-
rolloutConfigSet:
|
|
92
|
-
'Set {{rollout}}% rollout for version {{version}} on native version(s) {{versions}}',
|
|
118
|
+
usageUnderDevelopment: 'Usage is under development now.',
|
|
119
|
+
usageUploadApk: 'Usage: cresc uploadApk <apk file>',
|
|
120
|
+
usageUploadApp: 'Usage: cresc uploadApp <app file>',
|
|
121
|
+
usageUploadIpa: 'Usage: cresc uploadIpa <ipa file>',
|
|
93
122
|
versionBind:
|
|
94
123
|
'Bound version {{version}} to native version {{nativeVersion}} (id: {{id}})',
|
|
124
|
+
welcomeMessage: 'Welcome to Cresc hot update service, {{name}}.',
|
|
95
125
|
};
|
package/src/locales/zh.ts
CHANGED
|
@@ -1,7 +1,58 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
'
|
|
2
|
+
addedToGitignore: '已将 {{line}} 添加到 .gitignore',
|
|
3
|
+
androidCrunchPngsWarning:
|
|
4
|
+
'android 的 crunchPngs 选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
|
|
5
|
+
appId: '应用 id',
|
|
6
|
+
appIdMismatchApk:
|
|
7
|
+
'appId不匹配!当前apk: {{appIdInPkg}}, 当前update.json: {{appId}}',
|
|
8
|
+
appIdMismatchApp:
|
|
9
|
+
'appId不匹配!当前app: {{appIdInPkg}}, 当前update.json: {{appId}}',
|
|
10
|
+
appIdMismatchIpa:
|
|
11
|
+
'appId不匹配!当前ipa: {{appIdInPkg}}, 当前update.json: {{appId}}',
|
|
12
|
+
appKeyMismatchApk:
|
|
13
|
+
'appKey不匹配!当前apk: {{appKeyInPkg}}, 当前update.json: {{appKey}}',
|
|
14
|
+
appKeyMismatchApp:
|
|
15
|
+
'appKey不匹配!当前app: {{appKeyInPkg}}, 当前update.json: {{appKey}}',
|
|
16
|
+
appKeyMismatchIpa:
|
|
17
|
+
'appKey不匹配!当前ipa: {{appKeyInPkg}}, 当前update.json: {{appKey}}',
|
|
18
|
+
appName: '应用名称',
|
|
19
|
+
appNameQuestion: '应用名称:',
|
|
20
|
+
appNotSelected:
|
|
21
|
+
'尚未选择应用。请先运行 `pushy selectApp --platform {{platform}}` 来选择应用',
|
|
22
|
+
appUploadSuccess:
|
|
23
|
+
'已成功上传app原生包(id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
24
|
+
apkUploadSuccess:
|
|
25
|
+
'已成功上传apk原生包(id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
26
|
+
boundTo: ', 已绑定:{{name}} ({{id}})',
|
|
27
|
+
buildTimeNotFound:
|
|
28
|
+
'无法获取此包的编译时间戳。请更新 `react-native-update` 到最新版本后重新打包上传。',
|
|
29
|
+
bundleCommandError: '"react-native bundle" 命令退出,代码为 {{code}}。',
|
|
30
|
+
bundleNotFound:
|
|
31
|
+
'找不到 bundle 文件。请确保此 {{packageType}} 为 release 版本,且 bundle 文件名为默认的 `{{entryFile}}`',
|
|
32
|
+
bundlingWithRN: '正在使用 react-native {{version}} 打包',
|
|
33
|
+
cancelled: '已取消',
|
|
34
|
+
composingSourceMap: '正在生成 source map',
|
|
35
|
+
copyFileFailed: '复制文件失败:{{error}}',
|
|
36
|
+
copyHarmonyBundleError: '复制 Harmony bundle 错误:{{error}}',
|
|
37
|
+
copyingDebugId: '正在复制 debugid',
|
|
38
|
+
createAppSuccess: '已成功创建应用(id: {{id}})',
|
|
39
|
+
deleteFile: '删除 {{- file}}',
|
|
40
|
+
deletingFile: '删除 {{- file}}',
|
|
41
|
+
enterAppIdQuestion: '输入应用 id:',
|
|
42
|
+
enterNativePackageId: '输入原生包 id:',
|
|
43
|
+
errorInHarmonyApp: '获取 Harmony 应用入口时出错:{{error}}',
|
|
44
|
+
expiredStatus: '(已过期)',
|
|
45
|
+
failedToParseIcon: '[警告] 解析图标失败:{{error}}',
|
|
46
|
+
failedToParseUpdateJson: '无法解析文件 `update.json`。请手动删除它。',
|
|
47
|
+
fileGenerated: '已生成 {{- file}}',
|
|
48
|
+
fileSizeExceeded:
|
|
49
|
+
'此文件大小 {{fileSize}} , 超出当前额度 {{maxSize}} 。您可以考虑升级付费业务以提升此额度。详情请访问: {{- pricingPageUrl}}',
|
|
50
|
+
hermesDisabled: 'Hermes 已禁用',
|
|
51
|
+
hermesEnabledCompiling: 'Hermes 已启用,正在编译为 hermes 字节码:\n',
|
|
52
|
+
ipaUploadSuccess:
|
|
53
|
+
'已成功上传ipa原生包(id: {{id}}, version: {{version}}, buildTime: {{buildTime}})',
|
|
54
|
+
keyStrings: '键字符串:',
|
|
55
|
+
latestVersionTag: '(最新:{{version}})',
|
|
5
56
|
lockBestPractice: `
|
|
6
57
|
关于 lock 文件的最佳实践:
|
|
7
58
|
1. 开发团队中的所有成员应该使用相同的包管理器,维护同一份 lock 文件。
|
|
@@ -9,81 +60,59 @@ export default {
|
|
|
9
60
|
3. 代码审核时应关注 lock 文件的变化。
|
|
10
61
|
这样可以最大限度避免因依赖关系不一致而导致的热更异常,也降低供应链攻击等安全隐患。
|
|
11
62
|
`,
|
|
63
|
+
lockNotFound:
|
|
64
|
+
'没有检测到任何 lock 文件,这可能导致依赖关系不一致而使热更异常。',
|
|
65
|
+
loggedOut: '已退出登录',
|
|
66
|
+
loginExpired: '登录信息已过期,请使用 `pushy login` 命令重新登录',
|
|
67
|
+
loginFirst: '尚未登录。\n请在项目目录中运行`pushy login`命令来登录',
|
|
12
68
|
multipleLocksFound:
|
|
13
69
|
'检测到多种不同格式的锁文件({{- lockFiles}}),这可能导致依赖关系不一致而使热更异常。',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
appName: '应用名称',
|
|
70
|
+
nativePackageId: '原生包 Id',
|
|
71
|
+
nativeVersion: '原生版本',
|
|
72
|
+
nativeVersionNotFound: '未查询到 >= {{version}} 的原生版本',
|
|
73
|
+
nativeVersionNotFoundLess: '未查询到 <= {{version}} 的原生版本',
|
|
74
|
+
nativeVersionNotFoundMatch: '未查询到匹配原生版本:{{version}}',
|
|
75
|
+
offset: '偏移量 {{offset}}',
|
|
76
|
+
operationComplete: '操作完成,共已绑定 {{count}} 个原生版本',
|
|
77
|
+
operationSuccess: '操作成功',
|
|
78
|
+
packageIdRequired: '请提供 packageId 或 packageVersion 参数',
|
|
79
|
+
packageUploadSuccess: '已成功上传新热更包(id: {{id}})',
|
|
80
|
+
packing: '正在打包',
|
|
81
|
+
pausedStatus: '(已暂停)',
|
|
27
82
|
platform: '平台',
|
|
28
|
-
|
|
29
|
-
appNotSelected:
|
|
30
|
-
'尚未选择应用。请先运行 `pushy selectApp --platform {{platform}}` 来选择应用',
|
|
31
|
-
enterAppIdQuestion: '输入应用 id:',
|
|
32
|
-
appNameQuestion: '应用名称:',
|
|
83
|
+
platformPrompt: '平台(ios/android/harmony):',
|
|
33
84
|
platformQuestion: '平台(ios/android/harmony):',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
failedToParseUpdateJson: '无法解析文件 `update.json`。请手动删除它。',
|
|
85
|
+
platformRequired: '必须指定平台。',
|
|
86
|
+
pluginDetectionError: '检测 {{name}} 插件时出错:{{error}}',
|
|
87
|
+
pluginDetected: '检测到 {{name}} 插件',
|
|
38
88
|
ppkPackageGenerated: 'ppk 热更包已生成并保存到: {{- output}}',
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
89
|
+
processingError: '处理文件时出错:{{error}}',
|
|
90
|
+
processingPackage: '正在处理包 {{count}}...',
|
|
91
|
+
processingStringPool: '正在处理字符串池...',
|
|
92
|
+
publishUsage:
|
|
93
|
+
'使用方法: pushy publish ppk后缀文件 --platform ios|android|harmony',
|
|
94
|
+
rnuVersionNotFound:
|
|
95
|
+
'react-native-update: 无法获取版本号。请在项目目录中运行命令',
|
|
96
|
+
rolloutConfigSet:
|
|
97
|
+
'已在原生版本 {{versions}} 上设置灰度发布 {{rollout}}% 热更版本 {{version}}',
|
|
98
|
+
rolloutRangeError: 'rollout 必须是 1-100 的整数',
|
|
99
|
+
runningHermesc: '运行 hermesc:{{- command}} {{- args}}',
|
|
47
100
|
sentryCliNotFound: '无法找到 Sentry CLI 工具,请确保已正确安装 @sentry/cli',
|
|
48
101
|
sentryReleaseCreated: '已为版本 {{version}} 创建 Sentry release',
|
|
102
|
+
totalApps: '共 {{count}} 个 {{platform}} 应用',
|
|
103
|
+
totalPackages: '共 {{count}} 个包',
|
|
104
|
+
typeStrings: '类型字符串:',
|
|
105
|
+
unsupportedPlatform: '无法识别的平台 `{{platform}}`',
|
|
106
|
+
uploadBundlePrompt: '是否现在上传此热更包?(Y/N)',
|
|
49
107
|
uploadingSourcemap: '正在上传 sourcemap',
|
|
50
|
-
packing: '正在打包',
|
|
51
|
-
deletingFile: '删除 {{- file}}',
|
|
52
|
-
bundlingWithRN: '正在使用 react-native {{version}} 打包',
|
|
53
|
-
fileGenerated: '已生成 {{- file}}',
|
|
54
|
-
processingError: '处理文件时出错:{{error}}',
|
|
55
108
|
usageDiff: '用法:pushy {{command}} <origin> <next>',
|
|
56
|
-
|
|
57
|
-
pluginDetectionError: '检测 {{name}} 插件时出错:{{error}}',
|
|
58
|
-
addedToGitignore: '已将 {{line}} 添加到 .gitignore',
|
|
59
|
-
processingStringPool: '正在处理字符串池...',
|
|
60
|
-
processingPackage: '正在处理包 {{count}}...',
|
|
61
|
-
typeStrings: '类型字符串:',
|
|
62
|
-
keyStrings: '键字符串:',
|
|
63
|
-
failedToParseIcon: '[警告] 解析图标失败:{{error}}',
|
|
64
|
-
errorInHarmonyApp: '获取 Harmony 应用入口时出错:{{error}}',
|
|
65
|
-
totalPackages: '共 {{count}} 个包',
|
|
66
|
-
usageUploadIpa: '使用方法: pushy uploadIpa ipa后缀文件',
|
|
67
|
-
usageUploadApk: '使用方法: pushy uploadApk apk后缀文件',
|
|
68
|
-
usageUploadApp: '使用方法: pushy uploadApp app后缀文件',
|
|
109
|
+
usageParseApk: '使用方法: pushy parseApk apk后缀文件',
|
|
69
110
|
usageParseApp: '使用方法: pushy parseApp app后缀文件',
|
|
70
111
|
usageParseIpa: '使用方法: pushy parseIpa ipa后缀文件',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
rolloutRangeError: 'rollout 必须是 1-100 的整数',
|
|
75
|
-
nativeVersionNotFound: '未查询到 >= {{version}} 的原生版本',
|
|
76
|
-
nativeVersionNotFoundLess: '未查询到 <= {{version}} 的原生版本',
|
|
77
|
-
nativeVersionNotFoundMatch: '未查询到匹配原生版本:{{version}}',
|
|
78
|
-
packageIdRequired: '请提供 packageId 或 packageVersion 参数',
|
|
79
|
-
operationComplete: '操作完成,共已绑定 {{count}} 个原生版本',
|
|
80
|
-
platformRequired: '必须指定平台。',
|
|
81
|
-
bundleCommandError: '"react-native bundle" 命令退出,代码为 {{code}}。',
|
|
82
|
-
copyHarmonyBundleError: '复制 Harmony bundle 错误:{{error}}',
|
|
83
|
-
copyFileFailed: '复制文件失败:{{error}}',
|
|
84
|
-
deleteFile: '删除 {{- file}}',
|
|
85
|
-
rolloutConfigSet:
|
|
86
|
-
'已在原生版本 {{versions}} 上设置灰度发布 {{rollout}}% 热更版本 {{version}}',
|
|
112
|
+
usageUploadApk: '使用方法: pushy uploadApk apk后缀文件',
|
|
113
|
+
usageUploadApp: '使用方法: pushy uploadApp app后缀文件',
|
|
114
|
+
usageUploadIpa: '使用方法: pushy uploadIpa ipa后缀文件',
|
|
87
115
|
versionBind:
|
|
88
116
|
'已将热更版本 {{version}} 绑定到原生版本 {{nativeVersion}} (id: {{id}})',
|
|
117
|
+
welcomeMessage: '欢迎使用 pushy 热更新服务,{{name}}。',
|
|
89
118
|
};
|
package/src/package.ts
CHANGED
|
@@ -13,22 +13,23 @@ import type { Platform } from 'types';
|
|
|
13
13
|
export async function listPackage(appId: string) {
|
|
14
14
|
const { data } = await get(`/app/${appId}/package/list?limit=1000`);
|
|
15
15
|
|
|
16
|
-
const header = [
|
|
16
|
+
const header = [
|
|
17
|
+
{ value: t('nativePackageId') },
|
|
18
|
+
{ value: t('nativeVersion') },
|
|
19
|
+
];
|
|
17
20
|
const rows = [];
|
|
18
21
|
for (const pkg of data) {
|
|
19
22
|
const { version } = pkg;
|
|
20
23
|
let versionInfo = '';
|
|
21
24
|
if (version) {
|
|
22
|
-
versionInfo =
|
|
23
|
-
} else {
|
|
24
|
-
// versionInfo = ' (newest)';
|
|
25
|
+
versionInfo = t('boundTo', { name: version.name, id: version.id });
|
|
25
26
|
}
|
|
26
27
|
let output = pkg.name;
|
|
27
28
|
if (pkg.status === 'paused') {
|
|
28
|
-
output += '
|
|
29
|
+
output += t('pausedStatus');
|
|
29
30
|
}
|
|
30
31
|
if (pkg.status === 'expired') {
|
|
31
|
-
output += '
|
|
32
|
+
output += t('expiredStatus');
|
|
32
33
|
}
|
|
33
34
|
output += versionInfo;
|
|
34
35
|
rows.push([pkg.id, output]);
|
|
@@ -43,7 +44,7 @@ export async function choosePackage(appId: string) {
|
|
|
43
44
|
const list = await listPackage(appId);
|
|
44
45
|
|
|
45
46
|
while (true) {
|
|
46
|
-
const id = await question('
|
|
47
|
+
const id = await question(t('enterNativePackageId'));
|
|
47
48
|
const app = list.find((v) => v.id === Number(id));
|
|
48
49
|
if (app) {
|
|
49
50
|
return app;
|
|
@@ -66,15 +67,11 @@ export const commands = {
|
|
|
66
67
|
const { appId, appKey } = await getSelectedApp('ios');
|
|
67
68
|
|
|
68
69
|
if (appIdInPkg && appIdInPkg != appId) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
`appId不匹配!当前ipa: ${appIdInPkg}, 当前update.json: ${appId}`,
|
|
71
|
-
);
|
|
70
|
+
throw new Error(t('appIdMismatchIpa', { appIdInPkg, appId }));
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
if (appKeyInPkg && appKeyInPkg !== appKey) {
|
|
75
|
-
throw new Error(
|
|
76
|
-
`appKey不匹配!当前ipa: ${appKeyInPkg}, 当前update.json: ${appKey}`,
|
|
77
|
-
);
|
|
74
|
+
throw new Error(t('appKeyMismatchIpa', { appKeyInPkg, appKey }));
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
const { hash } = await uploadFile(fn);
|
|
@@ -87,9 +84,7 @@ export const commands = {
|
|
|
87
84
|
commit: await getCommitInfo(),
|
|
88
85
|
});
|
|
89
86
|
saveToLocal(fn, `${appId}/package/${id}.ipa`);
|
|
90
|
-
console.log(
|
|
91
|
-
`已成功上传ipa原生包(id: ${id}, version: ${versionName}, buildTime: ${buildTime})`,
|
|
92
|
-
);
|
|
87
|
+
console.log(t('ipaUploadSuccess', { id, version: versionName, buildTime }));
|
|
93
88
|
},
|
|
94
89
|
uploadApk: async ({ args }: { args: string[] }) => {
|
|
95
90
|
const fn = args[0];
|
|
@@ -105,15 +100,11 @@ export const commands = {
|
|
|
105
100
|
const { appId, appKey } = await getSelectedApp('android');
|
|
106
101
|
|
|
107
102
|
if (appIdInPkg && appIdInPkg != appId) {
|
|
108
|
-
throw new Error(
|
|
109
|
-
`appId不匹配!当前apk: ${appIdInPkg}, 当前update.json: ${appId}`,
|
|
110
|
-
);
|
|
103
|
+
throw new Error(t('appIdMismatchApk', { appIdInPkg, appId }));
|
|
111
104
|
}
|
|
112
105
|
|
|
113
106
|
if (appKeyInPkg && appKeyInPkg !== appKey) {
|
|
114
|
-
throw new Error(
|
|
115
|
-
`appKey不匹配!当前apk: ${appKeyInPkg}, 当前update.json: ${appKey}`,
|
|
116
|
-
);
|
|
107
|
+
throw new Error(t('appKeyMismatchApk', { appKeyInPkg, appKey }));
|
|
117
108
|
}
|
|
118
109
|
|
|
119
110
|
const { hash } = await uploadFile(fn);
|
|
@@ -126,9 +117,7 @@ export const commands = {
|
|
|
126
117
|
commit: await getCommitInfo(),
|
|
127
118
|
});
|
|
128
119
|
saveToLocal(fn, `${appId}/package/${id}.apk`);
|
|
129
|
-
console.log(
|
|
130
|
-
`已成功上传apk原生包(id: ${id}, version: ${versionName}, buildTime: ${buildTime})`,
|
|
131
|
-
);
|
|
120
|
+
console.log(t('apkUploadSuccess', { id, version: versionName, buildTime }));
|
|
132
121
|
},
|
|
133
122
|
uploadApp: async ({ args }: { args: string[] }) => {
|
|
134
123
|
const fn = args[0];
|
|
@@ -144,15 +133,11 @@ export const commands = {
|
|
|
144
133
|
const { appId, appKey } = await getSelectedApp('harmony');
|
|
145
134
|
|
|
146
135
|
if (appIdInPkg && appIdInPkg != appId) {
|
|
147
|
-
throw new Error(
|
|
148
|
-
`appId不匹配!当前app: ${appIdInPkg}, 当前update.json: ${appId}`,
|
|
149
|
-
);
|
|
136
|
+
throw new Error(t('appIdMismatchApp', { appIdInPkg, appId }));
|
|
150
137
|
}
|
|
151
138
|
|
|
152
139
|
if (appKeyInPkg && appKeyInPkg !== appKey) {
|
|
153
|
-
throw new Error(
|
|
154
|
-
`appKey不匹配!当前app: ${appKeyInPkg}, 当前update.json: ${appKey}`,
|
|
155
|
-
);
|
|
140
|
+
throw new Error(t('appKeyMismatchApp', { appKeyInPkg, appKey }));
|
|
156
141
|
}
|
|
157
142
|
|
|
158
143
|
const { hash } = await uploadFile(fn);
|
|
@@ -165,9 +150,7 @@ export const commands = {
|
|
|
165
150
|
commit: await getCommitInfo(),
|
|
166
151
|
});
|
|
167
152
|
saveToLocal(fn, `${appId}/package/${id}.app`);
|
|
168
|
-
console.log(
|
|
169
|
-
`已成功上传app原生包(id: ${id}, version: ${versionName}, buildTime: ${buildTime})`,
|
|
170
|
-
);
|
|
153
|
+
console.log(t('appUploadSuccess', { id, version: versionName, buildTime }));
|
|
171
154
|
},
|
|
172
155
|
parseApp: async ({ args }: { args: string[] }) => {
|
|
173
156
|
const fn = args[0];
|
|
@@ -192,7 +175,7 @@ export const commands = {
|
|
|
192
175
|
},
|
|
193
176
|
packages: async ({ options }: { options: { platform: Platform } }) => {
|
|
194
177
|
const platform = checkPlatform(
|
|
195
|
-
options.platform || (await question(
|
|
178
|
+
options.platform || (await question(t('platformPrompt'))),
|
|
196
179
|
);
|
|
197
180
|
const { appId } = await getSelectedApp(platform);
|
|
198
181
|
await listPackage(appId);
|
package/src/utils/i18n.ts
CHANGED
package/src/versions.ts
CHANGED
|
@@ -125,9 +125,7 @@ export const commands = {
|
|
|
125
125
|
const { name, description, metaInfo } = options;
|
|
126
126
|
|
|
127
127
|
if (!fn || !fn.endsWith('.ppk')) {
|
|
128
|
-
throw new Error(
|
|
129
|
-
'使用方法: pushy publish ppk后缀文件 --platform ios|android|harmony',
|
|
130
|
-
);
|
|
128
|
+
throw new Error(t('publishUsage'));
|
|
131
129
|
}
|
|
132
130
|
|
|
133
131
|
const platform = checkPlatform(
|
|
@@ -204,7 +202,7 @@ export const commands = {
|
|
|
204
202
|
minPkgVersion = String(minPkgVersion).trim();
|
|
205
203
|
const { data } = await get(`/app/${appId}/package/list?limit=1000`);
|
|
206
204
|
const pkgs = data.filter((pkg: Package) =>
|
|
207
|
-
compare(pkg.name, minPkgVersion
|
|
205
|
+
compare(pkg.name, minPkgVersion!, '>='),
|
|
208
206
|
);
|
|
209
207
|
if (pkgs.length === 0) {
|
|
210
208
|
throw new Error(t('nativeVersionNotFound', { version: minPkgVersion }));
|
|
@@ -245,10 +243,12 @@ export const commands = {
|
|
|
245
243
|
maxPkgVersion = String(maxPkgVersion).trim();
|
|
246
244
|
const { data } = await get(`/app/${appId}/package/list?limit=1000`);
|
|
247
245
|
const pkgs = data.filter((pkg: Package) =>
|
|
248
|
-
compare(pkg.name, maxPkgVersion
|
|
246
|
+
compare(pkg.name, maxPkgVersion!, '<='),
|
|
249
247
|
);
|
|
250
248
|
if (pkgs.length === 0) {
|
|
251
|
-
throw new Error(
|
|
249
|
+
throw new Error(
|
|
250
|
+
t('nativeVersionNotFoundLess', { version: maxPkgVersion }),
|
|
251
|
+
);
|
|
252
252
|
}
|
|
253
253
|
if (rollout !== undefined) {
|
|
254
254
|
const rolloutConfig: Record<string, number> = {};
|
|
@@ -290,7 +290,9 @@ export const commands = {
|
|
|
290
290
|
if (pkg) {
|
|
291
291
|
pkgId = pkg.id;
|
|
292
292
|
} else {
|
|
293
|
-
throw new Error(
|
|
293
|
+
throw new Error(
|
|
294
|
+
t('nativeVersionNotFoundMatch', { version: pkgVersion }),
|
|
295
|
+
);
|
|
294
296
|
}
|
|
295
297
|
}
|
|
296
298
|
if (!pkgId) {
|