react-native-update-cli 2.9.4 → 2.9.6
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/lib/api.js +19 -15
- package/lib/app.d.ts +5 -1
- package/lib/app.js +31 -21
- package/lib/bundle-pack.js +2 -1
- package/lib/bundle-runner.js +14 -14
- package/lib/diff.js +24 -22
- package/lib/exports.js +16 -16
- package/lib/index.js +3 -3
- package/lib/module-manager.js +3 -6
- package/lib/modules/app-module.js +1 -1
- package/lib/modules/index.js +7 -7
- package/lib/package.js +15 -11
- package/lib/utils/app-info-parser/aab.js +7 -7
- package/lib/utils/app-info-parser/resource-finder.js +7 -7
- package/lib/utils/app-info-parser/utils.js +10 -10
- package/lib/utils/app-info-parser/xml-parser/binary.js +2 -2
- package/lib/utils/command-result.js +3 -3
- package/lib/utils/constants.js +10 -10
- package/lib/utils/http-helper.js +5 -5
- package/lib/utils/index.js +10 -10
- package/lib/utils/latest-version/cli.js +1 -1
- package/lib/utils/latest-version/index.js +10 -10
- package/lib/utils/options.js +5 -5
- package/lib/utils/plugin-config.js +2 -2
- package/lib/utils/zip-entries.d.ts +1 -0
- package/lib/utils/zip-entries.js +82 -4
- package/lib/utils/zip-options.d.ts +9 -0
- package/lib/utils/zip-options.js +272 -0
- package/lib/versions.js +17 -21
- package/package.json +14 -14
- package/src/api.ts +7 -1
- package/src/app.ts +27 -12
- package/src/bundle-pack.ts +6 -1
- package/src/diff.ts +55 -15
- package/src/module-manager.ts +0 -4
- package/src/package.ts +5 -4
- package/src/utils/zip-entries.ts +89 -2
- package/src/utils/zip-options.ts +169 -0
- package/src/versions.ts +16 -18
package/lib/api.js
CHANGED
|
@@ -5,47 +5,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
closeSession
|
|
12
|
+
get closeSession () {
|
|
13
13
|
return closeSession;
|
|
14
14
|
},
|
|
15
|
-
doDelete
|
|
15
|
+
get doDelete () {
|
|
16
16
|
return doDelete;
|
|
17
17
|
},
|
|
18
|
-
get
|
|
18
|
+
get get () {
|
|
19
19
|
return get;
|
|
20
20
|
},
|
|
21
|
-
getAllPackages
|
|
21
|
+
get getAllPackages () {
|
|
22
22
|
return getAllPackages;
|
|
23
23
|
},
|
|
24
|
-
getApiToken
|
|
24
|
+
get getApiToken () {
|
|
25
25
|
return getApiToken;
|
|
26
26
|
},
|
|
27
|
-
getSession
|
|
27
|
+
get getSession () {
|
|
28
28
|
return getSession;
|
|
29
29
|
},
|
|
30
|
-
loadSession
|
|
30
|
+
get loadSession () {
|
|
31
31
|
return loadSession;
|
|
32
32
|
},
|
|
33
|
-
post
|
|
33
|
+
get post () {
|
|
34
34
|
return post;
|
|
35
35
|
},
|
|
36
|
-
put
|
|
36
|
+
get put () {
|
|
37
37
|
return put;
|
|
38
38
|
},
|
|
39
|
-
replaceSession
|
|
39
|
+
get replaceSession () {
|
|
40
40
|
return replaceSession;
|
|
41
41
|
},
|
|
42
|
-
saveSession
|
|
42
|
+
get saveSession () {
|
|
43
43
|
return saveSession;
|
|
44
44
|
},
|
|
45
|
-
setApiToken
|
|
45
|
+
get setApiToken () {
|
|
46
46
|
return setApiToken;
|
|
47
47
|
},
|
|
48
|
-
uploadFile
|
|
48
|
+
get uploadFile () {
|
|
49
49
|
return uploadFile;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
@@ -131,7 +131,11 @@ async function query(url, options) {
|
|
|
131
131
|
let json;
|
|
132
132
|
try {
|
|
133
133
|
json = JSON.parse(text);
|
|
134
|
-
} catch (e) {
|
|
134
|
+
} catch (e) {
|
|
135
|
+
if (resp.status === 200 && text) {
|
|
136
|
+
console.warn(`Warning: API returned 200 with non-JSON body (${text.length} bytes)`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
135
139
|
if (resp.status !== 200) {
|
|
136
140
|
const message = (json == null ? void 0 : json.message) || resp.statusText || `HTTP ${resp.status}`;
|
|
137
141
|
if (resp.status === 401) {
|
package/lib/app.d.ts
CHANGED
|
@@ -6,7 +6,11 @@ interface AppSummary {
|
|
|
6
6
|
}
|
|
7
7
|
export declare function getPlatform(platform?: string): Promise<Platform>;
|
|
8
8
|
export declare function assertPlatform(platform: string): Platform;
|
|
9
|
-
export declare function getSelectedApp(platform: Platform):
|
|
9
|
+
export declare function getSelectedApp(platform: Platform): Promise<{
|
|
10
|
+
appId: string;
|
|
11
|
+
appKey: string;
|
|
12
|
+
platform: Platform;
|
|
13
|
+
}>;
|
|
10
14
|
export declare function listApp(platform?: Platform | ''): Promise<AppSummary[]>;
|
|
11
15
|
export declare function chooseApp(platform: Platform): Promise<AppSummary>;
|
|
12
16
|
export declare const appCommands: {
|
package/lib/app.js
CHANGED
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
appCommands
|
|
12
|
+
get appCommands () {
|
|
13
13
|
return appCommands;
|
|
14
14
|
},
|
|
15
|
-
assertPlatform
|
|
15
|
+
get assertPlatform () {
|
|
16
16
|
return assertPlatform;
|
|
17
17
|
},
|
|
18
|
-
chooseApp
|
|
18
|
+
get chooseApp () {
|
|
19
19
|
return chooseApp;
|
|
20
20
|
},
|
|
21
|
-
getPlatform
|
|
21
|
+
get getPlatform () {
|
|
22
22
|
return getPlatform;
|
|
23
23
|
},
|
|
24
|
-
getSelectedApp
|
|
24
|
+
get getSelectedApp () {
|
|
25
25
|
return getSelectedApp;
|
|
26
26
|
},
|
|
27
|
-
listApp
|
|
27
|
+
get listApp () {
|
|
28
28
|
return listApp;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -54,20 +54,30 @@ function assertPlatform(platform) {
|
|
|
54
54
|
}
|
|
55
55
|
return platform;
|
|
56
56
|
}
|
|
57
|
-
function getSelectedApp(platform) {
|
|
57
|
+
async function getSelectedApp(platform) {
|
|
58
58
|
assertPlatform(platform);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
let updateInfo = {};
|
|
60
|
+
try {
|
|
61
|
+
updateInfo = JSON.parse(await _fs.default.promises.readFile('update.json', 'utf8'));
|
|
62
|
+
} catch (e) {
|
|
63
|
+
if (e.code === 'ENOENT') {
|
|
64
|
+
throw new Error((0, _i18n.t)('appNotSelected', {
|
|
65
|
+
platform
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
throw e;
|
|
63
69
|
}
|
|
64
|
-
const
|
|
65
|
-
if (!
|
|
70
|
+
const info = updateInfo[platform];
|
|
71
|
+
if (!info) {
|
|
66
72
|
throw new Error((0, _i18n.t)('appNotSelected', {
|
|
67
73
|
platform
|
|
68
74
|
}));
|
|
69
75
|
}
|
|
70
|
-
return
|
|
76
|
+
return {
|
|
77
|
+
appId: String(info.appId),
|
|
78
|
+
appKey: info.appKey,
|
|
79
|
+
platform
|
|
80
|
+
};
|
|
71
81
|
}
|
|
72
82
|
async function listApp(platform = '') {
|
|
73
83
|
const { data } = await (0, _api.get)('/app/list');
|
|
@@ -133,7 +143,7 @@ const appCommands = {
|
|
|
133
143
|
},
|
|
134
144
|
deleteApp: async ({ args, options })=>{
|
|
135
145
|
const { platform } = options;
|
|
136
|
-
const id = args[0] || chooseApp(platform);
|
|
146
|
+
const id = args[0] || (await chooseApp(platform)).id;
|
|
137
147
|
if (!id) {
|
|
138
148
|
console.log((0, _i18n.t)('cancelled'));
|
|
139
149
|
}
|
|
@@ -148,10 +158,10 @@ const appCommands = {
|
|
|
148
158
|
const platform = await getPlatform(options.platform);
|
|
149
159
|
const id = args[0] ? Number.parseInt(args[0]) : (await chooseApp(platform)).id;
|
|
150
160
|
let updateInfo = {};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
161
|
+
try {
|
|
162
|
+
updateInfo = JSON.parse(await _fs.default.promises.readFile('update.json', 'utf8'));
|
|
163
|
+
} catch (e) {
|
|
164
|
+
if (e.code !== 'ENOENT') {
|
|
155
165
|
console.error((0, _i18n.t)('failedToParseUpdateJson'));
|
|
156
166
|
throw e;
|
|
157
167
|
}
|
|
@@ -161,6 +171,6 @@ const appCommands = {
|
|
|
161
171
|
appId: id,
|
|
162
172
|
appKey
|
|
163
173
|
};
|
|
164
|
-
_fs.default.
|
|
174
|
+
await _fs.default.promises.writeFile('update.json', JSON.stringify(updateInfo, null, 4), 'utf8');
|
|
165
175
|
}
|
|
166
176
|
};
|
package/lib/bundle-pack.js
CHANGED
|
@@ -12,6 +12,7 @@ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
|
12
12
|
const _fsextra = /*#__PURE__*/ _interop_require_wildcard(require("fs-extra"));
|
|
13
13
|
const _yazl = require("yazl");
|
|
14
14
|
const _i18n = require("./utils/i18n");
|
|
15
|
+
const _zipoptions = require("./utils/zip-options");
|
|
15
16
|
function _interop_require_default(obj) {
|
|
16
17
|
return obj && obj.__esModule ? obj : {
|
|
17
18
|
default: obj
|
|
@@ -85,7 +86,7 @@ async function packBundle(dir, output) {
|
|
|
85
86
|
const fullPath = _path.default.join(root, name);
|
|
86
87
|
const stat = _fsextra.statSync(fullPath);
|
|
87
88
|
if (stat.isFile()) {
|
|
88
|
-
zipfile.addFile(fullPath, rel + name);
|
|
89
|
+
zipfile.addFile(fullPath, rel + name, (0, _zipoptions.zipOptionsForPayloadFile)(fullPath, rel + name));
|
|
89
90
|
} else if (stat.isDirectory()) {
|
|
90
91
|
addDirectory(fullPath, `${rel}${name}/`);
|
|
91
92
|
}
|
package/lib/bundle-runner.js
CHANGED
|
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
copyDebugidForSentry
|
|
12
|
+
get copyDebugidForSentry () {
|
|
13
13
|
return copyDebugidForSentry;
|
|
14
14
|
},
|
|
15
|
-
hasProjectDependency
|
|
15
|
+
get hasProjectDependency () {
|
|
16
16
|
return hasProjectDependency;
|
|
17
17
|
},
|
|
18
|
-
resolveExpoCli
|
|
18
|
+
get resolveExpoCli () {
|
|
19
19
|
return resolveExpoCli;
|
|
20
20
|
},
|
|
21
|
-
runReactNativeBundleCommand
|
|
21
|
+
get runReactNativeBundleCommand () {
|
|
22
22
|
return runReactNativeBundleCommand;
|
|
23
23
|
},
|
|
24
|
-
uploadSourcemapForSentry
|
|
24
|
+
get uploadSourcemapForSentry () {
|
|
25
25
|
return uploadSourcemapForSentry;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -95,7 +95,7 @@ function hasProjectDependency(dependencyName, projectRoot = process.cwd()) {
|
|
|
95
95
|
}
|
|
96
96
|
return dependencyName in dependencies;
|
|
97
97
|
});
|
|
98
|
-
} catch (
|
|
98
|
+
} catch (unused) {
|
|
99
99
|
return false;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -117,7 +117,7 @@ function resolveExpoCli(projectRoot = process.cwd()) {
|
|
|
117
117
|
]
|
|
118
118
|
});
|
|
119
119
|
searchPaths.push(_path.default.dirname(expoPackageJsonPath));
|
|
120
|
-
} catch (
|
|
120
|
+
} catch (unused) {
|
|
121
121
|
// expo 包不存在,忽略
|
|
122
122
|
}
|
|
123
123
|
const cliPath = require.resolve('@expo/cli', {
|
|
@@ -136,7 +136,7 @@ function resolveExpoCli(projectRoot = process.cwd()) {
|
|
|
136
136
|
cliPath,
|
|
137
137
|
usingExpo: true
|
|
138
138
|
};
|
|
139
|
-
} catch (
|
|
139
|
+
} catch (unused) {
|
|
140
140
|
return {
|
|
141
141
|
cliPath: '',
|
|
142
142
|
usingExpo: false
|
|
@@ -171,7 +171,7 @@ async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputF
|
|
|
171
171
|
process.cwd()
|
|
172
172
|
]
|
|
173
173
|
});
|
|
174
|
-
} catch (
|
|
174
|
+
} catch (unused) {
|
|
175
175
|
cliPath = require.resolve('@react-native-community/cli/build/bin.js', {
|
|
176
176
|
paths: [
|
|
177
177
|
process.cwd()
|
|
@@ -186,7 +186,7 @@ async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputF
|
|
|
186
186
|
process.cwd()
|
|
187
187
|
]
|
|
188
188
|
});
|
|
189
|
-
} catch (
|
|
189
|
+
} catch (unused) {
|
|
190
190
|
// fallback 到 RN CLI
|
|
191
191
|
}
|
|
192
192
|
};
|
|
@@ -316,7 +316,7 @@ async function checkGradleConfig() {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
} catch (
|
|
319
|
+
} catch (unused) {
|
|
320
320
|
// ignore parsing failures
|
|
321
321
|
}
|
|
322
322
|
return {
|
|
@@ -383,7 +383,7 @@ async function copyDebugidForSentry(bundleName, outputFolder, sourcemapOutput) {
|
|
|
383
383
|
process.cwd()
|
|
384
384
|
]
|
|
385
385
|
});
|
|
386
|
-
} catch (
|
|
386
|
+
} catch (unused) {
|
|
387
387
|
console.error((0, _i18n.t)('sentryCliNotFound'));
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
@@ -412,7 +412,7 @@ async function uploadSourcemapForSentry(bundleName, outputFolder, sourcemapOutpu
|
|
|
412
412
|
process.cwd()
|
|
413
413
|
]
|
|
414
414
|
});
|
|
415
|
-
} catch (
|
|
415
|
+
} catch (unused) {
|
|
416
416
|
console.error((0, _i18n.t)('sentryCliNotFound'));
|
|
417
417
|
return;
|
|
418
418
|
}
|
package/lib/diff.js
CHANGED
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
diffCommands
|
|
12
|
+
get diffCommands () {
|
|
13
13
|
return diffCommands;
|
|
14
14
|
},
|
|
15
|
-
enumZipEntries
|
|
15
|
+
get enumZipEntries () {
|
|
16
16
|
return _zipentries.enumZipEntries;
|
|
17
17
|
},
|
|
18
|
-
readEntry
|
|
18
|
+
get readEntry () {
|
|
19
19
|
return _zipentries.readEntry;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -27,6 +27,7 @@ const _utils = require("./utils");
|
|
|
27
27
|
const _constants = require("./utils/constants");
|
|
28
28
|
const _i18n = require("./utils/i18n");
|
|
29
29
|
const _zipentries = require("./utils/zip-entries");
|
|
30
|
+
const _zipoptions = require("./utils/zip-options");
|
|
30
31
|
function _interop_require_default(obj) {
|
|
31
32
|
return obj && obj.__esModule ? obj : {
|
|
32
33
|
default: obj
|
|
@@ -73,7 +74,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
73
74
|
}
|
|
74
75
|
return newObj;
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
+
const loadModule = (pkgName)=>{
|
|
77
78
|
const resolvePaths = [
|
|
78
79
|
'.',
|
|
79
80
|
_globaldirs.npm.packages,
|
|
@@ -83,15 +84,12 @@ const loadDiffModule = (pkgName)=>{
|
|
|
83
84
|
const resolved = require.resolve(pkgName, {
|
|
84
85
|
paths: resolvePaths
|
|
85
86
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return mod.diff;
|
|
89
|
-
}
|
|
90
|
-
} catch (e) {}
|
|
87
|
+
return require(resolved);
|
|
88
|
+
} catch (unused) {}
|
|
91
89
|
return undefined;
|
|
92
90
|
};
|
|
93
|
-
const hdiff =
|
|
94
|
-
const bsdiff =
|
|
91
|
+
const hdiff = loadModule('node-hdiffpatch');
|
|
92
|
+
const bsdiff = loadModule('node-bsdiff');
|
|
95
93
|
function basename(fn) {
|
|
96
94
|
const m = /^(.+\/)[^\/]+\/?$/.exec(fn);
|
|
97
95
|
return m == null ? void 0 : m[1];
|
|
@@ -148,7 +146,7 @@ async function diffFromPPK(origin, next, output, diffFn) {
|
|
|
148
146
|
//console.log('Found bundle');
|
|
149
147
|
const newSource = await (0, _zipentries.readEntry)(entry, nextZipfile);
|
|
150
148
|
//console.log('Begin diff');
|
|
151
|
-
zipfile.addBuffer(diffFn(originSource, newSource), `${entry.fileName}.patch
|
|
149
|
+
zipfile.addBuffer(diffFn(originSource, newSource), `${entry.fileName}.patch`, (0, _zipoptions.zipOptionsForPatchEntry)());
|
|
152
150
|
//console.log('End diff');
|
|
153
151
|
} else {
|
|
154
152
|
// If same file.
|
|
@@ -172,6 +170,7 @@ async function diffFromPPK(origin, next, output, diffFn) {
|
|
|
172
170
|
if (basePath) {
|
|
173
171
|
addEntry(basePath);
|
|
174
172
|
}
|
|
173
|
+
const entryPrefix = await (0, _zipentries.readEntryPrefix)(entry, nextZipfile, _zipoptions.ZIP_ENTRY_SNIFF_BYTES);
|
|
175
174
|
await new Promise((resolve, reject)=>{
|
|
176
175
|
nextZipfile.openReadStream(entry, (err, readStream)=>{
|
|
177
176
|
if (err) {
|
|
@@ -180,7 +179,7 @@ async function diffFromPPK(origin, next, output, diffFn) {
|
|
|
180
179
|
if (!readStream) {
|
|
181
180
|
return reject(new Error(`Unable to read zip entry: ${entry.fileName}`));
|
|
182
181
|
}
|
|
183
|
-
zipfile.addReadStream(readStream, entry.fileName);
|
|
182
|
+
zipfile.addReadStream(readStream, entry.fileName, (0, _zipoptions.zipOptionsForPayloadEntry)(entry.fileName, entryPrefix));
|
|
184
183
|
readStream.on('end', ()=>{
|
|
185
184
|
//console.log('add finished');
|
|
186
185
|
resolve(void 0);
|
|
@@ -202,7 +201,7 @@ async function diffFromPPK(origin, next, output, diffFn) {
|
|
|
202
201
|
zipfile.addBuffer(Buffer.from(JSON.stringify({
|
|
203
202
|
copies,
|
|
204
203
|
deletes
|
|
205
|
-
})), '__diff.json');
|
|
204
|
+
})), '__diff.json', (0, _zipoptions.zipOptionsForManifestEntry)());
|
|
206
205
|
zipfile.end();
|
|
207
206
|
await writePromise;
|
|
208
207
|
}
|
|
@@ -246,7 +245,7 @@ async function diffFromPackage(origin, next, output, diffFn, originBundleName, t
|
|
|
246
245
|
//console.log('Found bundle');
|
|
247
246
|
const newSource = await (0, _zipentries.readEntry)(entry, nextZipfile);
|
|
248
247
|
//console.log('Begin diff');
|
|
249
|
-
zipfile.addBuffer(diffFn(originSource, newSource), `${entry.fileName}.patch
|
|
248
|
+
zipfile.addBuffer(diffFn(originSource, newSource), `${entry.fileName}.patch`, (0, _zipoptions.zipOptionsForPatchEntry)());
|
|
250
249
|
//console.log('End diff');
|
|
251
250
|
} else {
|
|
252
251
|
// If same file.
|
|
@@ -260,6 +259,7 @@ async function diffFromPackage(origin, next, output, diffFn, originBundleName, t
|
|
|
260
259
|
copies[entry.fileName] = movedFrom;
|
|
261
260
|
return;
|
|
262
261
|
}
|
|
262
|
+
const entryPrefix = await (0, _zipentries.readEntryPrefix)(entry, nextZipfile, _zipoptions.ZIP_ENTRY_SNIFF_BYTES);
|
|
263
263
|
await new Promise((resolve, reject)=>{
|
|
264
264
|
nextZipfile.openReadStream(entry, (err, readStream)=>{
|
|
265
265
|
if (err) {
|
|
@@ -268,7 +268,7 @@ async function diffFromPackage(origin, next, output, diffFn, originBundleName, t
|
|
|
268
268
|
if (!readStream) {
|
|
269
269
|
return reject(new Error(`Unable to read zip entry: ${entry.fileName}`));
|
|
270
270
|
}
|
|
271
|
-
zipfile.addReadStream(readStream, entry.fileName);
|
|
271
|
+
zipfile.addReadStream(readStream, entry.fileName, (0, _zipoptions.zipOptionsForPayloadEntry)(entry.fileName, entryPrefix));
|
|
272
272
|
readStream.on('end', ()=>{
|
|
273
273
|
//console.log('add finished');
|
|
274
274
|
resolve(void 0);
|
|
@@ -279,7 +279,7 @@ async function diffFromPackage(origin, next, output, diffFn, originBundleName, t
|
|
|
279
279
|
});
|
|
280
280
|
zipfile.addBuffer(Buffer.from(JSON.stringify({
|
|
281
281
|
copies
|
|
282
|
-
})), '__diff.json');
|
|
282
|
+
})), '__diff.json', (0, _zipoptions.zipOptionsForManifestEntry)());
|
|
283
283
|
zipfile.end();
|
|
284
284
|
await writePromise;
|
|
285
285
|
}
|
|
@@ -288,19 +288,21 @@ function resolveDiffImplementation(useHdiff, options) {
|
|
|
288
288
|
return options.customDiff;
|
|
289
289
|
}
|
|
290
290
|
if (useHdiff) {
|
|
291
|
-
|
|
291
|
+
var _options_customHdiffModule;
|
|
292
|
+
const hdiffModule = (_options_customHdiffModule = options.customHdiffModule) != null ? _options_customHdiffModule : hdiff;
|
|
293
|
+
if (!(hdiffModule == null ? void 0 : hdiffModule.diff)) {
|
|
292
294
|
throw new Error((0, _i18n.t)('nodeHdiffpatchRequired', {
|
|
293
295
|
scriptName: _constants.scriptName
|
|
294
296
|
}));
|
|
295
297
|
}
|
|
296
|
-
return
|
|
298
|
+
return hdiffModule.diff;
|
|
297
299
|
}
|
|
298
|
-
if (!bsdiff) {
|
|
300
|
+
if (!(bsdiff == null ? void 0 : bsdiff.diff)) {
|
|
299
301
|
throw new Error((0, _i18n.t)('nodeBsdiffRequired', {
|
|
300
302
|
scriptName: _constants.scriptName
|
|
301
303
|
}));
|
|
302
304
|
}
|
|
303
|
-
return bsdiff;
|
|
305
|
+
return bsdiff.diff;
|
|
304
306
|
}
|
|
305
307
|
function diffArgsCheck(args, options, diffFnName, useHdiff) {
|
|
306
308
|
const [origin, next] = args;
|
package/lib/exports.js
CHANGED
|
@@ -5,53 +5,53 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
CLIProviderImpl
|
|
12
|
+
get CLIProviderImpl () {
|
|
13
13
|
return _provider.CLIProviderImpl;
|
|
14
14
|
},
|
|
15
|
-
appModule
|
|
15
|
+
get appModule () {
|
|
16
16
|
return _appmodule.appModule;
|
|
17
17
|
},
|
|
18
|
-
builtinModules
|
|
18
|
+
get builtinModules () {
|
|
19
19
|
return _modules.builtinModules;
|
|
20
20
|
},
|
|
21
|
-
bundleModule
|
|
21
|
+
get bundleModule () {
|
|
22
22
|
return _bundlemodule.bundleModule;
|
|
23
23
|
},
|
|
24
|
-
diffCommands
|
|
24
|
+
get diffCommands () {
|
|
25
25
|
return _diff.diffCommands;
|
|
26
26
|
},
|
|
27
|
-
getPlatform
|
|
27
|
+
get getPlatform () {
|
|
28
28
|
return _app.getPlatform;
|
|
29
29
|
},
|
|
30
|
-
getSelectedApp
|
|
30
|
+
get getSelectedApp () {
|
|
31
31
|
return _app.getSelectedApp;
|
|
32
32
|
},
|
|
33
|
-
getSession
|
|
33
|
+
get getSession () {
|
|
34
34
|
return _api.getSession;
|
|
35
35
|
},
|
|
36
|
-
loadSession
|
|
36
|
+
get loadSession () {
|
|
37
37
|
return _api.loadSession;
|
|
38
38
|
},
|
|
39
|
-
moduleManager
|
|
39
|
+
get moduleManager () {
|
|
40
40
|
return _modulemanager.moduleManager;
|
|
41
41
|
},
|
|
42
|
-
packageModule
|
|
42
|
+
get packageModule () {
|
|
43
43
|
return _packagemodule.packageModule;
|
|
44
44
|
},
|
|
45
|
-
question
|
|
45
|
+
get question () {
|
|
46
46
|
return _utils.question;
|
|
47
47
|
},
|
|
48
|
-
saveToLocal
|
|
48
|
+
get saveToLocal () {
|
|
49
49
|
return _utils.saveToLocal;
|
|
50
50
|
},
|
|
51
|
-
userModule
|
|
51
|
+
get userModule () {
|
|
52
52
|
return _usermodule.userModule;
|
|
53
53
|
},
|
|
54
|
-
versionModule
|
|
54
|
+
get versionModule () {
|
|
55
55
|
return _versionmodule.versionModule;
|
|
56
56
|
}
|
|
57
57
|
});
|
package/lib/index.js
CHANGED
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
CLIProviderImpl
|
|
13
|
+
get CLIProviderImpl () {
|
|
14
14
|
return _provider.CLIProviderImpl;
|
|
15
15
|
},
|
|
16
|
-
moduleManager
|
|
16
|
+
get moduleManager () {
|
|
17
17
|
return _modulemanager.moduleManager;
|
|
18
18
|
}
|
|
19
19
|
});
|
package/lib/module-manager.js
CHANGED
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ModuleManager
|
|
12
|
+
get ModuleManager () {
|
|
13
13
|
return ModuleManager;
|
|
14
14
|
},
|
|
15
|
-
moduleManager
|
|
15
|
+
get moduleManager () {
|
|
16
16
|
return moduleManager;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -36,9 +36,6 @@ class ModuleManager {
|
|
|
36
36
|
if (module.init) {
|
|
37
37
|
module.init(this.provider);
|
|
38
38
|
}
|
|
39
|
-
// console.log(
|
|
40
|
-
// `Module '${module.name}' (v${module.version}) registered successfully`,
|
|
41
|
-
// );
|
|
42
39
|
}
|
|
43
40
|
unregisterModule(moduleName) {
|
|
44
41
|
const module = this.modules.get(moduleName);
|
|
@@ -164,9 +164,9 @@ const appModule = {
|
|
|
164
164
|
name: 'analyze-apps',
|
|
165
165
|
description: 'Analyze app status',
|
|
166
166
|
execute: async (context, previousResult)=>{
|
|
167
|
+
var _state_appsData;
|
|
167
168
|
console.log('📊 Analyzing app status...');
|
|
168
169
|
const state = (0, _options.toObjectState)(previousResult, {});
|
|
169
|
-
var _state_appsData;
|
|
170
170
|
const appsData = (_state_appsData = state.appsData) != null ? _state_appsData : emptyAppsData;
|
|
171
171
|
const analysis = {
|
|
172
172
|
totalApps: 0,
|
package/lib/modules/index.js
CHANGED
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
appModule
|
|
12
|
+
get appModule () {
|
|
13
13
|
return _appmodule.appModule;
|
|
14
14
|
},
|
|
15
|
-
builtinModules
|
|
15
|
+
get builtinModules () {
|
|
16
16
|
return builtinModules;
|
|
17
17
|
},
|
|
18
|
-
bundleModule
|
|
18
|
+
get bundleModule () {
|
|
19
19
|
return _bundlemodule.bundleModule;
|
|
20
20
|
},
|
|
21
|
-
packageModule
|
|
21
|
+
get packageModule () {
|
|
22
22
|
return _packagemodule.packageModule;
|
|
23
23
|
},
|
|
24
|
-
userModule
|
|
24
|
+
get userModule () {
|
|
25
25
|
return _usermodule.userModule;
|
|
26
26
|
},
|
|
27
|
-
versionModule
|
|
27
|
+
get versionModule () {
|
|
28
28
|
return _versionmodule.versionModule;
|
|
29
29
|
}
|
|
30
30
|
});
|