rn-update-cli 1.0.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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +167 -0
  3. package/README.zh-CN.md +167 -0
  4. package/cli.json +525 -0
  5. package/lib/api.d.ts +56 -0
  6. package/lib/api.js +671 -0
  7. package/lib/app.d.ts +107 -0
  8. package/lib/app.js +329 -0
  9. package/lib/auto-update.d.ts +35 -0
  10. package/lib/auto-update.js +507 -0
  11. package/lib/bin.d.ts +2 -0
  12. package/lib/bin.js +133 -0
  13. package/lib/bundle-pack.d.ts +6 -0
  14. package/lib/bundle-pack.js +91 -0
  15. package/lib/bundle-runner.d.ts +168 -0
  16. package/lib/bundle-runner.js +1305 -0
  17. package/lib/bundle.d.ts +45 -0
  18. package/lib/bundle.js +226 -0
  19. package/lib/cache.d.ts +10 -0
  20. package/lib/cache.js +25 -0
  21. package/lib/commands.d.ts +11 -0
  22. package/lib/commands.js +72 -0
  23. package/lib/diff.d.ts +18 -0
  24. package/lib/diff.js +690 -0
  25. package/lib/exports.d.ts +11 -0
  26. package/lib/exports.js +20 -0
  27. package/lib/install.d.ts +9 -0
  28. package/lib/install.js +51 -0
  29. package/lib/locales/en.d.ts +187 -0
  30. package/lib/locales/en.js +194 -0
  31. package/lib/locales/zh.d.ts +187 -0
  32. package/lib/locales/zh.js +194 -0
  33. package/lib/native-package.d.ts +21 -0
  34. package/lib/native-package.js +298 -0
  35. package/lib/package.d.ts +68 -0
  36. package/lib/package.js +487 -0
  37. package/lib/provider.d.ts +24 -0
  38. package/lib/provider.js +244 -0
  39. package/lib/standalone-publish.d.ts +17 -0
  40. package/lib/standalone-publish.js +433 -0
  41. package/lib/symbolicate.d.ts +35 -0
  42. package/lib/symbolicate.js +130 -0
  43. package/lib/types.d.ts +152 -0
  44. package/lib/types.js +2 -0
  45. package/lib/user.d.ts +8 -0
  46. package/lib/user.js +50 -0
  47. package/lib/utils/add-gitignore.d.ts +6 -0
  48. package/lib/utils/add-gitignore.js +44 -0
  49. package/lib/utils/app-info-parser/aab.d.ts +27 -0
  50. package/lib/utils/app-info-parser/aab.js +256 -0
  51. package/lib/utils/app-info-parser/apk.d.ts +19 -0
  52. package/lib/utils/app-info-parser/apk.js +95 -0
  53. package/lib/utils/app-info-parser/app.d.ts +9 -0
  54. package/lib/utils/app-info-parser/app.js +15 -0
  55. package/lib/utils/app-info-parser/index.d.ts +21 -0
  56. package/lib/utils/app-info-parser/index.js +51 -0
  57. package/lib/utils/app-info-parser/ipa.d.ts +19 -0
  58. package/lib/utils/app-info-parser/ipa.js +101 -0
  59. package/lib/utils/app-info-parser/resource-finder.d.ts +49 -0
  60. package/lib/utils/app-info-parser/resource-finder.js +429 -0
  61. package/lib/utils/app-info-parser/utils.d.ts +36 -0
  62. package/lib/utils/app-info-parser/utils.js +140 -0
  63. package/lib/utils/app-info-parser/xml-parser/binary.d.ts +61 -0
  64. package/lib/utils/app-info-parser/xml-parser/binary.js +577 -0
  65. package/lib/utils/app-info-parser/xml-parser/manifest.d.ts +15 -0
  66. package/lib/utils/app-info-parser/xml-parser/manifest.js +207 -0
  67. package/lib/utils/app-info-parser/zip.d.ts +29 -0
  68. package/lib/utils/app-info-parser/zip.js +97 -0
  69. package/lib/utils/check-lockfile.d.ts +6 -0
  70. package/lib/utils/check-lockfile.js +93 -0
  71. package/lib/utils/check-plugin.d.ts +12 -0
  72. package/lib/utils/check-plugin.js +36 -0
  73. package/lib/utils/command-result.d.ts +8 -0
  74. package/lib/utils/command-result.js +27 -0
  75. package/lib/utils/constants.d.ts +10 -0
  76. package/lib/utils/constants.js +39 -0
  77. package/lib/utils/dep-versions.d.ts +20 -0
  78. package/lib/utils/dep-versions.js +129 -0
  79. package/lib/utils/git.d.ts +14 -0
  80. package/lib/utils/git.js +64 -0
  81. package/lib/utils/hbcTransform.d.ts +111 -0
  82. package/lib/utils/hbcTransform.js +561 -0
  83. package/lib/utils/hermes-base.d.ts +227 -0
  84. package/lib/utils/hermes-base.js +1287 -0
  85. package/lib/utils/hermes-literals.d.ts +64 -0
  86. package/lib/utils/hermes-literals.js +260 -0
  87. package/lib/utils/http-helper.d.ts +10 -0
  88. package/lib/utils/http-helper.js +150 -0
  89. package/lib/utils/i18n.d.ts +22 -0
  90. package/lib/utils/i18n.js +46 -0
  91. package/lib/utils/index.d.ts +67 -0
  92. package/lib/utils/index.js +545 -0
  93. package/lib/utils/latest-version/index.d.ts +154 -0
  94. package/lib/utils/latest-version/index.js +331 -0
  95. package/lib/utils/options.d.ts +10 -0
  96. package/lib/utils/options.js +68 -0
  97. package/lib/utils/plugin-config.d.ts +14 -0
  98. package/lib/utils/plugin-config.js +66 -0
  99. package/lib/utils/runtime.d.ts +54 -0
  100. package/lib/utils/runtime.js +263 -0
  101. package/lib/utils/slim-sourcemap.d.ts +28 -0
  102. package/lib/utils/slim-sourcemap.js +106 -0
  103. package/lib/utils/zip-entries.d.ts +10 -0
  104. package/lib/utils/zip-entries.js +211 -0
  105. package/lib/utils/zip-options.d.ts +17 -0
  106. package/lib/utils/zip-options.js +190 -0
  107. package/lib/utils/zip-range.d.ts +148 -0
  108. package/lib/utils/zip-range.js +581 -0
  109. package/lib/utils/zip-raw-writer.d.ts +52 -0
  110. package/lib/utils/zip-raw-writer.js +209 -0
  111. package/lib/version-operations.d.ts +21 -0
  112. package/lib/version-operations.js +320 -0
  113. package/lib/versions.d.ts +66 -0
  114. package/lib/versions.js +402 -0
  115. package/package.json +113 -0
  116. package/proto/Configuration.proto +183 -0
  117. package/proto/Resources.proto +569 -0
package/cli.json ADDED
@@ -0,0 +1,525 @@
1
+ {
2
+ "useCommand": true,
3
+ "defaultCommand": "help",
4
+ "commands": {
5
+ "help": {},
6
+ "login": {},
7
+ "logout": {},
8
+ "me": {},
9
+ "createApp": {
10
+ "options": {
11
+ "name": {
12
+ "hasValue": true
13
+ },
14
+ "platform": {
15
+ "hasValue": true
16
+ }
17
+ }
18
+ },
19
+ "apps": {
20
+ "options": {
21
+ "platform": {
22
+ "hasValue": true
23
+ },
24
+ "appId": {
25
+ "hasValue": true
26
+ },
27
+ "config": {
28
+ "hasValue": true
29
+ },
30
+ "json": {
31
+ "default": false
32
+ }
33
+ }
34
+ },
35
+ "channels": {
36
+ "options": {
37
+ "appId": { "hasValue": true },
38
+ "platform": { "hasValue": true },
39
+ "config": { "hasValue": true },
40
+ "json": { "default": false }
41
+ }
42
+ },
43
+ "createChannel": {
44
+ "options": {
45
+ "appId": { "hasValue": true },
46
+ "platform": { "hasValue": true },
47
+ "config": { "hasValue": true },
48
+ "code": { "hasValue": true },
49
+ "name": { "hasValue": true },
50
+ "nativePackageUrl": { "hasValue": true },
51
+ "paused": { "default": false },
52
+ "json": { "default": false }
53
+ }
54
+ },
55
+ "updateChannel": {
56
+ "options": {
57
+ "code": { "hasValue": true },
58
+ "name": { "hasValue": true },
59
+ "nativePackageUrl": { "hasValue": true },
60
+ "paused": { "default": false },
61
+ "json": { "default": false }
62
+ }
63
+ },
64
+ "deleteChannel": {},
65
+ "deleteApp": {
66
+ "options": {
67
+ "platform": {
68
+ "hasValue": true
69
+ }
70
+ }
71
+ },
72
+ "selectApp": {
73
+ "options": {
74
+ "platform": {
75
+ "hasValue": true
76
+ }
77
+ }
78
+ },
79
+ "uploadIpa": {
80
+ "options": {
81
+ "version": {
82
+ "hasValue": true
83
+ },
84
+ "channel": {
85
+ "hasValue": true
86
+ }
87
+ }
88
+ },
89
+ "uploadApk": {
90
+ "options": {
91
+ "version": {
92
+ "hasValue": true
93
+ },
94
+ "channel": {
95
+ "hasValue": true
96
+ }
97
+ }
98
+ },
99
+ "uploadAab": {
100
+ "options": {
101
+ "version": {
102
+ "hasValue": true
103
+ },
104
+ "channel": {
105
+ "hasValue": true
106
+ },
107
+ "includeAllSplits": {
108
+ "default": false
109
+ },
110
+ "splits": {
111
+ "hasValue": true
112
+ }
113
+ }
114
+ },
115
+ "uploadApp": {
116
+ "options": {
117
+ "version": {
118
+ "hasValue": true
119
+ },
120
+ "channel": {
121
+ "hasValue": true
122
+ }
123
+ }
124
+ },
125
+ "parseApp": {},
126
+ "parseIpa": {},
127
+ "parseApk": {},
128
+ "parseAab": {},
129
+ "extractApk": {
130
+ "options": {
131
+ "output": {
132
+ "hasValue": true
133
+ },
134
+ "includeAllSplits": {
135
+ "default": false
136
+ },
137
+ "splits": {
138
+ "hasValue": true
139
+ }
140
+ }
141
+ },
142
+ "packages": {
143
+ "options": {
144
+ "platform": {
145
+ "hasValue": true
146
+ }
147
+ }
148
+ },
149
+ "deletePackage": {
150
+ "options": {
151
+ "appId": {
152
+ "hasValue": true
153
+ },
154
+ "packageVersion": {
155
+ "hasValue": true
156
+ },
157
+ "packageId": {
158
+ "hasValue": true
159
+ },
160
+ "packageIds": {
161
+ "hasValue": true
162
+ }
163
+ }
164
+ },
165
+ "publish": {
166
+ "options": {
167
+ "platform": {
168
+ "hasValue": true
169
+ },
170
+ "name": {
171
+ "hasValue": true
172
+ },
173
+ "description": {
174
+ "hasValue": true
175
+ },
176
+ "metaInfo": {
177
+ "hasValue": true
178
+ },
179
+ "diffFromHash": {
180
+ "hasValue": true
181
+ },
182
+ "packageId": {
183
+ "hasValue": true
184
+ },
185
+ "packageVersion": {
186
+ "hasValue": true
187
+ },
188
+ "channel": {
189
+ "hasValue": true
190
+ },
191
+ "targets": {
192
+ "hasValue": true
193
+ },
194
+ "deploymentIds": {
195
+ "hasValue": true,
196
+ "description": "Retry exact deployment ids returned by standalone publish"
197
+ },
198
+ "releaseIds": {
199
+ "hasValue": true,
200
+ "description": "Legacy alias for deploymentIds"
201
+ },
202
+ "minPackageVersion": {
203
+ "hasValue": true
204
+ },
205
+ "maxPackageVersion": {
206
+ "hasValue": true
207
+ },
208
+ "packageVersionRange": {
209
+ "hasValue": true
210
+ },
211
+ "rollout": {
212
+ "hasValue": true
213
+ },
214
+ "dryRun": {
215
+ "default": false
216
+ },
217
+ "sourcemap": {
218
+ "hasValue": true
219
+ }
220
+ }
221
+ },
222
+ "registerPdiff": {
223
+ "description": "Upload and register a native-package patch for one exact build.",
224
+ "options": {
225
+ "deploymentId": {
226
+ "hasValue": true
227
+ },
228
+ "releaseId": {
229
+ "hasValue": true,
230
+ "description": "Legacy alias for deploymentId"
231
+ },
232
+ "nativeVersionId": {
233
+ "hasValue": true
234
+ },
235
+ "diffFromHash": {
236
+ "hasValue": true
237
+ },
238
+ "dryRun": {
239
+ "default": false
240
+ }
241
+ }
242
+ },
243
+ "versions": {
244
+ "options": {
245
+ "platform": {
246
+ "hasValue": true
247
+ }
248
+ }
249
+ },
250
+ "update": {
251
+ "options": {
252
+ "platform": {
253
+ "hasValue": true
254
+ },
255
+ "versionId": {
256
+ "hasValue": true
257
+ },
258
+ "packageId": {
259
+ "hasValue": true
260
+ },
261
+ "packageVersion": {
262
+ "hasValue": true
263
+ },
264
+ "channel": {
265
+ "hasValue": true
266
+ },
267
+ "minPackageVersion": {
268
+ "hasValue": true
269
+ },
270
+ "maxPackageVersion": {
271
+ "hasValue": true
272
+ },
273
+ "packageVersionRange": {
274
+ "hasValue": true
275
+ },
276
+ "rollout": {
277
+ "hasValue": true
278
+ },
279
+ "dryRun": {
280
+ "default": false
281
+ }
282
+ }
283
+ },
284
+ "updateVersionInfo": {
285
+ "options": {
286
+ "platform": {
287
+ "hasValue": true
288
+ },
289
+ "appId": {
290
+ "hasValue": true
291
+ },
292
+ "versionId": {
293
+ "hasValue": true
294
+ },
295
+ "name": {
296
+ "default": false,
297
+ "hasValue": true
298
+ },
299
+ "description": {
300
+ "default": false,
301
+ "hasValue": true
302
+ },
303
+ "metaInfo": {
304
+ "default": false,
305
+ "hasValue": true
306
+ }
307
+ }
308
+ },
309
+ "deleteVersion": {
310
+ "options": {
311
+ "platform": {
312
+ "hasValue": true
313
+ },
314
+ "versionId": {
315
+ "hasValue": true
316
+ },
317
+ "versionIds": {
318
+ "hasValue": true
319
+ },
320
+ "appId": {
321
+ "hasValue": true
322
+ }
323
+ }
324
+ },
325
+ "bundle": {
326
+ "description": "Bundle javascript code only and optionally publish.",
327
+ "options": {
328
+ "dev": {
329
+ "default": "false",
330
+ "hasValue": true
331
+ },
332
+ "platform": {
333
+ "hasValue": true
334
+ },
335
+ "bundleName": {
336
+ "default": "index.bundlejs",
337
+ "hasValue": true
338
+ },
339
+ "entryFile": {
340
+ "default": "index.js",
341
+ "hasValue": true
342
+ },
343
+ "intermediaDir": {
344
+ "default": "${tempDir}/intermedia/${platform}",
345
+ "hasValue": true
346
+ },
347
+ "output": {
348
+ "default": "${tempDir}/output/${platform}.${time}.ppk",
349
+ "hasValue": true
350
+ },
351
+ "sourcemap": {
352
+ "default": true
353
+ },
354
+ "taro": {
355
+ "default": false
356
+ },
357
+ "expo": {
358
+ "default": false
359
+ },
360
+ "rncli": {
361
+ "default": false
362
+ },
363
+ "hermes": {
364
+ "default": false
365
+ },
366
+ "hermesBase": {
367
+ "default": "auto",
368
+ "hasValue": true,
369
+ "description": "Hermes -base-bytecode: auto (previous version of this app, default) | none | path to .hbc/.ppk/.apk/.ipa"
370
+ },
371
+ "verifyHermesBase": {
372
+ "default": "true",
373
+ "hasValue": true,
374
+ "description": "After a base compile, check the bytecode is equivalent to a plain compile (disassembly compare); falls back on mismatch. Pass false to skip"
375
+ },
376
+ "cacheMaxMb": {
377
+ "hasValue": true,
378
+ "description": "Local bundle cache limit in MB (default 500)"
379
+ },
380
+ "resetCache": {
381
+ "default": "true",
382
+ "hasValue": true,
383
+ "description": "Pass --reset-cache to Metro (default true). false reuses Metro's transform cache, much faster for repeated bundles"
384
+ },
385
+ "name": {
386
+ "hasValue": true,
387
+ "description": "Version name for publishing"
388
+ },
389
+ "description": {
390
+ "hasValue": true,
391
+ "description": "Version description for publishing"
392
+ },
393
+ "metaInfo": {
394
+ "hasValue": true,
395
+ "description": "Meta information for publishing"
396
+ },
397
+ "packageId": {
398
+ "hasValue": true
399
+ },
400
+ "packageVersion": {
401
+ "hasValue": true
402
+ },
403
+ "minPackageVersion": {
404
+ "hasValue": true
405
+ },
406
+ "maxPackageVersion": {
407
+ "hasValue": true
408
+ },
409
+ "packageVersionRange": {
410
+ "hasValue": true
411
+ },
412
+ "rollout": {
413
+ "hasValue": true
414
+ },
415
+ "dryRun": {
416
+ "default": false
417
+ },
418
+ "sentry-release": {
419
+ "hasValue": true,
420
+ "description": "Sentry release for source map upload"
421
+ },
422
+ "sentryRelease": {
423
+ "hasValue": true,
424
+ "description": "Sentry release for source map upload"
425
+ },
426
+ "sentry-dist": {
427
+ "hasValue": true,
428
+ "description": "Sentry dist for source map upload"
429
+ },
430
+ "sentryDist": {
431
+ "hasValue": true,
432
+ "description": "Sentry dist for source map upload"
433
+ }
434
+ }
435
+ },
436
+ "hdiff": {
437
+ "description": "Create hdiff patch",
438
+ "options": {
439
+ "output": {
440
+ "default": "${tempDir}/output/hdiff",
441
+ "hasValue": true
442
+ },
443
+ "hbcTransform": {
444
+ "default": false
445
+ }
446
+ }
447
+ },
448
+ "hdiffFromApk": {
449
+ "description": "Create hdiff patch from a Android package(.apk)",
450
+ "options": {
451
+ "output": {
452
+ "default": "${tempDir}/output/hdiff-${time}.apk-patch",
453
+ "hasValue": true
454
+ }
455
+ }
456
+ },
457
+ "hdiffFromApp": {
458
+ "description": "Create hdiff patch from a Harmony package(.app)",
459
+ "options": {
460
+ "output": {
461
+ "default": "${tempDir}/output/hdiff-${time}.app-patch",
462
+ "hasValue": true
463
+ }
464
+ }
465
+ },
466
+ "hdiffFromIpa": {
467
+ "description": "Create hdiff patch from a iOS package(.ipa)",
468
+ "options": {
469
+ "output": {
470
+ "default": "${tempDir}/output/hdiff-${time}.ipa-patch",
471
+ "hasValue": true
472
+ }
473
+ }
474
+ },
475
+ "list": {
476
+ "description": "List all available commands",
477
+ "options": {}
478
+ },
479
+ "install": {
480
+ "description": "Install optional dependencies to the CLI",
481
+ "options": {}
482
+ },
483
+ "cache": {
484
+ "description": "Inspect or clean the local bundle cache: cache [clean]",
485
+ "options": {}
486
+ },
487
+ "symbolicate": {
488
+ "description": "Map a JS stack trace back to source using the source map archived with a published version.",
489
+ "options": {
490
+ "hash": {
491
+ "hasValue": true
492
+ },
493
+ "versionId": {
494
+ "hasValue": true
495
+ },
496
+ "platform": {
497
+ "hasValue": true
498
+ },
499
+ "output": {
500
+ "hasValue": true
501
+ }
502
+ }
503
+ }
504
+ },
505
+ "globalOptions": {
506
+ "no-interactive": {
507
+ "default": false
508
+ },
509
+ "acc": {
510
+ "default": false
511
+ },
512
+ "config": {
513
+ "hasValue": true
514
+ },
515
+ "appId": {
516
+ "hasValue": true
517
+ },
518
+ "appKey": {
519
+ "hasValue": true
520
+ },
521
+ "json": {
522
+ "default": false
523
+ }
524
+ }
525
+ }
package/lib/api.d.ts ADDED
@@ -0,0 +1,56 @@
1
+ import type { Package, Session } from './types';
2
+ import type { HermesBaseServerRecord } from './utils/hermes-base';
3
+ /** Unwrap the standalone service's `{ data: ... }` envelope. */
4
+ export declare function unwrapData<T = any>(response: any): T;
5
+ /** Prefix management routes only when talking to the independent Go service. */
6
+ export declare function servicePath(route: string): string;
7
+ export declare const getSession: () => Session | undefined;
8
+ export declare const getApiToken: () => string | undefined;
9
+ export declare const setApiToken: (token: string) => void;
10
+ export declare const replaceSession: (newSession: {
11
+ token: string;
12
+ }) => void;
13
+ export declare const loadSession: () => Promise<void>;
14
+ export declare const saveSession: () => void;
15
+ export declare const closeSession: () => void;
16
+ /** Remove credentials, query signatures and fragments before logging a URL. */
17
+ export declare function redactRequestUrl(requestUrl: string): string;
18
+ export declare const get: (api: string) => Promise<any>;
19
+ export declare const post: (api: string, body?: Record<string, any>) => Promise<any>;
20
+ export declare const put: (api: string, body?: Record<string, any>) => Promise<any>;
21
+ export declare const doDelete: (api: string, body?: Record<string, any>) => Promise<any>;
22
+ export declare function getMembershipEntitlement(appId: string): Promise<{
23
+ code: string;
24
+ name: string;
25
+ nativePackageMaxBytes: number;
26
+ hotUpdatePackageMaxBytes: number;
27
+ }>;
28
+ export declare function uploadTimeoutMs(fileSize: number): number;
29
+ /**
30
+ * A network-level failure worth one more attempt: a reset/timed-out/broken
31
+ * pipe connection, or our own deadline abort. HTTP responses (4xx/5xx) never
32
+ * get here — they are surfaced as-is.
33
+ */
34
+ export declare function isTransientUploadError(error: unknown): boolean;
35
+ export declare function uploadFile(fn: string, key?: string, appId?: string | number): Promise<{
36
+ hash: string;
37
+ url?: string;
38
+ key?: string;
39
+ }>;
40
+ /**
41
+ * Ask the active service for a Hermes base. The legacy service may resolve an
42
+ * HBC epoch directly; the standalone service returns its newest native package
43
+ * and leaves the downloaded bundle's HBC verification to hermes-base.ts.
44
+ */
45
+ export declare function getHermesBase(appId: string, bytecodeVersion: number): Promise<HermesBaseServerRecord | null>;
46
+ export declare const getAllPackages: (appId: string) => Promise<Package[] | null | undefined>;
47
+ export interface ServiceChannel {
48
+ id: string;
49
+ code: string;
50
+ name: string;
51
+ paused?: boolean;
52
+ }
53
+ /** Resolve the registered channel code to the UUID required by the Go API. */
54
+ export declare function getChannels(appId: string): Promise<ServiceChannel[]>;
55
+ /** Create one standalone-service channel with an explicit code/name identity. */
56
+ export declare function createChannel(appId: string, code: string, name?: string): Promise<ServiceChannel>;