react-native-update-cli 2.9.6 → 2.10.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 (53) hide show
  1. package/README.md +6 -9
  2. package/README.zh-CN.md +6 -9
  3. package/cli.json +0 -27
  4. package/lib/api.js +3 -4
  5. package/lib/app.js +1 -1
  6. package/lib/bundle-pack.js +1 -1
  7. package/lib/bundle-runner.js +2 -2
  8. package/lib/diff.d.ts +0 -4
  9. package/lib/diff.js +18 -61
  10. package/lib/exports.d.ts +8 -8
  11. package/lib/exports.js +7 -7
  12. package/lib/index.d.ts +2 -2
  13. package/lib/locales/en.d.ts +0 -1
  14. package/lib/locales/en.js +0 -1
  15. package/lib/locales/zh.d.ts +0 -1
  16. package/lib/locales/zh.js +0 -1
  17. package/lib/modules/index.d.ts +3 -3
  18. package/lib/package.js +1 -1
  19. package/lib/utils/app-info-parser/aab.js +1 -1
  20. package/lib/utils/app-info-parser/ipa.js +1 -1
  21. package/lib/utils/app-info-parser/utils.d.ts +1 -1
  22. package/lib/utils/check-plugin.js +22 -10
  23. package/lib/utils/git.js +1 -1
  24. package/lib/utils/index.js +3 -3
  25. package/lib/utils/latest-version/cli.js +1 -1
  26. package/lib/utils/latest-version/index.d.ts +1 -1
  27. package/lib/utils/latest-version/index.js +2 -2
  28. package/lib/utils/zip-options.d.ts +2 -1
  29. package/lib/utils/zip-options.js +10 -1
  30. package/lib/versions.d.ts +1 -1
  31. package/lib/versions.js +4 -4
  32. package/package.json +12 -9
  33. package/src/api.ts +4 -5
  34. package/src/app.ts +1 -2
  35. package/src/bundle-pack.ts +1 -1
  36. package/src/bundle-runner.ts +2 -2
  37. package/src/diff.ts +15 -64
  38. package/src/exports.ts +17 -20
  39. package/src/index.ts +2 -2
  40. package/src/locales/en.ts +0 -2
  41. package/src/locales/zh.ts +0 -2
  42. package/src/modules/index.ts +3 -3
  43. package/src/package.ts +1 -1
  44. package/src/utils/app-info-parser/aab.ts +1 -1
  45. package/src/utils/app-info-parser/ipa.ts +1 -1
  46. package/src/utils/app-info-parser/utils.ts +5 -5
  47. package/src/utils/check-plugin.ts +18 -11
  48. package/src/utils/git.ts +1 -1
  49. package/src/utils/index.ts +4 -5
  50. package/src/utils/latest-version/cli.ts +4 -4
  51. package/src/utils/latest-version/index.ts +5 -6
  52. package/src/utils/zip-options.ts +5 -1
  53. package/src/versions.ts +5 -10
@@ -7,6 +7,7 @@ export type ZipEntryOptions = {
7
7
  };
8
8
 
9
9
  export const ZIP_ENTRY_SNIFF_BYTES = 64;
10
+ export const MANIFEST_COMPRESSION_THRESHOLD_BYTES = 256;
10
11
 
11
12
  const alreadyCompressedExtensions = new Set([
12
13
  '.7z',
@@ -136,7 +137,10 @@ export function zipOptionsForPatchEntry(): ZipEntryOptions {
136
137
  return { compress: false };
137
138
  }
138
139
 
139
- export function zipOptionsForManifestEntry(): ZipEntryOptions {
140
+ export function zipOptionsForManifestEntry(byteLength = 0): ZipEntryOptions {
141
+ if (byteLength >= MANIFEST_COMPRESSION_THRESHOLD_BYTES) {
142
+ return { compressionLevel: 9 };
143
+ }
140
144
  return { compress: false };
141
145
  }
142
146
 
package/src/versions.ts CHANGED
@@ -1,15 +1,14 @@
1
- import { doDelete, get, getAllPackages, post, put, uploadFile } from './api';
2
- import { question, saveToLocal } from './utils';
3
- import { t } from './utils/i18n';
4
-
5
1
  import chalk from 'chalk';
6
2
  import { satisfies } from 'compare-versions';
7
3
  import Table from 'tty-table';
4
+ import { doDelete, get, getAllPackages, post, put, uploadFile } from './api';
8
5
  import { getPlatform, getSelectedApp } from './app';
9
6
  import { choosePackage } from './package';
10
7
  import type { Package, Platform, Version } from './types';
8
+ import { question, saveToLocal } from './utils';
11
9
  import { depVersions } from './utils/dep-versions';
12
10
  import { getCommitInfo } from './utils/git';
11
+ import { t } from './utils/i18n';
13
12
 
14
13
  interface VersionCommandOptions {
15
14
  appId?: string;
@@ -496,7 +495,7 @@ export const versionCommands = {
496
495
  let minPkgVersion = options.minPackageVersion;
497
496
  let maxPkgVersion = options.maxPackageVersion;
498
497
  let packageVersionRange = options.packageVersionRange;
499
- let rollout: number | undefined = undefined;
498
+ let rollout: number | undefined;
500
499
 
501
500
  if (options.rollout !== undefined) {
502
501
  rollout = Number.parseInt(options.rollout, 10);
@@ -604,11 +603,7 @@ export const versionCommands = {
604
603
  await put(`/app/${String(appId)}/version/${versionId}`, updateParams);
605
604
  console.log(t('operationSuccess'));
606
605
  },
607
- deleteVersion: async ({
608
- options,
609
- }: {
610
- options: VersionCommandOptions;
611
- }) => {
606
+ deleteVersion: async ({ options }: { options: VersionCommandOptions }) => {
612
607
  let appId = options.appId;
613
608
  if (!appId) {
614
609
  const platform = await getPlatform(options.platform);