@gfean/react-native-bundle-drop 0.1.33 → 0.1.35

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/CLIENT_README.md CHANGED
@@ -8,6 +8,12 @@ yarn add @gfean/react-native-bundle-drop
8
8
  cd ios && pod install && cd ..
9
9
  ```
10
10
 
11
+ Add the Android bootstrap side-effect import (resolver patches):
12
+ ```js
13
+ // index.js (entry)
14
+ import '@gfean/react-native-bundle-drop/bootstrap';
15
+ ```
16
+
11
17
  ## 2) App config
12
18
  Add `bundle.drop.config.js` to your project root:
13
19
  ```js
package/README.md CHANGED
@@ -8,6 +8,12 @@ yarn add @gfean/react-native-bundle-drop
8
8
  cd ios && pod install && cd ..
9
9
  ```
10
10
 
11
+ Add the Android bootstrap side-effect import once (images resolver patch):
12
+ ```js
13
+ // index.js (or entry file)
14
+ import '@gfean/react-native-bundle-drop/bootstrap';
15
+ ```
16
+
11
17
  ## Prerequisites
12
18
  - `bundle.drop.config.js` in your app root:
13
19
  ```js
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_native_1 = require("react-native");
4
+ const injectImageResolver_1 = require("./injectImageResolver");
5
+ const patchImageAutoResolve_1 = require("./patchImageAutoResolve");
6
+ (() => {
7
+ if (react_native_1.Platform.OS !== 'android') {
8
+ return;
9
+ }
10
+ // Apply the shared resolver/renderer patches early during app startup.
11
+ (0, injectImageResolver_1.injectBundleDropImageResolver)();
12
+ (0, patchImageAutoResolve_1.patchImageRenderToForceResolve)();
13
+ })();
package/lib/loadConfig.js CHANGED
@@ -5,8 +5,11 @@ const react_native_1 = require("react-native");
5
5
  // Simpler, fixed path load to match the prior behavior.
6
6
  function loadConfig() {
7
7
  try {
8
- // eslint-disable-next-line
9
- const cfg = require('../../../bundle.drop.config.js');
8
+ // Metro resolves this relative to the compiled file location:
9
+ // node_modules/@gfean/react-native-bundle-drop/lib/loadConfig.js
10
+ // so we walk four levels up to the app root.
11
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
12
+ const cfg = require('../../../../bundle.drop.config.js');
10
13
  if (!cfg?.serverUrl || !cfg?.project?.slug || !cfg?.org?.slug) {
11
14
  throw new Error('bundle.drop.config.js missing serverUrl, org.slug or project.slug');
12
15
  }
package/package.json CHANGED
@@ -1,12 +1,23 @@
1
1
  {
2
2
  "name": "@gfean/react-native-bundle-drop",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "description": "react native ota by gFean",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "author": " <> ()",
8
8
  "license": "UNLICENSED",
9
9
  "homepage": "https://github.com/GFean/react-native-bundle-drop",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./lib/index.d.ts",
13
+ "default": "./lib/index.js"
14
+ },
15
+ "./bootstrap": {
16
+ "types": "./lib/bootstrap.d.ts",
17
+ "default": "./lib/bootstrap.js"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
10
21
  "scripts": {
11
22
  "clean": "rimraf lib dist",
12
23
  "build": "tsc -p tsconfig.json && node scripts/make-cli-executable.js",