- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally
- Consider starting the commit message with an applicable emoji:
- π¨
:art:when improving the format/structure of the code - π
:racehorse:when improving performance - π±
:non-potable_water:when plugging memory leaks - π
:memo:when writing docs - π§
:penguin:when fixing something on Linux - π
:apple:when fixing something on Mac OS - π
:checkered_flag:when fixing something on Windows - π
:bug:when fixing a bug - π₯
:fire:when removing code or files - π
:green_heart:when fixing the CI build - β
:white_check_mark:when adding tests - π
:lock:when dealing with security - β¬οΈ
:arrow_up:when upgrading dependencies - β¬οΈ
:arrow_down:when downgrading dependencies - π
:shirt:when removing linter warnings
- π¨
The ExoRun project's structure will look similar to this:
ExoRun
βββ app
βΒ Β βββ components
βΒ Β βββ i18n
βΒ Β βββ utils
βΒ Β βββ models
βΒ Β βββ navigation
βΒ Β βββ screens
βΒ Β βββ services
βΒ Β βββ theme
βΒ Β βββ app.tsx
βΒ Β βββ environment-variables.ts
βββ storybook
βΒ Β βββ views
βΒ Β βββ index.ts
βΒ Β βββ storybook-registry.ts
βΒ Β βββ storybook.ts
βββ test
βΒ Β βββ tests
βΒ Β βββ mocks
βΒ Β βββ setup.ts
βββ README.md
βββ android
βΒ Β βββ app
βΒ Β βββ build.gradle
βΒ Β βββ gradle
βΒ Β βββ gradle.properties
βΒ Β βββ gradlew
βΒ Β βββ gradlew.bat
βΒ Β βββ keystores
βΒ Β βββ settings.gradle
βββ ignite
βΒ Β βββ ignite.json
βΒ Β βββ plugins
βββ index.js
βββ ios
βΒ Β βββ IgniteProject
βββ package.json
Included in an Ignite boilerplate project is the app directory. This is a directory you would normally have to create when using vanilla React Native.
The inside of the src directory looks similar to the following:
app
βββ components
βββ i18n
βββ models
βββ navigation
βββ screens
βββ services
βββ theme
βββ utils
βββ app.tsx
components
This is where your React components will live. Each component will have a directory containing the .tsx file, along with a story file, and optionally .presets, and .props files for larger components. The app will come with some commonly used components like Button.
i18n
This is where your translations will live if you are using react-native-i18n.
models
This is where your app's models will live. Each model has a directory which will contain the mobx-state-tree model file, test file, and any other supporting files like actions, types, etc.
navigation
This is where your react-navigation navigators will live.
screens
This is where your screen components will live. A screen is a React component which will take up the entire screen and be part of the navigation hierarchy. Each screen will have a directory containing the .tsx file, along with any assets or other helper files.
services Any services that interface with the outside world will live here (think REST APIs, Push Notifications, etc.).
theme Here lives the theme for your application, including spacing, colors, and typography.
utils This is a great place to put miscellaneous helpers and utilities. Things like date helpers, formatters, etc. are often found here. However, it should only be used for things that are truely shared across your application. If a helper or utility is only used by a specific component or model, consider co-locating your helper with that component or model.
app.tsx This is the entry point to your app. This is where you will find the main App component which renders the rest of the application. This is also where you will specify whether you want to run the app in storybook mode.
You will import your module via his directory prefixed by a '@'
For components you can do a chain import like:
import { Button, Screen, Text } from "@components"
However if there is no index.ts you can do:
import { Api } from '@services/api'
The ignite directory stores all things Ignite, including CLI and boilerplate items. Here you will find generators, plugins and examples to help you get started with React Native.
This is where your stories will be registered and where the Storybook configs will live
This directory will hold your Jest configs and mocks, as well as your storyshots test file. This is a file that contains the snapshots of all your component storybooks.
From the command line in your generated app's root directory, enter yarn run storybook
This starts up the storybook server.