react-native-update-cli 2.10.1 → 2.11.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.
Files changed (82) hide show
  1. package/README.md +47 -497
  2. package/README.zh-CN.md +52 -500
  3. package/cli.json +2 -16
  4. package/lib/api.js +1 -1
  5. package/lib/app.d.ts +1 -1
  6. package/lib/app.js +42 -45
  7. package/lib/bin.d.ts +2 -0
  8. package/lib/bin.js +70 -0
  9. package/lib/bundle-runner.d.ts +1 -0
  10. package/lib/bundle-runner.js +46 -10
  11. package/lib/exports.d.ts +2 -9
  12. package/lib/exports.js +0 -31
  13. package/lib/index.d.ts +1 -5
  14. package/lib/index.js +12 -128
  15. package/lib/locales/en.d.ts +1 -0
  16. package/lib/locales/en.js +1 -0
  17. package/lib/locales/zh.d.ts +1 -0
  18. package/lib/locales/zh.js +1 -0
  19. package/lib/package.d.ts +1 -2
  20. package/lib/package.js +50 -10
  21. package/lib/provider.d.ts +1 -4
  22. package/lib/provider.js +6 -25
  23. package/lib/types.d.ts +0 -37
  24. package/lib/user.d.ts +1 -1
  25. package/lib/user.js +1 -1
  26. package/lib/utils/app-info-parser/aab.js +46 -5
  27. package/lib/utils/app-info-parser/resource-finder.js +5 -5
  28. package/lib/utils/app-info-parser/utils.js +3 -2
  29. package/lib/utils/check-lockfile.js +1 -1
  30. package/lib/utils/dep-versions.js +2 -2
  31. package/lib/utils/http-helper.js +2 -2
  32. package/lib/utils/index.d.ts +0 -1
  33. package/lib/utils/index.js +0 -13
  34. package/lib/utils/plugin-config.js +42 -6
  35. package/lib/versions.d.ts +1 -0
  36. package/lib/versions.js +19 -16
  37. package/package.json +8 -10
  38. package/src/api.ts +1 -1
  39. package/src/app.ts +40 -40
  40. package/src/bin.ts +86 -0
  41. package/src/bundle-runner.ts +70 -12
  42. package/src/exports.ts +1 -12
  43. package/src/index.ts +1 -159
  44. package/src/locales/en.ts +1 -0
  45. package/src/locales/zh.ts +1 -0
  46. package/src/package.ts +6 -10
  47. package/src/provider.ts +10 -29
  48. package/src/types.ts +0 -54
  49. package/src/user.ts +1 -1
  50. package/src/utils/app-info-parser/aab.ts +2 -2
  51. package/src/utils/app-info-parser/resource-finder.ts +5 -5
  52. package/src/utils/app-info-parser/utils.ts +2 -2
  53. package/src/utils/check-lockfile.ts +1 -1
  54. package/src/utils/dep-versions.ts +2 -2
  55. package/src/utils/http-helper.ts +2 -2
  56. package/src/utils/index.ts +1 -12
  57. package/src/utils/plugin-config.ts +1 -1
  58. package/src/versions.ts +25 -17
  59. package/lib/module-manager.d.ts +0 -20
  60. package/lib/module-manager.js +0 -118
  61. package/lib/modules/app-module.d.ts +0 -2
  62. package/lib/modules/app-module.js +0 -263
  63. package/lib/modules/bundle-module.d.ts +0 -2
  64. package/lib/modules/bundle-module.js +0 -187
  65. package/lib/modules/index.d.ts +0 -6
  66. package/lib/modules/index.js +0 -42
  67. package/lib/modules/package-module.d.ts +0 -2
  68. package/lib/modules/package-module.js +0 -16
  69. package/lib/modules/user-module.d.ts +0 -2
  70. package/lib/modules/user-module.js +0 -413
  71. package/lib/modules/version-module.d.ts +0 -2
  72. package/lib/modules/version-module.js +0 -16
  73. package/lib/workflow-runner.d.ts +0 -2
  74. package/lib/workflow-runner.js +0 -25
  75. package/src/module-manager.ts +0 -145
  76. package/src/modules/app-module.ts +0 -277
  77. package/src/modules/bundle-module.ts +0 -212
  78. package/src/modules/index.ts +0 -19
  79. package/src/modules/package-module.ts +0 -10
  80. package/src/modules/user-module.ts +0 -465
  81. package/src/modules/version-module.ts +0 -8
  82. package/src/workflow-runner.ts +0 -24
