rnc

react-native-clean-project

Automating the clean up of a React Native project

Showing:

Popularity

Downloads/wk

28.4K

GitHub Stars

751

Maintenance

Last Commit

20d ago

Contributors

20

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

React Native Clean Project

npm version https://img.shields.io/github/license/pmadruga/react-native-clean-project.svg GitHub issues Build Status

Cleans your React Native project by purging caches and modules, and reinstalling them again.

Installing

yarn add -D react-native-clean-project

Running

React-Native CLI plugin

This module is automatically detected as a plugin by the standard react-native command, adding new sub-commands:

  • react-native clean-project-auto - fully automated project state clean: like a freshly-cloned, never-started repo
  • react-native clean-project - interactive project state clean: choose types of react-native state to clean

Direct execution

For complete control (including using command-line arguments to non-interactively fine-tune what state is cleaned):

./node_modules/.bin/react-native-clean-project

Or add it as a script to your package.json

"scripts": {
  "clean": "react-native-clean-project"
}

Content

This is a combination of the commands suggested in the React Native documentation plus others.

State TypeCommandIn clean-project-auto?Optional?Default?Option Flag
React-native cacherm -rf $TMPDIR/react-*YesNotrue
Metro bundler cacherm -rf $TMPDIR/metro-*YesNotrue
Watchman cachewatchman watch-del-allYesNotrue
NPM modulesrm -rf node_modulesYesYestrue--keep-node_modules
Yarn cacheyarn cache cleanYesYestrue--keep-node-modules
Yarn packagesyarn installNoYestrue--keep-node-modules
NPM cachenpm cache verifyYesYestrue--keep-node-modules
NPM Installnpm ciYesYestrue--keep-node-modules
iOS build folderrm -rf ios/buildYesYesfalse--remove-iOS-build
iOS pods folderrm -rf ios/PodsYesYesfalse--remove-iOS-pods
system iOS pods cachepod cache clean --allYesYestrue--keep-system-iOS-pods-cache
user iOS pods cacherm -rf ~/.cocoapodsYesYestrue--keep-user-iOS-pods-cache
Android build folderrm -rf android/buildYesYesfalse--remove-android-build
Android clean project(cd android && ./gradlew clean)YesYesfalse--clean-android-project
Brew packagebrew update && brew upgradeNoYestrue--keep-brew
Pod packagespod updateNoYestrue--keep-pods

Example: ./node_modules/.bin/react-native-clean-project --remove-iOS-build

Other Tips

You can also reset the Metro bundler cache when starting with react-native start --reset-cache

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial