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.
- package/README.md +6 -9
- package/README.zh-CN.md +6 -9
- package/cli.json +0 -27
- package/lib/api.js +3 -4
- package/lib/app.js +1 -1
- package/lib/bundle-pack.js +1 -1
- package/lib/bundle-runner.js +2 -2
- package/lib/diff.d.ts +0 -4
- package/lib/diff.js +18 -61
- package/lib/exports.d.ts +8 -8
- package/lib/exports.js +7 -7
- package/lib/index.d.ts +2 -2
- package/lib/locales/en.d.ts +0 -1
- package/lib/locales/en.js +0 -1
- package/lib/locales/zh.d.ts +0 -1
- package/lib/locales/zh.js +0 -1
- package/lib/modules/index.d.ts +3 -3
- package/lib/package.js +1 -1
- package/lib/utils/app-info-parser/aab.js +1 -1
- package/lib/utils/app-info-parser/ipa.js +1 -1
- package/lib/utils/app-info-parser/utils.d.ts +1 -1
- package/lib/utils/check-plugin.js +22 -10
- package/lib/utils/git.js +1 -1
- package/lib/utils/index.js +3 -3
- package/lib/utils/latest-version/cli.js +1 -1
- package/lib/utils/latest-version/index.d.ts +1 -1
- package/lib/utils/latest-version/index.js +2 -2
- package/lib/utils/zip-options.d.ts +2 -1
- package/lib/utils/zip-options.js +10 -1
- package/lib/versions.d.ts +1 -1
- package/lib/versions.js +4 -4
- package/package.json +12 -9
- package/src/api.ts +4 -5
- package/src/app.ts +1 -2
- package/src/bundle-pack.ts +1 -1
- package/src/bundle-runner.ts +2 -2
- package/src/diff.ts +15 -64
- package/src/exports.ts +17 -20
- package/src/index.ts +2 -2
- package/src/locales/en.ts +0 -2
- package/src/locales/zh.ts +0 -2
- package/src/modules/index.ts +3 -3
- package/src/package.ts +1 -1
- package/src/utils/app-info-parser/aab.ts +1 -1
- package/src/utils/app-info-parser/ipa.ts +1 -1
- package/src/utils/app-info-parser/utils.ts +5 -5
- package/src/utils/check-plugin.ts +18 -11
- package/src/utils/git.ts +1 -1
- package/src/utils/index.ts +4 -5
- package/src/utils/latest-version/cli.ts +4 -4
- package/src/utils/latest-version/index.ts +5 -6
- package/src/utils/zip-options.ts +5 -1
- package/src/versions.ts +5 -10
package/README.md
CHANGED
|
@@ -197,12 +197,9 @@ Each workflow step contains:
|
|
|
197
197
|
### Bundle Module (`bundle`)
|
|
198
198
|
|
|
199
199
|
- `bundle`: Bundle JavaScript code and optionally publish
|
|
200
|
-
- `diff`: Generate differences between two PPK files
|
|
201
200
|
- `hdiff`: Generate hdiff between two PPK files
|
|
202
|
-
- `diffFromApk`: Generate differences from APK files
|
|
203
201
|
- `hdiffFromApk`: Generate hdiff from APK files
|
|
204
202
|
- `hdiffFromApp`: Generate hdiff from APP files
|
|
205
|
-
- `diffFromIpa`: Generate differences from IPA files
|
|
206
203
|
- `hdiffFromIpa`: Generate hdiff from IPA files
|
|
207
204
|
|
|
208
205
|
### Version Module (`version`)
|
|
@@ -300,23 +297,23 @@ const bundleResult = await moduleManager.executeCommand('custom-bundle', {
|
|
|
300
297
|
},
|
|
301
298
|
});
|
|
302
299
|
|
|
303
|
-
// Generate
|
|
304
|
-
const diffResult = await moduleManager.executeCommand('
|
|
300
|
+
// Generate hdiff file
|
|
301
|
+
const diffResult = await moduleManager.executeCommand('hdiff', {
|
|
305
302
|
args: [],
|
|
306
303
|
options: {
|
|
307
304
|
origin: './build/v1.0.0.ppk',
|
|
308
305
|
next: './build/v1.1.0.ppk',
|
|
309
|
-
output: './build/
|
|
306
|
+
output: './build/hdiff.patch',
|
|
310
307
|
},
|
|
311
308
|
});
|
|
312
309
|
|
|
313
|
-
// Generate
|
|
314
|
-
const apkDiffResult = await moduleManager.executeCommand('
|
|
310
|
+
// Generate hdiff from APK files
|
|
311
|
+
const apkDiffResult = await moduleManager.executeCommand('hdiffFromApk', {
|
|
315
312
|
args: [],
|
|
316
313
|
options: {
|
|
317
314
|
origin: './build/app-v1.0.0.apk',
|
|
318
315
|
next: './build/app-v1.1.0.apk',
|
|
319
|
-
output: './build/apk-
|
|
316
|
+
output: './build/apk-hdiff.patch',
|
|
320
317
|
},
|
|
321
318
|
});
|
|
322
319
|
```
|
package/README.zh-CN.md
CHANGED
|
@@ -195,12 +195,9 @@ const workflowResult = await moduleManager.executeWorkflow('my-workflow', {
|
|
|
195
195
|
### Bundle 模块 (`bundle`)
|
|
196
196
|
|
|
197
197
|
- `bundle`: 打包 JavaScript 代码并可选发布
|
|
198
|
-
- `diff`: 生成两个 PPK 文件之间的差异
|
|
199
198
|
- `hdiff`: 生成两个 PPK 文件之间的 hdiff
|
|
200
|
-
- `diffFromApk`: 从 APK 文件生成差异
|
|
201
199
|
- `hdiffFromApk`: 从 APK 文件生成 hdiff
|
|
202
200
|
- `hdiffFromApp`: 从 APP 文件生成 hdiff
|
|
203
|
-
- `diffFromIpa`: 从 IPA 文件生成差异
|
|
204
201
|
- `hdiffFromIpa`: 从 IPA 文件生成 hdiff
|
|
205
202
|
|
|
206
203
|
### Version 模块 (`version`)
|
|
@@ -298,23 +295,23 @@ const bundleResult = await moduleManager.executeCommand('custom-bundle', {
|
|
|
298
295
|
},
|
|
299
296
|
});
|
|
300
297
|
|
|
301
|
-
//
|
|
302
|
-
const diffResult = await moduleManager.executeCommand('
|
|
298
|
+
// 生成 hdiff 文件
|
|
299
|
+
const diffResult = await moduleManager.executeCommand('hdiff', {
|
|
303
300
|
args: [],
|
|
304
301
|
options: {
|
|
305
302
|
origin: './build/v1.0.0.ppk',
|
|
306
303
|
next: './build/v1.1.0.ppk',
|
|
307
|
-
output: './build/
|
|
304
|
+
output: './build/hdiff.patch',
|
|
308
305
|
},
|
|
309
306
|
});
|
|
310
307
|
|
|
311
|
-
// 从APK
|
|
312
|
-
const apkDiffResult = await moduleManager.executeCommand('
|
|
308
|
+
// 从 APK 文件生成 hdiff
|
|
309
|
+
const apkDiffResult = await moduleManager.executeCommand('hdiffFromApk', {
|
|
313
310
|
args: [],
|
|
314
311
|
options: {
|
|
315
312
|
origin: './build/app-v1.0.0.apk',
|
|
316
313
|
next: './build/app-v1.1.0.apk',
|
|
317
|
-
output: './build/apk-
|
|
314
|
+
output: './build/apk-hdiff.patch',
|
|
318
315
|
},
|
|
319
316
|
});
|
|
320
317
|
```
|
package/cli.json
CHANGED
|
@@ -294,33 +294,6 @@
|
|
|
294
294
|
"release": {
|
|
295
295
|
"description": "Push builded file to server."
|
|
296
296
|
},
|
|
297
|
-
"diff": {
|
|
298
|
-
"description": "Create diff patch",
|
|
299
|
-
"options": {
|
|
300
|
-
"output": {
|
|
301
|
-
"default": "${tempDir}/output/diff",
|
|
302
|
-
"hasValue": true
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
"diffFromApk": {
|
|
307
|
-
"description": "Create diff patch from a Android package(.apk)",
|
|
308
|
-
"options": {
|
|
309
|
-
"output": {
|
|
310
|
-
"default": "${tempDir}/output/diff-${time}.apk-patch",
|
|
311
|
-
"hasValue": true
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
"diffFromIpa": {
|
|
316
|
-
"description": "Create diff patch from a iOS package(.ipa)",
|
|
317
|
-
"options": {
|
|
318
|
-
"output": {
|
|
319
|
-
"default": "${tempDir}/output/diff-${time}.ipa-patch",
|
|
320
|
-
"hasValue": true
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
297
|
"hdiff": {
|
|
325
298
|
"description": "Create hdiff patch",
|
|
326
299
|
"options": {
|
package/lib/api.js
CHANGED
|
@@ -49,14 +49,14 @@ _export(exports, {
|
|
|
49
49
|
return uploadFile;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
53
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
54
|
-
const _util = /*#__PURE__*/ _interop_require_default(require("util"));
|
|
55
52
|
const _filesizeparser = /*#__PURE__*/ _interop_require_default(require("filesize-parser"));
|
|
56
53
|
const _formdata = /*#__PURE__*/ _interop_require_default(require("form-data"));
|
|
54
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
57
55
|
const _nodefetch = /*#__PURE__*/ _interop_require_default(require("node-fetch"));
|
|
56
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
58
57
|
const _progress = /*#__PURE__*/ _interop_require_default(require("progress"));
|
|
59
58
|
const _tcpping = /*#__PURE__*/ _interop_require_default(require("tcp-ping"));
|
|
59
|
+
const _util = /*#__PURE__*/ _interop_require_default(require("util"));
|
|
60
60
|
const _httphelper = require("./utils/http-helper");
|
|
61
61
|
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
|
|
62
62
|
const _constants = require("./utils/constants");
|
|
@@ -189,7 +189,6 @@ async function uploadFile(fn, key) {
|
|
|
189
189
|
});
|
|
190
190
|
let realUrl = url;
|
|
191
191
|
if (backupUrl) {
|
|
192
|
-
// @ts-ignore
|
|
193
192
|
if (global.USE_ACC_OSS) {
|
|
194
193
|
realUrl = backupUrl;
|
|
195
194
|
} else {
|
package/lib/app.js
CHANGED
|
@@ -30,8 +30,8 @@ _export(exports, {
|
|
|
30
30
|
});
|
|
31
31
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
32
32
|
const _ttytable = /*#__PURE__*/ _interop_require_default(require("tty-table"));
|
|
33
|
-
const _utils = require("./utils");
|
|
34
33
|
const _api = require("./api");
|
|
34
|
+
const _utils = require("./utils");
|
|
35
35
|
const _i18n = require("./utils/i18n");
|
|
36
36
|
function _interop_require_default(obj) {
|
|
37
37
|
return obj && obj.__esModule ? obj : {
|
package/lib/bundle-pack.js
CHANGED
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "packBundle", {
|
|
|
8
8
|
return packBundle;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
11
|
const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
|
|
12
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
13
|
const _yazl = require("yazl");
|
|
14
14
|
const _i18n = require("./utils/i18n");
|
|
15
15
|
const _zipoptions = require("./utils/zip-options");
|
package/lib/bundle-runner.js
CHANGED
|
@@ -26,10 +26,10 @@ _export(exports, {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
const _child_process = require("child_process");
|
|
29
|
-
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
30
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
31
29
|
const _compareversions = require("compare-versions");
|
|
32
30
|
const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
|
|
31
|
+
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
32
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
33
33
|
const _i18n = require("./utils/i18n");
|
|
34
34
|
function _interop_require_default(obj) {
|
|
35
35
|
return obj && obj.__esModule ? obj : {
|
package/lib/diff.d.ts
CHANGED
|
@@ -2,12 +2,8 @@ import type { CommandContext } from './types';
|
|
|
2
2
|
import { enumZipEntries, readEntry } from './utils/zip-entries';
|
|
3
3
|
export { enumZipEntries, readEntry };
|
|
4
4
|
export declare const diffCommands: {
|
|
5
|
-
diff: ({ args, options }: CommandContext) => Promise<void>;
|
|
6
5
|
hdiff: ({ args, options }: CommandContext) => Promise<void>;
|
|
7
|
-
diffFromApk: ({ args, options }: CommandContext) => Promise<void>;
|
|
8
6
|
hdiffFromApk: ({ args, options }: CommandContext) => Promise<void>;
|
|
9
|
-
diffFromApp: ({ args, options }: CommandContext) => Promise<void>;
|
|
10
7
|
hdiffFromApp: ({ args, options }: CommandContext) => Promise<void>;
|
|
11
|
-
diffFromIpa: ({ args, options }: CommandContext) => Promise<void>;
|
|
12
8
|
hdiffFromIpa: ({ args, options }: CommandContext) => Promise<void>;
|
|
13
9
|
};
|
package/lib/diff.js
CHANGED
|
@@ -19,9 +19,9 @@ _export(exports, {
|
|
|
19
19
|
return _zipentries.readEntry;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
23
22
|
const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
|
|
24
23
|
const _globaldirs = require("global-dirs");
|
|
24
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
25
25
|
const _yazl = require("yazl");
|
|
26
26
|
const _utils = require("./utils");
|
|
27
27
|
const _constants = require("./utils/constants");
|
|
@@ -89,9 +89,8 @@ const loadModule = (pkgName)=>{
|
|
|
89
89
|
return undefined;
|
|
90
90
|
};
|
|
91
91
|
const hdiff = loadModule('node-hdiffpatch');
|
|
92
|
-
const bsdiff = loadModule('node-bsdiff');
|
|
93
92
|
function basename(fn) {
|
|
94
|
-
const m = /^(.+\/)[
|
|
93
|
+
const m = /^(.+\/)[^/]+\/?$/.exec(fn);
|
|
95
94
|
return m == null ? void 0 : m[1];
|
|
96
95
|
}
|
|
97
96
|
async function diffFromPPK(origin, next, output, diffFn) {
|
|
@@ -198,10 +197,11 @@ async function diffFromPPK(origin, next, output, diffFn) {
|
|
|
198
197
|
}
|
|
199
198
|
}
|
|
200
199
|
//console.log({copies, deletes});
|
|
201
|
-
|
|
200
|
+
const diffManifest = Buffer.from(JSON.stringify({
|
|
202
201
|
copies,
|
|
203
202
|
deletes
|
|
204
|
-
}))
|
|
203
|
+
}));
|
|
204
|
+
zipfile.addBuffer(diffManifest, '__diff.json', (0, _zipoptions.zipOptionsForManifestEntry)(diffManifest.length));
|
|
205
205
|
zipfile.end();
|
|
206
206
|
await writePromise;
|
|
207
207
|
}
|
|
@@ -277,41 +277,34 @@ async function diffFromPackage(origin, next, output, diffFn, originBundleName, t
|
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
|
-
|
|
280
|
+
const diffManifest = Buffer.from(JSON.stringify({
|
|
281
281
|
copies
|
|
282
|
-
}))
|
|
282
|
+
}));
|
|
283
|
+
zipfile.addBuffer(diffManifest, '__diff.json', (0, _zipoptions.zipOptionsForManifestEntry)(diffManifest.length));
|
|
283
284
|
zipfile.end();
|
|
284
285
|
await writePromise;
|
|
285
286
|
}
|
|
286
|
-
function resolveDiffImplementation(
|
|
287
|
+
function resolveDiffImplementation(options) {
|
|
288
|
+
var _options_customHdiffModule;
|
|
287
289
|
if (options.customDiff) {
|
|
288
290
|
return options.customDiff;
|
|
289
291
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
if (!(hdiffModule == null ? void 0 : hdiffModule.diff)) {
|
|
294
|
-
throw new Error((0, _i18n.t)('nodeHdiffpatchRequired', {
|
|
295
|
-
scriptName: _constants.scriptName
|
|
296
|
-
}));
|
|
297
|
-
}
|
|
298
|
-
return hdiffModule.diff;
|
|
299
|
-
}
|
|
300
|
-
if (!(bsdiff == null ? void 0 : bsdiff.diff)) {
|
|
301
|
-
throw new Error((0, _i18n.t)('nodeBsdiffRequired', {
|
|
292
|
+
const hdiffModule = (_options_customHdiffModule = options.customHdiffModule) != null ? _options_customHdiffModule : hdiff;
|
|
293
|
+
if (!(hdiffModule == null ? void 0 : hdiffModule.diff)) {
|
|
294
|
+
throw new Error((0, _i18n.t)('nodeHdiffpatchRequired', {
|
|
302
295
|
scriptName: _constants.scriptName
|
|
303
296
|
}));
|
|
304
297
|
}
|
|
305
|
-
return
|
|
298
|
+
return hdiffModule.diff;
|
|
306
299
|
}
|
|
307
|
-
function diffArgsCheck(args, options, diffFnName
|
|
300
|
+
function diffArgsCheck(args, options, diffFnName) {
|
|
308
301
|
const [origin, next] = args;
|
|
309
302
|
if (!origin || !next) {
|
|
310
303
|
throw new Error((0, _i18n.t)('usageDiff', {
|
|
311
304
|
command: diffFnName
|
|
312
305
|
}));
|
|
313
306
|
}
|
|
314
|
-
const diffFn = resolveDiffImplementation(
|
|
307
|
+
const diffFn = resolveDiffImplementation(options);
|
|
315
308
|
const { output } = (0, _utils.translateOptions)({
|
|
316
309
|
...options,
|
|
317
310
|
tempDir: _constants.tempDir
|
|
@@ -330,8 +323,8 @@ const transformIpaPackagePath = (v)=>{
|
|
|
330
323
|
const match = /^Payload\/[^/]+\/(.+)$/.exec(v);
|
|
331
324
|
return match == null ? void 0 : match[1];
|
|
332
325
|
};
|
|
333
|
-
const createDiffCommand = ({ diffFnName,
|
|
334
|
-
const { origin, next, realOutput, diffFn } = diffArgsCheck(args, options, diffFnName
|
|
326
|
+
const createDiffCommand = ({ diffFnName, target })=>async ({ args, options })=>{
|
|
327
|
+
const { origin, next, realOutput, diffFn } = diffArgsCheck(args, options, diffFnName);
|
|
335
328
|
if (target.kind === 'ppk') {
|
|
336
329
|
await diffFromPPK(origin, next, realOutput, diffFn);
|
|
337
330
|
} else {
|
|
@@ -342,64 +335,28 @@ const createDiffCommand = ({ diffFnName, useHdiff, target })=>async ({ args, opt
|
|
|
342
335
|
}));
|
|
343
336
|
};
|
|
344
337
|
const diffCommands = {
|
|
345
|
-
diff: createDiffCommand({
|
|
346
|
-
diffFnName: 'diff',
|
|
347
|
-
useHdiff: false,
|
|
348
|
-
target: {
|
|
349
|
-
kind: 'ppk'
|
|
350
|
-
}
|
|
351
|
-
}),
|
|
352
338
|
hdiff: createDiffCommand({
|
|
353
339
|
diffFnName: 'hdiff',
|
|
354
|
-
useHdiff: true,
|
|
355
340
|
target: {
|
|
356
341
|
kind: 'ppk'
|
|
357
342
|
}
|
|
358
343
|
}),
|
|
359
|
-
diffFromApk: createDiffCommand({
|
|
360
|
-
diffFnName: 'diffFromApk',
|
|
361
|
-
useHdiff: false,
|
|
362
|
-
target: {
|
|
363
|
-
kind: 'package',
|
|
364
|
-
originBundleName: 'assets/index.android.bundle'
|
|
365
|
-
}
|
|
366
|
-
}),
|
|
367
344
|
hdiffFromApk: createDiffCommand({
|
|
368
345
|
diffFnName: 'hdiffFromApk',
|
|
369
|
-
useHdiff: true,
|
|
370
346
|
target: {
|
|
371
347
|
kind: 'package',
|
|
372
348
|
originBundleName: 'assets/index.android.bundle'
|
|
373
349
|
}
|
|
374
350
|
}),
|
|
375
|
-
diffFromApp: createDiffCommand({
|
|
376
|
-
diffFnName: 'diffFromApp',
|
|
377
|
-
useHdiff: false,
|
|
378
|
-
target: {
|
|
379
|
-
kind: 'package',
|
|
380
|
-
originBundleName: 'resources/rawfile/bundle.harmony.js'
|
|
381
|
-
}
|
|
382
|
-
}),
|
|
383
351
|
hdiffFromApp: createDiffCommand({
|
|
384
352
|
diffFnName: 'hdiffFromApp',
|
|
385
|
-
useHdiff: true,
|
|
386
353
|
target: {
|
|
387
354
|
kind: 'package',
|
|
388
355
|
originBundleName: 'resources/rawfile/bundle.harmony.js'
|
|
389
356
|
}
|
|
390
357
|
}),
|
|
391
|
-
diffFromIpa: createDiffCommand({
|
|
392
|
-
diffFnName: 'diffFromIpa',
|
|
393
|
-
useHdiff: false,
|
|
394
|
-
target: {
|
|
395
|
-
kind: 'package',
|
|
396
|
-
originBundleName: 'main.jsbundle',
|
|
397
|
-
transformPackagePath: transformIpaPackagePath
|
|
398
|
-
}
|
|
399
|
-
}),
|
|
400
358
|
hdiffFromIpa: createDiffCommand({
|
|
401
359
|
diffFnName: 'hdiffFromIpa',
|
|
402
|
-
useHdiff: true,
|
|
403
360
|
target: {
|
|
404
361
|
kind: 'package',
|
|
405
362
|
originBundleName: 'main.jsbundle',
|
package/lib/exports.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
export { getSession, loadSession } from './api';
|
|
2
|
+
export { getPlatform, getSelectedApp } from './app';
|
|
3
|
+
export { diffCommands } from './diff';
|
|
1
4
|
export { moduleManager } from './module-manager';
|
|
2
|
-
export { CLIProviderImpl } from './provider';
|
|
3
|
-
export type { CLIProvider, CLIModule, CommandDefinition, CustomWorkflow, WorkflowStep, CommandContext, CommandResult, BundleOptions, PublishOptions, UploadOptions, Platform, Session, Version, Package, } from './types';
|
|
4
5
|
export { builtinModules } from './modules';
|
|
5
|
-
export { bundleModule } from './modules/bundle-module';
|
|
6
|
-
export { versionModule } from './modules/version-module';
|
|
7
6
|
export { appModule } from './modules/app-module';
|
|
8
|
-
export {
|
|
7
|
+
export { bundleModule } from './modules/bundle-module';
|
|
9
8
|
export { packageModule } from './modules/package-module';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
9
|
+
export { userModule } from './modules/user-module';
|
|
10
|
+
export { versionModule } from './modules/version-module';
|
|
11
|
+
export { CLIProviderImpl } from './provider';
|
|
12
|
+
export type { BundleOptions, CLIModule, CLIProvider, CommandContext, CommandDefinition, CommandResult, CustomWorkflow, Package, Platform, PublishOptions, Session, UploadOptions, Version, WorkflowStep, } from './types';
|
|
13
13
|
export { question, saveToLocal } from './utils';
|
package/lib/exports.js
CHANGED
|
@@ -55,15 +55,15 @@ _export(exports, {
|
|
|
55
55
|
return _versionmodule.versionModule;
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
+
const _api = require("./api");
|
|
59
|
+
const _app = require("./app");
|
|
60
|
+
const _diff = require("./diff");
|
|
58
61
|
const _modulemanager = require("./module-manager");
|
|
59
|
-
const _provider = require("./provider");
|
|
60
62
|
const _modules = require("./modules");
|
|
61
|
-
const _bundlemodule = require("./modules/bundle-module");
|
|
62
|
-
const _versionmodule = require("./modules/version-module");
|
|
63
63
|
const _appmodule = require("./modules/app-module");
|
|
64
|
-
const
|
|
64
|
+
const _bundlemodule = require("./modules/bundle-module");
|
|
65
65
|
const _packagemodule = require("./modules/package-module");
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
66
|
+
const _usermodule = require("./modules/user-module");
|
|
67
|
+
const _versionmodule = require("./modules/version-module");
|
|
68
|
+
const _provider = require("./provider");
|
|
69
69
|
const _utils = require("./utils");
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { moduleManager } from './module-manager';
|
|
3
|
-
export { moduleManager };
|
|
4
3
|
export { CLIProviderImpl } from './provider';
|
|
5
|
-
export type {
|
|
4
|
+
export type { CLIModule, CLIProvider, CommandDefinition, CustomWorkflow, WorkflowStep, } from './types';
|
|
5
|
+
export { moduleManager };
|
package/lib/locales/en.d.ts
CHANGED
package/lib/locales/en.js
CHANGED
|
@@ -146,7 +146,6 @@ This can reduce the risk of inconsistent dependencies and supply chain attacks.
|
|
|
146
146
|
deleteVersionError: 'Failed to delete version {{versionId}}: {{error}}',
|
|
147
147
|
bundleFileNotFound: 'Bundle file not found! Please use default bundle file name and path.',
|
|
148
148
|
diffPackageGenerated: '{{- output}} generated.',
|
|
149
|
-
nodeBsdiffRequired: 'This function needs "node-bsdiff". Please run "{{scriptName}} install node-bsdiff" to install',
|
|
150
149
|
nodeHdiffpatchRequired: 'This function needs "node-hdiffpatch". Please run "{{scriptName}} install node-hdiffpatch" to install',
|
|
151
150
|
apkExtracted: 'APK extracted to {{output}}'
|
|
152
151
|
};
|
package/lib/locales/zh.d.ts
CHANGED
package/lib/locales/zh.js
CHANGED
|
@@ -145,7 +145,6 @@ const _default = {
|
|
|
145
145
|
deleteVersionError: '删除热更包 {{versionId}} 失败: {{error}}',
|
|
146
146
|
bundleFileNotFound: '未找到 bundle 文件!请使用默认的 bundle 文件名和路径。',
|
|
147
147
|
diffPackageGenerated: '{{- output}} 已生成。',
|
|
148
|
-
nodeBsdiffRequired: '此功能需要 "node-bsdiff"。请运行 "{{scriptName}} install node-bsdiff" 来安装',
|
|
149
148
|
nodeHdiffpatchRequired: '此功能需要 "node-hdiffpatch"。请运行 "{{scriptName}} install node-hdiffpatch" 来安装',
|
|
150
149
|
apkExtracted: 'APK 已提取到 {{output}}'
|
|
151
150
|
};
|
package/lib/modules/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { bundleModule } from './bundle-module';
|
|
2
|
-
export { versionModule } from './version-module';
|
|
3
1
|
export { appModule } from './app-module';
|
|
4
|
-
export {
|
|
2
|
+
export { bundleModule } from './bundle-module';
|
|
5
3
|
export { packageModule } from './package-module';
|
|
4
|
+
export { userModule } from './user-module';
|
|
5
|
+
export { versionModule } from './version-module';
|
|
6
6
|
export declare const builtinModules: import("..").CLIModule[];
|
package/lib/package.js
CHANGED
|
@@ -22,9 +22,9 @@ _export(exports, {
|
|
|
22
22
|
return packageCommands;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
+
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
25
26
|
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
26
27
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
27
|
-
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
28
28
|
const _ttytable = /*#__PURE__*/ _interop_require_default(require("tty-table"));
|
|
29
29
|
const _api = require("./api");
|
|
30
30
|
const _app = require("./app");
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "AabParser", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _child_process = require("child_process");
|
|
12
|
+
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
12
13
|
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
13
14
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
14
|
-
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
15
15
|
const _yauzl = require("yauzl");
|
|
16
16
|
const _i18n = require("../i18n");
|
|
17
17
|
const _resourcefinder = require("./resource-finder");
|
|
@@ -13,7 +13,7 @@ const _zip = require("./zip");
|
|
|
13
13
|
const parsePlist = require('plist').parse;
|
|
14
14
|
const parseBplist = require('bplist-parser').parseBuffer;
|
|
15
15
|
const cgbiToPng = require('cgbi-to-png');
|
|
16
|
-
const PlistName = /payload\/[
|
|
16
|
+
const PlistName = /payload\/[^/]+?.app\/info.plist$/i;
|
|
17
17
|
const ProvisionName = /payload\/.+?\.app\/embedded.mobileprovision/;
|
|
18
18
|
class IpaParser extends _zip.Zip {
|
|
19
19
|
parse() {
|
|
@@ -28,4 +28,4 @@ declare const getBase64FromBuffer: (buffer: Buffer | string) => string;
|
|
|
28
28
|
* @param {String} str
|
|
29
29
|
*/
|
|
30
30
|
declare const decodeNullUnicode: (value: string | RegExp) => string | RegExp;
|
|
31
|
-
export {
|
|
31
|
+
export { decodeNullUnicode, findApkIconPath, findIpaIconPath, getBase64FromBuffer, isArray, isBrowser, isObject, isPrimitive, mapInfoResource, };
|
|
@@ -15,21 +15,33 @@ async function checkPlugins() {
|
|
|
15
15
|
sentry: false,
|
|
16
16
|
sourcemap: false
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
const results = await Promise.all(_pluginconfig.plugins.map(async (plugin)=>{
|
|
19
19
|
try {
|
|
20
20
|
const isEnabled = await plugin.detect();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
return {
|
|
22
|
+
isEnabled,
|
|
23
|
+
error: null
|
|
24
|
+
};
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return {
|
|
27
|
+
isEnabled: false,
|
|
28
|
+
error
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
results.forEach(({ isEnabled, error }, index)=>{
|
|
33
|
+
const plugin = _pluginconfig.plugins[index];
|
|
34
|
+
if (error) {
|
|
28
35
|
console.warn((0, _i18n.t)('pluginDetectionError', {
|
|
29
36
|
name: plugin.name,
|
|
30
|
-
error
|
|
37
|
+
error
|
|
38
|
+
}));
|
|
39
|
+
} else if (isEnabled && plugin.bundleParams) {
|
|
40
|
+
Object.assign(params, plugin.bundleParams);
|
|
41
|
+
console.log((0, _i18n.t)('pluginDetected', {
|
|
42
|
+
name: plugin.name
|
|
31
43
|
}));
|
|
32
44
|
}
|
|
33
|
-
}
|
|
45
|
+
});
|
|
34
46
|
return params;
|
|
35
47
|
}
|
package/lib/utils/git.js
CHANGED
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "getCommitInfo", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
12
|
const _isomorphicgit = /*#__PURE__*/ _interop_require_default(require("isomorphic-git"));
|
|
13
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
14
14
|
function _interop_require_default(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : {
|
|
16
16
|
default: obj
|
package/lib/utils/index.js
CHANGED
|
@@ -37,17 +37,17 @@ _export(exports, {
|
|
|
37
37
|
return translateOptions;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
41
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
42
40
|
const _chalk = /*#__PURE__*/ _interop_require_default(require("chalk"));
|
|
43
41
|
const _compareversions = require("compare-versions");
|
|
44
42
|
const _fsextra = /*#__PURE__*/ _interop_require_default(require("fs-extra"));
|
|
43
|
+
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
44
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
45
|
+
const _read = require("read");
|
|
45
46
|
const _yauzl = require("yauzl");
|
|
46
47
|
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../package.json"));
|
|
47
48
|
const _latestversion = /*#__PURE__*/ _interop_require_default(require("./latest-version"));
|
|
48
49
|
const _appinfoparser = /*#__PURE__*/ _interop_require_default(require("./app-info-parser"));
|
|
49
50
|
const _checkplugin = require("./check-plugin");
|
|
50
|
-
const _read = require("read");
|
|
51
51
|
const _constants = require("./constants");
|
|
52
52
|
const _depversions = require("./dep-versions");
|
|
53
53
|
const _i18n = require("./i18n");
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
+
const _safe = require("@colors/colors/safe");
|
|
5
6
|
const _fs = require("fs");
|
|
6
7
|
const _path = require("path");
|
|
7
|
-
const _safe = require("@colors/colors/safe");
|
|
8
8
|
const _diff = /*#__PURE__*/ _interop_require_default(require("semver/functions/diff"));
|
|
9
9
|
const _major = /*#__PURE__*/ _interop_require_default(require("semver/functions/major"));
|
|
10
10
|
const _ = /*#__PURE__*/ _interop_require_default(require("."));
|
|
@@ -142,5 +142,5 @@ type PackageJson = Record<string, any> & ({
|
|
|
142
142
|
});
|
|
143
143
|
export declare const ONE_DAY: number;
|
|
144
144
|
declare const latestVersion: LatestVersion;
|
|
145
|
-
export type { LatestVersion,
|
|
145
|
+
export type { LatestVersion, LatestVersionOptions, LatestVersionPackage, Package, PackageJson, PackageJsonDependencies, PackageRange, RegistryVersions, RequestOptions, };
|
|
146
146
|
export default latestVersion;
|
|
@@ -17,14 +17,14 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _fs = require("fs");
|
|
20
|
+
const _globaldirs = require("global-dirs");
|
|
20
21
|
const _os = require("os");
|
|
21
22
|
const _path = require("path");
|
|
22
|
-
const _url = require("url");
|
|
23
|
-
const _globaldirs = require("global-dirs");
|
|
24
23
|
const _registryauthtoken = /*#__PURE__*/ _interop_require_default(require("registry-auth-token"));
|
|
25
24
|
const _registryurl = /*#__PURE__*/ _interop_require_default(require("registry-auth-token/registry-url"));
|
|
26
25
|
const _gt = /*#__PURE__*/ _interop_require_default(require("semver/functions/gt"));
|
|
27
26
|
const _maxsatisfying = /*#__PURE__*/ _interop_require_default(require("semver/ranges/max-satisfying"));
|
|
27
|
+
const _url = require("url");
|
|
28
28
|
function _interop_require_default(obj) {
|
|
29
29
|
return obj && obj.__esModule ? obj : {
|
|
30
30
|
default: obj
|
|
@@ -3,7 +3,8 @@ export type ZipEntryOptions = {
|
|
|
3
3
|
compressionLevel?: number;
|
|
4
4
|
};
|
|
5
5
|
export declare const ZIP_ENTRY_SNIFF_BYTES = 64;
|
|
6
|
+
export declare const MANIFEST_COMPRESSION_THRESHOLD_BYTES = 256;
|
|
6
7
|
export declare function zipOptionsForPatchEntry(): ZipEntryOptions;
|
|
7
|
-
export declare function zipOptionsForManifestEntry(): ZipEntryOptions;
|
|
8
|
+
export declare function zipOptionsForManifestEntry(byteLength?: number): ZipEntryOptions;
|
|
8
9
|
export declare function zipOptionsForPayloadEntry(fileName: string, prefix?: Buffer): ZipEntryOptions;
|
|
9
10
|
export declare function zipOptionsForPayloadFile(filePath: string, entryName?: string): ZipEntryOptions;
|