Git Product home page Git Product logo

react-native-clean-project's Introduction

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 Type Command In clean-project-auto? Optional? Default? Option Flag
React-native cache rm -rf $TMPDIR/react-* Yes No true
Metro bundler cache rm -rf $TMPDIR/metro-* Yes No true
Watchman cache watchman watch-del-all Yes No true
NPM modules rm -rf node_modules Yes Yes true --keep-node_modules
Yarn cache yarn cache clean Yes Yes true --keep-node-modules
Yarn packages yarn install No Yes true --keep-node-modules
NPM cache npm cache verify Yes Yes true --keep-node-modules
NPM Install npm ci Yes Yes true --keep-node-modules
iOS build folder rm -rf ios/build Yes Yes false --remove-iOS-build
iOS pods folder rm -rf ios/Pods Yes Yes false --remove-iOS-pods
system iOS pods cache pod cache clear --all Yes Yes true --keep-system-iOS-pods-cache
user iOS pods cache rm -rf ~/.cocoapods Yes Yes true --keep-user-iOS-pods-cache
Android build folder rm -rf android/build Yes Yes false --remove-android-build
Android clean project (cd android && ./gradlew clean) Yes Yes false --clean-android-project
Brew package brew update && brew upgrade No Yes true --keep-brew
Pod packages pod update No Yes true --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

react-native-clean-project's People

Contributors

pmadruga avatar mikehardy avatar dependabot[bot] avatar codybrouwers avatar fdiskas avatar zachcoyle avatar wilau2 avatar alexanderwallin avatar jack828 avatar shivamjoker avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.