npm.io
0.2.0 • Published 7 years ago

react-native-template-basic-app

Licence
MIT
Version
0.2.0
Deps
0
Size
14 kB
Vulns
0
Weekly
0
Stars
15

React Native Basic App Template

A simple basic template to start a new React Native app with ESLint and custom scripts.

Requirements

  • node
  • react-native-cli
  • yarn

Usage

Create a new project passing a template:

react-native init [ProjectName] --template basic-app

Wait for download dependencies.

Finish installation

Run node setup.js to inject custom scripts and remove unnecessary files.

For VSCode users

If you use Path Intellisense extension add the following to settings.json:

  "path-intellisense.mappings": {
    "~": "${workspaceRoot}/src"
  }
Flow configuration

Open .flowconfig file. Go to the [options] section and find the line where is module.name_mapper. Add this to the next line:

module.name_mapper='^~\/\(.*\)

It should look like the following:

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)

Includes

  • ESlint (extends Airbnb)
  • Husky
  • Lint Staged
  • Prettier
  • Flow
  • Enzyme
Custom Scripts
  • android:install - Run in Release mode
  • ios:install - Run in Release mode
  • project:clean - Clean project
  • prettier:check - Check for unformatted files
  • prettier:all - Format files
  • flow - Run Flow
  • lint - Run lint
  • start - Start Metro Bundler
  • start:clean - Start Metro Bundler without cache
  • test - Run jest
  • test:watch - Run jest in watch mode

Contributing

Clone this repo with git clone https://github.com/lucianomlima/react-native-template-basic react-native-template-basic-app cause npm needs project dir name to be equal to project name in package.json.

To execute the project with your changes, you can use the absolute path of cloned repo with react-native-cli:

react-native init [PROJECT_NAME] --template file:///path/to/repo

License

MIT

-> '<PROJECT_ROOT>/src/\1'

It should look like the following:

__CODE_BLOCK_3__

Includes

  • ESlint (extends Airbnb)
  • Husky
  • Lint Staged
  • Prettier
  • Flow
  • Enzyme
Custom Scripts
  • __INLINE_CODE_5__ - Run in Release mode
  • __INLINE_CODE_6__ - Run in Release mode
  • __INLINE_CODE_7__ - Clean project
  • __INLINE_CODE_8__ - Check for unformatted files
  • __INLINE_CODE_9__ - Format files
  • __INLINE_CODE_10__ - Run Flow
  • __INLINE_CODE_11__ - Run lint
  • __INLINE_CODE_12__ - Start Metro Bundler
  • __INLINE_CODE_13__ - Start Metro Bundler without cache
  • __INLINE_CODE_14__ - Run jest
  • __INLINE_CODE_15__ - Run jest in watch mode

Contributing

Clone this repo with __INLINE_CODE_16__ cause npm needs project dir name to be equal to project name in __INLINE_CODE_17__.

To execute the project with your changes, you can use the absolute path of cloned repo with __INLINE_CODE_18__:

__CODE_BLOCK_4__

License

MIT

-> 'RelativeImageStub' module.name_mapper='^~\/\(.*\)

Includes

  • ESlint (extends Airbnb)
  • Husky
  • Lint Staged
  • Prettier
  • Flow
  • Enzyme
Custom Scripts
  • __INLINE_CODE_5__ - Run in Release mode
  • __INLINE_CODE_6__ - Run in Release mode
  • __INLINE_CODE_7__ - Clean project
  • __INLINE_CODE_8__ - Check for unformatted files
  • __INLINE_CODE_9__ - Format files
  • __INLINE_CODE_10__ - Run Flow
  • __INLINE_CODE_11__ - Run lint
  • __INLINE_CODE_12__ - Start Metro Bundler
  • __INLINE_CODE_13__ - Start Metro Bundler without cache
  • __INLINE_CODE_14__ - Run jest
  • __INLINE_CODE_15__ - Run jest in watch mode

