react-native-update-cli 2.0.0 → 2.0.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/README.md +101 -76
- package/README.zh-CN.md +131 -106
- package/cli.json +21 -3
- package/lib/locales/en.js +2 -1
- package/lib/locales/zh.js +2 -1
- package/lib/package.js +27 -6
- package/lib/provider.js +2 -1
- package/package.json +1 -1
- package/src/locales/en.ts +1 -0
- package/src/locales/zh.ts +1 -0
- package/src/package.ts +48 -27
- package/src/provider.ts +1 -1
- package/src/types.ts +1 -0
package/lib/package.js
CHANGED
|
@@ -82,13 +82,13 @@ async function choosePackage(appId) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
const packageCommands = {
|
|
85
|
-
uploadIpa: async ({ args })=>{
|
|
85
|
+
uploadIpa: async ({ args, options })=>{
|
|
86
86
|
const fn = args[0];
|
|
87
87
|
if (!fn || !fn.endsWith('.ipa')) {
|
|
88
88
|
throw new Error((0, _i18n.t)('usageUploadIpa'));
|
|
89
89
|
}
|
|
90
90
|
const ipaInfo = await (0, _utils.getIpaInfo)(fn);
|
|
91
|
-
const { versionName, buildTime } = ipaInfo;
|
|
91
|
+
const { versionName: extractedVersionName, buildTime } = ipaInfo;
|
|
92
92
|
const appIdInPkg = ipaInfo.appId;
|
|
93
93
|
const appKeyInPkg = ipaInfo.appKey;
|
|
94
94
|
const { appId, appKey } = await (0, _app.getSelectedApp)('ios');
|
|
@@ -104,6 +104,13 @@ const packageCommands = {
|
|
|
104
104
|
appKey
|
|
105
105
|
}));
|
|
106
106
|
}
|
|
107
|
+
// Use custom version if provided, otherwise use extracted version
|
|
108
|
+
const versionName = options.version || extractedVersionName;
|
|
109
|
+
if (options.version) {
|
|
110
|
+
console.log((0, _i18n.t)('usingCustomVersion', {
|
|
111
|
+
version: versionName
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
107
114
|
const { hash } = await (0, _api.uploadFile)(fn);
|
|
108
115
|
const { id } = await (0, _api.post)(`/app/${appId}/package/create`, {
|
|
109
116
|
name: versionName,
|
|
@@ -119,13 +126,13 @@ const packageCommands = {
|
|
|
119
126
|
buildTime
|
|
120
127
|
}));
|
|
121
128
|
},
|
|
122
|
-
uploadApk: async ({ args })=>{
|
|
129
|
+
uploadApk: async ({ args, options })=>{
|
|
123
130
|
const fn = args[0];
|
|
124
131
|
if (!fn || !fn.endsWith('.apk')) {
|
|
125
132
|
throw new Error((0, _i18n.t)('usageUploadApk'));
|
|
126
133
|
}
|
|
127
134
|
const apkInfo = await (0, _utils.getApkInfo)(fn);
|
|
128
|
-
const { versionName, buildTime } = apkInfo;
|
|
135
|
+
const { versionName: extractedVersionName, buildTime } = apkInfo;
|
|
129
136
|
const appIdInPkg = apkInfo.appId;
|
|
130
137
|
const appKeyInPkg = apkInfo.appKey;
|
|
131
138
|
const { appId, appKey } = await (0, _app.getSelectedApp)('android');
|
|
@@ -141,6 +148,13 @@ const packageCommands = {
|
|
|
141
148
|
appKey
|
|
142
149
|
}));
|
|
143
150
|
}
|
|
151
|
+
// Use custom version if provided, otherwise use extracted version
|
|
152
|
+
const versionName = options.version || extractedVersionName;
|
|
153
|
+
if (options.version) {
|
|
154
|
+
console.log((0, _i18n.t)('usingCustomVersion', {
|
|
155
|
+
version: versionName
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
144
158
|
const { hash } = await (0, _api.uploadFile)(fn);
|
|
145
159
|
const { id } = await (0, _api.post)(`/app/${appId}/package/create`, {
|
|
146
160
|
name: versionName,
|
|
@@ -156,13 +170,13 @@ const packageCommands = {
|
|
|
156
170
|
buildTime
|
|
157
171
|
}));
|
|
158
172
|
},
|
|
159
|
-
uploadApp: async ({ args })=>{
|
|
173
|
+
uploadApp: async ({ args, options })=>{
|
|
160
174
|
const fn = args[0];
|
|
161
175
|
if (!fn || !fn.endsWith('.app')) {
|
|
162
176
|
throw new Error((0, _i18n.t)('usageUploadApp'));
|
|
163
177
|
}
|
|
164
178
|
const appInfo = await (0, _utils.getAppInfo)(fn);
|
|
165
|
-
const { versionName, buildTime } = appInfo;
|
|
179
|
+
const { versionName: extractedVersionName, buildTime } = appInfo;
|
|
166
180
|
const appIdInPkg = appInfo.appId;
|
|
167
181
|
const appKeyInPkg = appInfo.appKey;
|
|
168
182
|
const { appId, appKey } = await (0, _app.getSelectedApp)('harmony');
|
|
@@ -178,6 +192,13 @@ const packageCommands = {
|
|
|
178
192
|
appKey
|
|
179
193
|
}));
|
|
180
194
|
}
|
|
195
|
+
// Use custom version if provided, otherwise use extracted version
|
|
196
|
+
const versionName = options.version || extractedVersionName;
|
|
197
|
+
if (options.version) {
|
|
198
|
+
console.log((0, _i18n.t)('usingCustomVersion', {
|
|
199
|
+
version: versionName
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
181
202
|
const { hash } = await (0, _api.uploadFile)(fn);
|
|
182
203
|
const { id } = await (0, _api.post)(`/app/${appId}/package/create`, {
|
|
183
204
|
name: versionName,
|
package/lib/provider.js
CHANGED
|
@@ -135,7 +135,8 @@ class CLIProviderImpl {
|
|
|
135
135
|
],
|
|
136
136
|
options: {
|
|
137
137
|
platform,
|
|
138
|
-
appId
|
|
138
|
+
appId,
|
|
139
|
+
version: options.version
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
const { packageCommands } = await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./package")));
|
package/package.json
CHANGED
package/src/locales/en.ts
CHANGED
|
@@ -130,4 +130,5 @@ This can reduce the risk of inconsistent dependencies and supply chain attacks.
|
|
|
130
130
|
updateNativePackageQuestion: 'Bind to native package now?(Y/N)',
|
|
131
131
|
unnamed: '(Unnamed)',
|
|
132
132
|
dryRun: 'Below is the dry-run result, no actual operation will be performed:',
|
|
133
|
+
usingCustomVersion: 'Using custom version: {{version}}',
|
|
133
134
|
};
|
package/src/locales/zh.ts
CHANGED
package/src/package.ts
CHANGED
|
@@ -23,9 +23,9 @@ export async function listPackage(appId: string) {
|
|
|
23
23
|
let versionInfo = '';
|
|
24
24
|
if (version) {
|
|
25
25
|
const versionObj = version as any;
|
|
26
|
-
versionInfo = t('boundTo', {
|
|
27
|
-
name: versionObj.name || version,
|
|
28
|
-
id: versionObj.id || version
|
|
26
|
+
versionInfo = t('boundTo', {
|
|
27
|
+
name: versionObj.name || version,
|
|
28
|
+
id: versionObj.id || version,
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
let output = pkg.name;
|
|
@@ -57,16 +57,19 @@ export async function choosePackage(appId: string) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export const packageCommands = {
|
|
60
|
-
uploadIpa: async ({
|
|
60
|
+
uploadIpa: async ({
|
|
61
|
+
args,
|
|
62
|
+
options,
|
|
63
|
+
}: {
|
|
64
|
+
args: string[];
|
|
65
|
+
options: Record<string, any>;
|
|
66
|
+
}) => {
|
|
61
67
|
const fn = args[0];
|
|
62
68
|
if (!fn || !fn.endsWith('.ipa')) {
|
|
63
69
|
throw new Error(t('usageUploadIpa'));
|
|
64
70
|
}
|
|
65
71
|
const ipaInfo = await getIpaInfo(fn);
|
|
66
|
-
const {
|
|
67
|
-
versionName,
|
|
68
|
-
buildTime,
|
|
69
|
-
} = ipaInfo;
|
|
72
|
+
const { versionName: extractedVersionName, buildTime } = ipaInfo;
|
|
70
73
|
const appIdInPkg = (ipaInfo as any).appId;
|
|
71
74
|
const appKeyInPkg = (ipaInfo as any).appKey;
|
|
72
75
|
const { appId, appKey } = await getSelectedApp('ios');
|
|
@@ -79,6 +82,12 @@ export const packageCommands = {
|
|
|
79
82
|
throw new Error(t('appKeyMismatchIpa', { appKeyInPkg, appKey }));
|
|
80
83
|
}
|
|
81
84
|
|
|
85
|
+
// Use custom version if provided, otherwise use extracted version
|
|
86
|
+
const versionName = options.version || extractedVersionName;
|
|
87
|
+
if (options.version) {
|
|
88
|
+
console.log(t('usingCustomVersion', { version: versionName }));
|
|
89
|
+
}
|
|
90
|
+
|
|
82
91
|
const { hash } = await uploadFile(fn);
|
|
83
92
|
|
|
84
93
|
const { id } = await post(`/app/${appId}/package/create`, {
|
|
@@ -89,20 +98,21 @@ export const packageCommands = {
|
|
|
89
98
|
commit: await getCommitInfo(),
|
|
90
99
|
});
|
|
91
100
|
saveToLocal(fn, `${appId}/package/${id}.ipa`);
|
|
92
|
-
console.log(
|
|
93
|
-
t('ipaUploadSuccess', { id, version: versionName, buildTime }),
|
|
94
|
-
);
|
|
101
|
+
console.log(t('ipaUploadSuccess', { id, version: versionName, buildTime }));
|
|
95
102
|
},
|
|
96
|
-
uploadApk: async ({
|
|
103
|
+
uploadApk: async ({
|
|
104
|
+
args,
|
|
105
|
+
options,
|
|
106
|
+
}: {
|
|
107
|
+
args: string[];
|
|
108
|
+
options: Record<string, any>;
|
|
109
|
+
}) => {
|
|
97
110
|
const fn = args[0];
|
|
98
111
|
if (!fn || !fn.endsWith('.apk')) {
|
|
99
112
|
throw new Error(t('usageUploadApk'));
|
|
100
113
|
}
|
|
101
114
|
const apkInfo = await getApkInfo(fn);
|
|
102
|
-
const {
|
|
103
|
-
versionName,
|
|
104
|
-
buildTime,
|
|
105
|
-
} = apkInfo;
|
|
115
|
+
const { versionName: extractedVersionName, buildTime } = apkInfo;
|
|
106
116
|
const appIdInPkg = (apkInfo as any).appId;
|
|
107
117
|
const appKeyInPkg = (apkInfo as any).appKey;
|
|
108
118
|
const { appId, appKey } = await getSelectedApp('android');
|
|
@@ -115,6 +125,12 @@ export const packageCommands = {
|
|
|
115
125
|
throw new Error(t('appKeyMismatchApk', { appKeyInPkg, appKey }));
|
|
116
126
|
}
|
|
117
127
|
|
|
128
|
+
// Use custom version if provided, otherwise use extracted version
|
|
129
|
+
const versionName = options.version || extractedVersionName;
|
|
130
|
+
if (options.version) {
|
|
131
|
+
console.log(t('usingCustomVersion', { version: versionName }));
|
|
132
|
+
}
|
|
133
|
+
|
|
118
134
|
const { hash } = await uploadFile(fn);
|
|
119
135
|
|
|
120
136
|
const { id } = await post(`/app/${appId}/package/create`, {
|
|
@@ -125,20 +141,21 @@ export const packageCommands = {
|
|
|
125
141
|
commit: await getCommitInfo(),
|
|
126
142
|
});
|
|
127
143
|
saveToLocal(fn, `${appId}/package/${id}.apk`);
|
|
128
|
-
console.log(
|
|
129
|
-
t('apkUploadSuccess', { id, version: versionName, buildTime }),
|
|
130
|
-
);
|
|
144
|
+
console.log(t('apkUploadSuccess', { id, version: versionName, buildTime }));
|
|
131
145
|
},
|
|
132
|
-
uploadApp: async ({
|
|
146
|
+
uploadApp: async ({
|
|
147
|
+
args,
|
|
148
|
+
options,
|
|
149
|
+
}: {
|
|
150
|
+
args: string[];
|
|
151
|
+
options: Record<string, any>;
|
|
152
|
+
}) => {
|
|
133
153
|
const fn = args[0];
|
|
134
154
|
if (!fn || !fn.endsWith('.app')) {
|
|
135
155
|
throw new Error(t('usageUploadApp'));
|
|
136
156
|
}
|
|
137
157
|
const appInfo = await getAppInfo(fn);
|
|
138
|
-
const {
|
|
139
|
-
versionName,
|
|
140
|
-
buildTime,
|
|
141
|
-
} = appInfo;
|
|
158
|
+
const { versionName: extractedVersionName, buildTime } = appInfo;
|
|
142
159
|
const appIdInPkg = (appInfo as any).appId;
|
|
143
160
|
const appKeyInPkg = (appInfo as any).appKey;
|
|
144
161
|
const { appId, appKey } = await getSelectedApp('harmony');
|
|
@@ -151,6 +168,12 @@ export const packageCommands = {
|
|
|
151
168
|
throw new Error(t('appKeyMismatchApp', { appKeyInPkg, appKey }));
|
|
152
169
|
}
|
|
153
170
|
|
|
171
|
+
// Use custom version if provided, otherwise use extracted version
|
|
172
|
+
const versionName = options.version || extractedVersionName;
|
|
173
|
+
if (options.version) {
|
|
174
|
+
console.log(t('usingCustomVersion', { version: versionName }));
|
|
175
|
+
}
|
|
176
|
+
|
|
154
177
|
const { hash } = await uploadFile(fn);
|
|
155
178
|
|
|
156
179
|
const { id } = await post(`/app/${appId}/package/create`, {
|
|
@@ -161,9 +184,7 @@ export const packageCommands = {
|
|
|
161
184
|
commit: await getCommitInfo(),
|
|
162
185
|
});
|
|
163
186
|
saveToLocal(fn, `${appId}/package/${id}.app`);
|
|
164
|
-
console.log(
|
|
165
|
-
t('appUploadSuccess', { id, version: versionName, buildTime }),
|
|
166
|
-
);
|
|
187
|
+
console.log(t('appUploadSuccess', { id, version: versionName, buildTime }));
|
|
167
188
|
},
|
|
168
189
|
parseApp: async ({ args }: { args: string[] }) => {
|
|
169
190
|
const fn = args[0];
|
package/src/provider.ts
CHANGED
|
@@ -110,7 +110,7 @@ export class CLIProviderImpl implements CLIProvider {
|
|
|
110
110
|
|
|
111
111
|
const context: CommandContext = {
|
|
112
112
|
args: [filePath],
|
|
113
|
-
options: { platform, appId },
|
|
113
|
+
options: { platform, appId, version: options.version },
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
const { packageCommands } = await import('./package');
|