react-native-config 1.5.2 → 1.5.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.
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Config variables for React Native apps
|
|
2
2
|
|
|
3
|
-
Module to expose config variables to your javascript code in React Native, supporting iOS, Android and Windows.
|
|
3
|
+
Module to expose config variables to your javascript code in React Native, supporting iOS, Android, macOS and Windows.
|
|
4
4
|
|
|
5
5
|
Bring some [12 factor](http://12factor.net/config) love to your mobile apps!
|
|
6
6
|
|
|
@@ -49,7 +49,7 @@ if cocoapods are used in the project then pod has to be installed as well:
|
|
|
49
49
|
(cd ios; pod install)
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
- Manual Link (iOS)
|
|
52
|
+
- Manual Link (iOS / macOS)
|
|
53
53
|
|
|
54
54
|
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
|
|
55
55
|
2. Go to `node_modules` ➜ `react-native-config` ➜ `ios` and add `ReactNativeConfig.xcodeproj`
|
|
@@ -195,7 +195,7 @@ versionCode project.env.get("VERSION_CODE").toInteger()
|
|
|
195
195
|
|
|
196
196
|
Once again, remember variables stored in `.env` are published with your code, so **DO NOT put anything sensitive there like your app `signingConfigs`.**
|
|
197
197
|
|
|
198
|
-
### iOS
|
|
198
|
+
### iOS / macOS
|
|
199
199
|
|
|
200
200
|
Read variables declared in `.env` from your Obj-C classes like:
|
|
201
201
|
|
|
@@ -312,7 +312,7 @@ Also note that besides requiring lowercase, the matching is done with `buildFlav
|
|
|
312
312
|
|
|
313
313
|
<a name="ios-multi-scheme"></a>
|
|
314
314
|
|
|
315
|
-
#### iOS
|
|
315
|
+
#### iOS / macOS
|
|
316
316
|
|
|
317
317
|
The basic idea in iOS is to have one scheme per environment file, so you can easily alternate between them.
|
|
318
318
|
|
package/android/build.gradle
CHANGED
|
@@ -15,7 +15,28 @@ def safeExtGet(prop, fallback) {
|
|
|
15
15
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
def supportsNamespace() {
|
|
19
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.');
|
|
20
|
+
def major = parsed[0].toInteger();
|
|
21
|
+
def minor = parsed[1].toInteger();
|
|
22
|
+
|
|
23
|
+
// Namespace support was added in 7.3.0
|
|
24
|
+
if (major == 7 && minor >= 3) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return major >= 8;
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
android {
|
|
32
|
+
if(supportsNamespace()) {
|
|
33
|
+
namespace = "com.lugg.RNCConfig"
|
|
34
|
+
sourceSets {
|
|
35
|
+
main {
|
|
36
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
19
40
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
20
41
|
|
|
21
42
|
defaultConfig {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-config",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "Expose config variables to React Native apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"env",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
],
|
|
15
15
|
"homepage": "https://github.com/luggit/react-native-config",
|
|
16
16
|
"contributors": [
|
|
17
|
-
"Luan Curti <luancurti@gmail.com> (https://github.com/luancurti)"
|
|
17
|
+
"Luan Curti <luancurti@gmail.com> (https://github.com/luancurti)",
|
|
18
|
+
"Amer Lotfi Orimi <amerllica@gmail.com> (https://github.com/amerllica)"
|
|
18
19
|
],
|
|
19
20
|
"repository": {
|
|
20
21
|
"type": "git",
|
|
@@ -34,8 +35,8 @@
|
|
|
34
35
|
"types": "./index.d.ts",
|
|
35
36
|
"license": "MIT",
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@semantic-release/git": "^
|
|
38
|
-
"semantic-release": "^
|
|
38
|
+
"@semantic-release/git": "^10.0.1",
|
|
39
|
+
"semantic-release": "^19.0.5"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"react-native-windows": ">=0.61"
|
|
@@ -15,7 +15,8 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.license = 'MIT'
|
|
16
16
|
s.ios.deployment_target = '9.0'
|
|
17
17
|
s.tvos.deployment_target = '9.0'
|
|
18
|
-
s.
|
|
18
|
+
s.macos.deployment_target = '10.15'
|
|
19
|
+
s.visionos.deployment_target = '1.0' if s.respond_to?(:visionos)
|
|
19
20
|
|
|
20
21
|
s.source = { git: 'https://github.com/luggit/react-native-config.git', tag: "v#{s.version.to_s}" }
|
|
21
22
|
s.script_phase = {
|
|
@@ -26,6 +27,7 @@ HOST_PATH="$SRCROOT/../.."
|
|
|
26
27
|
"${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig/BuildDotenvConfig.rb" "$HOST_PATH" "${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig"
|
|
27
28
|
),
|
|
28
29
|
execution_position: :before_compile,
|
|
30
|
+
always_out_of_date: "1",
|
|
29
31
|
input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb'],
|
|
30
32
|
output_files: ['$BUILD_DIR/GeneratedInfoPlistDotEnv.h', '$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/GeneratedDotEnv.m']
|
|
31
33
|
}
|
|
@@ -49,6 +51,7 @@ HOST_PATH="$SRCROOT/../.."
|
|
|
49
51
|
"${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig/BuildDotenvConfig.rb" "$HOST_PATH" "${PODS_TARGET_SRCROOT}/ios/ReactNativeConfig"
|
|
50
52
|
),
|
|
51
53
|
execution_position: :before_compile,
|
|
54
|
+
always_out_of_date: "1",
|
|
52
55
|
input_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/BuildDotenvConfig.rb'],
|
|
53
56
|
output_files: ['$PODS_TARGET_SRCROOT/ios/ReactNativeConfig/GeneratedDotEnv.m']
|
|
54
57
|
}
|