Contributing

Clone this repo with __INLINE_CODE_16__ cause npm needs project dir name to be equal to project name in __INLINE_CODE_17__.

To execute the project with your changes, you can use the absolute path of cloned repo with __INLINE_CODE_18__:

__CODE_BLOCK_4__

License

MIT

-> '<PROJECT_ROOT>/src/\1'

It should look like the following:

__CODE_BLOCK_3__

Includes

  • ESlint (extends Airbnb)
  • Husky
  • Lint Staged
  • Prettier
  • Flow
  • Enzyme
Custom Scripts
  • __INLINE_CODE_5__ - Run in Release mode
  • __INLINE_CODE_6__ - Run in Release mode
  • __INLINE_CODE_7__ - Clean project
  • __INLINE_CODE_8__ - Check for unformatted files
  • __INLINE_CODE_9__ - Format files
  • __INLINE_CODE_10__ - Run Flow
  • __INLINE_CODE_11__ - Run lint
  • __INLINE_CODE_12__ - Start Metro Bundler
  • __INLINE_CODE_13__ - Start Metro Bundler without cache
  • __INLINE_CODE_14__ - Run jest
  • __INLINE_CODE_15__ - Run jest in watch mode

Contributing

Clone this repo with __INLINE_CODE_16__ cause npm needs project dir name to be equal to project name in __INLINE_CODE_17__.

To execute the project with your changes, you can use the absolute path of cloned repo with __INLINE_CODE_18__:

__CODE_BLOCK_4__

License

MIT

-> '<PROJECT_ROOT>/src/\1'

Includes

  • ESlint (extends Airbnb)
  • Husky
  • Lint Staged
  • Prettier
  • Flow
  • Enzyme
Custom Scripts
  • __INLINE_CODE_5__ - Run in Release mode
  • __INLINE_CODE_6__ - Run in Release mode
  • __INLINE_CODE_7__ - Clean project
  • __INLINE_CODE_8__ - Check for unformatted files
  • __INLINE_CODE_9__ - Format files
  • __INLINE_CODE_10__ - Run Flow
  • __INLINE_CODE_11__ - Run lint
  • __INLINE_CODE_12__ - Start Metro Bundler
  • __INLINE_CODE_13__ - Start Metro Bundler without cache
  • __INLINE_CODE_14__ - Run jest
  • __INLINE_CODE_15__ - Run jest in watch mode

Contributing

Clone this repo with __INLINE_CODE_16__ cause npm needs project dir name to be equal to project name in __INLINE_CODE_17__.

To execute the project with your changes, you can use the absolute path of cloned repo with __INLINE_CODE_18__:

__CODE_BLOCK_4__

License

MIT

-> '<PROJECT_ROOT>/src/\1'

It should look like the following:

__CODE_BLOCK_3__

Includes

  • ESlint (extends Airbnb)
  • Husky
  • Lint Staged
  • Prettier
  • Flow
  • Enzyme
Custom Scripts
  • __INLINE_CODE_5__ - Run in Release mode
  • __INLINE_CODE_6__ - Run in Release mode
  • __INLINE_CODE_7__ - Clean project
  • __INLINE_CODE_8__ - Check for unformatted files
  • __INLINE_CODE_9__ - Format files
  • __INLINE_CODE_10__ - Run Flow
  • __INLINE_CODE_11__ - Run lint
  • __INLINE_CODE_12__ - Start Metro Bundler
  • __INLINE_CODE_13__ - Start Metro Bundler without cache
  • __INLINE_CODE_14__ - Run jest
  • __INLINE_CODE_15__ - Run jest in watch mode

Contributing

Clone this repo with __INLINE_CODE_16__ cause npm needs project dir name to be equal to project name in __INLINE_CODE_17__.

To execute the project with your changes, you can use the absolute path of cloned repo with __INLINE_CODE_18__:

__CODE_BLOCK_4__

License

MIT