react-native-component-cli
v2.0.1
Published
scaffold a react native component within seconds
Downloads
77
Maintainers
Readme
react-native-component-cli
Why?
Many repositories of react native component are not well structured and missing basic parts in CI / CD workflow including development setup, testing, lint... react-native-component-cli
helps to instantly scaffold a react-native-component project with following features:
- Dev locally - Easy local dev with minimum dependencies
- Test - Fully test your component with Enzyme
- Lint - Lint source code with ready-to-go rules
- Stock - No unofficial 3rd Party Lib involved / Stock React Native Dev Experience
Install
by npx (Preferred)
If you are using an NPM version before 5.2.0, install
npx
with the following cmd
$ npm install npx -g
by npm install
$ npm install react-native-component-cli -g
$ npm install expo-cli -g
Usage
1. Create
by npx (Preferred)
$ npx react-native-component-cli create
by npm install
$ rnc create
2. Install
$ cd path-to-your-react-native-component
$ npm install
3. Run Test
$ npm test
4. Start Dev / View Demo
$ npm start
Output
react-native-example-component
├── demo // contains an Expo project for dev
│ ├── App.js // the main file for develop the Expo project
│ ├── AppEntry.js // the entry point for the Expo project
│ ├── app.json // the Expo project config
│ └── metro.config.js // the metro bundler config
├── src // contains source file(s) for the component
│ └── index.js
├── test // contains test file(s) for the component
│ └── index.test.js
├── .eslintrc.js // the eslint config for the component
├── babel.config.js // the babel config for the test & Expo environments
├── setup-tests.js // the jest-setup file for Enzyme
├── README.md // README for the component
├── .gitignore // git ignore for the component
└── package.json // pacakge.json for the component
Roadmap
- [x] Upgrade to Expo SDK 33.0 ( React Native 0.59.8 & React 16.8.3 )
- [x] Upgrade to Expo SDK 35.0 ( React Native 0.59.8 & React 16.8.6 )
- [x] Upgrade to Expo SDK 36.0 ( React Native 0.61.4 & React 16.9.0 )
License
MIT