Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxkomarychev/react-native-ultimate-config
Config that works
https://github.com/maxkomarychev/react-native-ultimate-config
12factor 12factorapp android config dotenv env environment gradle ios java javascript monorepo objective-c react-native typescript xcconfig
Last synced: 2 days ago
JSON representation
Config that works
- Host: GitHub
- URL: https://github.com/maxkomarychev/react-native-ultimate-config
- Owner: maxkomarychev
- License: mit
- Created: 2020-03-28T15:48:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-29T16:40:04.000Z (6 months ago)
- Last Synced: 2024-10-14T13:16:29.872Z (3 months ago)
- Topics: 12factor, 12factorapp, android, config, dotenv, env, environment, gradle, ios, java, javascript, monorepo, objective-c, react-native, typescript, xcconfig
- Language: JavaScript
- Homepage:
- Size: 8.69 MB
- Stars: 262
- Watchers: 7
- Forks: 31
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-ultimate-config - Configure all levels of your react-native app with a single file (Components / System)
- awesome-react-native - react-native-ultimate-config - Configure all levels of your react-native app with a single file (Components / System)
- jimsghstars - maxkomarychev/react-native-ultimate-config - Config that works (JavaScript)
README
# react-native-ultimate-config
_Config that works_
[![NPM](https://img.shields.io/npm/l/react-native-ultimate-config)](https://www.npmjs.com/package/react-native-ultimate-config)
[![npm](https://img.shields.io/npm/v/react-native-ultimate-config?color=green&label=version)](https://www.npmjs.com/package/react-native-ultimate-config)
[![npm](https://img.shields.io/npm/dw/react-native-ultimate-config?color=green)](https://www.npmjs.com/package/react-native-ultimate-config)_Project generated with https://github.com/brodybits/create-react-native-module_
## Suport of gradle
| react-native-ultimate-config | gradle |
| ---------------------------- | ------ |
| ^3 | <=6 |
| >4 | 7 |## TL;DR usage
1. install
|npm | yarn |
|-|-|
|`npm install react-native-ultimate-config` | `yarn add react-native-ultimate-config`|
2. [one-off setup for native projects](./docs/quickstart.md)
3. initialize env
|npm | yarn |
|-|-|
|`npm run rnuc `|`yarn rnuc `|
4. build! `react-native run-{ios,android}`## ββApproach to versioning and breaking changes
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
unless they affect behavior of API or CLI.Therefore every time this library is updated all files MUST be regenerated using `rnuc` command.
## Table of contents
1. [Features π](#features)
1. [Mission π₯Ύ](#mission)
1. [Quickstart Guide π](./docs/quickstart.md)
1. [API π§°](./docs/api.md)
1. [Changelog π](./packages/react-native-ultimate-config/CHANGELOG.md)
1. [Cookbook π₯¦](./docs/cookbook.md)
1. [Troubleshooting π±](./docs/troubleshooting.md)
1. [Contributor notes](./docs/contributor-notes.md)
1. [Alternatives](./docs/alternatives.md)## Features
1. Simple one-off [setup](./docs/quickstart.md) for native projects
1. No need to mess with xcode schemes or android flavors
1. Access from [javascript](./docs/api.md#javascript)
1. Access from native code: [java](./docs/api.md#java) and [objective-c](./docs/api.md#objective-c)
1. Access in build tools: [xcode](./docs/api.md#ios), [gradle](./docs/api.md#buildgradle) and [AndroidManifest.xml](./docs/api.md#androidmanifestxml)
1. [Web support](./docs/api.md#web) (works with React Native for Web)
1. [Hooks](./docs/api.md#hooks)
1. [Monorepo support](./docs/monorepo-tips.md) (yarn workspaces or lerna)
1. Unit tested with jest
1. E2E tested with detox
1. Provides typescript [typings](./docs/api.md#typescript)
1. Supports [dotenv and yaml](./docs/api.md#files)
1. [Fully typed](./docs/api.md#note-about-types) values available when using yaml config
1. Configure values [per platform](./docs/api.md#per-platform-values) in one file## Mission
React-Native brings together 3 platforms: ios, android, javascript each of
which have different conventions and approaches how to manage environment
settings.A typical app is usually operating in some environment defined by server urls
various api keys or feature flags. When dealing with react-native such things
often need to exist in 3 places: ios, android and js code. Even managing things
as simple as application name or bundle id needs to be done in 2 places:
`Info.plist` and `AndroidManifest.xml``react-native-ultimate-config` tries to reduce friction in managing these things
by abstracting away from nuances of native projects.With `react-native-ultimate-config` it is possible to [consume](./docs/api.md) variables in
every place of a typical react-native app:- javascript
- native code
- java
- objective-c
- native build configuration
- ios
- build settings
- infoplist
- android
- build config
- string resources
- project.ext```
|-------------------------------------------------------|
| |
| javascript |
| |
|-------------------------------------------------------|
| | |
| objective-c | java |
| | |
|-------------------------------------------------------|
| | |
| build settings | AndroidManifest.xml |
| infoplist | build.gradle |
| | |
|-------------------------------------------------------|
```