package/README.zh-CN.md CHANGED
@@ -1,56 +1,50 @@
1
1
  # React Native Update CLI
2
2
 
3
- 这是一个统一的 React Native Update CLI,同时支持传统命令和模块化架构以及自定义发布流程。
3
+ [English Documentation](./README.md)
4
4
 
5
- ## 🚀 特性
5
+ React Native Update 命令行工具,用于打包、上传原生包、发布 OTA 版本,以及管理应用和包。
6
6
 
7
- - **统一 CLI**: 使用单个`pushy`命令提供所有功能
8
- - **向后兼容**: 所有现有命令都能正常工作
9
- - **模块化架构**: 将 CLI 功能拆分为独立的模块
10
- - **自定义工作流**: 支持创建自定义的发布流程
11
- - **可扩展性**: 用户可以导入和注册自定义模块
12
- - **类型安全**: 完整的 TypeScript 类型支持
7
+ ## 功能
13
8
 
14
- ## 📦 安装
9
+ - 统一的 `pushy` / `cresc` CLI 入口
10
+ - 保持既有命令兼容
11
+ - 可用于构建脚本和 CI/CD 的 Provider API
12
+ - 提供 TypeScript 类型定义
13
+
14
+ ## 安装
15
15
 
16
16
  ```bash
17
17
  npm install react-native-update-cli
18
18
  ```
19
19
 
20
- ## 🎯 快速开始
21
-
22
- ### 基本使用
20
+ ## 基础用法
23
21
 
24
22
  ```bash
25
- # 使用统一CLI
26
23
  npx pushy help
27
-
28
- # 列出所有可用命令和工作流
29
24
  npx pushy list
30
25
 
31
- # 执行内置的工作流
32
- npx pushy workflow setup-app
33
-
34
- # 执行自定义工作流
35
- npx pushy workflow custom-publish
26
+ npx pushy bundle --platform ios
27
+ npx pushy publish --platform ios --name 1.0.0
28
+ npx pushy uploadIpa ./app.ipa
36
29
  ```
37
30
 
38
- ### 编程方式使用
31
+ ## 编程调用
39
32
 
40
33
  ```typescript
41
- import { moduleManager, CLIProviderImpl } from 'react-native-update-cli';
34
+ import { CLIProviderImpl } from 'react-native-update-cli';
42
35
 
43
- // 获取CLI提供者
44
- const provider = moduleManager.getProvider();
36
+ const provider = new CLIProviderImpl();
45
37
 
46
- // 执行打包
47
38
  const bundleResult = await provider.bundle({
48
39
  platform: 'ios',
49
40
  dev: false,
50
41
  sourcemap: true,
51
42
  });
52
43
 
53
- // 发布版本
44
+ if (!bundleResult.success) {
45
+ throw new Error(bundleResult.error);
46
+ }
47
+
54
48
  const publishResult = await provider.publish({
55
49
  name: 'v1.2.3',
56
50
  description: 'Bug fixes and improvements',
@@ -58,279 +52,87 @@ const publishResult = await provider.publish({
58
52
  });
59
53
  ```
60
54
 
61
- ## 🔧 创建自定义模块
62
-
63
- ### 1. 定义模块
64
-
65
- ```typescript
66
- import type {
67
- CLIModule,
68
- CommandDefinition,
69
- CustomWorkflow,
70
- } from 'react-native-update-cli';
71
-
72
- export const myCustomModule: CLIModule = {
73
- name: 'my-custom',
74
- version: '1.0.0',
75
-
76
- commands: [
77
- {
78
- name: 'custom-command',
79
- description: 'My custom command',
80
- handler: async (context) => {
81
- console.log('Executing custom command...');
82
- return {
83
- success: true,
84
- data: { message: 'Custom command executed' },
85
- };
86
- },
87
- options: {
88
- param: { hasValue: true, description: 'Custom parameter' },
89
- },
90
- },
91
- ],
92
-
93
- workflows: [
94
- {
95
- name: 'my-workflow',
96
- description: 'My custom workflow',
97
- steps: [
98
- {
99
- name: 'step1',
100
- description: 'First step',
101
- execute: async (context, previousResult) => {
102
- console.log('Executing step 1...');
103
- return { step1Completed: true };
104
- },
105
- },
106
- {
107
- name: 'step2',
108
- description: 'Second step',
109
- execute: async (context, previousResult) => {
110
- console.log('Executing step 2...');
111
- return { ...previousResult, step2Completed: true };
112
- },
113
- },
114
- ],
115
- },
116
- ],
117
-
118
- init: (provider) => {
119
- console.log('Custom module initialized');
120
- },
121
-
122
- cleanup: () => {
123
- console.log('Custom module cleanup');
124
- },
125
- };
126
- ```
127
-
128
- ### 2. 注册模块
129
-
130
- ```typescript
131
- import { moduleManager } from 'react-native-update-cli';
132
- import { myCustomModule } from './my-custom-module';
133
-
134
- // 注册自定义模块
135
- moduleManager.registerModule(myCustomModule);
136
-
137
- // 执行自定义命令
138
- const result = await moduleManager.executeCommand('custom-command', {
139
- args: [],
140
- options: { param: 'value' },
141
- });
142
-
143
- // 执行自定义工作流
144
- const workflowResult = await moduleManager.executeWorkflow('my-workflow', {
145
- args: [],
146
- options: {},
147
- });
148
- ```
149
-
150
- ## 🔄 工作流系统
151
-
152
- ### 工作流步骤
153
-
154
- 每个工作流步骤包含:
155
-
156
- - `name`: 步骤名称
157
- - `description`: 步骤描述
158
- - `execute`: 执行函数
159
- - `condition`: 可选的条件函数
160
-
161
- ### 条件执行
162
-
163
- ```typescript
164
- {
165
- name: 'conditional-step',
166
- description: 'Only execute in production',
167
- execute: async (context, previousResult) => {
168
- // 执行逻辑
169
- },
170
- condition: (context) => {
171
- return context.options.environment === 'production';
172
- }
173
- }
174
- ```
175
-
176
- ### 工作流验证
177
-
178
- ```typescript
179
- {
180
- name: 'validated-workflow',
181
- description: 'Workflow with validation',
182
- steps: [...],
183
- validate: (context) => {
184
- if (!context.options.requiredParam) {
185
- console.error('Required parameter missing');
186
- return false;
187
- }
188
- return true;
189
- }
190
- }
191
- ```
192
-
193
- ## 📋 内置模块
55
+ ## 内置命令
194
56
 
195
- ### Bundle 模块 (`bundle`)
57
+ ### Bundle
196
58
 
197
- - `bundle`: 打包 JavaScript 代码并可选发布
198
- - `hdiff`: 生成两个 PPK 文件之间的 hdiff
199
- - `hdiffFromApk`: 从 APK 文件生成 hdiff
200
- - `hdiffFromApp`: 从 APP 文件生成 hdiff
201
- - `hdiffFromIpa`: 从 IPA 文件生成 hdiff
59
+ - `bundle`: 打包 JavaScript 代码,可选择发布
60
+ - `hdiff`: 基于两个 PPK 文件生成 hdiff
61
+ - `hdiffFromApk`: 基于 APK 文件生成 hdiff
62
+ - `hdiffFromApp`: 基于 APP 文件生成 hdiff
63
+ - `hdiffFromIpa`: 基于 IPA 文件生成 hdiff
202
64
 
