react-native-update-cli 1.11.0 → 1.12.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.js +1 -1
- package/lib/bundle.js +21 -1
- package/package.json +2 -1
- package/src/api.js +1 -1
- package/src/bundle.js +28 -3
package/lib/api.js
CHANGED
|
@@ -17,7 +17,7 @@ var _utils = require('./utils');
|
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
|
|
19
19
|
const fetch = require('node-fetch');
|
|
20
|
-
const defaultEndpoint = '
|
|
20
|
+
const defaultEndpoint = 'https://update.reactnative.cn/api';
|
|
21
21
|
let host = process.env.PUSHY_REGISTRY || defaultEndpoint;
|
|
22
22
|
const fs = require('fs');
|
|
23
23
|
|
package/lib/bundle.js
CHANGED
|
@@ -26,6 +26,7 @@ const path = require('path');
|
|
|
26
26
|
const { spawn, spawnSync } = require('child_process');
|
|
27
27
|
const g2js = require('gradle-to-js/lib/parser');
|
|
28
28
|
const os = require('os');
|
|
29
|
+
const properties = require('properties');
|
|
29
30
|
|
|
30
31
|
var bsdiff, hdiff, diff;
|
|
31
32
|
try {
|
|
@@ -81,7 +82,26 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
|
|
|
81
82
|
if (exitCode) {
|
|
82
83
|
reject(new Error(`"react-native bundle" command exited with code ${exitCode}.`));
|
|
83
84
|
} else {
|
|
84
|
-
|
|
85
|
+
let hermesEnabled = false;
|
|
86
|
+
|
|
87
|
+
if (platform === 'android') {
|
|
88
|
+
const gradlePropeties = await new Promise(resolve => {
|
|
89
|
+
properties.parse('./android/gradle.properties', { path: true }, function (error, props) {
|
|
90
|
+
if (error) {
|
|
91
|
+
console.error(error);
|
|
92
|
+
resolve(null);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
resolve(props);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
hermesEnabled = gradlePropeties.hermesEnabled;
|
|
99
|
+
|
|
100
|
+
if (typeof hermesEnabled !== 'boolean') hermesEnabled = gradleConfig.enableHermes;
|
|
101
|
+
} else if (platform === 'ios' && fs.existsSync('ios/Pods/hermes-engine')) {
|
|
102
|
+
hermesEnabled = true;
|
|
103
|
+
}
|
|
104
|
+
if (hermesEnabled) {
|
|
85
105
|
await compileHermesByteCode(bundleName, outputFolder, sourcemapOutput);
|
|
86
106
|
}
|
|
87
107
|
resolve(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-update-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"gradle-to-js": "^2.0.1",
|
|
40
40
|
"node-fetch": "^2.6.1",
|
|
41
41
|
"progress": "^2.0.3",
|
|
42
|
+
"properties": "^1.2.1",
|
|
42
43
|
"read": "^1.0.7",
|
|
43
44
|
"request": "^2.88.2",
|
|
44
45
|
"tcp-ping": "^0.1.1",
|
package/src/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const fetch = require('node-fetch');
|
|
2
|
-
const defaultEndpoint = '
|
|
2
|
+
const defaultEndpoint = 'https://update.reactnative.cn/api';
|
|
3
3
|
let host = process.env.PUSHY_REGISTRY || defaultEndpoint;
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
import request from 'request';
|
package/src/bundle.js
CHANGED
|
@@ -8,6 +8,7 @@ import { checkPlatform } from './app';
|
|
|
8
8
|
const { spawn, spawnSync } = require('child_process');
|
|
9
9
|
const g2js = require('gradle-to-js/lib/parser');
|
|
10
10
|
const os = require('os');
|
|
11
|
+
const properties = require('properties');
|
|
11
12
|
|
|
12
13
|
var bsdiff, hdiff, diff;
|
|
13
14
|
try {
|
|
@@ -94,10 +95,34 @@ async function runReactNativeBundleCommand(
|
|
|
94
95
|
),
|
|
95
96
|
);
|
|
96
97
|
} else {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
let hermesEnabled = false;
|
|
99
|
+
|
|
100
|
+
if (platform === 'android') {
|
|
101
|
+
const gradlePropeties = await new Promise((resolve) => {
|
|
102
|
+
properties.parse(
|
|
103
|
+
'./android/gradle.properties',
|
|
104
|
+
{ path: true },
|
|
105
|
+
function (error, props) {
|
|
106
|
+
if (error) {
|
|
107
|
+
console.error(error);
|
|
108
|
+
resolve(null);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
resolve(props);
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
hermesEnabled = gradlePropeties.hermesEnabled;
|
|
116
|
+
|
|
117
|
+
if (typeof hermesEnabled !== 'boolean')
|
|
118
|
+
hermesEnabled = gradleConfig.enableHermes;
|
|
119
|
+
} else if (
|
|
120
|
+
platform === 'ios' &&
|
|
121
|
+
fs.existsSync('ios/Pods/hermes-engine')
|
|
100
122
|
) {
|
|
123
|
+
hermesEnabled = true;
|
|
124
|
+
}
|
|
125
|
+
if (hermesEnabled) {
|
|
101
126
|
await compileHermesByteCode(
|
|
102
127
|
bundleName,
|
|
103
128
|
outputFolder,
|