react-native-update-cli 2.8.5 → 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.
- package/lib/api.d.ts +18 -0
- package/lib/app.d.ts +38 -0
- package/lib/app.js +5 -4
- package/lib/bundle-pack.d.ts +1 -0
- package/lib/bundle-pack.js +104 -0
- package/lib/bundle-runner.d.ts +20 -0
- package/lib/bundle-runner.js +404 -0
- package/lib/bundle.d.ts +6 -0
- package/lib/bundle.js +73 -471
- package/lib/diff.d.ts +13 -0
- package/lib/diff.js +144 -123
- package/lib/exports.d.ts +12 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +5 -13
- package/lib/install.d.ts +4 -0
- package/lib/locales/en.d.ts +137 -0
- package/lib/locales/zh.d.ts +136 -0
- package/lib/module-manager.d.ts +20 -0
- package/lib/module-manager.js +3 -9
- package/lib/modules/app-module.d.ts +2 -0
- package/lib/modules/app-module.js +84 -44
- package/lib/modules/bundle-module.d.ts +2 -0
- package/lib/modules/bundle-module.js +7 -8
- package/lib/modules/index.d.ts +6 -0
- package/lib/modules/package-module.d.ts +2 -0
- package/lib/modules/user-module.d.ts +2 -0
- package/lib/modules/user-module.js +55 -44
- package/lib/modules/version-module.d.ts +2 -0
- package/lib/package.d.ts +58 -0
- package/lib/package.js +103 -139
- package/lib/provider.d.ts +26 -0
- package/lib/provider.js +115 -217
- package/lib/types.d.ts +120 -0
- package/lib/user.d.ts +8 -0
- package/lib/utils/add-gitignore.d.ts +1 -0
- package/lib/utils/app-info-parser/aab.d.ts +22 -0
- package/lib/utils/app-info-parser/aab.js +0 -4
- package/lib/utils/app-info-parser/apk.d.ts +14 -0
- package/lib/utils/app-info-parser/apk.js +6 -4
- package/lib/utils/app-info-parser/app.d.ts +4 -0
- package/lib/utils/app-info-parser/app.js +3 -0
- package/lib/utils/app-info-parser/index.d.ts +16 -0
- package/lib/utils/app-info-parser/index.js +2 -0
- package/lib/utils/app-info-parser/ipa.d.ts +14 -0
- package/lib/utils/app-info-parser/ipa.js +1 -1
- package/lib/utils/app-info-parser/resource-finder.d.ts +49 -0
- package/lib/utils/app-info-parser/utils.d.ts +31 -0
- package/lib/utils/app-info-parser/utils.js +1 -0
- package/lib/utils/app-info-parser/xml-parser/binary.d.ts +56 -0
- package/lib/utils/app-info-parser/xml-parser/manifest.d.ts +10 -0
- package/lib/utils/app-info-parser/zip.d.ts +18 -0
- package/lib/utils/app-info-parser/zip.js +7 -9
- package/lib/utils/check-lockfile.d.ts +1 -0
- package/lib/utils/check-plugin.d.ts +7 -0
- package/lib/utils/command-result.d.ts +3 -0
- package/lib/utils/command-result.js +35 -0
- package/lib/utils/constants.d.ts +9 -0
- package/lib/utils/dep-versions.d.ts +1 -0
- package/lib/utils/git.d.ts +8 -0
- package/lib/utils/http-helper.d.ts +4 -0
- package/lib/utils/i18n.d.ts +12 -0
- package/lib/utils/index.d.ts +22 -0
- package/lib/utils/index.js +52 -22
- package/lib/utils/latest-version/cli.d.ts +1 -0
- package/lib/utils/latest-version/cli.js +24 -60
- package/lib/utils/latest-version/index.d.ts +146 -0
- package/lib/utils/latest-version/index.js +22 -22
- package/lib/utils/options.d.ts +4 -0
- package/lib/utils/options.js +63 -0
- package/lib/utils/plugin-config.d.ts +9 -0
- package/lib/utils/zip-entries.d.ts +3 -0
- package/lib/versions.d.ts +43 -0
- package/lib/workflow-runner.d.ts +2 -0
- package/lib/workflow-runner.js +25 -0
- package/package.json +20 -5
- package/src/api.ts +1 -1
- package/src/app.ts +20 -11
- package/src/bundle-pack.ts +51 -0
- package/src/bundle-runner.ts +463 -0
- package/src/bundle.ts +184 -571
- package/src/diff.ts +208 -174
- package/src/index.ts +15 -17
- package/src/module-manager.ts +15 -15
- package/src/modules/app-module.ts +120 -48
- package/src/modules/bundle-module.ts +21 -11
- package/src/modules/package-module.ts +0 -1
- package/src/modules/user-module.ts +117 -58
- package/src/package.ts +158 -138
- package/src/provider.ts +164 -240
- package/src/types.ts +13 -8
- package/src/utils/app-info-parser/aab.ts +0 -7
- package/src/utils/app-info-parser/apk.ts +9 -6
- package/src/utils/app-info-parser/app.ts +5 -1
- package/src/utils/app-info-parser/index.ts +11 -6
- package/src/utils/app-info-parser/ipa.ts +1 -1
- package/src/utils/app-info-parser/utils.ts +3 -0
- package/src/utils/app-info-parser/xml-parser/manifest.ts +3 -1
- package/src/utils/app-info-parser/zip.ts +12 -14
- package/src/utils/command-result.ts +24 -0
- package/src/utils/index.ts +138 -39
- package/src/utils/latest-version/cli.ts +22 -20
- package/src/utils/latest-version/index.ts +20 -20
- package/src/utils/options.ts +56 -0
- package/src/utils/zip-entries.ts +1 -1
- package/src/workflow-runner.ts +24 -0
- package/index.js +0 -1
package/lib/diff.js
CHANGED
|
@@ -73,7 +73,6 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
73
73
|
}
|
|
74
74
|
return newObj;
|
|
75
75
|
}
|
|
76
|
-
var _loadDiffModule;
|
|
77
76
|
const loadDiffModule = (pkgName)=>{
|
|
78
77
|
const resolvePaths = [
|
|
79
78
|
'.',
|
|
@@ -91,28 +90,25 @@ const loadDiffModule = (pkgName)=>{
|
|
|
91
90
|
} catch (e) {}
|
|
92
91
|
return undefined;
|
|
93
92
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
let bsdiff;
|
|
97
|
-
let diff;
|
|
98
|
-
bsdiff = loadDiffModule('node-bsdiff');
|
|
93
|
+
const hdiff = loadDiffModule('node-hdiffpatch');
|
|
94
|
+
const bsdiff = loadDiffModule('node-bsdiff');
|
|
99
95
|
function basename(fn) {
|
|
100
96
|
const m = /^(.+\/)[^\/]+\/?$/.exec(fn);
|
|
101
97
|
return m == null ? void 0 : m[1];
|
|
102
98
|
}
|
|
103
|
-
async function diffFromPPK(origin, next, output) {
|
|
99
|
+
async function diffFromPPK(origin, next, output, diffFn) {
|
|
104
100
|
_fsextra.ensureDirSync(_path.default.dirname(output));
|
|
105
101
|
const originEntries = {};
|
|
106
102
|
const originMap = {};
|
|
107
103
|
let originSource;
|
|
108
|
-
await (0, _zipentries.enumZipEntries)(origin, (entry, zipFile)=>{
|
|
104
|
+
await (0, _zipentries.enumZipEntries)(origin, async (entry, zipFile)=>{
|
|
109
105
|
originEntries[entry.fileName] = entry;
|
|
110
106
|
if (!/\/$/.test(entry.fileName)) {
|
|
111
107
|
// isFile
|
|
112
108
|
originMap[entry.crc32] = entry.fileName;
|
|
113
109
|
if ((0, _constants.isPPKBundleFileName)(entry.fileName)) {
|
|
114
110
|
// This is source.
|
|
115
|
-
|
|
111
|
+
originSource = await (0, _zipentries.readEntry)(entry, zipFile);
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
114
|
});
|
|
@@ -122,9 +118,7 @@ async function diffFromPPK(origin, next, output) {
|
|
|
122
118
|
const copies = {};
|
|
123
119
|
const zipfile = new _yazl.ZipFile();
|
|
124
120
|
const writePromise = new Promise((resolve, reject)=>{
|
|
125
|
-
zipfile.outputStream.on('error',
|
|
126
|
-
throw err;
|
|
127
|
-
});
|
|
121
|
+
zipfile.outputStream.on('error', reject);
|
|
128
122
|
zipfile.outputStream.pipe(_fsextra.createWriteStream(output)).on('close', ()=>{
|
|
129
123
|
resolve(void 0);
|
|
130
124
|
});
|
|
@@ -135,6 +129,7 @@ async function diffFromPPK(origin, next, output) {
|
|
|
135
129
|
if (!fn || addedEntry[fn]) {
|
|
136
130
|
return;
|
|
137
131
|
}
|
|
132
|
+
addedEntry[fn] = true;
|
|
138
133
|
const base = basename(fn);
|
|
139
134
|
if (base) {
|
|
140
135
|
addEntry(base);
|
|
@@ -142,7 +137,7 @@ async function diffFromPPK(origin, next, output) {
|
|
|
142
137
|
zipfile.addEmptyDirectory(fn);
|
|
143
138
|
}
|
|
144
139
|
const newEntries = {};
|
|
145
|
-
await (0, _zipentries.enumZipEntries)(next, (entry, nextZipfile)=>{
|
|
140
|
+
await (0, _zipentries.enumZipEntries)(next, async (entry, nextZipfile)=>{
|
|
146
141
|
newEntries[entry.fileName] = entry;
|
|
147
142
|
if (/\/$/.test(entry.fileName)) {
|
|
148
143
|
// Directory
|
|
@@ -151,11 +146,10 @@ async function diffFromPPK(origin, next, output) {
|
|
|
151
146
|
}
|
|
152
147
|
} else if ((0, _constants.isPPKBundleFileName)(entry.fileName)) {
|
|
153
148
|
//console.log('Found bundle');
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
});
|
|
149
|
+
const newSource = await (0, _zipentries.readEntry)(entry, nextZipfile);
|
|
150
|
+
//console.log('Begin diff');
|
|
151
|
+
zipfile.addBuffer(diffFn(originSource, newSource), `${entry.fileName}.patch`);
|
|
152
|
+
//console.log('End diff');
|
|
159
153
|
} else {
|
|
160
154
|
// If same file.
|
|
161
155
|
const originEntry = originEntries[entry.fileName];
|
|
@@ -164,21 +158,28 @@ async function diffFromPPK(origin, next, output) {
|
|
|
164
158
|
return;
|
|
165
159
|
}
|
|
166
160
|
// If moved from other place
|
|
167
|
-
|
|
161
|
+
const movedFrom = originMap[entry.crc32];
|
|
162
|
+
if (movedFrom) {
|
|
168
163
|
const base = basename(entry.fileName);
|
|
169
|
-
if (!originEntries[base]) {
|
|
164
|
+
if (base && !originEntries[base]) {
|
|
170
165
|
addEntry(base);
|
|
171
166
|
}
|
|
172
|
-
copies[entry.fileName] =
|
|
167
|
+
copies[entry.fileName] = movedFrom;
|
|
173
168
|
return;
|
|
174
169
|
}
|
|
175
170
|
// New file.
|
|
176
|
-
|
|
177
|
-
|
|
171
|
+
const basePath = basename(entry.fileName);
|
|
172
|
+
if (basePath) {
|
|
173
|
+
addEntry(basePath);
|
|
174
|
+
}
|
|
175
|
+
await new Promise((resolve, reject)=>{
|
|
178
176
|
nextZipfile.openReadStream(entry, (err, readStream)=>{
|
|
179
177
|
if (err) {
|
|
180
178
|
return reject(err);
|
|
181
179
|
}
|
|
180
|
+
if (!readStream) {
|
|
181
|
+
return reject(new Error(`Unable to read zip entry: ${entry.fileName}`));
|
|
182
|
+
}
|
|
182
183
|
zipfile.addReadStream(readStream, entry.fileName);
|
|
183
184
|
readStream.on('end', ()=>{
|
|
184
185
|
//console.log('add finished');
|
|
@@ -205,12 +206,12 @@ async function diffFromPPK(origin, next, output) {
|
|
|
205
206
|
zipfile.end();
|
|
206
207
|
await writePromise;
|
|
207
208
|
}
|
|
208
|
-
async function diffFromPackage(origin, next, output, originBundleName, transformPackagePath = (v)=>v) {
|
|
209
|
+
async function diffFromPackage(origin, next, output, diffFn, originBundleName, transformPackagePath = (v)=>v) {
|
|
209
210
|
_fsextra.ensureDirSync(_path.default.dirname(output));
|
|
210
211
|
const originEntries = {};
|
|
211
212
|
const originMap = {};
|
|
212
213
|
let originSource;
|
|
213
|
-
await (0, _zipentries.enumZipEntries)(origin, (entry, zipFile)=>{
|
|
214
|
+
await (0, _zipentries.enumZipEntries)(origin, async (entry, zipFile)=>{
|
|
214
215
|
if (!/\/$/.test(entry.fileName)) {
|
|
215
216
|
const fn = transformPackagePath(entry.fileName);
|
|
216
217
|
if (!fn) {
|
|
@@ -222,7 +223,7 @@ async function diffFromPackage(origin, next, output, originBundleName, transform
|
|
|
222
223
|
originMap[entry.crc32] = fn;
|
|
223
224
|
if (fn === originBundleName) {
|
|
224
225
|
// This is source.
|
|
225
|
-
|
|
226
|
+
originSource = await (0, _zipentries.readEntry)(entry, zipFile);
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
});
|
|
@@ -232,24 +233,21 @@ async function diffFromPackage(origin, next, output, originBundleName, transform
|
|
|
232
233
|
const copies = {};
|
|
233
234
|
const zipfile = new _yazl.ZipFile();
|
|
234
235
|
const writePromise = new Promise((resolve, reject)=>{
|
|
235
|
-
zipfile.outputStream.on('error',
|
|
236
|
-
throw err;
|
|
237
|
-
});
|
|
236
|
+
zipfile.outputStream.on('error', reject);
|
|
238
237
|
zipfile.outputStream.pipe(_fsextra.createWriteStream(output)).on('close', ()=>{
|
|
239
238
|
resolve(void 0);
|
|
240
239
|
});
|
|
241
240
|
});
|
|
242
|
-
await (0, _zipentries.enumZipEntries)(next, (entry, nextZipfile)=>{
|
|
241
|
+
await (0, _zipentries.enumZipEntries)(next, async (entry, nextZipfile)=>{
|
|
243
242
|
if (/\/$/.test(entry.fileName)) {
|
|
244
243
|
// Directory
|
|
245
244
|
zipfile.addEmptyDirectory(entry.fileName);
|
|
246
245
|
} else if ((0, _constants.isPPKBundleFileName)(entry.fileName)) {
|
|
247
246
|
//console.log('Found bundle');
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
});
|
|
247
|
+
const newSource = await (0, _zipentries.readEntry)(entry, nextZipfile);
|
|
248
|
+
//console.log('Begin diff');
|
|
249
|
+
zipfile.addBuffer(diffFn(originSource, newSource), `${entry.fileName}.patch`);
|
|
250
|
+
//console.log('End diff');
|
|
253
251
|
} else {
|
|
254
252
|
// If same file.
|
|
255
253
|
if (originEntries[entry.fileName] === entry.crc32) {
|
|
@@ -257,15 +255,19 @@ async function diffFromPackage(origin, next, output, originBundleName, transform
|
|
|
257
255
|
return;
|
|
258
256
|
}
|
|
259
257
|
// If moved from other place
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
const movedFrom = originMap[entry.crc32];
|
|
259
|
+
if (movedFrom) {
|
|
260
|
+
copies[entry.fileName] = movedFrom;
|
|
262
261
|
return;
|
|
263
262
|
}
|
|
264
|
-
|
|
263
|
+
await new Promise((resolve, reject)=>{
|
|
265
264
|
nextZipfile.openReadStream(entry, (err, readStream)=>{
|
|
266
265
|
if (err) {
|
|
267
266
|
return reject(err);
|
|
268
267
|
}
|
|
268
|
+
if (!readStream) {
|
|
269
|
+
return reject(new Error(`Unable to read zip entry: ${entry.fileName}`));
|
|
270
|
+
}
|
|
269
271
|
zipfile.addReadStream(readStream, entry.fileName);
|
|
270
272
|
readStream.on('end', ()=>{
|
|
271
273
|
//console.log('add finished');
|
|
@@ -281,106 +283,125 @@ async function diffFromPackage(origin, next, output, originBundleName, transform
|
|
|
281
283
|
zipfile.end();
|
|
282
284
|
await writePromise;
|
|
283
285
|
}
|
|
284
|
-
function
|
|
286
|
+
function resolveDiffImplementation(useHdiff, options) {
|
|
287
|
+
if (options.customDiff) {
|
|
288
|
+
return options.customDiff;
|
|
289
|
+
}
|
|
290
|
+
if (useHdiff) {
|
|
291
|
+
if (!hdiff) {
|
|
292
|
+
throw new Error((0, _i18n.t)('nodeHdiffpatchRequired', {
|
|
293
|
+
scriptName: _constants.scriptName
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
return hdiff;
|
|
297
|
+
}
|
|
298
|
+
if (!bsdiff) {
|
|
299
|
+
throw new Error((0, _i18n.t)('nodeBsdiffRequired', {
|
|
300
|
+
scriptName: _constants.scriptName
|
|
301
|
+
}));
|
|
302
|
+
}
|
|
303
|
+
return bsdiff;
|
|
304
|
+
}
|
|
305
|
+
function diffArgsCheck(args, options, diffFnName, useHdiff) {
|
|
285
306
|
const [origin, next] = args;
|
|
286
307
|
if (!origin || !next) {
|
|
287
|
-
|
|
288
|
-
command:
|
|
308
|
+
throw new Error((0, _i18n.t)('usageDiff', {
|
|
309
|
+
command: diffFnName
|
|
289
310
|
}));
|
|
290
|
-
process.exit(1);
|
|
291
|
-
}
|
|
292
|
-
if (options == null ? void 0 : options.customDiff) {
|
|
293
|
-
diff = options.customDiff;
|
|
294
|
-
} else {
|
|
295
|
-
if (diffFn.startsWith('hdiff')) {
|
|
296
|
-
if (!hdiff) {
|
|
297
|
-
console.error((0, _i18n.t)('nodeHdiffpatchRequired', {
|
|
298
|
-
scriptName: _constants.scriptName
|
|
299
|
-
}));
|
|
300
|
-
process.exit(1);
|
|
301
|
-
}
|
|
302
|
-
diff = hdiff;
|
|
303
|
-
} else {
|
|
304
|
-
if (!bsdiff) {
|
|
305
|
-
console.error((0, _i18n.t)('nodeBsdiffRequired', {
|
|
306
|
-
scriptName: _constants.scriptName
|
|
307
|
-
}));
|
|
308
|
-
process.exit(1);
|
|
309
|
-
}
|
|
310
|
-
diff = bsdiff;
|
|
311
|
-
}
|
|
312
311
|
}
|
|
312
|
+
const diffFn = resolveDiffImplementation(useHdiff, options);
|
|
313
313
|
const { output } = (0, _utils.translateOptions)({
|
|
314
314
|
...options,
|
|
315
315
|
tempDir: _constants.tempDir
|
|
316
316
|
});
|
|
317
|
+
if (typeof output !== 'string') {
|
|
318
|
+
throw new Error('Output path is required.');
|
|
319
|
+
}
|
|
317
320
|
return {
|
|
318
321
|
origin,
|
|
319
322
|
next,
|
|
323
|
+
diffFn,
|
|
320
324
|
realOutput: output.replace(/\$\{time\}/g, `${Date.now()}`)
|
|
321
325
|
};
|
|
322
326
|
}
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
console.log((0, _i18n.t)('diffPackageGenerated', {
|
|
335
|
-
output: realOutput
|
|
336
|
-
}));
|
|
337
|
-
},
|
|
338
|
-
async diffFromApk ({ args, options }) {
|
|
339
|
-
const { origin, next, realOutput } = diffArgsCheck(args, options, 'diffFromApk');
|
|
340
|
-
await diffFromPackage(origin, next, realOutput, 'assets/index.android.bundle');
|
|
341
|
-
console.log((0, _i18n.t)('diffPackageGenerated', {
|
|
342
|
-
output: realOutput
|
|
343
|
-
}));
|
|
344
|
-
},
|
|
345
|
-
async hdiffFromApk ({ args, options }) {
|
|
346
|
-
const { origin, next, realOutput } = diffArgsCheck(args, options, 'hdiffFromApk');
|
|
347
|
-
await diffFromPackage(origin, next, realOutput, 'assets/index.android.bundle');
|
|
348
|
-
console.log((0, _i18n.t)('diffPackageGenerated', {
|
|
349
|
-
output: realOutput
|
|
350
|
-
}));
|
|
351
|
-
},
|
|
352
|
-
async diffFromApp ({ args, options }) {
|
|
353
|
-
const { origin, next, realOutput } = diffArgsCheck(args, options, 'diffFromApp');
|
|
354
|
-
await diffFromPackage(origin, next, realOutput, 'resources/rawfile/bundle.harmony.js');
|
|
355
|
-
console.log((0, _i18n.t)('diffPackageGenerated', {
|
|
356
|
-
output: realOutput
|
|
357
|
-
}));
|
|
358
|
-
},
|
|
359
|
-
async hdiffFromApp ({ args, options }) {
|
|
360
|
-
const { origin, next, realOutput } = diffArgsCheck(args, options, 'hdiffFromApp');
|
|
361
|
-
await diffFromPackage(origin, next, realOutput, 'resources/rawfile/bundle.harmony.js');
|
|
362
|
-
console.log((0, _i18n.t)('diffPackageGenerated', {
|
|
363
|
-
output: realOutput
|
|
364
|
-
}));
|
|
365
|
-
},
|
|
366
|
-
async diffFromIpa ({ args, options }) {
|
|
367
|
-
const { origin, next, realOutput } = diffArgsCheck(args, options, 'diffFromIpa');
|
|
368
|
-
await diffFromPackage(origin, next, realOutput, 'main.jsbundle', (v)=>{
|
|
369
|
-
const m = /^Payload\/[^/]+\/(.+)$/.exec(v);
|
|
370
|
-
return m == null ? void 0 : m[1];
|
|
371
|
-
});
|
|
372
|
-
console.log((0, _i18n.t)('diffPackageGenerated', {
|
|
373
|
-
output: realOutput
|
|
374
|
-
}));
|
|
375
|
-
},
|
|
376
|
-
async hdiffFromIpa ({ args, options }) {
|
|
377
|
-
const { origin, next, realOutput } = diffArgsCheck(args, options, 'hdiffFromIpa');
|
|
378
|
-
await diffFromPackage(origin, next, realOutput, 'main.jsbundle', (v)=>{
|
|
379
|
-
const m = /^Payload\/[^/]+\/(.+)$/.exec(v);
|
|
380
|
-
return m == null ? void 0 : m[1];
|
|
381
|
-
});
|
|
327
|
+
const transformIpaPackagePath = (v)=>{
|
|
328
|
+
const match = /^Payload\/[^/]+\/(.+)$/.exec(v);
|
|
329
|
+
return match == null ? void 0 : match[1];
|
|
330
|
+
};
|
|
331
|
+
const createDiffCommand = ({ diffFnName, useHdiff, target })=>async ({ args, options })=>{
|
|
332
|
+
const { origin, next, realOutput, diffFn } = diffArgsCheck(args, options, diffFnName, useHdiff);
|
|
333
|
+
if (target.kind === 'ppk') {
|
|
334
|
+
await diffFromPPK(origin, next, realOutput, diffFn);
|
|
335
|
+
} else {
|
|
336
|
+
await diffFromPackage(origin, next, realOutput, diffFn, target.originBundleName, target.transformPackagePath);
|
|
337
|
+
}
|
|
382
338
|
console.log((0, _i18n.t)('diffPackageGenerated', {
|
|
383
339
|
output: realOutput
|
|
384
340
|
}));
|
|
385
|
-
}
|
|
341
|
+
};
|
|
342
|
+
const diffCommands = {
|
|
343
|
+
diff: createDiffCommand({
|
|
344
|
+
diffFnName: 'diff',
|
|
345
|
+
useHdiff: false,
|
|
346
|
+
target: {
|
|
347
|
+
kind: 'ppk'
|
|
348
|
+
}
|
|
349
|
+
}),
|
|
350
|
+
hdiff: createDiffCommand({
|
|
351
|
+
diffFnName: 'hdiff',
|
|
352
|
+
useHdiff: true,
|
|
353
|
+
target: {
|
|
354
|
+
kind: 'ppk'
|
|
355
|
+
}
|
|
356
|
+
}),
|
|
357
|
+
diffFromApk: createDiffCommand({
|
|
358
|
+
diffFnName: 'diffFromApk',
|
|
359
|
+
useHdiff: false,
|
|
360
|
+
target: {
|
|
361
|
+
kind: 'package',
|
|
362
|
+
originBundleName: 'assets/index.android.bundle'
|
|
363
|
+
}
|
|
364
|
+
}),
|
|
365
|
+
hdiffFromApk: createDiffCommand({
|
|
366
|
+
diffFnName: 'hdiffFromApk',
|
|
367
|
+
useHdiff: true,
|
|
368
|
+
target: {
|
|
369
|
+
kind: 'package',
|
|
370
|
+
originBundleName: 'assets/index.android.bundle'
|
|
371
|
+
}
|
|
372
|
+
}),
|
|
373
|
+
diffFromApp: createDiffCommand({
|
|
374
|
+
diffFnName: 'diffFromApp',
|
|
375
|
+
useHdiff: false,
|
|
376
|
+
target: {
|
|
377
|
+
kind: 'package',
|
|
378
|
+
originBundleName: 'resources/rawfile/bundle.harmony.js'
|
|
379
|
+
}
|
|
380
|
+
}),
|
|
381
|
+
hdiffFromApp: createDiffCommand({
|
|
382
|
+
diffFnName: 'hdiffFromApp',
|
|
383
|
+
useHdiff: true,
|
|
384
|
+
target: {
|
|
385
|
+
kind: 'package',
|
|
386
|
+
originBundleName: 'resources/rawfile/bundle.harmony.js'
|
|
387
|
+
}
|
|
388
|
+
}),
|
|
389
|
+
diffFromIpa: createDiffCommand({
|
|
390
|
+
diffFnName: 'diffFromIpa',
|
|
391
|
+
useHdiff: false,
|
|
392
|
+
target: {
|
|
393
|
+
kind: 'package',
|
|
394
|
+
originBundleName: 'main.jsbundle',
|
|
395
|
+
transformPackagePath: transformIpaPackagePath
|
|
396
|
+
}
|
|
397
|
+
}),
|
|
398
|
+
hdiffFromIpa: createDiffCommand({
|
|
399
|
+
diffFnName: 'hdiffFromIpa',
|
|
400
|
+
useHdiff: true,
|
|
401
|
+
target: {
|
|
402
|
+
kind: 'package',
|
|
403
|
+
originBundleName: 'main.jsbundle',
|
|
404
|
+
transformPackagePath: transformIpaPackagePath
|
|
405
|
+
}
|
|
406
|
+
})
|
|
386
407
|
};
|
package/lib/exports.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
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
|
+
export { builtinModules } from './modules';
|
|
5
|
+
export { bundleModule } from './modules/bundle-module';
|
|
6
|
+
export { versionModule } from './modules/version-module';
|
|
7
|
+
export { appModule } from './modules/app-module';
|
|
8
|
+
export { userModule } from './modules/user-module';
|
|
9
|
+
export { packageModule } from './modules/package-module';
|
|
10
|
+
export { loadSession, getSession } from './api';
|
|
11
|
+
export { getPlatform, getSelectedApp } from './app';
|
|
12
|
+
export { question, saveToLocal } from './utils';
|
package/lib/index.d.ts
ADDED
package/lib/index.js
CHANGED
|
@@ -43,27 +43,18 @@ function printUsage() {
|
|
|
43
43
|
console.log('React Native Update CLI');
|
|
44
44
|
console.log('');
|
|
45
45
|
console.log('Traditional commands:');
|
|
46
|
-
const
|
|
47
|
-
..._user.userCommands,
|
|
48
|
-
..._bundle.bundleCommands,
|
|
49
|
-
..._diff.diffCommands,
|
|
50
|
-
..._app.appCommands,
|
|
51
|
-
..._package.packageCommands,
|
|
52
|
-
..._versions.versionCommands,
|
|
53
|
-
..._install.installCommands
|
|
54
|
-
};
|
|
55
|
-
for (const [name, handler] of Object.entries(legacyCommands)){
|
|
46
|
+
for (const name of Object.keys(legacyCommands)){
|
|
56
47
|
console.log(` ${name}: Legacy command`);
|
|
57
48
|
}
|
|
58
49
|
console.log('');
|
|
59
50
|
console.log('Modular commands:');
|
|
60
|
-
const commands = _modulemanager.moduleManager.
|
|
51
|
+
const commands = _modulemanager.moduleManager.listCommands();
|
|
61
52
|
for (const command of commands){
|
|
62
53
|
console.log(` ${command.name}: ${command.description || 'No description'}`);
|
|
63
54
|
}
|
|
64
55
|
console.log('');
|
|
65
56
|
console.log('Available workflows:');
|
|
66
|
-
const workflows = _modulemanager.moduleManager.
|
|
57
|
+
const workflows = _modulemanager.moduleManager.listWorkflows();
|
|
67
58
|
for (const workflow of workflows){
|
|
68
59
|
console.log(` ${workflow.name}: ${workflow.description || 'No description'}`);
|
|
69
60
|
}
|
|
@@ -121,7 +112,8 @@ async function run() {
|
|
|
121
112
|
}
|
|
122
113
|
console.log('Workflow completed successfully:', result.data);
|
|
123
114
|
} else if (legacyCommands[argv.command]) {
|
|
124
|
-
|
|
115
|
+
const legacyHandler = legacyCommands[argv.command];
|
|
116
|
+
await legacyHandler(argv);
|
|
125
117
|
} else {
|
|
126
118
|
const result = await _modulemanager.moduleManager.executeCommand(argv.command, context);
|
|
127
119
|
if (!result.success) {
|
package/lib/install.d.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
addedToGitignore: string;
|
|
3
|
+
androidCrunchPngsWarning: string;
|
|
4
|
+
aabOpenApksFailed: string;
|
|
5
|
+
aabReadUniversalApkFailed: string;
|
|
6
|
+
aabUniversalApkNotFound: string;
|
|
7
|
+
aabBundletoolDownloadHint: string;
|
|
8
|
+
aabManifestNotFound: string;
|
|
9
|
+
aabParseResourcesWarning: string;
|
|
10
|
+
aabParseFailed: string;
|
|
11
|
+
aabParseManifestError: string;
|
|
12
|
+
aabParseResourcesError: string;
|
|
13
|
+
appId: string;
|
|
14
|
+
appIdMismatchApk: string;
|
|
15
|
+
appIdMismatchApp: string;
|
|
16
|
+
appIdMismatchIpa: string;
|
|
17
|
+
appKeyMismatchApk: string;
|
|
18
|
+
appKeyMismatchApp: string;
|
|
19
|
+
appKeyMismatchIpa: string;
|
|
20
|
+
appName: string;
|
|
21
|
+
appNameQuestion: string;
|
|
22
|
+
appNotSelected: string;
|
|
23
|
+
appUploadSuccess: string;
|
|
24
|
+
apkUploadSuccess: string;
|
|
25
|
+
boundTo: string;
|
|
26
|
+
buildTimeNotFound: string;
|
|
27
|
+
bundleCommandError: string;
|
|
28
|
+
bundleNotFound: string;
|
|
29
|
+
bundlingWithRN: string;
|
|
30
|
+
cancelled: string;
|
|
31
|
+
composingSourceMap: string;
|
|
32
|
+
copyFileFailed: string;
|
|
33
|
+
copyHarmonyBundleError: string;
|
|
34
|
+
copyingDebugId: string;
|
|
35
|
+
createAppSuccess: string;
|
|
36
|
+
deleteFile: string;
|
|
37
|
+
deletingFile: string;
|
|
38
|
+
enterAppIdQuestion: string;
|
|
39
|
+
enterNativePackageId: string;
|
|
40
|
+
errorInHarmonyApp: string;
|
|
41
|
+
expiredStatus: string;
|
|
42
|
+
failedToParseIcon: string;
|
|
43
|
+
failedToParseUpdateJson: string;
|
|
44
|
+
fileGenerated: string;
|
|
45
|
+
fileSizeExceeded: string;
|
|
46
|
+
forceHermes: string;
|
|
47
|
+
hermesEnabledCompiling: string;
|
|
48
|
+
ipaUploadSuccess: string;
|
|
49
|
+
keyStrings: string;
|
|
50
|
+
latestVersionTag: string;
|
|
51
|
+
lockBestPractice: string;
|
|
52
|
+
lockNotFound: string;
|
|
53
|
+
loggedOut: string;
|
|
54
|
+
loginExpired: string;
|
|
55
|
+
loginFirst: string;
|
|
56
|
+
multipleLocksFound: string;
|
|
57
|
+
nativePackageId: string;
|
|
58
|
+
nativeVersion: string;
|
|
59
|
+
nativeVersionNotFoundGte: string;
|
|
60
|
+
nativeVersionNotFoundLte: string;
|
|
61
|
+
nativeVersionNotFoundMatch: string;
|
|
62
|
+
nativePackageIdNotFound: string;
|
|
63
|
+
noPackagesFound: string;
|
|
64
|
+
offset: string;
|
|
65
|
+
operationComplete: string;
|
|
66
|
+
operationSuccess: string;
|
|
67
|
+
packageIdRequired: string;
|
|
68
|
+
packageUploadSuccess: string;
|
|
69
|
+
depsChangeSummary: string;
|
|
70
|
+
depsChangeTargetPackage: string;
|
|
71
|
+
depsChangeDependencyHeader: string;
|
|
72
|
+
depsChangeVersionHeader: string;
|
|
73
|
+
depsChangeAddedLabel: string;
|
|
74
|
+
depsChangeRemovedLabel: string;
|
|
75
|
+
depsChangeChangedLabel: string;
|
|
76
|
+
depsChangeArrow: string;
|
|
77
|
+
depsChangeRiskWarning: string;
|
|
78
|
+
depsChangeFetchFailed: string;
|
|
79
|
+
depsChangeNonBlockingHint: string;
|
|
80
|
+
packing: string;
|
|
81
|
+
pausedStatus: string;
|
|
82
|
+
platform: string;
|
|
83
|
+
platformPrompt: string;
|
|
84
|
+
platformQuestion: string;
|
|
85
|
+
platformRequired: string;
|
|
86
|
+
pluginDetectionError: string;
|
|
87
|
+
pluginDetected: string;
|
|
88
|
+
ppkPackageGenerated: string;
|
|
89
|
+
processingError: string;
|
|
90
|
+
processingPackage: string;
|
|
91
|
+
processingStringPool: string;
|
|
92
|
+
publishUsage: string;
|
|
93
|
+
rnuVersionNotFound: string;
|
|
94
|
+
rolloutConfigSet: string;
|
|
95
|
+
rolloutRangeError: string;
|
|
96
|
+
runningHermesc: string;
|
|
97
|
+
sentryCliNotFound: string;
|
|
98
|
+
sentryReleaseCreated: string;
|
|
99
|
+
totalApps: string;
|
|
100
|
+
totalPackages: string;
|
|
101
|
+
typeStrings: string;
|
|
102
|
+
unsupportedPlatform: string;
|
|
103
|
+
uploadBundlePrompt: string;
|
|
104
|
+
uploadingSourcemap: string;
|
|
105
|
+
usageDiff: string;
|
|
106
|
+
usageParseApk: string;
|
|
107
|
+
usageParseAab: string;
|
|
108
|
+
usageExtractApk: string;
|
|
109
|
+
usageParseApp: string;
|
|
110
|
+
usageParseIpa: string;
|
|
111
|
+
usageUnderDevelopment: string;
|
|
112
|
+
usageUploadApk: string;
|
|
113
|
+
usageUploadAab: string;
|
|
114
|
+
usageUploadApp: string;
|
|
115
|
+
usageUploadIpa: string;
|
|
116
|
+
versionBind: string;
|
|
117
|
+
welcomeMessage: string;
|
|
118
|
+
versionNameQuestion: string;
|
|
119
|
+
versionDescriptionQuestion: string;
|
|
120
|
+
versionMetaInfoQuestion: string;
|
|
121
|
+
updateNativePackageQuestion: string;
|
|
122
|
+
unnamed: string;
|
|
123
|
+
dryRun: string;
|
|
124
|
+
usingCustomVersion: string;
|
|
125
|
+
confirmDeletePackage: string;
|
|
126
|
+
deletePackageSuccess: string;
|
|
127
|
+
deletePackageError: string;
|
|
128
|
+
usageDeletePackage: string;
|
|
129
|
+
deleteVersionSuccess: string;
|
|
130
|
+
deleteVersionError: string;
|
|
131
|
+
bundleFileNotFound: string;
|
|
132
|
+
diffPackageGenerated: string;
|
|
133
|
+
nodeBsdiffRequired: string;
|
|
134
|
+
nodeHdiffpatchRequired: string;
|
|
135
|
+
apkExtracted: string;
|
|
136
|
+
};
|
|
137
|
+
export default _default;
|