203
- ### Version 模块 (`version`)
65
+ ### Version
204
66
 
205
67
  - `publish`: 发布新版本
206
- - `versions`: 列出所有版本
207
- - `update`: 更新版本信息
208
- - `updateVersionInfo`: 更新版本元数据
68
+ - `versions`: 列出版本
69
+ - `update`: 更新版本包规则
70
+ - `updateVersionInfo`: 更新版本元信息
71
+ - `deleteVersion`: 删除版本
209
72
 
210
- ### App 模块 (`app`)
73
+ ### App
211
74
 
212
- - `createApp`: 创建新应用
213
- - `apps`: 列出所有应用
75
+ - `createApp`: 创建应用
76
+ - `apps`: 列出应用
214
77
  - `selectApp`: 选择应用
215
78
  - `deleteApp`: 删除应用
216
79
 
217
- ### Package 模块 (`package`)
80
+ ### Package
218
81
 
219
- - `uploadIpa`: 上传 IPA 文件(支持 `--version` 参数覆盖提取的版本)
220
- - `uploadApk`: 上传 APK 文件(支持 `--version` 参数覆盖提取的版本)
221
- - `uploadAab`: 上传 AAB 文件(转换为 APK,支持 `--version`、`--includeAllSplits`、`--splits`)
222
- - `uploadApp`: 上传 APP 文件(支持 `--version` 参数覆盖提取的版本)
82
+ - `uploadIpa`: 上传 IPA 文件
83
+ - `uploadApk`: 上传 APK 文件
84
+ - `uploadAab`: 上传 AAB 文件
85
+ - `uploadApp`: 上传 APP 文件
223
86
  - `parseApp`: 解析 APP 文件信息
224
87
  - `parseIpa`: 解析 IPA 文件信息
225
88
  - `parseApk`: 解析 APK 文件信息
226
- - `extractApk`: 从 AAB 提取通用 APK(支持 `--output`、`--includeAllSplits`、`--splits`)
89
+ - `parseAab`: 解析 AAB 文件信息
90
+ - `extractApk`: 从 AAB 提取通用 APK
227
91
  - `packages`: 列出包
92
+ - `deletePackage`: 删除包
228
93
 
229
- ### User 模块 (`user`)
94
+ ### User
230
95
 
231
96
  - `login`: 登录
232
- - `logout`: 登出
233
- - `me`: 显示用户信息
234
-
235
- ## 🛠️ CLI 提供者 API
97
+ - `logout`: 退出登录
98
+ - `me`: 查看当前用户信息
236
99
 
237
- ### 核心功能
100
+ ## Provider API
238
101
 
239
102
  ```typescript
240
103
  interface CLIProvider {
241
- // 打包
242
104
  bundle(options: BundleOptions): Promise<CommandResult>;
243
-
244
- // 发布
245
105
  publish(options: PublishOptions): Promise<CommandResult>;
246
-
247
- // 上传
248
106
  upload(options: UploadOptions): Promise<CommandResult>;
249
107
 
250
- // 应用管理
251
108
  getSelectedApp(
252
109
  platform?: Platform,
253
110
  ): Promise<{ appId: string; platform: Platform }>;
254
111
  listApps(platform?: Platform): Promise<CommandResult>;
255
112
  createApp(name: string, platform: Platform): Promise<CommandResult>;
256
113
 
257
- // 版本管理
258
114
  listVersions(appId: string): Promise<CommandResult>;
259
- getVersion(appId: string, versionId: string): Promise<CommandResult>;
260
115
  updateVersion(
261
116
  appId: string,
262
117
  versionId: string,
263
118
  updates: Partial<Version>,
264
119
  ): Promise<CommandResult>;
265
120
 
266
- // 包管理
267
- listPackages(appId: string, platform?: Platform): Promise<CommandResult>;
268
- getPackage(appId: string, packageId: string): Promise<CommandResult>;
269
-
270
- // 工具函数
271
121
  getPlatform(platform?: Platform): Promise<Platform>;
272
122
  loadSession(): Promise<Session>;
273
- saveToLocal(key: string, value: string): void;
274
- question(prompt: string): Promise<string>;
275
-
276
- // 工作流
277
- registerWorkflow(workflow: CustomWorkflow): void;
278
- executeWorkflow(
279
- workflowName: string,
280
- context: CommandContext,
281
- ): Promise<CommandResult>;
282
123
  }
283
124
  ```
