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
If you are using an NPM version before 5.2.0, install
npx
with the following cmd
$ npm install npx -g
$ npm install react-native-component-cli -g
$ npm install expo-cli -g
$ npx react-native-component-cli create
$ rnc create
$ cd path-to-your-react-native-component
$ npm install
$ npm test
$ npm start
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
- Upgrade to Expo SDK 33.0 ( React Native 0.59.8 & React 16.8.3 )
- Upgrade to Expo SDK 35.0 ( React Native 0.59.8 & React 16.8.6 )
- Upgrade to Expo SDK 36.0 ( React Native 0.61.4 & React 16.9.0 )
MIT