Skip to content

Latest commit

 

History

History
278 lines (194 loc) · 8.86 KB

DOC_CONFIG_FOLDERS.md

File metadata and controls

278 lines (194 loc) · 8.86 KB
id title sidebar_label
config_folders
Config Folders
Config Folders

Legend:

  • [PLATFORM] - specific platform key like ios, android, web, etc..
  • [APP_ID] - name of your folder in ./appConfigs which contains specific renative.json file
  • [PROJECT_NAME] - name field in the root package.json file of your project
  • [PLUGIN_ID] - key of the plugin defined in ./projectConfig/plugins.json
  • [WORKSPACE_PATH] - path to your workspace (~/.rnv by default) where local and sensitive information is stored.

NOTE: [WORKSPACE_PATH] folder path can be customised in ~/.rnv/renative.workspaces.json

{
    "workspaces": {
        "rnv": {
            "path": "~/.rnv"
        },
        "SOME_ANOTHER_WORKSPACE_ID": {
            "path": "<WORKSPACE_PATH>"
        }
    }
}

You can then switch to custom workspace per each project ./renative.json

{
  "workspaceID": "SOME_ANOTHER_WORKSPACE_ID"
}

Structure

applies for both public and private ./.. and ~./rnv/[PROJECT_NAME]/..

.
├── projectConfig
│   ├── fonts
│   ├── plugins
│   └── builds
└── appConfigs
    └── [APP_ID]
        ├── assets
        │   └── [PLATFORM]
        ├── fonts
        ├── builds
        └── plugins
            └── [PLUGIN_KEY]
                ├── fonts
                └── builds

Merges

Following is the order of merges of various folders (if present) contributing to final platformBuilds/*/**.

⬇️ [RNV_ROOT]/platformTemplates/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ ./projectConfig/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ ./projectConfig/builds/_shared/*/** => ./platformBuilds/_shared/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ ./appConfigs/[APP_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ ./projectConfig/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ ./appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*
⬇️ ./platformBuilds

Following is the order of merges of various folders (if present) contributing to final platformAssets/*/**.

⬇️ ./projectConfig/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ ./appConfigs/[APP_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ ./projectConfig/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ ./appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ [WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*
⬇️ ./platformAssets

Special Folders

  • platformBuilds - TODO
  • platformAssets - TODO
  • appConfigs - TODO
  • projectConfig - TODO
  • buildHooks - TODO
  • src - TODO
  • builds - TODO
  • plugins - TODO
  • fonts - TODO
  • assets - TODO

File Overrides / Injectors

Every time you run RNV command, ReNative checks following "special" folders and copies contents of those into designated target folders

  • */plugins/[PLUGIN_ID]
  • */plugins/[PLUGIN_ID]/overrides -> special override allows you to override files in plugin itself! (located ./node_modules)
  • */builds/[PLATFORM]
  • */fonts
  • */assets/runtime
  • */assets/[PLATFORM]

You can utilise above folders in following places:

  • ./appConfigs/[APP_ID]
  • ./projectConfig
  • [WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]
  • [WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig

Platform Builds Overrides

Project Scoped Build Override

./projectConfig/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

Project Scoped Build Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

App Config Scoped Build Override

./appConfigs/[APP_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

App Config Scoped Build Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

Plugin + Project Scoped Build Override

./projectConfig/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

Plugin + Project Scoped Build Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

Plugin + App Config Scoped Build Override

./appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

Plugin + App Config Scoped Build Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/builds/[PLATFORM]/*/** => ./platformBuilds/[APP_ID]_[PLATFORM]/*/*

Platform Assets Overrides

Project Scoped Assets Override

./projectConfig/assets/runtime/*/** => ./platformAssets/runtime/*/*

Project Scoped Assets Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/assets/runtime/*/** => ./platformAssets/runtime/*/*

App Config Scoped Build Override

./appConfigs/[APP_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*

App Config Scoped Build Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*

Plugin + Project Scoped Build Override

./projectConfig/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*

Plugin + Project Scoped Build Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/projectConfig/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*

Plugin + App Config Scoped Build Override

./appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*

Plugin + App Config Scoped Build Override (Private Content)

[WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/[APP_ID]/plugins/[PLUGIN_ID]/assets/runtime/*/** => ./platformAssets/runtime/*/*

Build Flavour Injectors

Sometimes you need to add buildFlavour specific file into project before build. ie Firebase, Crashlytics configs and so on

you can achieve by creating folder with postfix <PLATFORM>@<BUILD_SCHEME_NAME>

.
├── appConfigs
    └── helloWorld
        ├── assets
        ├── plugins
        │   └── some-plugin
        │       └── builds
        │            ├── android@release
        │            │   └── fileToBeInjectedInReleaseMode.txt
        │            └── android@debug
        │                └── fileToBeInjectedInDebugMode.txt
        └── builds
            ├── android@release
            │   └── fileToBeInjectedInReleaseMode.txt
            └── android@debug
                └── fileToBeInjectedInDebugMode.txt

Flavoured Builds

Combination of features above allows you to configure and build large number of flavoured builds with almost no extra configuration

Files / Assets

Override Rules:

✅ What to add to ./appConfigs/*/**

  • icon assets
  • splash screens
  • runtime configs

❌ What NOT to add to ./appConfigs/*/**

  • passwords
  • production keys
  • keystores, p12
  • googleservice-info.json
  • fabric keys
  • any other sensitive data

those should be added to private project mirror:

[WORKSPACE_PATH]/[PROJECT_NAME]/appConfigs/*/**