@callstack/react-native-brownfield 1.0.0 → 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.
@@ -5,6 +5,8 @@ internal import ReactAppDependencyProvider
5
5
 
6
6
  class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
7
7
  var entryFile = "index"
8
+ var bundlePath = "main.jsbundle"
9
+ var bundle = Bundle.main
8
10
  // MARK: - RCTReactNativeFactoryDelegate Methods
9
11
 
10
12
  override func sourceURL(for bridge: RCTBridge) -> URL? {
@@ -20,7 +22,7 @@ class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
20
22
  let resourceName = withoutLast.joined()
21
23
  let fileExtension = resourceURLComponents.last ?? ""
22
24
 
23
- return Bundle.main.url(forResource: resourceName, withExtension: fileExtension)
25
+ return bundle.url(forResource: resourceName, withExtension: fileExtension)
24
26
  #endif
25
27
  }
26
28
  }
@@ -48,7 +50,20 @@ class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
48
50
  * Path to JavaScript bundle file.
49
51
  * Default value: "main.jsbundle"
50
52
  */
51
- @objc public var bundlePath: String = "main.jsbundle"
53
+ @objc public var bundlePath: String = "main.jsbundle" {
54
+ didSet {
55
+ delegate.bundlePath = bundlePath
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
+ }
52
67
  /**
53
68
  * React Native factory instance created when starting React Native.
54
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.0",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "author": "Michal Chudziak <mike.chudziak@callstack.com>",
6
6
  "contributors": [