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

don't use makefile :) #49

Open
dougwilson opened this issue Aug 18, 2014 · 11 comments
Open

don't use makefile :) #49

dougwilson opened this issue Aug 18, 2014 · 11 comments
Labels

Comments

@dougwilson
Copy link
Contributor

would anyone be offended if i moved the stuff in makefile into the npm scripts?

@jonathanong
Copy link
Member

It'll be more useful later when we have multiple pages because it does all that mtime checking as well

@dougwilson
Copy link
Contributor Author

gotcha. hm, i wonder if there is a good way to keep both... for now i'm going to check in the npm scripts so it's easy for me to run this stuff :)

@Fishrock123
Copy link
Member

Why can't we do this in a js script?

@rlidwka
Copy link
Contributor

rlidwka commented Aug 18, 2014

Because make exists already and does a better job?

I don't really understand that urge to rewrite anything in javascript...

@Fishrock123
Copy link
Member

Idk I think make doesn't run well on windows or something, doesn't actually matter much to me.

@rlidwka
Copy link
Contributor

rlidwka commented Aug 18, 2014

well make runs rather nicely on windows under vagrant :)

@dougwilson
Copy link
Contributor Author

i can run Makefile with dmake :) I just find that it's nice, especially for new-comers, to not need other tools outside the language the repo is about, since it raises the barrier to entry.

@jonathanong
Copy link
Member

alternative is to make a watch script

@rlidwka
Copy link
Contributor

rlidwka commented Aug 20, 2014

Here is probably what will be our makefile soon:

NODE ?= node
NPM  ?= npm

index.html: node_modules src/* src/db.json
   @${NODE} src/build.js

# command to rebuild db.json, will be executed
# only once if src/db.json isn't present
src/db.json:
   @${NODE} --harmony src/make-db.js

# `make db` will force rebuilding db.json even if it exists
db:
   @${MAKE} --always-make src/db.json

# removes autogenerated files
clean:
   rm src/db.json index.html

# install all packages if they don't exist (repo just been cloned)
node_modules: package.json
   @${NPM} install .

.PHONY: db clean

And here are deployment instructions:

Just run `make`, it'll do everything :)

If you do that with npm scripts, you have to ask users to do:

  • npm install .
  • npm run build-db
  • npm run build

If I have node.js installed as /usr/bin/node-0.11, I run NODE=/usr/bin/node-0.11 make, and you simply can't do that in npm scripts.

So all right you can use npm scripts if it works for you, but I don't see any real alternatives here.

@dougwilson
Copy link
Contributor Author

we should probably add a readme that contains rebuilding instructions, by the way

@jonathanong
Copy link
Member

i prefer no makefile for open source projects just so we have the lowest barrier to contribution possible. i always use makefiles in my personal projects though...

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

4 participants