react-native-update-cli 2.18.0 → 2.19.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 (52) hide show
  1. package/lib/api.d.ts +1 -1
  2. package/lib/api.js +140 -134
  3. package/lib/app.d.ts +2 -2
  4. package/lib/app.js +60 -107
  5. package/lib/bin.js +38 -35
  6. package/lib/bundle-pack.js +57 -77
  7. package/lib/bundle-runner.js +249 -312
  8. package/lib/bundle.js +71 -89
  9. package/lib/diff.js +188 -235
  10. package/lib/exports.js +14 -37
  11. package/lib/index.js +16 -17
  12. package/lib/install.js +24 -37
  13. package/lib/locales/en.js +3 -11
  14. package/lib/locales/zh.js +3 -11
  15. package/lib/package.js +164 -218
  16. package/lib/provider.js +85 -107
  17. package/lib/types.js +1 -3
  18. package/lib/user.d.ts +1 -1
  19. package/lib/user.js +26 -39
  20. package/lib/utils/add-gitignore.js +16 -29
  21. package/lib/utils/app-info-parser/aab.js +133 -157
  22. package/lib/utils/app-info-parser/apk.js +42 -39
  23. package/lib/utils/app-info-parser/app.js +5 -11
  24. package/lib/utils/app-info-parser/index.js +21 -31
  25. package/lib/utils/app-info-parser/ipa.js +35 -35
  26. package/lib/utils/app-info-parser/resource-finder.js +84 -71
  27. package/lib/utils/app-info-parser/utils.js +52 -77
  28. package/lib/utils/app-info-parser/xml-parser/binary.js +82 -90
  29. package/lib/utils/app-info-parser/xml-parser/manifest.js +88 -98
  30. package/lib/utils/app-info-parser/zip.js +43 -51
  31. package/lib/utils/check-lockfile.js +28 -37
  32. package/lib/utils/check-plugin.js +16 -32
  33. package/lib/utils/command-result.js +7 -20
  34. package/lib/utils/constants.js +23 -63
  35. package/lib/utils/dep-versions.js +21 -27
  36. package/lib/utils/git.js +20 -64
  37. package/lib/utils/hbcTransform.js +133 -246
  38. package/lib/utils/http-helper.js +33 -44
  39. package/lib/utils/i18n.js +17 -26
  40. package/lib/utils/index.js +137 -179
  41. package/lib/utils/latest-version/index.js +128 -137
  42. package/lib/utils/options.js +13 -34
  43. package/lib/utils/plugin-config.js +43 -56
  44. package/lib/utils/runtime.js +50 -108
  45. package/lib/utils/zip-entries.js +70 -97
  46. package/lib/utils/zip-options.js +80 -181
  47. package/lib/versions.js +231 -265
  48. package/package.json +19 -21
  49. package/src/api.ts +44 -3
  50. package/src/package.ts +1 -1
  51. package/src/user.ts +1 -1
  52. package/src/versions.ts +1 -1
package/lib/exports.js CHANGED
@@ -1,38 +1,15 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get CLIProviderImpl () {
13
- return _provider.CLIProviderImpl;
14
- },
15
- get diffCommands () {
16
- return _diff.diffCommands;
17
- },
18
- get getPlatform () {
19
- return _app.getPlatform;
20
- },
21
- get getSelectedApp () {
22
- return _app.getSelectedApp;
23
- },
24
- get getSession () {
25
- return _api.getSession;
26
- },
27
- get loadSession () {
28
- return _api.loadSession;
29
- },
30
- get question () {
31
- return _utils.question;
32
- }
33
- });
34
- const _api = require("./api");
35
- const _app = require("./app");
36
- const _diff = require("./diff");
37
- const _provider = require("./provider");
38
- const _utils = require("./utils");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.question = exports.CLIProviderImpl = exports.diffCommands = exports.getSelectedApp = exports.getPlatform = exports.loadSession = exports.getSession = void 0;
4
+ var api_1 = require("./api");
5
+ Object.defineProperty(exports, "getSession", { enumerable: true, get: function () { return api_1.getSession; } });
6
+ Object.defineProperty(exports, "loadSession", { enumerable: true, get: function () { return api_1.loadSession; } });
7
+ var app_1 = require("./app");
8
+ Object.defineProperty(exports, "getPlatform", { enumerable: true, get: function () { return app_1.getPlatform; } });
9
+ Object.defineProperty(exports, "getSelectedApp", { enumerable: true, get: function () { return app_1.getSelectedApp; } });
10
+ var diff_1 = require("./diff");
11
+ Object.defineProperty(exports, "diffCommands", { enumerable: true, get: function () { return diff_1.diffCommands; } });
12
+ var provider_1 = require("./provider");
13
+ Object.defineProperty(exports, "CLIProviderImpl", { enumerable: true, get: function () { return provider_1.CLIProviderImpl; } });
14
+ var utils_1 = require("./utils");
15
+ Object.defineProperty(exports, "question", { enumerable: true, get: function () { return utils_1.question; } });
package/lib/index.js CHANGED
@@ -1,18 +1,17 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- _export_star(require("./exports"), exports);
6
- function _export_star(from, to) {
7
- Object.keys(from).forEach(function(k) {
8
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
- Object.defineProperty(to, k, {
10
- enumerable: true,
11
- get: function() {
12
- return from[k];
13
- }
14
- });
15
- }
16
- });
17
- return from;
18
- }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./exports"), exports);
package/lib/install.js CHANGED
@@ -1,59 +1,46 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "installCommands", {
6
- enumerable: true,
7
- get: function() {
8
- return installCommands;
9
- }
10
- });
11
- const _child_process = require("child_process");
12
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
- const _constants = require("./utils/constants");
14
- const _i18n = require("./utils/i18n");
15
- const _runtime = require("./utils/runtime");
16
- function _interop_require_default(obj) {
17
- return obj && obj.__esModule ? obj : {
18
- default: obj
19
- };
20
- }
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.installCommands = void 0;
7
+ const child_process_1 = require("child_process");
8
+ const path_1 = __importDefault(require("path"));
9
+ const constants_1 = require("./utils/constants");
10
+ const i18n_1 = require("./utils/i18n");
11
+ const runtime_1 = require("./utils/runtime");
21
12
  // package names / version specs only — rejects shell metacharacters since