284
125
 
285
- ### 自定义命令
286
-
287
- ```typescript
288
- // 执行自定义打包命令
289
- const bundleResult = await moduleManager.executeCommand('custom-bundle', {
290
- args: [],
291
- options: {
292
- platform: 'android',
293
- validate: true,
294
- optimize: true,
295
- },
296
- });
297
-
298
- // 生成 hdiff 文件
299
- const diffResult = await moduleManager.executeCommand('hdiff', {
300
- args: [],
301
- options: {
302
- origin: './build/v1.0.0.ppk',
303
- next: './build/v1.1.0.ppk',
304
- output: './build/hdiff.patch',
305
- },
306
- });
307
-
308
- // 从 APK 文件生成 hdiff
309
- const apkDiffResult = await moduleManager.executeCommand('hdiffFromApk', {
310
- args: [],
311
- options: {
312
- origin: './build/app-v1.0.0.apk',
313
- next: './build/app-v1.1.0.apk',
314
- output: './build/apk-hdiff.patch',
315
- },
316
- });
317
- ```
318
-
319
- ## 🔧 配置
320
-
321
- ### 环境变量
126
+ ## 环境变量
322
127
 
323
128
  ```bash
324
- # 设置API端点
325
129
  export PUSHY_REGISTRY=https://your-api-endpoint.com
326
-
327
- # 设置非交互模式
328
130
  export NO_INTERACTIVE=true
329
131
  ```
330
132
 
331
- ### 配置文件
133
+ ## 配置文件
332
134
 
333
- 创建 `update.json` 文件:
135
+ 在 React Native 项目中创建 `update.json`:
334
136
 
335
137
  ```json
336
138
  {
@@ -345,256 +147,6 @@ export NO_INTERACTIVE=true
345
147
  }
346
148
  ```
347
149
 
