Skip to content
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

Thoughts on build tools/config #47

Open
craigspaeth opened this issue Jan 25, 2015 · 0 comments
Open

Thoughts on build tools/config #47

craigspaeth opened this issue Jan 25, 2015 · 0 comments
Labels

Comments

@craigspaeth
Copy link
Contributor

rant

Obviously ppl are encouraged to use whatever build/config approach they like the most (Grunt/Gulp/Broccoli/Make/Jake/Cake/sh/npm run/whatever + nconf/package.json/config.json/config.js/.env/whatever). For Ezel I want to keep it as basic as possible. I think keeping all config in environment variables is a good idea and using a config.js file makes it easy to accidentally require on the client-side.

So I'm sold on all config being in a .env file & preferably checked out of the repo. Using a .env loader is a decent approach but not so nice for running scripts outside of your web server which can get a little messy.

Foreman is kinda to best tool for this setup b/c a Procfile can take the place of the Makefile (hmm actually maybe not b/c it seems like foreman start tries to run all tasks), it loads the .env file automatically, and it makes it easy to deploy to the most popular PAAS—Heroku. It keeps the .env file loading outside of your scripts so you can easily run foreman run migrate. Downside however is mainly that globally installing Foreman makes it a not so nicely self-contained project or the default way to run tasks out of the box is an ugly node_modules/.bin/foreman run start—although I guess that could be mitigated by npm start npm test. It also adds a Procfile to your app which is just awkward to rip out for hosting on other popular PAAS like Nodejitsu/OpsWorks.

I guess in the end I believe a .env file for config is a good opinion to encourage but the build tool I could care less about. It might be best to just drop the Makefile b/c it can throw the grunt/gulpers off and use npm run instead. Then clearly state that build/config is totally up to you but if you want Ezel's advice use Foreman and modularize complex build tasks into /lib or extracted node modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant