react-native-config-ultimate 0.1.0 → 0.2.1

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 (112) hide show
  1. package/README.md +476 -121
  2. package/android/build.gradle +1 -1
  3. package/android/rncu.gradle +19 -15
  4. package/android/src/main/java/com/reactnativeultimateconfig/UltimateConfigHelper.java +87 -0
  5. package/android/src/main/java/com/reactnativeultimateconfig/UltimateConfigPackage.java +1 -1
  6. package/android/src/newarch/java/com/reactnativeultimateconfig/UltimateConfigModule.java +3 -50
  7. package/android/src/oldarch/java/com/reactnativeultimateconfig/UltimateConfigModule.java +3 -54
  8. package/ios/UltimateConfig.mm +2 -1
  9. package/lib/commonjs/cli.js +11 -2
  10. package/lib/commonjs/cli.js.map +1 -1
  11. package/lib/commonjs/flatten.js +6 -1
  12. package/lib/commonjs/flatten.js.map +1 -1
  13. package/lib/commonjs/load-env.js +14 -0
  14. package/lib/commonjs/load-env.js.map +1 -1
  15. package/lib/commonjs/main.js +5 -1
  16. package/lib/commonjs/main.js.map +1 -1
  17. package/lib/commonjs/render-env.js +1 -1
  18. package/lib/commonjs/render-env.js.map +1 -1
  19. package/lib/commonjs/resolve-env.js +5 -1
  20. package/lib/commonjs/resolve-env.js.map +1 -1
  21. package/lib/commonjs/templates/override.js.handlebars +1 -10
  22. package/lib/commonjs/validate-env.js +20 -7
  23. package/lib/commonjs/validate-env.js.map +1 -1
  24. package/lib/module/cli.js +11 -2
  25. package/lib/module/cli.js.map +1 -1
  26. package/lib/module/flatten.js +6 -1
  27. package/lib/module/flatten.js.map +1 -1
  28. package/lib/module/load-env.js +14 -0
  29. package/lib/module/load-env.js.map +1 -1
  30. package/lib/module/main.js +6 -2
  31. package/lib/module/main.js.map +1 -1
  32. package/lib/module/render-env.js +1 -1
  33. package/lib/module/render-env.js.map +1 -1
  34. package/lib/module/resolve-env.js +5 -1
  35. package/lib/module/resolve-env.js.map +1 -1
  36. package/lib/module/templates/override.js.handlebars +1 -10
  37. package/lib/module/validate-env.js +19 -7
  38. package/lib/module/validate-env.js.map +1 -1
  39. package/lib/typescript/src/cli.d.ts.map +1 -1
  40. package/lib/typescript/src/flatten.d.ts.map +1 -1
  41. package/lib/typescript/src/load-env.d.ts.map +1 -1
  42. package/lib/typescript/src/main.d.ts +1 -1
  43. package/lib/typescript/src/main.d.ts.map +1 -1
  44. package/lib/typescript/src/render-env.d.ts.map +1 -1
  45. package/lib/typescript/src/resolve-env.d.ts +8 -1
  46. package/lib/typescript/src/resolve-env.d.ts.map +1 -1
  47. package/lib/typescript/src/validate-env.d.ts +8 -0
  48. package/lib/typescript/src/validate-env.d.ts.map +1 -1
  49. package/package.json +4 -2
  50. package/src/cli.ts +12 -2
  51. package/src/flatten.ts +6 -1
  52. package/src/load-env.ts +18 -0
  53. package/src/main.ts +6 -2
  54. package/src/render-env.ts +4 -1
  55. package/src/resolve-env.ts +16 -2
  56. package/src/templates/override.js.handlebars +1 -10
  57. package/src/validate-env.ts +23 -7
  58. package/android/rnuc.yaml +0 -1
  59. package/lib/commonjs/bin.spec.js +0 -50
  60. package/lib/commonjs/bin.spec.js.map +0 -1
  61. package/lib/commonjs/cli.spec.js +0 -190
  62. package/lib/commonjs/cli.spec.js.map +0 -1
  63. package/lib/commonjs/flatten.spec.js +0 -32
  64. package/lib/commonjs/flatten.spec.js.map +0 -1
  65. package/lib/commonjs/load-env.spec.js +0 -257
  66. package/lib/commonjs/load-env.spec.js.map +0 -1
  67. package/lib/commonjs/main.spec.js +0 -228
  68. package/lib/commonjs/main.spec.js.map +0 -1
  69. package/lib/commonjs/render-env.spec.js +0 -397
  70. package/lib/commonjs/render-env.spec.js.map +0 -1
  71. package/lib/commonjs/resolve-env.spec.js +0 -31
  72. package/lib/commonjs/resolve-env.spec.js.map +0 -1
  73. package/lib/commonjs/validate-env.spec.js +0 -325
  74. package/lib/commonjs/validate-env.spec.js.map +0 -1
  75. package/lib/commonjs/write-env.spec.js +0 -115
  76. package/lib/commonjs/write-env.spec.js.map +0 -1
  77. package/lib/module/bin.spec.js +0 -49
  78. package/lib/module/bin.spec.js.map +0 -1
  79. package/lib/module/cli.spec.js +0 -190
  80. package/lib/module/cli.spec.js.map +0 -1
  81. package/lib/module/flatten.spec.js +0 -31
  82. package/lib/module/flatten.spec.js.map +0 -1
  83. package/lib/module/load-env.spec.js +0 -257
  84. package/lib/module/load-env.spec.js.map +0 -1
  85. package/lib/module/main.spec.js +0 -224
  86. package/lib/module/main.spec.js.map +0 -1
  87. package/lib/module/render-env.spec.js +0 -396
  88. package/lib/module/render-env.spec.js.map +0 -1
  89. package/lib/module/resolve-env.spec.js +0 -30
  90. package/lib/module/resolve-env.spec.js.map +0 -1
  91. package/lib/module/validate-env.spec.js +0 -325
  92. package/lib/module/validate-env.spec.js.map +0 -1
  93. package/lib/module/write-env.spec.js +0 -115
  94. package/lib/module/write-env.spec.js.map +0 -1
  95. package/lib/typescript/src/bin.spec.d.ts +0 -2
  96. package/lib/typescript/src/bin.spec.d.ts.map +0 -1
  97. package/lib/typescript/src/cli.spec.d.ts +0 -14
  98. package/lib/typescript/src/cli.spec.d.ts.map +0 -1
  99. package/lib/typescript/src/flatten.spec.d.ts +0 -2
  100. package/lib/typescript/src/flatten.spec.d.ts.map +0 -1
  101. package/lib/typescript/src/load-env.spec.d.ts +0 -6
  102. package/lib/typescript/src/load-env.spec.d.ts.map +0 -1
  103. package/lib/typescript/src/main.spec.d.ts +0 -2
  104. package/lib/typescript/src/main.spec.d.ts.map +0 -1
  105. package/lib/typescript/src/render-env.spec.d.ts +0 -2
  106. package/lib/typescript/src/render-env.spec.d.ts.map +0 -1
  107. package/lib/typescript/src/resolve-env.spec.d.ts +0 -2
  108. package/lib/typescript/src/resolve-env.spec.d.ts.map +0 -1
  109. package/lib/typescript/src/validate-env.spec.d.ts +0 -2
  110. package/lib/typescript/src/validate-env.spec.d.ts.map +0 -1
  111. package/lib/typescript/src/write-env.spec.d.ts +0 -9
  112. package/lib/typescript/src/write-env.spec.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,150 +1,505 @@
1
- # react-native-config-ultimate
1
+ <p align="center">
2
+ <img src=".github/logo.svg" alt="react-native-config-ultimate logo" width="100" height="100" />
3
+ </p>
2
4
 
3
- _Config that works_
5
+ <h1 align="center">react-native-config-ultimate</h1>
4
6
 
5
- [![NPM](https://img.shields.io/npm/l/react-native-config-ultimate)](https://www.npmjs.com/package/react-native-config-ultimate)
6
- [![npm](https://img.shields.io/npm/v/react-native-config-ultimate?color=green&label=version)](https://www.npmjs.com/package/react-native-config-ultimate)
7
- [![npm](https://img.shields.io/npm/dw/react-native-config-ultimate?color=green)](https://www.npmjs.com/package/react-native-config-ultimate)
7
+ <p align="center">
8
+ <strong>Environment variables for React Native that just work.</strong>
9
+ <br />
10
+ <strong>iOS</strong> &bull; <strong>Android</strong> &bull; <strong>Web</strong> &bull; <strong>Old & New Architecture</strong>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <a href="https://www.npmjs.com/package/react-native-config-ultimate">
15
+ <img src="https://img.shields.io/npm/v/react-native-config-ultimate?style=flat-square&color=CC3534&label=npm" alt="npm version" />
16
+ </a>
17
+ <a href="https://www.npmjs.com/package/react-native-config-ultimate">
18
+ <img src="https://img.shields.io/npm/dm/react-native-config-ultimate?style=flat-square&color=007ACC&label=downloads" alt="npm downloads" />
19
+ </a>
20
+ <a href="./LICENSE">
21
+ <img src="https://img.shields.io/npm/l/react-native-config-ultimate?style=flat-square&color=brightgreen" alt="license" />
22
+ </a>
23
+ <a href="https://www.typescriptlang.org/">
24
+ <img src="https://img.shields.io/badge/TypeScript-strict-3178C6?style=flat-square" alt="TypeScript" />
25
+ </a>
26
+ </p>
27
+
28
+ <p align="center">
29
+ <a href="./docs/quickstart.md"><strong>Getting Started</strong></a> &nbsp;•&nbsp;
30
+ <a href="./docs/api.md"><strong>API Reference</strong></a> &nbsp;•&nbsp;
31
+ <a href="./docs/cookbook.md"><strong>Cookbook</strong></a> &nbsp;•&nbsp;
32
+ <a href="https://github.com/javier545dev/react-native-config-ultimate/issues"><strong>Report Bug</strong></a>
33
+ </p>
34
+
35
+ ---
36
+
37
+ ## The Problem
38
+
39
+ Managing environment variables in React Native is painful:
40
+
41
+ ```
42
+ ❌ Different config files for iOS and Android
43
+ ❌ Separate setup for each platform
44
+ ❌ Type-unsafe string values
45
+ ❌ No support for New Architecture
46
+ ❌ Existing solutions are unmaintained
47
+ ```
48
+
49
+ ## The Solution
50
+
51
+ **One config file. Every platform. Type-safe. Just works.**
52
+
53
+ ```bash
54
+ # Create your config
55
+ echo "API_URL=https://api.myapp.com" > .env
56
+
57
+ # Generate for all platforms
58
+ npx rncu .env
59
+
60
+ # Use everywhere ✨
61
+ ```
62
+
63
+ ```tsx
64
+ import Config from 'react-native-config-ultimate';
65
+
66
+ // TypeScript knows your config shape!
67
+ console.log(Config.API_URL); // https://api.myapp.com
68
+ ```
8
69
 
9
70
  ---
10
71
 
11
- > **This is a community-maintained fork** of
12
- > [`react-native-ultimate-config`](https://github.com/maxkomarychev/react-native-ultimate-config)
13
- > originally created by [Max Komarychev](https://github.com/maxkomarychev).
14
- >
15
- > The original library has not received updates since September 2023 and does not
16
- > support React Native's New Architecture (TurboModules), React 19, or modern
17
- > tooling. This fork picks up where it left off.
18
- >
19
- > **Full credit and gratitude to Max** for the original design, architecture, and
20
- > years of maintenance. This project would not exist without his work.
21
- > The MIT license is preserved in its entirety.
72
+ ## Why Choose This Library?
73
+
74
+ <table>
75
+ <tr>
76
+ <th width="33%">🚀 Modern</th>
77
+ <th width="33%">📱 Universal</th>
78
+ <th width="33%">🛡️ Type-Safe</th>
79
+ </tr>
80
+ <tr>
81
+ <td>
82
+
83
+ - New Architecture ready
84
+ - TurboModules support
85
+ - React Native 0.73+
86
+ - React 18 & 19
87
+
88
+ </td>
89
+ <td>
90
+
91
+ - iOS (Swift, Obj-C)
92
+ - Android (Kotlin, Java)
93
+ - Web (RN Web, Vite)
94
+
95
+ </td>
96
+ <td>
97
+
98
+ - Auto-generated `.d.ts`
99
+ - Strict TypeScript
100
+ - Schema validation
101
+ - Zero `any` types
102
+
103
+ </td>
104
+ </tr>
105
+ </table>
106
+
107
+ ### Comparison
108
+
109
+ | Feature | react-native-config-ultimate | react-native-config | react-native-dotenv |
110
+ |---------|:----------------------------:|:-------------------:|:-------------------:|
111
+ | **New Architecture** | ✅ | ❌ | ❌ |
112
+ | **React Native 0.79+** | ✅ | ⚠️ | ⚠️ |
113
+ | **Web support** | ✅ | ❌ | ✅ |
114
+ | **YAML config** | ✅ | ❌ | ❌ |
115
+ | **Per-platform values** | ✅ | ❌ | ❌ |
116
+ | **Type-safe** | ✅ | ⚠️ | ⚠️ |
117
+ | **Multi-env merging** | ✅ | ❌ | ❌ |
118
+ | **Schema validation** | ✅ | ❌ | ❌ |
119
+ | **Native code access** | ✅ | ✅ | ❌ |
120
+ | **Active maintenance** | ✅ | ⚠️ | ⚠️ |
22
121
 
23
122
  ---
24
123
 
25
- ## Gradle compatibility
124
+ ## Quick Start
125
+
126
+ ### 1. Install
127
+
128
+ ```bash
129
+ npm install react-native-config-ultimate
130
+ # or
131
+ yarn add react-native-config-ultimate
132
+ # or
133
+ pnpm add react-native-config-ultimate
134
+ ```
135
+
136
+ ### 2. Create config file
26
137
 
27
- | react-native-config-ultimate | gradle |
28
- | ---------------------------- | ------ |
29
- | 0.0.x | 8 |
138
+ **Option A: `.env` (simple)**
139
+ ```bash
140
+ API_URL=https://api.myapp.com
141
+ APP_NAME=MyApp
142
+ DEBUG_MODE=true
143
+ VERSION=1.0.0
144
+ ```
30
145
 
31
- > For older versions see the original package [`react-native-ultimate-config`](https://github.com/maxkomarychev/react-native-ultimate-config).
146
+ **Option B: `.env.yaml` (powerful)**
147
+ ```yaml
148
+ API_URL: https://api.myapp.com
149
+ APP_NAME: MyApp
150
+ DEBUG_MODE: true
151
+ VERSION: 1.0.0
32
152
 
33
- ## React Native compatibility
153
+ # Per-platform values 🎯
154
+ APP_ICON:
155
+ ios: AppIcon
156
+ android: ic_launcher
157
+ ```
34
158
 
35
- | react-native-config-ultimate | react-native | react | New Architecture |
36
- | ---------------------------- | ------------ | ------ | ---------------- |
37
- | 0.0.x | >=0.73 | >=18 | ✅ TurboModules |
159
+ ### 3. Setup native projects
38
160
 
39
- ## TL;DR usage
161
+ 📱 **iOS** — [Setup Guide](./docs/quickstart.md#ios-setup)
162
+ 🤖 **Android** — [Setup Guide](./docs/quickstart.md#android-setup)
40
163
 
41
- 1. install
42
- | npm | yarn |
43
- |-|-|
44
- |`npm install react-native-config-ultimate` | `yarn add react-native-config-ultimate`|
45
- 2. [one-off setup for native projects](./docs/quickstart.md)
46
- 3. initialize env
47
- | npm | yarn |
48
- |-|-|
49
- |`npx rncu .env`|`yarn rncu .env`|
50
- 4. build! `react-native run-{ios,android}`
164
+ ### 4. Generate & use
51
165
 
52
- ## ☝❗Approach to versioning and breaking changes
166
+ ```bash
167
+ npx rncu .env
168
+ # or
169
+ npx rncu .env.yaml
170
+ ```
53
171
 
54
- This library is using [semver](https://semver.org/) and heavily relying on codegeneration. Many new features and/or bugfixes will require these files to be regenerated. Changes to codegenerated files will not be considered breaking
55
- unless they affect behavior of API or CLI.
172
+ ```tsx
173
+ import Config from 'react-native-config-ultimate';
56
174
 
57
- Therefore every time this library is updated all files MUST be regenerated using `rncu` command.
175
+ function App() {
176
+ return (
177
+ <View>
178
+ <Text>API: {Config.API_URL}</Text>
179
+ <Text>Version: {Config.VERSION}</Text>
180
+ {Config.DEBUG_MODE && <Text>🐛 Debug Mode</Text>}
181
+ </View>
182
+ );
183
+ }
184
+ ```
58
185
 
59
- ## Table of contents
186
+ **That's it!** Full guide: [**Quickstart →**](./docs/quickstart.md)
60
187
 
61
- 1. [Features 🎆](#features)
62
- 1. [Mission 🥾](#mission)
63
- 1. [Quickstart Guide 🏃](./docs/quickstart.md)
64
- 1. [Migration Guide 🚀](./docs/migration.md) — from `react-native-ultimate-config` or `react-native-config`
65
- 1. [API 🧰](./docs/api.md)
66
- 1. [Testing Guide 🧪](./docs/testing.md)
67
- 1. [Cookbook 🥦](./docs/cookbook.md)
68
- 1. [Troubleshooting 🎱](./docs/troubleshooting.md)
69
- 1. [Contributing 🤝](./CONTRIBUTING.md)
70
- 1. [Alternatives](./docs/alternatives.md)
188
+ ---
71
189
 
72
190
  ## Features
73
191
 
74
- 1. Simple one-off [setup](./docs/quickstart.md) for native projects
75
- 1. No need to mess with xcode schemes or android flavors
76
- 1. Access from [javascript](./docs/api.md#javascript)
77
- 1. Access from native code: [Java](./docs/api.md#java), [Kotlin](./docs/api.md#kotlin), [Objective-C](./docs/api.md#objective-c), and [Swift](./docs/api.md#swift)
78
- 1. Access in build tools: [xcode](./docs/api.md#ios), [gradle](./docs/api.md#buildgradle) and [AndroidManifest.xml](./docs/api.md#androidmanifestxml)
79
- 1. [Web support](./docs/api.md#web) (works with React Native for Web)
80
- 1. [Hooks](./docs/api.md#hooks)
81
- 1. [Monorepo support](./docs/monorepo-tips.md) (yarn workspaces or lerna)
82
- 1. **[New Architecture](./docs/api.md#new-architecture)** — TurboModules support (RN 0.68+), fully backward-compatible with old arch
83
- 1. **[Multi-env file merging](./docs/api.md#multi-env-file-merging)** — `rncu .env.base .env.staging` (v7+)
84
- 1. **[Dotenv variable expansion](./docs/api.md#dotenv-variable-expansion)** — `API_URL=$BASE_URL/v1` (v7+)
85
- 1. **[Schema validation](./docs/api.md#schema-validation)** — fail at build time on missing or invalid vars (v7+)
86
- 1. Unit tested with jest (136 tests, 93%+ coverage)
87
- 1. Written in TypeScript with strict mode — [exact typings](./docs/api.md#typescript) generated for your env vars
88
- 1. Supports [dotenv and yaml](./docs/api.md#files)
89
- 1. [Fully typed](./docs/api.md#note-about-types) values available when using yaml config
90
- 1. Configure values [per platform](./docs/api.md#per-platform-values) in one file
91
-
92
- ## Mission
93
-
94
- React-Native brings together 3 platforms: ios, android, javascript each of
95
- which have different conventions and approaches how to manage environment
96
- settings.
97
-
98
- A typical app is usually operating in some environment defined by server urls
99
- various api keys or feature flags. When dealing with react-native such things
100
- often need to exist in 3 places: ios, android and js code. Even managing things
101
- as simple as application name or bundle id needs to be done in 2 places:
102
- `Info.plist` and `AndroidManifest.xml`
103
-
104
- `react-native-config-ultimate` tries to reduce friction in managing these things
105
- by abstracting away from nuances of native projects.
106
-
107
- With `react-native-config-ultimate` it is possible to [consume](./docs/api.md) variables in
108
- every place of a typical react-native app:
109
-
110
- - javascript / typescript
111
- - native code
112
- - java / kotlin
113
- - objective-c / swift
114
- - native build configuration
115
- - ios
116
- - build settings
117
- - infoplist
118
- - android
119
- - build config
120
- - string resources
121
- - project.ext
122
-
123
- ```
124
- |-------------------------------------------------------|
125
- | |
126
- | javascript / typescript |
127
- | |
128
- |-------------------------------------------------------|
129
- | | |
130
- | objective-c / swift | java / kotlin |
131
- | | |
132
- |-------------------------------------------------------|
133
- | | |
134
- | build settings | AndroidManifest.xml |
135
- | infoplist | build.gradle |
136
- | | |
137
- |-------------------------------------------------------|
192
+ <details>
193
+ <summary><strong>📁 Multi-Environment Support</strong></summary>
194
+
195
+ Merge multiple env files great for staging, production, etc:
196
+
197
+ ```bash
198
+ npx rncu .env.base .env.staging
199
+ ```
200
+
201
+ Later values override earlier ones.
202
+
203
+ </details>
204
+
205
+ <details>
206
+ <summary><strong>🔗 Variable Expansion</strong></summary>
207
+
208
+ Reference other variables:
209
+
210
+ ```bash
211
+ BASE_URL=https://api.myapp.com
212
+ API_URL=$BASE_URL/v1
213
+ AUTH_URL=$BASE_URL/auth
214
+ ```
215
+
216
+ </details>
217
+
218
+ <details>
219
+ <summary><strong>✅ Schema Validation</strong></summary>
220
+
221
+ Fail fast if required vars are missing:
222
+
223
+ ```js
224
+ // .rncurc.js
225
+ module.exports = {
226
+ schema: {
227
+ API_URL: { type: 'string', required: true },
228
+ DEBUG_MODE: { type: 'boolean', default: false },
229
+ }
230
+ };
231
+ ```
232
+
233
+ </details>
234
+
235
+ <details>
236
+ <summary><strong>🎯 Per-Platform Values</strong></summary>
237
+
238
+ Different values for iOS/Android/Web:
239
+
240
+ ```yaml
241
+ APP_STORE_URL:
242
+ ios: https://apps.apple.com/app/myapp
243
+ android: https://play.google.com/store/apps/details?id=com.myapp
244
+ web: https://myapp.com
245
+ ```
246
+
247
+ </details>
248
+
249
+ <details>
250
+ <summary><strong>🪝 Hooks API</strong></summary>
251
+
252
+ Transform values at build time:
253
+
254
+ ```js
255
+ // .rncurc.js
256
+ module.exports = {
257
+ on_env: (env) => ({
258
+ ...env,
259
+ BUILD_TIME: new Date().toISOString(),
260
+ })
261
+ };
262
+ ```
263
+
264
+ </details>
265
+
266
+ <details>
267
+ <summary><strong>👀 Watch Mode</strong></summary>
268
+
269
+ Auto-regenerate on changes:
270
+
271
+ ```bash
272
+ npx rncu .env --watch
273
+ ```
274
+
275
+ </details>
276
+
277
+ ---
278
+
279
+ ## How It Works
280
+
281
+ ```mermaid
282
+ flowchart TB
283
+ subgraph Config["📄 Configuration"]
284
+ ENV[".env"]
285
+ YAML[".env.yaml"]
286
+ SCHEMA[".rncurc.js"]
287
+ end
288
+
289
+ subgraph Build["🔧 Build Time"]
290
+ CLI["npx rncu"]
291
+ end
292
+
293
+ subgraph Generated["📦 Generated Files"]
294
+ TS["env.ts + index.d.ts"]
295
+ XCCONFIG["rncu.xcconfig"]
296
+ KT["RNCUValues.kt"]
297
+ end
298
+
299
+ subgraph iOS["🍎 iOS"]
300
+ SWIFT["Swift"]
301
+ OBJC["Objective-C"]
302
+ PLIST["Info.plist"]
303
+ XCODE["Build Settings"]
304
+ end
305
+
306
+ subgraph Android["🤖 Android"]
307
+ KOTLIN["Kotlin"]
308
+ JAVA["Java"]
309
+ MANIFEST["AndroidManifest"]
310
+ GRADLE["build.gradle"]
311
+ end
312
+
313
+ subgraph Web["🌐 Web"]
314
+ VITE["Vite"]
315
+ WEBPACK["Webpack"]
316
+ RNW["React Native Web"]
317
+ end
318
+
319
+ subgraph JS["⚛️ JavaScript"]
320
+ REACT["React Components"]
321
+ HOOKS["Custom Hooks"]
322
+ SERVICES["API Services"]
323
+ end
324
+
325
+ ENV --> CLI
326
+ YAML --> CLI
327
+ SCHEMA --> CLI
328
+
329
+ CLI --> TS
330
+ CLI --> XCCONFIG
331
+ CLI --> KT
332
+
333
+ TS --> JS
334
+ TS --> Web
335
+
336
+ XCCONFIG --> iOS
337
+ KT --> Android
338
+
339
+ style Config fill:#e3f2fd
340
+ style Build fill:#fff8e1
341
+ style Generated fill:#e8f5e9
342
+ style iOS fill:#fafafa
343
+ style Android fill:#e8f5e9
344
+ style Web fill:#e1f5fe
345
+ style JS fill:#fce4ec
346
+ ```
347
+ ```
348
+
349
+ ---
350
+
351
+ ## Access Everywhere
352
+
353
+ Your config is available in every layer of your app:
354
+
355
+ | Layer | iOS | Android |
356
+ |:------|:----|:--------|
357
+ | **JavaScript / TypeScript** | `Config.API_URL` | `Config.API_URL` |
358
+ | **Native Code** | `UltimateConfig.API_URL` (Swift / Obj-C) | `BuildConfig.API_URL` (Kotlin / Java) |
359
+ | **Build Settings** | `$(API_URL)` — Xcode Build Settings, Info.plist | `${API_URL}` — AndroidManifest.xml, build.gradle |
360
+
361
+ **Examples:**
362
+
363
+ ```swift
364
+ // Swift
365
+ let apiUrl = UltimateConfig.API_URL
366
+ ```
367
+
368
+ ```kotlin
369
+ // Kotlin
370
+ val apiUrl = BuildConfig.API_URL
371
+ ```
372
+
373
+ ```xml
374
+ <!-- AndroidManifest.xml -->
375
+ <meta-data android:name="api_url" android:value="${API_URL}" />
376
+ ```
377
+
378
+ ---
379
+
380
+ ## Compatibility
381
+
382
+ | Version | React Native | React | Gradle | Architecture |
383
+ |:-------:|:------------:|:-----:|:------:|:------------:|
384
+ | **0.2.x** | ≥ 0.73 | ≥ 18 | ≥ 8 | ✅ New (TurboModules) |
385
+
386
+ > **Need older RN support?** See [`react-native-ultimate-config`](https://github.com/maxkomarychev/react-native-ultimate-config)
387
+
388
+ ---
389
+
390
+ ## Documentation
391
+
392
+ | 📖 Guide | Description |
393
+ |:---------|:------------|
394
+ | [**Quickstart**](./docs/quickstart.md) | Installation and setup |
395
+ | [**API Reference**](./docs/api.md) | JavaScript, native code, build tools |
396
+ | [**Migration Guide**](./docs/migration.md) | From react-native-config |
397
+ | [**Cookbook**](./docs/cookbook.md) | Common patterns and recipes |
398
+ | [**Testing**](./docs/testing.md) | Mocking Config in tests |
399
+ | [**Monorepo Tips**](./docs/monorepo-tips.md) | pnpm, yarn workspaces, Lerna |
400
+ | [**Troubleshooting**](./docs/troubleshooting.md) | Common issues and solutions |
401
+
402
+ ---
403
+
404
+ ## Examples
405
+
406
+ | Project | React Native | Platforms | Description |
407
+ |:--------|:------------:|:---------:|:------------|
408
+ | [**example**](./packages/example) | 0.83 | iOS, Android | Full native app with YAML |
409
+ | [**Example079**](./packages/Example079) | 0.79 | iOS, Android, Web | Native + Vite web |
410
+ | [**example-web**](./packages/example-web) | — | Web | Standalone Vite + RN Web |
411
+
412
+ ---
413
+
414
+ ## Frequently Asked Questions
415
+
416
+ <details>
417
+ <summary><strong>Do I need to rebuild after changing .env?</strong></summary>
418
+
419
+ **JavaScript**: No, just re-run `npx rncu .env` and reload the app.
420
+
421
+ **Native values** (Info.plist, AndroidManifest): Yes, you need to rebuild.
422
+
423
+ </details>
424
+
425
+ <details>
426
+ <summary><strong>How do I use different configs for dev/staging/prod?</strong></summary>
427
+
428
+ Use multi-file merging:
429
+ ```bash
430
+ npx rncu .env.base .env.production
431
+ ```
432
+
433
+ Or use separate commands in your package.json:
434
+ ```json
435
+ {
436
+ "scripts": {
437
+ "env:dev": "rncu .env.dev",
438
+ "env:prod": "rncu .env.prod"
439
+ }
440
+ }
138
441
  ```
139
442
 
443
+ </details>
444
+
445
+ <details>
446
+ <summary><strong>Is this library actively maintained?</strong></summary>
447
+
448
+ Yes! This is a community fork that adds New Architecture support, React 19 compatibility, and ongoing maintenance. See [CONTRIBUTING.md](./CONTRIBUTING.md).
449
+
450
+ </details>
451
+
140
452
  ---
141
453
 
142
- ## Releases
454
+ ## Contributing
455
+
456
+ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
457
+
458
+ ```bash
459
+ git clone https://github.com/javier545dev/react-native-config-ultimate.git
460
+ cd react-native-config-ultimate
461
+ pnpm install
462
+ pnpm test
463
+ pnpm build
464
+ ```
465
+
466
+ ---
143
467
 
144
- This project uses [release-please](https://github.com/googleapis/release-please) for automated releases. Every merge to `master` with conventional commits (`feat:`, `fix:`, etc.) will automatically:
468
+ ## Credits
469
+
470
+ <table>
471
+ <tr>
472
+ <td align="center">
473
+ <strong>Original Author</strong><br/>
474
+ <a href="https://github.com/maxkomarychev">Max Komarychev</a><br/>
475
+ <sub>Creator of react-native-ultimate-config</sub>
476
+ </td>
477
+ <td align="center">
478
+ <strong>Current Maintainer</strong><br/>
479
+ <a href="https://github.com/javier545dev">javier545dev</a><br/>
480
+ <sub>New Architecture & React 19 support</sub>
481
+ </td>
482
+ </tr>
483
+ </table>
484
+
485
+ > This is a community-maintained fork of [`react-native-ultimate-config`](https://github.com/maxkomarychev/react-native-ultimate-config). Full credit to Max for the original design and years of maintenance. The MIT license is preserved.
486
+
487
+ ---
488
+
489
+ ## License
490
+
491
+ MIT License — see [LICENSE](./LICENSE) for details.
492
+
493
+ ---
145
494
 
146
- 1. Create/update a Release PR with changelog
147
- 2. When merged, create a GitHub Release
148
- 3. Publish to npm
495
+ <p align="center">
496
+ <strong>If this library helps you, consider giving it a ⭐️</strong>
497
+ <br/><br/>
498
+ <a href="https://github.com/javier545dev/react-native-config-ultimate">
499
+ <img src="https://img.shields.io/github/stars/javier545dev/react-native-config-ultimate?style=social" alt="GitHub stars" />
500
+ </a>
501
+ </p>
149
502
 
150
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for commit conventions.
503
+ <p align="center">
504
+ <a href="./docs/quickstart.md"><strong>Get Started →</strong></a>
505
+ </p>
@@ -145,7 +145,7 @@ afterEvaluate { project ->
145
145
  def javaCompileTask = variant.javaCompileProvider.get()
146
146
 
147
147
  task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
148
- from javaCompileTask.destinationDir
148
+ from javaCompileTask.destinationDirectory
149
149
  }
150
150
  }
151
151