@callstack/react-native-brownfield 1.0.1 → 1.1.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- <p align="center">
2
- <img alt="React Native Brownfield" src="https://user-images.githubusercontent.com/7837457/63594721-7f7b8800-c5b7-11e9-87ef-a0898cd22fcc.png" width="600">
3
- </p>
1
+ <a href="https://www.callstack.com/open-source?utm_campaign=generic&utm_source=github&utm_medium=referral&utm_content=react-native-brownfield" align="center">
2
+ <img alt="React Native Brownfield" src="https://github.com/user-attachments/assets/55fcdff5-54f0-4081-adf6-55dfa5c29af2">
3
+ </a>
4
4
 
5
5
  <p align="center">
6
6
  Set of helpers to make your brownfield integration smooth and easy.
@@ -6,6 +6,7 @@ internal import ReactAppDependencyProvider
6
6
  class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
7
7
  var entryFile = "index"
8
8
  var bundlePath = "main.jsbundle"
9
+ var bundle = Bundle.main
9
10
  // MARK: - RCTReactNativeFactoryDelegate Methods
10
11
 
11
12
  override func sourceURL(for bridge: RCTBridge) -> URL? {
@@ -21,7 +22,7 @@ class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
21
22
  let resourceName = withoutLast.joined()
22
23
  let fileExtension = resourceURLComponents.last ?? ""
23
24
 
24
- return Bundle.main.url(forResource: resourceName, withExtension: fileExtension)
25
+ return bundle.url(forResource: resourceName, withExtension: fileExtension)
25
26
  #endif
26
27
  }
27
28
  }
@@ -54,6 +55,15 @@ class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
54
55
  delegate.bundlePath = bundlePath
55
56
  }
56
57
  }
58
+ /**
59
+ * Bundle instance to lookup the JavaScript bundle.
60
+ * Default value: Bundle.main
61
+ */
62
+ @objc public var bundle: Bundle = Bundle.main {
63
+ didSet {
64
+ delegate.bundle = bundle
65
+ }
66
+ }
57
67
  /**
58
68
  * React Native factory instance created when starting React Native.
59
69
  * Default value: nil
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@callstack/react-native-brownfield",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Michal Chudziak <mike.chudziak@callstack.com>",
6
6
  "contributors": [