react-native-update-cli 1.22.0 → 1.23.1

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
@@ -51,7 +51,7 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
51
51
  if (platform === 'android') {
52
52
  gradleConfig = await checkGradleConfig();
53
53
  if (gradleConfig.crunchPngs !== false) {
54
- console.warn('android的crunchPngs选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n');
54
+ console.warn('android crunchPngs 选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n');
55
55
  }
56
56
  }
57
57
 
@@ -68,18 +68,16 @@ async function runReactNativeBundleCommand(bundleName, development, entryFile, o
68
68
  let cliPath = require.resolve('react-native/local-cli/cli.js', {
69
69
  paths: [process.cwd()]
70
70
  });
71
+ let isExpo = false;
71
72
  try {
72
- require.resolve('expo-router', {
73
- paths: [process.cwd()]
74
- });
75
-
76
- console.log(`expo-router detected, will use @expo/cli to bundle.\n`);
77
- // if using expo-router, use expo-cli
73
+ // use expo-cli if exists
78
74
  cliPath = require.resolve('@expo/cli', {
79
75
  paths: [process.cwd()]
80
76
  });
77
+ isExpo = true;
78
+ console.log(`expo detected, will use @expo/cli to bundle.\n`);
81
79
  } catch (e) {}
82
- const bundleCommand = cliPath.includes('@expo/cli') ? 'export:embed' : 'bundle';
80
+ const bundleCommand = isExpo ? 'export:embed' : 'bundle';
83
81
 
84
82
  Array.prototype.push.apply(reactNativeBundleArgs, [cliPath, bundleCommand, '--assets-dest', outputFolder, '--bundle-output', _path2.default.join(outputFolder, bundleName), '--dev', development, '--entry-file', entryFile, '--platform', platform, '--reset-cache']);
85
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update-cli",
3
- "version": "1.22.0",
3
+ "version": "1.23.1",
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
@@ -33,7 +33,7 @@ async function runReactNativeBundleCommand(
33
33
  gradleConfig = await checkGradleConfig();
34
34
  if (gradleConfig.crunchPngs !== false) {
35
35
  console.warn(
36
- 'android的crunchPngs选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
36
+ 'android crunchPngs 选项似乎尚未禁用(如已禁用则请忽略此提示),这可能导致热更包体积异常增大,具体请参考 https://pushy.reactnative.cn/docs/getting-started.html#%E7%A6%81%E7%94%A8-android-%E7%9A%84-crunch-%E4%BC%98%E5%8C%96 \n',
37
37
  );
38
38
  }
39
39
  }
@@ -54,20 +54,16 @@ async function runReactNativeBundleCommand(
54
54
  let cliPath = require.resolve('react-native/local-cli/cli.js', {
55
55
  paths: [process.cwd()],
56
56
  });
57
+ let isExpo = false;
57
58
  try {
58
- require.resolve('expo-router', {
59
- paths: [process.cwd()],
60
- });
61
-
62
- console.log(`expo-router detected, will use @expo/cli to bundle.\n`);
63
- // if using expo-router, use expo-cli
59
+ // use expo-cli if exists
64
60
  cliPath = require.resolve('@expo/cli', {
65
61
  paths: [process.cwd()],
66
62
  });
63
+ isExpo = true;
64
+ console.log(`expo detected, will use @expo/cli to bundle.\n`);
67
65
  } catch (e) {}
68
- const bundleCommand = cliPath.includes('@expo/cli')
69
- ? 'export:embed'
70
- : 'bundle';
66
+ const bundleCommand = isExpo ? 'export:embed' : 'bundle';
71
67
 
72
68
  Array.prototype.push.apply(reactNativeBundleArgs, [
73
69
  cliPath,
@@ -204,7 +200,7 @@ async function compileHermesByteCode(
204
200
  }
205
201
 
206
202
  const hermesCommand = `${hermesPath}/hermesc`;
207
-
203
+
208
204
  const args = [
209
205
  '-emit-binary',
210
206
  '-out',