348
- ## 🚨 注意事项
349
-
350
- 1. **向后兼容**: 新的模块化 CLI 保持与现有 CLI 的兼容性
351
- 2. **类型安全**: 所有 API 都有完整的 TypeScript 类型定义
352
- 3. **错误处理**: 所有操作都返回标准化的结果格式
353
- 4. **资源清理**: 模块支持清理函数来释放资源
354
- 5. **模块分离**: 功能按逻辑分离到不同模块中,便于维护和扩展
355
-
356
- ## 🤝 贡献
357
-
358
- 欢迎提交 Issue 和 Pull Request 来改进这个项目!
359
-
360
- ## 🚀 Provider API 使用指南
361
-
362
- Provider 提供了简洁的编程接口,适合在应用程序中集成 React Native Update CLI 功能。
363
-
364
- ### 📋 核心 API 方法
365
-
366
- #### 核心业务功能
367
-
368
- ```typescript
369
- // 打包应用
370
- await provider.bundle({
371
- platform: 'ios',
372
- dev: false,
373
- sourcemap: true,
374
- });
375
-
376
- // 发布版本
377
- await provider.publish({
378
- name: 'v1.0.0',
379
- description: 'Bug fixes',
380
- rollout: 100,
381
- });
382
-
383
- // 上传文件
384
- await provider.upload({
385
- filePath: 'app.ipa',
386
- platform: 'ios',
387
- });
388
- ```
389
-
390
- #### 应用管理
391
-
392
- ```typescript
393
- // 创建应用
394
- await provider.createApp('MyApp', 'ios');
395
-
396
- // 列出应用
397
- await provider.listApps('ios');
398
-
399
- // 获取当前应用
400
- const { appId, platform } = await provider.getSelectedApp('ios');
401
- ```
402
-
403
- #### 版本管理
404
-
405
- ```typescript
406
- // 列出版本
407
- await provider.listVersions('app123');
408
-
409
- // 更新版本
410
- await provider.updateVersion('app123', 'version456', {
411
- name: 'v1.1.0',
412
- description: 'New features',
413
- });
414
- ```
415
-
416
- #### 工具函数
417
-
418
- ```typescript
419
- // 获取平台
420
- const platform = await provider.getPlatform('ios');
421
-
422
- // 加载会话
423
- const session = await provider.loadSession();
424
- ```
425
-
426
- ### 🎯 使用场景
427
-
428
- #### 1. 自动化构建脚本
429
-
430
- ```typescript
431
- import { moduleManager } from 'react-native-update-cli';
432
-
433
- async function buildAndPublish() {
434
- const provider = moduleManager.getProvider();
435
-
436
- // 1. 打包
437
- const bundleResult = await provider.bundle({
438
- platform: 'ios',
439
- dev: false,
440
- sourcemap: true,
441
- });
442
-
443
- if (!bundleResult.success) {
444
- throw new Error(`打包失败: ${bundleResult.error}`);
445
- }
446
-
447
- // 2. 发布
448
- const publishResult = await provider.publish({
449
- name: 'v1.2.3',
450
- description: 'Bug fixes and performance improvements',
451
- rollout: 100,
452
- });
453
-
454
- if (!publishResult.success) {
455
- throw new Error(`发布失败: ${publishResult.error}`);
456
- }
457
-
458
- console.log('构建和发布完成!');
459
- }
460
- ```
461
-
462
- #### 2. CI/CD 集成
463
-
464
- ```typescript
465
- async function ciBuild() {
466
- const provider = moduleManager.getProvider();
467
-
468
- const result = await provider.bundle({
469
- platform: process.env.PLATFORM as 'ios' | 'android',
470
- dev: process.env.NODE_ENV !== 'production',
471
- sourcemap: process.env.NODE_ENV === 'production',
472
- });
473
-
474
- return result;
475
- }
476
- ```
477
-
478
- #### 3. 应用管理服务
479
-
480
- ```typescript
481
- class AppManagementService {
482
- private provider = moduleManager.getProvider();
483
-
484
- async setupNewApp(name: string, platform: Platform) {
485
- // 创建应用
486
- const createResult = await this.provider.createApp(name, platform);
487
-
488
- if (createResult.success) {
489
- // 获取应用信息
490
- const { appId } = await this.provider.getSelectedApp(platform);
491
-
492
- // 列出版本
493
- await this.provider.listVersions(appId);
494
-
495
- return { appId, success: true };
496
- }
497
-
498
- return { success: false, error: createResult.error };
499
- }
500
- }
501
- ```
502
-
503
- ### ⚠️ 注意事项
504
-
505
- 1. **错误处理**: 所有 Provider 方法都返回`CommandResult`,需要检查`success`字段
506
- 2. **类型安全**: Provider 提供完整的 TypeScript 类型支持
507
- 3. **会话管理**: 使用前确保已登录,可通过`loadSession()`检查
508
- 4. **平台支持**: 支持`'ios' | 'android' | 'harmony'`三个平台
509
-
510
- ### 🔧 高级功能
511
-
512
- #### 自定义工作流
513
-
514
- ```typescript
515
- // 注册自定义工作流
516
- provider.registerWorkflow({
517
- name: 'quick-release',
518
- description: '快速发布流程',
519
- steps: [
520
- {
521
- name: 'bundle',
522
- execute: async () => {
523
- return await provider.bundle({ platform: 'ios', dev: false });
524
- },
525
- },
526
- {
527
- name: 'publish',
528
- execute: async (context, bundleResult) => {
529
- if (!bundleResult.success) {
530
- throw new Error('打包失败,无法发布');
531
- }
532
- return await provider.publish({ name: 'auto-release', rollout: 50 });
533
- },
534
- },
535
- ],
536
- });
537
-
538
- // 执行工作流
539
- await provider.executeWorkflow('quick-release', { args: [], options: {} });
540
- ```
541
-
542
- ### 📚 完整示例
543
-
544
- ```typescript
545
- import { moduleManager } from 'react-native-update-cli';
546
-
547
- class ReactNativeUpdateService {
548
- private provider = moduleManager.getProvider();
150
+ ## 注意事项
549
151
 
550
- async initialize() {
551
- // 加载会话
552
- await this.provider.loadSession();
553
- }
554
-
555
- async buildAndDeploy(platform: Platform, version: string) {
556
- try {
557
- // 1. 打包
558
- const bundleResult = await this.provider.bundle({
559
- platform,
560
- dev: false,
561
- sourcemap: true,
562
- });
563
-
564
- if (!bundleResult.success) {
565
- throw new Error(`打包失败: ${bundleResult.error}`);
566
- }
567
-
568
- // 2. 发布
569
- const publishResult = await this.provider.publish({
570
- name: version,
571
- description: `Release ${version}`,
572
- rollout: 100,
573
- });
574
-
575
- if (!publishResult.success) {
576
- throw new Error(`发布失败: ${publishResult.error}`);
577
- }
578
-
579
- return { success: true, data: publishResult.data };
580
- } catch (error) {
581
- return {
582
- success: false,
583
- error: error instanceof Error ? error.message : 'Unknown error',
584
- };
585
- }
586
- }
587
-
588
- async getAppInfo(platform: Platform) {
589
- const { appId } = await this.provider.getSelectedApp(platform);
590
- const versions = await this.provider.listVersions(appId);
591
-
592
- return { appId, versions };
593
- }
594
- }
595
-
596
- // 使用示例
597
- const service = new ReactNativeUpdateService();
598
- await service.initialize();
599
- await service.buildAndDeploy('ios', 'v1.0.0');
600
- ```
152
+ Provider 方法都会返回 `CommandResult`,消费 `data` 前需要检查 `success`。CLI 支持 `ios`、`android` 和 `harmony` 三个平台。
package/cli.json CHANGED
@@ -331,22 +331,8 @@
331
331
  }
