react-native-custom-ota 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/bin/custom-ota.js +11 -3
  2. package/package.json +1 -1
package/bin/custom-ota.js CHANGED
@@ -55,7 +55,7 @@ function detectAppId() {
55
55
  try {
56
56
  const data = JSON.parse(fs.readFileSync(appJsonPath, "utf8"));
57
57
  if (data.name) return String(data.name).toLowerCase();
58
- } catch (e) {}
58
+ } catch (e) { }
59
59
  }
60
60
 
61
61
  const pkgJsonPath = path.join(root, "package.json");
@@ -63,7 +63,7 @@ function detectAppId() {
63
63
  try {
64
64
  const data = JSON.parse(fs.readFileSync(pkgJsonPath, "utf8"));
65
65
  if (data.name) return String(data.name).toLowerCase();
66
- } catch (e) {}
66
+ } catch (e) { }
67
67
  }
68
68
 
69
69
  return "com.otademoapp";
@@ -97,7 +97,15 @@ async function buildAndPublish(p) {
97
97
 
98
98
  const bundleFile = p === "android" ? "index.android.bundle" : "main.jsbundle";
99
99
  const bundlePath = path.join(outDir, bundleFile);
100
- const assetsDir = path.join(outDir, "assets");
100
+
101
+ // Metro bundle output:
102
+ // Android tạo drawable-xxx/ và raw/, iOS tạo assets/ bên trong thư mục chỉ định.
103
+ // Đặt assetsDir = outDir để đồng bộ cấu trúc với JSBundle offline.
104
+ const testBrokenAssets =
105
+ process.env.TEST_BROKEN_ASSETS === "true" ||
106
+ args.includes("--broken-assets");
107
+
108
+ const assetsDir = testBrokenAssets ? path.join(outDir, "assets") : outDir;
101
109
 
102
110
  // 1. Metro Bundle
103
111
  console.log(`📦 [1/3] Đang chạy Metro Bundle...`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-custom-ota",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Self-hosted OTA (Over-The-Air) update library for React Native with automatic rollback, similar to react-native-code-push",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",