@situm/react-native 3.9.0-beta.2 → 3.9.0-beta.4

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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/withSitum.js +37 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situm/react-native",
3
- "version": "3.9.0-beta.2",
3
+ "version": "3.9.0-beta.4",
4
4
  "description": "Set of utilities that allow any developer to build React Native location based apps using Situm's indoor positioning system.",
5
5
  "private": false,
6
6
  "repository": "https://github.com/situmtech/react-native",
@@ -29,6 +29,7 @@
29
29
  "LICENSE",
30
30
  "SECURITY-POLICY.md",
31
31
  "security.txt",
32
+ "withSitum.js",
32
33
  "!lib/typescript/example",
33
34
  "!ios/build",
34
35
  "!android/build",
package/withSitum.js ADDED
@@ -0,0 +1,37 @@
1
+ let withProjectBuildGradle;
2
+
3
+ try {
4
+ const configPlugins = require("@expo/config-plugins");
5
+ withProjectBuildGradle = configPlugins.withProjectBuildGradle;
6
+ } catch (e) {
7
+ console.warn(
8
+ "[@situm/react-native] @expo/config-plugins is not installed. Skipping Expo config plugin setup."
9
+ );
10
+ }
11
+
12
+ module.exports = function withSitum(config) {
13
+ console.log("Situm > Config > withSitum");
14
+ if (!withProjectBuildGradle) {
15
+ return config;
16
+ }
17
+ console.log("Situm > Config > Expo environment!");
18
+
19
+ return withProjectBuildGradle(config, async (config) => {
20
+ const {
21
+ modResults,
22
+ modResults: { contents },
23
+ } = config;
24
+ console.log("Situm > Config > BuildGradle");
25
+ if (
26
+ !contents.includes("https://repo.situm.es/artifactory/libs-release-local")
27
+ ) {
28
+ modResults.contents = contents.replace(
29
+ /mavenCentral\(\)/,
30
+ `mavenCentral()
31
+ maven { url "https://repo.situm.es/artifactory/libs-release-local" }`
32
+ );
33
+ console.log("Situm > Config > BuildGradle > Repository added.");
34
+ }
35
+ return config;
36
+ });
37
+ };