332
332
  },
333
333
  "list": {
334
- "description": "List all bundles",
335
- "options": {
336
- "output": {
337
- "default": "${tempDir}/output/list",
338
- "hasValue": true
339
- }
340
- }
341
- },
342
- "workflow": {
343
- "description": "List all workflows",
344
- "options": {
345
- "output": {
346
- "default": "${tempDir}/output/workflow",
347
- "hasValue": true
348
- }
349
- }
334
+ "description": "List all available commands",
335
+ "options": {}
350
336
  },
351
337
  "install": {
352
338
  "description": "Install optional dependencies to the CLI",
package/lib/api.js CHANGED
@@ -131,7 +131,7 @@ async function query(url, options) {
131
131
  let json;
132
132
  try {
133
133
  json = JSON.parse(text);
134
- } catch (e) {
134
+ } catch (_e) {
135
135
  if (resp.status === 200 && text) {
136
136
  console.warn(`Warning: API returned 200 with non-JSON body (${text.length} bytes)`);
137
137
  }
package/lib/app.d.ts CHANGED
@@ -19,7 +19,7 @@ declare function selectApp({ args, options, }: {
19
19
  platform?: Platform | '';
20
20
  };
21
21
  }): Promise<void>;
22
- export declare const appCommands: {
22
+ export declare function getAppCommands(): {
23
23
  createApp: ({ options, }: {
24
24
  options: {
25
25
  name: string;