pmadruga / react-native-clean-project

Automating the clean up of a React Native project
MIT License
1.18k stars 52 forks source link

Update how tasks are executed and add additional tasks #3

Closed codybrouwers closed 6 years ago

codybrouwers commented 6 years ago

First off, thanks for providing this helpful package! It has benefited me a few times when trying to debug an issue and needing to run some of these tasks.

I kept running into the issue of the tasks not running asynchronous, which for most of them that isn't a problem, but when wiping the node_modules folder and then running yarn install, I found it would always do the install first then wipe the folder. So this PR should make those specific tasks execute consecutively.

I also added a few other tasks to the list like optionally wiping the build folders which I've found to be helpful when debugging a build issue.

Definitely open to any suggestions or changes you want to make!

pmadruga commented 6 years ago

Wow, thanks for this. It is great! Give me a couple days to review, add some comments, and then test it in a couple of my projects. If all is good, I'll merge it. Again, thanks!

codybrouwers commented 6 years ago

Sounds good, looking forward to your comments! :)

pmadruga commented 6 years ago

Hi!

I have tested and works great. Two things:

  1. With the current setup - where the user is asked if it wants to keep or remove some folders - it will hang on a CI. A way to solve this would be to use --remove-iOS and --keep-node_modules when running the script. The default would be without questions (while removing just the node_modules).
  2. After 1, adding a test to ensure that the tests run based on the cli options. I have been meaning to add https://github.com/substack/tape to the stack. I can add tape into master before merging this branch so you can use it here.

Again, thanks for the PR!

codybrouwers commented 6 years ago

Hey @pmadruga, added those command line arguments, give it a try and let me know what you think of the defaults. Also I added the list of commands back into the README, I thought having them there was super helpful for anyone wanting to run the script, but if you want to remove them no problem, let me know.

I will take a look at tape later this week hopefully, looks interesting!

codybrouwers commented 6 years ago

Also just saw your new contributing guidelines, I'll follow those going forward 😝👍

pmadruga commented 6 years ago

Thanks @CodyBrouwers ! will check on it as soon as possible (perhaps end of this week).