@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 +3 -3
- package/ios/ReactNativeBrownfield.swift +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<
|
|
2
|
-
<img alt="React Native Brownfield" src="https://
|
|
3
|
-
</
|
|
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
|
|
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
|