22
13
  // Windows needs shell: true to run package manager .cmd shims
23
14
  const SAFE_PACKAGE_ARG = /^[@a-z0-9^~._/-]+$/i;
24
- const installCommands = {
25
- install: async ({ args })=>{
15
+ exports.installCommands = {
16
+ install: async ({ args }) => {
26
17
  if (args.length === 0) {
27
- throw new Error((0, _i18n.t)('installPackageRequired', {
28
- scriptName: _constants.scriptName
29
- }));
18
+ throw new Error((0, i18n_1.t)('installPackageRequired', { scriptName: constants_1.scriptName }));
30
19
  }
31
- for (const arg of args){
20
+ for (const arg of args) {
32
21
  if (!SAFE_PACKAGE_ARG.test(arg)) {
33
- throw new Error((0, _i18n.t)('installPackageRequired', {
34
- scriptName: _constants.scriptName
35
- }));
22
+ throw new Error((0, i18n_1.t)('installPackageRequired', { scriptName: constants_1.scriptName }));
36
23
  }
37
24
  }
38
- const cliDir = _path.default.resolve(__dirname, '..');
39
- const installCommand = (0, _runtime.getInstallCommand)(args, cliDir);
40
- const result = (0, _child_process.spawnSync)(installCommand.command, installCommand.args, {
25
+ const cliDir = path_1.default.resolve(__dirname, '..');
26
+ const installCommand = (0, runtime_1.getInstallCommand)(args, cliDir);
27
+ const result = (0, child_process_1.spawnSync)(installCommand.command, installCommand.args, {
41
28
  cwd: cliDir,
42
29
  stdio: 'inherit',
43
30
  // package manager executables are .cmd shims on Windows
44
- shell: process.platform === 'win32'
31
+ shell: process.platform === 'win32',
45
32
  });
46
33
  if (result.error) {
47
- throw new Error((0, _i18n.t)('installFailed', {
34
+ throw new Error((0, i18n_1.t)('installFailed', {
48
35
  packages: args.join(' '),
49
- error: result.error.message
36
+ error: result.error.message,
50
37
  }));
51
38
  }
52
39
  if (result.status !== 0) {
53
- throw new Error((0, _i18n.t)('installFailed', {
40
+ throw new Error((0, i18n_1.t)('installFailed', {
54
41
  packages: args.join(' '),
55
- error: `${installCommand.command} exited with code ${result.status}`
42
+ error: `${installCommand.command} exited with code ${result.status}`,
56
43
  }));
57
44
  }
58
- }
45
+ },
59
46
  };
package/lib/locales/en.js CHANGED
@@ -1,14 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- const _default = {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
12
4
  addedToGitignore: 'Added {{line}} to .gitignore',
13
5
  androidCrunchPngsWarning: 'The crunchPngs option of android seems not disabled (Please ignore this warning if already disabled), which may cause abnormal consumption of mobile network traffic. Please refer to https://cresc.dev/docs/getting-started#disable-crunchpngs-on-android \n',
14
6
  aabOpenApksFailed: 'Failed to open generated .apks file',
@@ -169,5 +161,5 @@ This can reduce the risk of inconsistent dependencies and supply chain attacks.
169
161
  unknownCommand: 'Unknown command: {{command}}',
170
162
  unsupportedPlatformForHermes: 'Unsupported platform for Hermes: {{platform}}',
171
163
  invalidManifest: 'Invalid manifest',
172
- failedToResolveResource: 'Failed to resolve resource: {{error}}'
164
+ failedToResolveResource: 'Failed to resolve resource: {{error}}',
173
165
  };
package/lib/locales/zh.js CHANGED
@@ -1,14 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return _default;
9
- }
10
- });
11
- const _default = {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
12
4
  addedToGitignore: '已将 {{line}} 添加到 .gitignore',
13
5
  androidCrunchPngsWarning: 'android 的 crunchPngs 选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
14
6
  aabOpenApksFailed: '无法打开生成的 .apks 文件',
@@ -168,5 +160,5 @@ const _default = {
168
160
  unknownCommand: '未知命令:{{command}}',
169
161
  unsupportedPlatformForHermes: 'Hermes 不支持当前系统平台:{{platform}}',
170
162
  invalidManifest: '无效的 manifest',
171
- failedToResolveResource: '资源解析失败:{{error}}'
163
+ failedToResolveResource: '资源解析失败:{{error}}',
172
164
  };