react-native-update-cli 1.36.0 → 1.37.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/app.js +4 -3
- package/lib/bundle.js +1 -1
- package/lib/package.js +1 -1
- package/lib/versions.js +5 -5
- package/package.json +2 -1
- package/src/app.js +3 -2
- package/src/bundle.js +1 -1
- package/src/package.js +1 -1
- package/src/versions.js +5 -5
package/lib/app.js
CHANGED
|
@@ -36,7 +36,8 @@ function _interop_require_default(obj) {
|
|
|
36
36
|
}
|
|
37
37
|
const validPlatforms = {
|
|
38
38
|
ios: 1,
|
|
39
|
-
android: 1
|
|
39
|
+
android: 1,
|
|
40
|
+
harmony: 1
|
|
40
41
|
};
|
|
41
42
|
function checkPlatform(platform) {
|
|
42
43
|
if (!validPlatforms[platform]) {
|
|
@@ -99,7 +100,7 @@ const commands = {
|
|
|
99
100
|
createApp: async function({ options }) {
|
|
100
101
|
const name = options.name || await (0, _utils.question)('应用名称:');
|
|
101
102
|
const { downloadUrl } = options;
|
|
102
|
-
const platform = checkPlatform(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
103
|
+
const platform = checkPlatform(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
103
104
|
const { id } = await (0, _api.post)('/app/create', {
|
|
104
105
|
name,
|
|
105
106
|
platform
|
|
@@ -129,7 +130,7 @@ const commands = {
|
|
|
129
130
|
listApp(platform);
|
|
130
131
|
},
|
|
131
132
|
selectApp: async function({ args, options }) {
|
|
132
|
-
const platform = checkPlatform(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
133
|
+
const platform = checkPlatform(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
133
134
|
const id = args[0] ? parseInt(args[0]) : (await chooseApp(platform)).id;
|
|
134
135
|
let updateInfo = {};
|
|
135
136
|
if (_fs.default.existsSync('update.json')) {
|
package/lib/bundle.js
CHANGED
|
@@ -596,7 +596,7 @@ function diffArgsCheck(args, options, diffFn) {
|
|
|
596
596
|
}
|
|
597
597
|
const commands = {
|
|
598
598
|
bundle: async function({ options }) {
|
|
599
|
-
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
599
|
+
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
600
600
|
let { bundleName, entryFile, intermediaDir, output, dev, sourcemap } = (0, _utils.translateOptions)({
|
|
601
601
|
...options,
|
|
602
602
|
platform
|
package/lib/package.js
CHANGED
|
@@ -134,7 +134,7 @@ const commands = {
|
|
|
134
134
|
console.log(await (0, _utils.getApkInfo)(fn));
|
|
135
135
|
},
|
|
136
136
|
packages: async function({ options }) {
|
|
137
|
-
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
137
|
+
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
138
138
|
const { appId } = await (0, _app.getSelectedApp)(platform);
|
|
139
139
|
await listPackage(appId);
|
|
140
140
|
}
|
package/lib/versions.js
CHANGED
|
@@ -81,9 +81,9 @@ const commands = {
|
|
|
81
81
|
const fn = args[0];
|
|
82
82
|
const { name, description, metaInfo } = options;
|
|
83
83
|
if (!fn || !fn.endsWith('.ppk')) {
|
|
84
|
-
throw new Error('使用方法: pushy publish ppk后缀文件 --platform ios|android');
|
|
84
|
+
throw new Error('使用方法: pushy publish ppk后缀文件 --platform ios|android|harmony');
|
|
85
85
|
}
|
|
86
|
-
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
86
|
+
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
87
87
|
const { appId } = await (0, _app.getSelectedApp)(platform);
|
|
88
88
|
const { hash } = await (0, _api.uploadFile)(fn);
|
|
89
89
|
const { id } = await (0, _api.post)(`/app/${appId}/version/create`, {
|
|
@@ -107,12 +107,12 @@ const commands = {
|
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
versions: async function({ options }) {
|
|
110
|
-
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
110
|
+
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
111
111
|
const { appId } = await (0, _app.getSelectedApp)(platform);
|
|
112
112
|
await listVersions(appId);
|
|
113
113
|
},
|
|
114
114
|
update: async function({ args, options }) {
|
|
115
|
-
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
115
|
+
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
116
116
|
const { appId } = await (0, _app.getSelectedApp)(platform);
|
|
117
117
|
let versionId = options.versionId || (await chooseVersion(appId)).id;
|
|
118
118
|
if (versionId === 'null') {
|
|
@@ -229,7 +229,7 @@ const commands = {
|
|
|
229
229
|
console.log(`已将热更版本 ${versionId} 绑定到原生版本 ${pkgVersion} (id: ${pkgId})`);
|
|
230
230
|
},
|
|
231
231
|
updateVersionInfo: async function({ args, options }) {
|
|
232
|
-
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android):'));
|
|
232
|
+
const platform = (0, _app.checkPlatform)(options.platform || await (0, _utils.question)('平台(ios/android/harmony):'));
|
|
233
233
|
const { appId } = await (0, _app.getSelectedApp)(platform);
|
|
234
234
|
const versionId = options.versionId || (await chooseVersion(appId)).id;
|
|
235
235
|
const updateParams = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-update-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.37.0",
|
|
4
4
|
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"react-native",
|
|
24
24
|
"ios",
|
|
25
25
|
"android",
|
|
26
|
+
"harmony",
|
|
26
27
|
"update"
|
|
27
28
|
],
|
|
28
29
|
"author": "reactnativecn",
|
package/src/app.js
CHANGED
|
@@ -7,6 +7,7 @@ import { post, get, doDelete } from './api';
|
|
|
7
7
|
const validPlatforms = {
|
|
8
8
|
ios: 1,
|
|
9
9
|
android: 1,
|
|
10
|
+
harmony: 1,
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
export function checkPlatform(platform) {
|
|
@@ -74,7 +75,7 @@ export const commands = {
|
|
|
74
75
|
const name = options.name || (await question('应用名称:'));
|
|
75
76
|
const { downloadUrl } = options;
|
|
76
77
|
const platform = checkPlatform(
|
|
77
|
-
options.platform || (await question('平台(ios/android):')),
|
|
78
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
78
79
|
);
|
|
79
80
|
const { id } = await post('/app/create', { name, platform });
|
|
80
81
|
console.log(`已成功创建应用(id: ${id})`);
|
|
@@ -98,7 +99,7 @@ export const commands = {
|
|
|
98
99
|
},
|
|
99
100
|
selectApp: async function ({ args, options }) {
|
|
100
101
|
const platform = checkPlatform(
|
|
101
|
-
options.platform || (await question('平台(ios/android):')),
|
|
102
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
102
103
|
);
|
|
103
104
|
const id = args[0] ? parseInt(args[0]) : (await chooseApp(platform)).id;
|
|
104
105
|
|
package/src/bundle.js
CHANGED
|
@@ -699,7 +699,7 @@ function diffArgsCheck(args, options, diffFn) {
|
|
|
699
699
|
export const commands = {
|
|
700
700
|
bundle: async function ({ options }) {
|
|
701
701
|
const platform = checkPlatform(
|
|
702
|
-
options.platform || (await question('平台(ios/android):')),
|
|
702
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
703
703
|
);
|
|
704
704
|
|
|
705
705
|
let { bundleName, entryFile, intermediaDir, output, dev, sourcemap } =
|
package/src/package.js
CHANGED
|
@@ -138,7 +138,7 @@ export const commands = {
|
|
|
138
138
|
},
|
|
139
139
|
packages: async function ({ options }) {
|
|
140
140
|
const platform = checkPlatform(
|
|
141
|
-
options.platform || (await question('平台(ios/android):')),
|
|
141
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
142
142
|
);
|
|
143
143
|
const { appId } = await getSelectedApp(platform);
|
|
144
144
|
await listPackage(appId);
|
package/src/versions.js
CHANGED
|
@@ -86,12 +86,12 @@ export const commands = {
|
|
|
86
86
|
|
|
87
87
|
if (!fn || !fn.endsWith('.ppk')) {
|
|
88
88
|
throw new Error(
|
|
89
|
-
'使用方法: pushy publish ppk后缀文件 --platform ios|android',
|
|
89
|
+
'使用方法: pushy publish ppk后缀文件 --platform ios|android|harmony',
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
const platform = checkPlatform(
|
|
94
|
-
options.platform || (await question('平台(ios/android):')),
|
|
94
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
95
95
|
);
|
|
96
96
|
const { appId } = await getSelectedApp(platform);
|
|
97
97
|
|
|
@@ -114,14 +114,14 @@ export const commands = {
|
|
|
114
114
|
},
|
|
115
115
|
versions: async function ({ options }) {
|
|
116
116
|
const platform = checkPlatform(
|
|
117
|
-
options.platform || (await question('平台(ios/android):')),
|
|
117
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
118
118
|
);
|
|
119
119
|
const { appId } = await getSelectedApp(platform);
|
|
120
120
|
await listVersions(appId);
|
|
121
121
|
},
|
|
122
122
|
update: async function ({ args, options }) {
|
|
123
123
|
const platform = checkPlatform(
|
|
124
|
-
options.platform || (await question('平台(ios/android):')),
|
|
124
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
125
125
|
);
|
|
126
126
|
const { appId } = await getSelectedApp(platform);
|
|
127
127
|
let versionId = options.versionId || (await chooseVersion(appId)).id;
|
|
@@ -255,7 +255,7 @@ export const commands = {
|
|
|
255
255
|
},
|
|
256
256
|
updateVersionInfo: async function ({ args, options }) {
|
|
257
257
|
const platform = checkPlatform(
|
|
258
|
-
options.platform || (await question('平台(ios/android):')),
|
|
258
|
+
options.platform || (await question('平台(ios/android/harmony):')),
|
|
259
259
|
);
|
|
260
260
|
const { appId } = await getSelectedApp(platform);
|
|
261
261
|
const versionId = options.versionId || (await chooseVersion(appId)).id;
|