react-native-update-cli 2.8.4 → 2.9.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 (112) hide show
  1. package/lib/api.d.ts +18 -0
  2. package/lib/app.d.ts +38 -0
  3. package/lib/app.js +5 -4
  4. package/lib/bundle-pack.d.ts +1 -0
  5. package/lib/bundle-pack.js +104 -0
  6. package/lib/bundle-runner.d.ts +20 -0
  7. package/lib/bundle-runner.js +404 -0
  8. package/lib/bundle.d.ts +6 -0
  9. package/lib/bundle.js +73 -471
  10. package/lib/diff.d.ts +13 -0
  11. package/lib/diff.js +144 -123
  12. package/lib/exports.d.ts +12 -0
  13. package/lib/index.d.ts +5 -0
  14. package/lib/index.js +5 -13
  15. package/lib/install.d.ts +4 -0
  16. package/lib/locales/en.d.ts +137 -0
  17. package/lib/locales/en.js +11 -0
  18. package/lib/locales/zh.d.ts +136 -0
  19. package/lib/locales/zh.js +11 -0
  20. package/lib/module-manager.d.ts +20 -0
  21. package/lib/module-manager.js +3 -9
  22. package/lib/modules/app-module.d.ts +2 -0
  23. package/lib/modules/app-module.js +84 -44
  24. package/lib/modules/bundle-module.d.ts +2 -0
  25. package/lib/modules/bundle-module.js +7 -8
  26. package/lib/modules/index.d.ts +6 -0
  27. package/lib/modules/package-module.d.ts +2 -0
  28. package/lib/modules/user-module.d.ts +2 -0
  29. package/lib/modules/user-module.js +55 -44
  30. package/lib/modules/version-module.d.ts +2 -0
  31. package/lib/package.d.ts +58 -0
  32. package/lib/package.js +103 -139
  33. package/lib/provider.d.ts +26 -0
  34. package/lib/provider.js +115 -217
  35. package/lib/types.d.ts +120 -0
  36. package/lib/user.d.ts +8 -0
  37. package/lib/utils/add-gitignore.d.ts +1 -0
  38. package/lib/utils/app-info-parser/aab.d.ts +22 -0
  39. package/lib/utils/app-info-parser/aab.js +0 -4
  40. package/lib/utils/app-info-parser/apk.d.ts +14 -0
  41. package/lib/utils/app-info-parser/apk.js +6 -4
  42. package/lib/utils/app-info-parser/app.d.ts +4 -0
  43. package/lib/utils/app-info-parser/app.js +3 -0
  44. package/lib/utils/app-info-parser/index.d.ts +16 -0
  45. package/lib/utils/app-info-parser/index.js +2 -0
  46. package/lib/utils/app-info-parser/ipa.d.ts +14 -0
  47. package/lib/utils/app-info-parser/ipa.js +1 -1
  48. package/lib/utils/app-info-parser/resource-finder.d.ts +49 -0
  49. package/lib/utils/app-info-parser/utils.d.ts +31 -0
  50. package/lib/utils/app-info-parser/utils.js +1 -0
  51. package/lib/utils/app-info-parser/xml-parser/binary.d.ts +56 -0
  52. package/lib/utils/app-info-parser/xml-parser/manifest.d.ts +10 -0
  53. package/lib/utils/app-info-parser/zip.d.ts +18 -0
  54. package/lib/utils/app-info-parser/zip.js +7 -9
  55. package/lib/utils/check-lockfile.d.ts +1 -0
  56. package/lib/utils/check-plugin.d.ts +7 -0
  57. package/lib/utils/command-result.d.ts +3 -0
  58. package/lib/utils/command-result.js +35 -0
  59. package/lib/utils/constants.d.ts +9 -0
  60. package/lib/utils/dep-versions.d.ts +1 -0
  61. package/lib/utils/git.d.ts +8 -0
  62. package/lib/utils/http-helper.d.ts +4 -0
  63. package/lib/utils/i18n.d.ts +12 -0
  64. package/lib/utils/index.d.ts +22 -0
  65. package/lib/utils/index.js +52 -22
  66. package/lib/utils/latest-version/cli.d.ts +1 -0
  67. package/lib/utils/latest-version/cli.js +24 -60
  68. package/lib/utils/latest-version/index.d.ts +146 -0
  69. package/lib/utils/latest-version/index.js +22 -22
  70. package/lib/utils/options.d.ts +4 -0
  71. package/lib/utils/options.js +63 -0
  72. package/lib/utils/plugin-config.d.ts +9 -0
  73. package/lib/utils/zip-entries.d.ts +3 -0
  74. package/lib/versions.d.ts +43 -0
  75. package/lib/versions.js +186 -2
  76. package/lib/workflow-runner.d.ts +2 -0
  77. package/lib/workflow-runner.js +25 -0
  78. package/package.json +20 -5
  79. package/src/api.ts +1 -1
  80. package/src/app.ts +20 -11
  81. package/src/bundle-pack.ts +51 -0
  82. package/src/bundle-runner.ts +463 -0
  83. package/src/bundle.ts +184 -571
  84. package/src/diff.ts +208 -174
  85. package/src/index.ts +15 -17
  86. package/src/locales/en.ts +15 -0
  87. package/src/locales/zh.ts +13 -0
  88. package/src/module-manager.ts +15 -15
  89. package/src/modules/app-module.ts +120 -48
  90. package/src/modules/bundle-module.ts +21 -11
  91. package/src/modules/package-module.ts +0 -1
  92. package/src/modules/user-module.ts +117 -58
  93. package/src/package.ts +158 -138
  94. package/src/provider.ts +164 -240
  95. package/src/types.ts +15 -8
  96. package/src/utils/app-info-parser/aab.ts +0 -7
  97. package/src/utils/app-info-parser/apk.ts +9 -6
  98. package/src/utils/app-info-parser/app.ts +5 -1
  99. package/src/utils/app-info-parser/index.ts +11 -6
  100. package/src/utils/app-info-parser/ipa.ts +1 -1
  101. package/src/utils/app-info-parser/utils.ts +3 -0
  102. package/src/utils/app-info-parser/xml-parser/manifest.ts +3 -1
  103. package/src/utils/app-info-parser/zip.ts +12 -14
  104. package/src/utils/command-result.ts +24 -0
  105. package/src/utils/index.ts +138 -39
  106. package/src/utils/latest-version/cli.ts +22 -20
  107. package/src/utils/latest-version/index.ts +20 -20
  108. package/src/utils/options.ts +56 -0
  109. package/src/utils/zip-entries.ts +1 -1
  110. package/src/versions.ts +265 -2
  111. package/src/workflow-runner.ts +24 -0
  112. package/index.js +0 -1
