react-native-update-cli 1.17.0 → 1.18.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/bundle.js CHANGED
@@ -56,10 +56,17 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
56
56
 
57
57
  fs.emptyDirSync(outputFolder);
58
58
 
59
- Array.prototype.push.apply(reactNativeBundleArgs, [require.resolve('react-native/local-cli/cli.js', {
59
+ let cliPath = require.resolve('react-native/local-cli/cli.js', {
60
60
  paths: [process.cwd()]
61
- }), // 'react-native' package may be symlinked
62
- 'bundle', '--assets-dest', outputFolder, '--bundle-output', path.join(outputFolder, bundleName), '--dev', development, '--entry-file', entryFile, '--platform', platform, '--reset-cache']);
61
+ });
62
+ try {
63
+ cliPath = require.resolve('@expo/cli', {
64
+ paths: [process.cwd()]
65
+ });
66
+ } catch (e) {}
67
+ const bundleCommand = cliPath.includes('@expo/cli') ? 'export:embed' : 'bundle';
68
+
69
+ Array.prototype.push.apply(reactNativeBundleArgs, [cliPath, bundleCommand, '--assets-dest', outputFolder, '--bundle-output', path.join(outputFolder, bundleName), '--dev', development, '--entry-file', entryFile, '--platform', platform, '--reset-cache']);
63
70
 
64
71
  if (sourcemapOutput) {
65
72
  reactNativeBundleArgs.push('--sourcemap-output', sourcemapOutput);
@@ -160,7 +167,8 @@ async function compileHermesByteCode(bundleName, outputFolder, sourcemapOutput)
160
167
  if (sourcemapOutput) {
161
168
  args.push('-output-source-map');
162
169
  }
163
- spawnSync(path.join.apply(null, hermesCommand.split('/')), args, {
170
+ console.log('Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n');
171
+ spawnSync(hermesCommand, args, {
164
172
  stdio: 'ignore'
165
173
  });
166
174
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update-cli",
3
- "version": "1.17.0",
3
+ "version": "1.18.0",
4
4
  "description": "Command tools for javaScript updater with `pushy` service for react native apps.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/src/bundle.js CHANGED
@@ -49,11 +49,21 @@ async function runReactNativeBundleCommand(
49
49
 
50
50
  fs.emptyDirSync(outputFolder);
51
51
 
52
- Array.prototype.push.apply(reactNativeBundleArgs, [
53
- require.resolve('react-native/local-cli/cli.js', {
52
+ let cliPath = require.resolve('react-native/local-cli/cli.js', {
53
+ paths: [process.cwd()],
54
+ });
55
+ try {
56
+ cliPath = require.resolve('@expo/cli', {
54
57
  paths: [process.cwd()],
55
- }), // 'react-native' package may be symlinked
56
- 'bundle',
58
+ });
59
+ } catch (e) {}
60
+ const bundleCommand = cliPath.includes('@expo/cli')
61
+ ? 'export:embed'
62
+ : 'bundle';
63
+
64
+ Array.prototype.push.apply(reactNativeBundleArgs, [
65
+ cliPath,
66
+ bundleCommand,
57
67
  '--assets-dest',
58
68
  outputFolder,
59
69
  '--bundle-output',
@@ -204,7 +214,10 @@ async function compileHermesByteCode(
204
214
  if (sourcemapOutput) {
205
215
  args.push('-output-source-map');
206
216
  }
207
- spawnSync(path.join.apply(null, hermesCommand.split('/')), args, {
217
+ console.log(
218
+ 'Running hermesc: ' + hermesCommand + ' ' + args.join(' ') + '\n',
219
+ );
220
+ spawnSync(hermesCommand, args, {
208
221
  stdio: 'ignore',
209
222
  });
210
223
  }