Coder Social home page Coder Social logo

samermurad / react-native-ultimate-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maxkomarychev/react-native-ultimate-config

1.0 1.0 1.0 8.65 MB

Config that works

License: MIT License

Java 19.19% JavaScript 49.44% Starlark 1.38% Ruby 3.61% Objective-C 11.07% Shell 0.06% Handlebars 3.09% C 1.46% HTML 3.95% CSS 2.14% TypeScript 4.62%

react-native-ultimate-config's Introduction

react-native-ultimate-config

Config that works

NPM npm npm

Project generated with https://github.com/brodybits/create-react-native-module

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
  3. initialize env
    npm yarn
    npm run rnuc <env file> yarn rnuc <env file>
  4. build! react-native run-{ios,android}

☝❗Approach to versioning and breaking changes

This library is using semver 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 🎆
  2. Mission 🥾
  3. Quickstart Guide 🏃
  4. API 🧰
  5. Changelog 📓
  6. Cookbook 🥦
  7. Troubleshooting 🎱
  8. Contributor notes
  9. Alternatives

Features

  1. Simple one-off setup for native projects
  2. No need to mess with xcode schemes or android flavors
  3. Access from javascript
  4. Access from native code: java and objective-c
  5. Access in build tools: xcode, gradle and AndroidManifest.xml
  6. Web support (works with React Native for Web)
  7. Hooks
  8. Monorepo support (yarn workspaces or lerna)
  9. Unit tested with jest
  10. E2E tested with detox
  11. Provides typescript typings
  12. Supports dotenv and yaml
  13. Fully typed values available when using yaml config
  14. Configure values per platform 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 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        |
|                          |                            |
|-------------------------------------------------------|

react-native-ultimate-config's People

Contributors

atomheartother avatar dayze avatar elliotdickison avatar irohitb avatar isilher avatar maxkomarychev avatar menardi avatar sdenaci avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

g-ioannidi5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.