@@ -13,47 +13,6 @@ function _interop_require_default(obj) {
13
13
  default: obj
14
14
  };
15
15
  }
16
- function _getRequireWildcardCache(nodeInterop) {
17
- if (typeof WeakMap !== "function") return null;
18
- var cacheBabelInterop = new WeakMap();
19
- var cacheNodeInterop = new WeakMap();
20
- return (_getRequireWildcardCache = function(nodeInterop) {
21
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
22
- })(nodeInterop);
23
- }
24
- function _interop_require_wildcard(obj, nodeInterop) {
25
- if (!nodeInterop && obj && obj.__esModule) {
26
- return obj;
27
- }
28
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
29
- return {
30
- default: obj
31
- };
32
- }
33
- var cache = _getRequireWildcardCache(nodeInterop);
34
- if (cache && cache.has(obj)) {
35
- return cache.get(obj);
36
- }
37
- var newObj = {
38
- __proto__: null
39
- };
40
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
41
- for(var key in obj){
42
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
43
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
44
- if (desc && (desc.get || desc.set)) {
45
- Object.defineProperty(newObj, key, desc);
46
- } else {
47
- newObj[key] = obj[key];
48
- }
49
- }
50
- }
51
- newObj.default = obj;
52
- if (cache) {
53
- cache.set(obj, newObj);
54
- }
55
- return newObj;
56
- }
57
16
  const colorizeDiff = (from, to)=>{
58
17
  const toParts = to.split('.');
59
18
  const diffIndex = from.split('.').findIndex((part, i)=>part !== toParts[i]);
@@ -105,11 +64,11 @@ const columnHeaderRenderer = (column)=>{
105
64
  const drawBox = (lines, color = _safe.yellow, horizontalPadding = 3)=>{
106
65
  const maxLineWidth = lines.reduce((max, row)=>Math.max(max, (0, _safe.strip)(row).length), 0);
107
66
  console.log(color(`┌${'─'.repeat(maxLineWidth + horizontalPadding * 2)}┐`));
108
- lines.forEach((row)=>{
67
+ for (const row of lines){
109
68
  const padding = ' '.repeat(horizontalPadding);
110
69
  const fullRow = `${row}${' '.repeat(maxLineWidth - (0, _safe.strip)(row).length)}`;
111
70
  console.log(`${color('│')}${padding}${(0, _safe.reset)(fullRow)}${padding}${color('│')}`);
112
- });
71
+ }
113
72
  console.log(color(`└${'─'.repeat(maxLineWidth + horizontalPadding * 2)}┘`));
114
73
  };
115
74
  const getTableColumns = (rows)=>{
@@ -171,11 +130,11 @@ const getTableColumns = (rows)=>{
171
130
  items: []
172
131
  }
173
132
  ];
174
- rows.forEach((row)=>{
175
- columns.forEach((column)=>{
133
+ for (const row of rows){
134
+ for (const column of columns){
176
135
  column.maxLength = Math.max(column.label.length, column.maxLength, row[column.attrName].length || 0);
177
- });
178
- });
136
+ }
137
+ }
179
138
  return columns;
180
139
  };
181
140
  const getTableRows = (updates)=>{
@@ -184,7 +143,8 @@ const getTableRows = (updates)=>{
184
143
  const getGroup = (a, b)=>{
185
144
  if (b && (0, _major.default)(b) === 0) {
186
145
  return 'majorVersionZero';
187
- } else if (a && b) {
146
+ }
147
+ if (a && b) {
188
148
  var _semverDiff;
189
149
  const releaseType = (_semverDiff = (0, _diff.default)(a, b)) != null ? _semverDiff : '';
190
150
  if ([
@@ -193,12 +153,14 @@ const getTableRows = (updates)=>{
193
153
  'prerelease'
194
154
  ].includes(releaseType)) {
195
155
  return 'major';
196
- } else if ([
156
+ }
157
+ if ([
197
158
  'minor',
198
159
  'preminor'
199
160
  ].includes(releaseType)) {
200
161
  return 'minor';
201
- } else if ([
162
+ }
163
+ if ([
202
164
  'patch',
203
165
  'prepatch'
204
166
  ].includes(releaseType)) {
@@ -208,7 +170,7 @@ const getTableRows = (updates)=>{
208
170
  return 'unknown';
209
171
  };
210
172
  const add = (group, location, installed, wanted)=>all.push({
211
- name: ' ' + name,
173
+ name: ` ${name}`,
212
174
  location,
213
175
  installed: installed != null ? installed : 'unknown',
214
176
  latest: latest != null ? latest : 'unknown',
@@ -279,21 +241,23 @@ const displayTable = (latestVersionPackages)=>{
279
241
  const checkVersions = async (packages, skipMissing, options = {
280
242
  useCache: true
281
243
  })=>{
282
- const ora = (await Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("ora")))).default;
283
- const spinner = ora({
284
- text: (0, _safe.cyan)('Checking versions...')
285
- });
286
- spinner.start();
287
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
288
- // @ts-ignore
289
- let latestVersionPackages = await (0, _.default)(packages, options);
244
+ console.log((0, _safe.cyan)('Checking versions...'));
245
+ let latestVersionPackages;
246
+ if (typeof packages === 'string') {
247
+ latestVersionPackages = [
248
+ await (0, _.default)(packages, options)
249
+ ];
250
+ } else if (Array.isArray(packages)) {
251
+ latestVersionPackages = await (0, _.default)(packages, options);
252
+ } else {
253
+ latestVersionPackages = await (0, _.default)(packages, options);
254
+ }
290
255
  if (skipMissing) {
291
256
  latestVersionPackages = latestVersionPackages.filter((pkg)=>{
292
257
  var _pkg_local, _ref;
293
258
  return (_ref = (_pkg_local = pkg.local) != null ? _pkg_local : pkg.globalNpm) != null ? _ref : pkg.globalYarn;
294
259
  });
295
260
  }
296
- spinner.stop();
297
261
  displayTable(latestVersionPackages);
298
262
  };
299
263
  void (async ()=>{
@@ -0,0 +1,146 @@
1
+ import type { Agent } from 'http';
2
+ interface RegistryVersions {
3
+ /**
4
+ * The latest version of the package found on the registry (if found).
5
+ */
6
+ latest?: string;
7
+ /**
8
+ * The next version of the package found on the registry (if found).
9
+ */
10
+ next?: string;
11
+ /**
12
+ * The latest version of the package found on the registry and satisfied by the wanted tag or version range.
13
+ */
14
+ wanted?: string;
15
+ }
16
+ interface InstalledVersions {
17
+ /**
18
+ * The current local installed version of the package (if installed).
19
+ */
20
+ local?: string;
21
+ /**
22
+ * The current npm global installed version of the package (if installed).
23
+ */
24
+ globalNpm?: string;
25
+ /**
26
+ * The current yarn global installed version of the package (if installed).
27
+ */
28
+ globalYarn?: string;
29
+ }
30
+ interface LatestVersionPackage extends InstalledVersions, RegistryVersions {
31
+ /**
32
+ * The name of the package.
33
+ */
34
+ name: string;
35
+ /**
36
+ * The tag or version range that was provided (if provided).
37
+ * @default "latest"
38
+ */
39
+ wantedTagOrRange?: string;
40
+ /**
41
+ * Whether the local or global installed versions (if any) could be upgraded or not, based on the wanted version.
42
+ */
43
+ updatesAvailable: {
44
+ local: string | false;
45
+ globalNpm: string | false;
46
+ globalYarn: string | false;
47
+ } | false;
48
+ /**
49
+ * Any error that might have occurred during the process.
50
+ */
51
+ error?: Error;
52
+ }
53
+ interface RequestOptions {
54
+ readonly ca?: string | Buffer | Array<string | Buffer>;
55
+ readonly rejectUnauthorized?: boolean;
56
+ readonly agent?: Agent | boolean;
57
+ readonly timeout?: number;
58
+ }
59
+ interface LatestVersionOptions {
60
+ /**
61
+ * Awaiting the api to return might take time, depending on the network, and might impact your package loading performance.
62
+ * You can use the cache mechanism to improve load performance and reduce unnecessary network requests.
63
+ * If `useCache` is not supplied, the api will always check for updates and wait for every requests to return before returning itself.
64
+ * If `useCache` is used, the api will always returned immediately, with either (for each provided packages):
65
+ * 1) a latest/next version available if a cache was found
66
+ * 2) no latest/next version available if no cache was found - in such case updates will be fetched in the background and a cache will
67
+ * be created for each provided packages and made available for the next call to the api.
68
+ * @default false
69
+ */
70
+ readonly useCache?: boolean;
71
+ /**
72
+ * How long the cache for the provided packages should be used before being refreshed (in milliseconds).
73
+ * If `useCache` is not supplied, this option has no effect.
74
+ * If `0` is used, this will force the cache to refresh immediately:
75
+ * 1) The api will returned immediately (without any latest nor next version available for the provided packages)
76
+ * 2) New updates will be fetched in the background
77
+ * 3) The cache for each provided packages will be refreshed and made available for the next call to the api
78
+ * @default ONE_DAY
79
+ */
80
+ readonly cacheMaxAge?: number;
81
+ /**
82
+ * A JavaScript package registry url that implements the CommonJS Package Registry specification.
83
+ * @default "Looks at any registry urls in the .npmrc file or fallback to the default npm registry instead"
84
+ * @example <caption>.npmrc</caption>
85
+ * registry = 'https://custom-registry.com/'
86
+ * @pkgscope:registry = 'https://custom-registry.com/'
87
+ */
88
+ readonly registryUrl?: string;
89
+ /**
90
+ * Set of options to be passed down to Node.js http/https request.
91
+ * @example <caption>Behind a proxy with self-signed certificate</caption>
92
+ * { ca: [ fs.readFileSync('proxy-cert.pem') ] }
93
+ * @example <caption>Bypassing certificate validation</caption>
94
+ * { rejectUnauthorized: false }
95
+ */
96
+ readonly requestOptions?: RequestOptions;
97
+ }
98
+ interface LatestVersion {
99
+ /**
100
+ * Get latest versions of packages from of a package json like object.
101
+ * @param {PackageJson} item - A package json like object (with dependencies, devDependencies and peerDependencies attributes).
102
+ * @example { dependencies: { 'npm': 'latest' }, devDependencies: { 'npm': '1.3.2' }, peerDependencies: { '@scope/name': '^5.0.2' } }
103
+ * @param {LatestVersionOptions} [options] - An object optionally specifying the use of the cache, the max age of the cache, the registry url and the http or https options.
104
+ * If `useCache` is not supplied, the default of `false` is used.
105
+ * If `cacheMaxAge` is not supplied, the default of `one day` is used.
106
+ * If `registryUrl` is not supplied, the default from `.npmrc` is used or a fallback to the `npm registry url` instead.
107
+ * @returns {Promise<LatestVersionPackage[]>}
108
+ */
109
+ (item: PackageJson, options?: LatestVersionOptions): Promise<LatestVersionPackage[]>;
110
+ /**
111
+ * Get latest version of a single package.
112
+ * @param {Package} item - A single package object (represented by a string that should match the following format: `${'@' | ''}${string}@${string}`)
113
+ * @example 'npm', 'npm@1.3.2', '@scope/name@^5.0.2'
114
+ * @param {LatestVersionOptions} [options] - An object optionally specifying the use of the cache, the max age of the cache, the registry url and the http or https options.
115
+ * If `useCache` is not supplied, the default of `false` is used.
116
+ * If `cacheMaxAge` is not supplied, the default of `one day` is used.
117
+ * If `registryUrl` is not supplied, the default from `.npmrc` is used or a fallback to the npm registry url instead.
118
+ * @returns {Promise<LatestVersionPackage>}
119
+ */
120
+ (item: Package, options?: LatestVersionOptions): Promise<LatestVersionPackage>;
121
+ /**
122
+ * Get latest versions of a collection of packages.
123
+ * @param {Package[]} items - A collection of package object (represented by a string that should match the following format: `${'@' | ''}${string}@${string}`)
124
+ * @example ['npm', 'npm@1.3.2', '@scope/name@^5.0.2']
125
+ * @param {LatestVersionOptions} [options] - An object optionally specifying the use of the cache, the max age of the cache, the registry url and the http or https options.
126
+ * If `useCache` is not supplied, the default of `false` is used.
127
+ * If `cacheMaxAge` is not supplied, the default of `one day` is used.
128
+ * If `registryUrl` is not supplied, the default from `.npmrc` is used or a fallback to the npm registry url instead.
129
+ * @returns {Promise<LatestVersionPackage[]>}
130
+ */
131
+ (items: Package[], options?: LatestVersionOptions): Promise<LatestVersionPackage[]>;
132
+ }
133
+ type PackageRange = `${'@' | ''}${string}@${string}`;
134
+ type Package = PackageRange | string;
135
+ type PackageJsonDependencies = Record<string, string>;
136
+ type PackageJson = Record<string, any> & ({
137
+ dependencies: PackageJsonDependencies;
138
+ } | {
139
+ devDependencies: PackageJsonDependencies;
140
+ } | {
141
+ peerDependencies: PackageJsonDependencies;
142
+ });
143
+ export declare const ONE_DAY: number;
144
+ declare const latestVersion: LatestVersion;
145
+ export type { LatestVersion, Package, PackageRange, PackageJson, PackageJsonDependencies, RegistryVersions, LatestVersionPackage, RequestOptions, LatestVersionOptions, };
146
+ export default latestVersion;
@@ -173,7 +173,8 @@ const getInstalledVersion = (pkgName, location = 'local')=>{
173
173
  if (location === 'globalNpm') {
174
174
  var _require;
175
175
  return (_require = require((0, _path.join)(_globaldirs.npm.packages, pkgName, 'package.json'))) == null ? void 0 : _require.version;
176
- } else if (location === 'globalYarn') {
176
+ }
177
+ if (location === 'globalYarn') {
177
178
  var _yarnGlobalPkg_dependencies, _require1;
178
179
  // Make sure package is globally installed by Yarn
179
180
  const yarnGlobalPkg = require((0, _path.resolve)(_globaldirs.yarn.packages, '..', 'package.json'));
@@ -181,27 +182,26 @@ const getInstalledVersion = (pkgName, location = 'local')=>{
181
182
  return undefined;
182
183
  }
183
184
  return (_require1 = require((0, _path.join)(_globaldirs.yarn.packages, pkgName, 'package.json'))) == null ? void 0 : _require1.version;
184
- } else {
185
- /**
186
- * Compute the local paths manually as require.resolve() and require.resolve.paths()
187
- * cannot be trusted anymore.
188
- * @see https://github.com/nodejs/node/issues/33460
189
- * @see https://github.com/nodejs/loaders/issues/26
190
- */ const { root } = (0, _path.parse)(process.cwd());
191
- let path = process.cwd();
192
- const localPaths = [
193
- (0, _path.join)(path, 'node_modules')
194
- ];
195
- while(path !== root){
196
- path = (0, _path.dirname)(path);
197
- localPaths.push((0, _path.join)(path, 'node_modules'));
198
- }
199
- for (const localPath of localPaths){
200
- const pkgPath = (0, _path.join)(localPath, pkgName, 'package.json');
201
- if ((0, _fs.existsSync)(pkgPath)) {
202
- var _require2;
203
- return (_require2 = require(pkgPath)) == null ? void 0 : _require2.version;
204
- }
185
+ }
186
+ /**
187
+ * Compute the local paths manually as require.resolve() and require.resolve.paths()
188
+ * cannot be trusted anymore.
189
+ * @see https://github.com/nodejs/node/issues/33460
190
+ * @see https://github.com/nodejs/loaders/issues/26
191
+ */ const { root } = (0, _path.parse)(process.cwd());
192
+ let path = process.cwd();
193
+ const localPaths = [
194
+ (0, _path.join)(path, 'node_modules')
195
+ ];
196
+ while(path !== root){
197
+ path = (0, _path.dirname)(path);
198
+ localPaths.push((0, _path.join)(path, 'node_modules'));
199
+ }
200
+ for (const localPath of localPaths){
201
+ const pkgPath = (0, _path.join)(localPath, pkgName, 'package.json');
202
+ if ((0, _fs.existsSync)(pkgPath)) {
203
+ var _require2;
204
+ return (_require2 = require(pkgPath)) == null ? void 0 : _require2.version;
205
205
  }
206
206
  }
207
207
  return undefined;
@@ -0,0 +1,4 @@
1
+ export declare function getBooleanOption(options: Record<string, unknown>, key: string, fallback?: boolean): boolean;
2
+ export declare function getStringOption(options: Record<string, unknown>, key: string, fallback?: string): string;
3
+ export declare function getOptionalStringOption(options: Record<string, unknown>, key: string): string | undefined;
4
+ export declare function toObjectState<T extends Record<string, unknown>>(value: unknown, fallback: T): T;
@@ -0,0 +1,63 @@
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: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ getBooleanOption: function() {
13
+ return getBooleanOption;
14
+ },
15
+ getOptionalStringOption: function() {
16
+ return getOptionalStringOption;
17
+ },
18
+ getStringOption: function() {
19
+ return getStringOption;
20
+ },
21
+ toObjectState: function() {
22
+ return toObjectState;
23
+ }
24
+ });
25
+ function getBooleanOption(options, key, fallback = false) {
26
+ const value = options[key];
27
+ if (typeof value === 'boolean') {
28
+ return value;
29
+ }
30
+ if (typeof value === 'string') {
31
+ return value.toLowerCase() === 'true';
32
+ }
33
+ if (typeof value === 'number') {
34
+ return value !== 0;
35
+ }
36
+ return fallback;
37
+ }
38
+ function getStringOption(options, key, fallback = '') {
39
+ const value = options[key];
40
+ if (typeof value === 'string') {
41
+ return value;
42
+ }
43
+ if (typeof value === 'number' || typeof value === 'boolean') {
44
+ return String(value);
45
+ }
46
+ return fallback;
47
+ }
48
+ function getOptionalStringOption(options, key) {
49
+ const value = options[key];
50
+ if (typeof value === 'string') {
51
+ return value || undefined;
52
+ }
53
+ if (typeof value === 'number' || typeof value === 'boolean') {
54
+ return String(value);
55
+ }
56
+ return undefined;
57
+ }
58
+ function toObjectState(value, fallback) {
59
+ if (value && typeof value === 'object') {
60
+ return value;
61
+ }
62
+ return fallback;
63
+ }
@@ -0,0 +1,9 @@
1
+ interface PluginConfig {
2
+ name: string;
3
+ bundleParams?: {
4
+ [key: string]: any;
5
+ };
6
+ detect: () => Promise<boolean>;
7
+ }
8
+ export declare const plugins: PluginConfig[];
9
+ export {};
@@ -0,0 +1,3 @@
1
+ import { type Entry, type ZipFile as YauzlZipFile } from 'yauzl';
2
+ export declare function readEntry(entry: Entry, zipFile: YauzlZipFile): Promise<Buffer>;
3
+ export declare function enumZipEntries(zipFn: string, callback: (entry: Entry, zipFile: YauzlZipFile, nestedPath?: string) => Promise<any> | undefined, nestedPath?: string): Promise<unknown>;
@@ -0,0 +1,43 @@
1
+ import type { Package, Platform } from './types';
2
+ interface VersionCommandOptions {
3
+ appId?: string;
4
+ name?: string;
5
+ description?: string;
6
+ metaInfo?: string;
7
+ platform?: Platform;
8
+ versionId?: string;
9
+ packageId?: string;
10
+ packageVersion?: string;
11
+ minPackageVersion?: string;
12
+ maxPackageVersion?: string;
13
+ packageVersionRange?: string;
14
+ rollout?: string;
15
+ dryRun?: boolean;
16
+ versionDeps?: Record<string, string>;
17
+ }
18
+ export declare const bindVersionToPackages: ({ appId, versionId, pkgs, rollout, dryRun, }: {
19
+ appId: string;
20
+ versionId: string;
21
+ pkgs: Package[];
22
+ rollout?: number;
23
+ dryRun?: boolean;
24
+ }) => Promise<void>;
25
+ export declare const versionCommands: {
26
+ publish: ({ args, options, }: {
27
+ args: string[];
28
+ options: VersionCommandOptions;
29
+ }) => Promise<string>;
30
+ versions: ({ options }: {
31
+ options: VersionCommandOptions;
32
+ }) => Promise<void>;
33
+ update: ({ options }: {
34
+ options: VersionCommandOptions;
35
+ }) => Promise<void>;
36
+ updateVersionInfo: ({ options, }: {
37
+ options: VersionCommandOptions;
38
+ }) => Promise<void>;
39
+ deleteVersion: ({ options, }: {
40
+ options: VersionCommandOptions;
41
+ }) => Promise<void>;
42
+ };
43
+ export {};