New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup script #160
Setup script #160
Conversation
This is awesome! Brilliant work! 💯 I'm making a few tweaks and will get this merged today. Thanks so much! You nailed it! 👍 |
I made some tweaks:
I'm torn on whether to remove the git repo. It actually bit me as I was trying your PR. I had made some tweaks and then wiping out the repo removed my changes. I'm also trying to remove the keywords from package.json, but am struggling with the proper regex (not my strongsuit). Certainly open to a suggestion there! Thanks again! |
Yeah, I feel you on the Git issue--I can safely say I have never had to try to deal with writing a script that deletes Git and itself--it certainly made for an interesting time trying to keep it tracked. It seems like the only time it would really be an issue is for someone who is planning on contributing, and thus needs to keep the original repo--otherwise, I think it's a really handy feature to have in there. (Maybe just adding a cautionary note to the relevant line in the README file would be enough?) Keywords: I started looking at that as well, and felt like it was probably more effort than it was worth in that case--mostly, like you said, because it doesn't use the same simple regex that the other prompts do. Are you thinking you would like to prompt the user for new keywords, or just clean it out and leave an empty array for the user to populate manually? |
I was just going to clean out the existing keywords, or, if easier, remove the keywords section altogether. |
Cool, that should be easy enough. I think I have it already, but I just need to test a full run of it when I have a minute. I'll send another PR later today. |
Hey Cory, One quick thing I noticed in trying to re-clone from scratch and run this. Maybe it's something wrong on my end, but when I am starting from a clean clone of the repo, the script won't run using Am I maybe missing a global install that is causing this, or do we need to switch it back to the original ES5-ish syntax, since the assumption will be that anyone running this is starting from a clean clone with no packages installed? I do fully admit that this could be user error on my part, but I just wanted to check before proceeding with anything. Thanks again! |
Ah! Great point. I didn't consider that. Since babel-node isn't installed until npm install is run, it indeed needs to be in ES5. If your next PR has it back in ES5, I'll just merge it in to complete the rollback of my mistake. 👍 |
Ok, cool. I will send a PR later on today. (Incidentally, this is the same reason I didn't use |
Yep, that makes sense. I also realized we need a bit of validation on the project name. No spaces are allowed. |
Yeah, I had considered that possibility as well. It's actually pretty trivial to add regex checking to user input with |
Setup script to perform the following actions:
package.json
where appriopriatetools/setup
folder containing the script when finishedI did add two devDependencies in
package.json
:prompt
andreplace
, for handling thepackage.json
updates. If you would prefer that I not save them as dependencies, I could look at having the script just manually install then uninstall them.Let me know if you have any questions or issues.
Thanks,
Gabe