react-native-update-cli 2.10.1 → 2.10.2
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.
- package/README.md +47 -497
- package/README.zh-CN.md +52 -500
- package/cli.json +2 -16
- package/lib/api.js +1 -1
- package/lib/exports.d.ts +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.js +14 -62
- package/lib/locales/en.d.ts +1 -0
- package/lib/locales/en.js +1 -0
- package/lib/locales/zh.d.ts +1 -0
- package/lib/locales/zh.js +1 -0
- package/lib/module-manager.d.ts +1 -5
- package/lib/module-manager.js +2 -30
- package/lib/modules/app-module.js +1 -249
- package/lib/modules/bundle-module.js +1 -173
- package/lib/modules/package-module.js +1 -2
- package/lib/modules/user-module.js +1 -399
- package/lib/modules/version-module.js +1 -2
- package/lib/package.d.ts +1 -2
- package/lib/package.js +6 -6
- package/lib/provider.d.ts +1 -4
- package/lib/provider.js +2 -21
- package/lib/types.d.ts +0 -20
- package/lib/user.d.ts +1 -1
- package/lib/user.js +1 -1
- package/lib/utils/app-info-parser/aab.js +1 -1
- package/lib/utils/app-info-parser/resource-finder.js +5 -5
- package/lib/utils/app-info-parser/utils.js +3 -2
- package/lib/utils/check-lockfile.js +1 -1
- package/lib/utils/dep-versions.js +2 -2
- package/lib/utils/http-helper.js +2 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/versions.d.ts +1 -0
- package/lib/versions.js +19 -14
- package/package.json +1 -1
- package/src/api.ts +1 -1
- package/src/exports.ts +0 -2
- package/src/index.ts +16 -81
- package/src/locales/en.ts +1 -0
- package/src/locales/zh.ts +1 -0
- package/src/module-manager.ts +1 -41
- package/src/modules/app-module.ts +1 -271
- package/src/modules/bundle-module.ts +1 -206
- package/src/modules/package-module.ts +0 -3
- package/src/modules/user-module.ts +1 -459
- package/src/modules/version-module.ts +0 -1
- package/src/package.ts +5 -7
- package/src/provider.ts +4 -25
- package/src/types.ts +0 -32
- package/src/user.ts +1 -1
- package/src/utils/app-info-parser/aab.ts +1 -1
- package/src/utils/app-info-parser/resource-finder.ts +5 -5
- package/src/utils/app-info-parser/utils.ts +2 -2
- package/src/utils/check-lockfile.ts +1 -1
- package/src/utils/dep-versions.ts +2 -2
- package/src/utils/http-helper.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/versions.ts +24 -14
- package/lib/workflow-runner.d.ts +0 -2
- package/lib/workflow-runner.js +0 -25
- package/src/workflow-runner.ts +0 -24
|
@@ -71,7 +71,7 @@ const mapInfoResource = (
|
|
|
71
71
|
* @param info // json info parsed from .apk file
|
|
72
72
|
*/
|
|
73
73
|
const findApkIconPath = (info: any) => {
|
|
74
|
-
if (!info.application.icon
|
|
74
|
+
if (!info.application.icon?.splice) {
|
|
75
75
|
return '';
|
|
76
76
|
}
|
|
77
77
|
const rulesMap: Record<string, number> = {
|
|
@@ -142,7 +142,7 @@ const getBase64FromBuffer = (buffer: Buffer | string) => {
|
|
|
142
142
|
*/
|
|
143
143
|
const decodeNullUnicode = (value: string | RegExp) => {
|
|
144
144
|
if (typeof value === 'string') {
|
|
145
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex:
|
|
145
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: strips null unicode padding from decoded strings
|
|
146
146
|
return value.replace(/\u0000/g, '');
|
|
147
147
|
}
|
|
148
148
|
return value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let currentPackage = null;
|
|
2
2
|
try {
|
|
3
3
|
currentPackage = require(`${process.cwd()}/package.json`);
|
|
4
|
-
} catch (
|
|
4
|
+
} catch (_e) {
|
|
5
5
|
// console.warn('No package.json file were found');
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ if (currentPackage) {
|
|
|
23
23
|
});
|
|
24
24
|
const version = require(packageJsonPath).version;
|
|
25
25
|
_depVersions[dep] = version;
|
|
26
|
-
} catch (
|
|
26
|
+
} catch (_e) {}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
package/src/utils/http-helper.ts
CHANGED
|
@@ -28,7 +28,7 @@ export const ping = async (url: string) => {
|
|
|
28
28
|
fetch(url, {
|
|
29
29
|
method: 'HEAD',
|
|
30
30
|
})
|
|
31
|
-
.then(({ status
|
|
31
|
+
.then(({ status }) => {
|
|
32
32
|
pingFinished = true;
|
|
33
33
|
if (status === 200) {
|
|
34
34
|
// console.log('ping success', url);
|
|
@@ -37,7 +37,7 @@ export const ping = async (url: string) => {
|
|
|
37
37
|
// console.log('ping failed', url, status, statusText);
|
|
38
38
|
throw new Error('ping failed');
|
|
39
39
|
})
|
|
40
|
-
.catch((
|
|
40
|
+
.catch((_e) => {
|
|
41
41
|
pingFinished = true;
|
|
42
42
|
// console.log('ping error', url, e);
|
|
43
43
|
throw new Error('ping error');
|
package/src/utils/index.ts
CHANGED
|
@@ -403,7 +403,7 @@ async function resolveResource(
|
|
|
403
403
|
|
|
404
404
|
const localDir = path.resolve(os.homedir(), tempDir);
|
|
405
405
|
fs.ensureDirSync(localDir);
|
|
406
|
-
export function saveToLocal(
|
|
406
|
+
export function saveToLocal(_originPath: string, _destName: string) {
|
|
407
407
|
// TODO
|
|
408
408
|
// const destPath = path.join(localDir, destName);
|
|
409
409
|
// fs.ensureDirSync(path.dirname(destPath));
|
package/src/versions.ts
CHANGED
|
@@ -25,6 +25,7 @@ interface VersionCommandOptions {
|
|
|
25
25
|
rollout?: string;
|
|
26
26
|
dryRun?: boolean;
|
|
27
27
|
versionDeps?: Record<string, string>;
|
|
28
|
+
warnDepsChanges?: boolean;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
type Deps = Record<string, string>;
|
|
@@ -193,6 +194,7 @@ function printDepsChangesForPackage({
|
|
|
193
194
|
]);
|
|
194
195
|
|
|
195
196
|
console.log('');
|
|
197
|
+
console.log(chalk.bgYellow.black.bold(` ${t('depsChangeWarningTitle')} `));
|
|
196
198
|
console.log(
|
|
197
199
|
chalk.yellow(
|
|
198
200
|
t('depsChangeTargetPackage', {
|
|
@@ -243,7 +245,7 @@ async function printDepsChangesForPublish({
|
|
|
243
245
|
pkgs: Package[];
|
|
244
246
|
providedVersionDeps?: Deps;
|
|
245
247
|
}) {
|
|
246
|
-
if (!versionId || pkgs.length
|
|
248
|
+
if (!versionId || pkgs.length !== 1) {
|
|
247
249
|
return;
|
|
248
250
|
}
|
|
249
251
|
|
|
@@ -279,7 +281,7 @@ async function printDepsChangesForPublish({
|
|
|
279
281
|
}
|
|
280
282
|
|
|
281
283
|
async function showVersion(appId: string, offset: number) {
|
|
282
|
-
const { data
|
|
284
|
+
const { data } = await get(`/app/${appId}/version/list`);
|
|
283
285
|
console.log(t('offset', { offset }));
|
|
284
286
|
for (const version of data) {
|
|
285
287
|
const pkgCount = version.packages?.length || 0;
|
|
@@ -401,17 +403,17 @@ export const bindVersionToPackages = async ({
|
|
|
401
403
|
};
|
|
402
404
|
|
|
403
405
|
export const versionCommands = {
|
|
404
|
-
publish: async
|
|
406
|
+
publish: async ({
|
|
405
407
|
args,
|
|
406
408
|
options,
|
|
407
409
|
}: {
|
|
408
410
|
args: string[];
|
|
409
411
|
options: VersionCommandOptions;
|
|
410
|
-
}) {
|
|
412
|
+
}) => {
|
|
411
413
|
const fn = args[0];
|
|
412
414
|
const { name, description, metaInfo } = options;
|
|
413
415
|
|
|
414
|
-
if (!fn
|
|
416
|
+
if (!fn?.endsWith('.ppk')) {
|
|
415
417
|
throw new Error(t('publishUsage'));
|
|
416
418
|
}
|
|
417
419
|
|
|
@@ -452,7 +454,7 @@ export const versionCommands = {
|
|
|
452
454
|
minPackageVersion ||
|
|
453
455
|
maxPackageVersion
|
|
454
456
|
) {
|
|
455
|
-
await
|
|
457
|
+
await versionCommands.update({
|
|
456
458
|
options: {
|
|
457
459
|
versionId: id,
|
|
458
460
|
platform,
|
|
@@ -464,13 +466,19 @@ export const versionCommands = {
|
|
|
464
466
|
rollout,
|
|
465
467
|
dryRun,
|
|
466
468
|
versionDeps: depVersions,
|
|
469
|
+
warnDepsChanges: true,
|
|
467
470
|
},
|
|
468
471
|
});
|
|
469
472
|
} else {
|
|
470
473
|
const q = await question(t('updateNativePackageQuestion'));
|
|
471
474
|
if (q.toLowerCase() === 'y') {
|
|
472
|
-
await
|
|
473
|
-
options: {
|
|
475
|
+
await versionCommands.update({
|
|
476
|
+
options: {
|
|
477
|
+
versionId: id,
|
|
478
|
+
platform,
|
|
479
|
+
versionDeps: depVersions,
|
|
480
|
+
warnDepsChanges: true,
|
|
481
|
+
},
|
|
474
482
|
});
|
|
475
483
|
}
|
|
476
484
|
}
|
|
@@ -570,12 +578,14 @@ export const versionCommands = {
|
|
|
570
578
|
}
|
|
571
579
|
}
|
|
572
580
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
581
|
+
if (options.warnDepsChanges) {
|
|
582
|
+
await printDepsChangesForPublish({
|
|
583
|
+
appId: String(appId),
|
|
584
|
+
versionId: String(versionId),
|
|
585
|
+
pkgs: pkgsToBind,
|
|
586
|
+
providedVersionDeps: options.versionDeps,
|
|
587
|
+
});
|
|
588
|
+
}
|
|
579
589
|
|
|
580
590
|
await bindVersionToPackages({
|
|
581
591
|
appId: String(appId),
|
package/lib/workflow-runner.d.ts
DELETED
package/lib/workflow-runner.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "runWorkflow", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return runWorkflow;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
async function runWorkflow(workflowName, workflow, context) {
|
|
12
|
-
if (workflow.validate && !workflow.validate(context)) {
|
|
13
|
-
throw new Error(`Workflow '${workflowName}' validation failed`);
|
|
14
|
-
}
|
|
15
|
-
let previousResult;
|
|
16
|
-
for (const step of workflow.steps){
|
|
17
|
-
if (step.condition && !step.condition(context)) {
|
|
18
|
-
console.log(`Skipping step '${step.name}' due to condition`);
|
|
19
|
-
continue;
|
|
20
|
-
}
|
|
21
|
-
console.log(`Executing step '${step.name}'`);
|
|
22
|
-
previousResult = await step.execute(context, previousResult);
|
|
23
|
-
}
|
|
24
|
-
return previousResult;
|
|
25
|
-
}
|
package/src/workflow-runner.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CommandContext, CustomWorkflow } from './types';
|
|
2
|
-
|
|
3
|
-
export async function runWorkflow(
|
|
4
|
-
workflowName: string,
|
|
5
|
-
workflow: CustomWorkflow,
|
|
6
|
-
context: CommandContext,
|
|
7
|
-
): Promise<unknown> {
|
|
8
|
-
if (workflow.validate && !workflow.validate(context)) {
|
|
9
|
-
throw new Error(`Workflow '${workflowName}' validation failed`);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let previousResult: unknown;
|
|
13
|
-
for (const step of workflow.steps) {
|
|
14
|
-
if (step.condition && !step.condition(context)) {
|
|
15
|
-
console.log(`Skipping step '${step.name}' due to condition`);
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
console.log(`Executing step '${step.name}'`);
|
|
20
|
-
previousResult = await step.execute(context, previousResult);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return previousResult;
|
|
24
|
-
}
|