react-native-config-ultimate 0.0.4 → 0.0.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.
@@ -11,10 +11,30 @@ buildscript {
11
11
  }
12
12
 
13
13
 
14
+ def rncuError(String msg) {
15
+ throw new GradleException(
16
+ "\n\n" +
17
+ "════════════════════════════════════════════════════════════\n" +
18
+ " react-native-config-ultimate — Android build error\n" +
19
+ "════════════════════════════════════════════════════════════\n" +
20
+ " ${msg}\n\n" +
21
+ " Fix: run this from your React Native project root:\n\n" +
22
+ " npx rncu .env\n\n" +
23
+ " Docs: https://github.com/javier545dev/react-native-config-ultimate\n" +
24
+ "════════════════════════════════════════════════════════════\n"
25
+ )
26
+ }
27
+
14
28
  def readYaml(yamlPath) {
15
29
  def yamlFile = new File(yamlPath.toAbsolutePath().toString())
16
30
  if (!yamlFile.exists()) {
17
- throw new GradleException("yaml file at path ${yamlPath.toAbsolutePath().toString()} does not exist")
31
+ rncuError(
32
+ "rncu.yaml not found at:\n" +
33
+ " ${yamlPath.toAbsolutePath()}\n\n" +
34
+ " This file is generated by the rncu CLI. It is missing\n" +
35
+ " because you have not run rncu yet (or ran npm install\n" +
36
+ " after the last rncu run, which resets the file)."
37
+ )
18
38
  }
19
39
  def cfg = new org.yaml.snakeyaml.Yaml().load(yamlFile.newInputStream())
20
40
  if (
@@ -23,9 +43,9 @@ def readYaml(yamlPath) {
23
43
  || cfg instanceof Double
24
44
  || cfg instanceof Boolean
25
45
  ) {
26
- throw new GradleException("could not read object from ${yamlPath} but got '${cfg.class.name}'")
46
+ rncuError("rncu.yaml is not a valid key-value map (got '${cfg.class.name}'). Re-run: npx rncu .env")
27
47
  } else if (cfg == null) {
28
- throw new GradleException("could not read object from ${yamlPath} but got 'null'")
48
+ rncuError("rncu.yaml is empty. Re-run: npx rncu .env")
29
49
  }
30
50
  return cfg
31
51
  }
@@ -1 +1,2 @@
1
- #error "invoke bin.js with env file before compiling native project"
1
+ #error "react-native-config-ultimate: ConfigValues.h not generated. Run: npx rncu .env from your project root before building iOS.
2
+ "
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-config-ultimate",
3
3
  "title": "React Native Config Ultimate",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "description": "Config that works. A community-maintained fork of react-native-ultimate-config.",
6
6
  "main": "index.js",
7
7
  "react-native": "index.js",
@@ -32,7 +32,7 @@
32
32
  "typecheck": "tsc --noEmit",
33
33
  "pretest": "tsc",
34
34
  "test": "jest",
35
- "prepack": "echo '#error \"invoke bin.js with env file before compiling native project\"' > ios/ConfigValues.h && echo 'module.exports = {};' > override.js",
35
+ "prepack": "printf '#error \"react-native-config-ultimate: ConfigValues.h not generated. Run: npx rncu .env from your project root before building iOS.\\n\"' > ios/ConfigValues.h && echo 'module.exports = {};' > override.js",
36
36
  "lint": "eslint src/**/*.ts index.ts --max-warnings=0",
37
37
  "format": "prettier --write src/**/*.ts index.ts"
38
38
  },