react-native-update-cli 2.7.1 → 2.7.3
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/bundle.js +20 -6
- package/package.json +1 -1
- package/src/bundle.ts +19 -9
package/lib/bundle.js
CHANGED
|
@@ -28,6 +28,7 @@ const _yazl = require("yazl");
|
|
|
28
28
|
const _app = require("./app");
|
|
29
29
|
const _utils = require("./utils");
|
|
30
30
|
const _os = /*#__PURE__*/ _interop_require_default(require("os"));
|
|
31
|
+
const _globaldirs = require("global-dirs");
|
|
31
32
|
const _addgitignore = require("./utils/add-gitignore");
|
|
32
33
|
const _checklockfile = require("./utils/check-lockfile");
|
|
33
34
|
const _constants = require("./utils/constants");
|
|
@@ -82,15 +83,28 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
82
83
|
}
|
|
83
84
|
const g2js = require('gradle-to-js/lib/parser');
|
|
84
85
|
const properties = require('properties');
|
|
86
|
+
const loadDiffModule = (pkgName)=>{
|
|
87
|
+
const resolvePaths = [
|
|
88
|
+
process.cwd(),
|
|
89
|
+
_globaldirs.npm.packages,
|
|
90
|
+
_globaldirs.yarn.packages
|
|
91
|
+
];
|
|
92
|
+
try {
|
|
93
|
+
const resolved = require.resolve(pkgName, {
|
|
94
|
+
paths: resolvePaths
|
|
95
|
+
});
|
|
96
|
+
const mod = require(resolved);
|
|
97
|
+
if (mod == null ? void 0 : mod.diff) {
|
|
98
|
+
return mod.diff;
|
|
99
|
+
}
|
|
100
|
+
} catch (e) {}
|
|
101
|
+
return undefined;
|
|
102
|
+
};
|
|
85
103
|
let bsdiff;
|
|
86
104
|
let hdiff;
|
|
87
105
|
let diff;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} catch (e) {}
|
|
91
|
-
try {
|
|
92
|
-
hdiff = require('node-hdiffpatch').diff;
|
|
93
|
-
} catch (e) {}
|
|
106
|
+
bsdiff = loadDiffModule('node-bsdiff');
|
|
107
|
+
hdiff = loadDiffModule('node-hdiffpatch');
|
|
94
108
|
async function runReactNativeBundleCommand({ bundleName, dev, entryFile, outputFolder, platform, sourcemapOutput, config, forceHermes, cli }) {
|
|
95
109
|
let gradleConfig = {};
|
|
96
110
|
if (platform === 'android') {
|
package/package.json
CHANGED
package/src/bundle.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { translateOptions } from './utils';
|
|
|
13
13
|
import { checkPlugins, question } from './utils';
|
|
14
14
|
const g2js = require('gradle-to-js/lib/parser');
|
|
15
15
|
import os from 'os';
|
|
16
|
+
import { npm, yarn } from 'global-dirs';
|
|
16
17
|
const properties = require('properties');
|
|
17
18
|
import { addGitIgnore } from './utils/add-gitignore';
|
|
18
19
|
import { checkLockFiles } from './utils/check-lockfile';
|
|
@@ -23,16 +24,25 @@ import { versionCommands } from './versions';
|
|
|
23
24
|
|
|
24
25
|
type Diff = (oldSource?: Buffer, newSource?: Buffer) => Buffer;
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
const loadDiffModule = (pkgName: string): Diff | undefined => {
|
|
28
|
+
const resolvePaths = [process.cwd(), npm.packages, yarn.packages];
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
const resolved = require.resolve(pkgName, { paths: resolvePaths });
|
|
32
|
+
const mod = require(resolved);
|
|
33
|
+
if (mod?.diff) {
|
|
34
|
+
return mod.diff as Diff;
|
|
35
|
+
}
|
|
36
|
+
} catch {}
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
let bsdiff: Diff | undefined;
|
|
42
|
+
let hdiff: Diff | undefined;
|
|
43
|
+
let diff: Diff;
|
|
44
|
+
bsdiff = loadDiffModule('node-bsdiff');
|
|
45
|
+
hdiff = loadDiffModule('node-hdiffpatch');
|
|
36
46
|
|
|
37
47
|
async function runReactNativeBundleCommand({
|
|
38
48
|
bundleName,
|