@bravemobile/react-native-code-push 12.2.0 → 12.3.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.
|
@@ -96,10 +96,9 @@ function getHermesCommand() {
|
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return bundledHermesEngine;
|
|
99
|
+
const hermescExecutable = path.join(getHermesCompilerPath(), getHermesOSBin(), getHermesOSExe());
|
|
100
|
+
if (fileExists(hermescExecutable)) {
|
|
101
|
+
return hermescExecutable;
|
|
103
102
|
}
|
|
104
103
|
throw new Error('Hermes engine binary not found. Please upgrade to react-native 0.69 or later');
|
|
105
104
|
}
|
|
@@ -144,6 +143,28 @@ function getReactNativePackagePath() {
|
|
|
144
143
|
}
|
|
145
144
|
return path.join('node_modules', 'react-native');
|
|
146
145
|
}
|
|
146
|
+
function getHermescDirPathInHermesCompilerPackage() {
|
|
147
|
+
const result = childProcess.spawnSync('node', [
|
|
148
|
+
'--print',
|
|
149
|
+
"require.resolve('hermes-compiler/package.json')",
|
|
150
|
+
]);
|
|
151
|
+
const packagePath = path.dirname(result.stdout.toString());
|
|
152
|
+
const hermescDirPath = path.join(packagePath, 'hermesc');
|
|
153
|
+
if (result.status === 0 && directoryExistsSync(hermescDirPath)) {
|
|
154
|
+
return hermescDirPath;
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
function getHermesCompilerPath() {
|
|
159
|
+
const hermescDirPath = getHermescDirPathInHermesCompilerPackage();
|
|
160
|
+
if (hermescDirPath) {
|
|
161
|
+
// Since react-native 0.83, Hermes compiler executables are in 'hermes-compiler' package
|
|
162
|
+
return hermescDirPath;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
return path.join(getReactNativePackagePath(), 'sdks', 'hermesc');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
147
168
|
function directoryExistsSync(dirname) {
|
|
148
169
|
try {
|
|
149
170
|
return fs.statSync(dirname).isDirectory();
|
|
@@ -114,16 +114,10 @@ function getHermesCommand(): string {
|
|
|
114
114
|
return false;
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
'hermesc',
|
|
122
|
-
getHermesOSBin(),
|
|
123
|
-
getHermesOSExe(),
|
|
124
|
-
);
|
|
125
|
-
if (fileExists(bundledHermesEngine)) {
|
|
126
|
-
return bundledHermesEngine;
|
|
117
|
+
|
|
118
|
+
const hermescExecutable = path.join(getHermesCompilerPath(), getHermesOSBin(), getHermesOSExe());
|
|
119
|
+
if (fileExists(hermescExecutable)) {
|
|
120
|
+
return hermescExecutable;
|
|
127
121
|
}
|
|
128
122
|
throw new Error('Hermes engine binary not found. Please upgrade to react-native 0.69 or later');
|
|
129
123
|
}
|
|
@@ -174,6 +168,29 @@ function getReactNativePackagePath(): string {
|
|
|
174
168
|
return path.join('node_modules', 'react-native');
|
|
175
169
|
}
|
|
176
170
|
|
|
171
|
+
function getHermescDirPathInHermesCompilerPackage() {
|
|
172
|
+
const result = childProcess.spawnSync('node', [
|
|
173
|
+
'--print',
|
|
174
|
+
"require.resolve('hermes-compiler/package.json')",
|
|
175
|
+
]);
|
|
176
|
+
const packagePath = path.dirname(result.stdout.toString());
|
|
177
|
+
const hermescDirPath = path.join(packagePath, 'hermesc');
|
|
178
|
+
if (result.status === 0 && directoryExistsSync(hermescDirPath)) {
|
|
179
|
+
return hermescDirPath;
|
|
180
|
+
}
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function getHermesCompilerPath() {
|
|
185
|
+
const hermescDirPath = getHermescDirPathInHermesCompilerPackage();
|
|
186
|
+
if (hermescDirPath) {
|
|
187
|
+
// Since react-native 0.83, Hermes compiler executables are in 'hermes-compiler' package
|
|
188
|
+
return hermescDirPath
|
|
189
|
+
} else {
|
|
190
|
+
return path.join(getReactNativePackagePath(), 'sdks', 'hermesc');
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
177
194
|
function directoryExistsSync(dirname: string): boolean {
|
|
178
195
|
try {
|
|
179
196
|
return fs.statSync(dirname).isDirectory();
|