Commit a6d6f2b1 authored by Nick Stenning's avatar Nick Stenning

Add NPM scripts to package.json

This serves two purposes:

- The default `npm install && npm test` now suffices to run the test
  suite. This is what Travis and many other systems will do by default
  to build JavaScript projects.

- It removes the need to do $(shell npm bin) hackery in the Makefile.
parent 34be72d3
NPM_BIN := $(shell npm bin)
.PHONY: default .PHONY: default
default: all default: all
...@@ -15,14 +13,13 @@ clean: ...@@ -15,14 +13,13 @@ clean:
## Run test suite ## Run test suite
.PHONY: test .PHONY: test
test: node_modules/.uptodate test: node_modules/.uptodate
$(NPM_BIN)/gulp test-app npm test
################################################################################ ################################################################################
build/manifest.json: node_modules/.uptodate build/manifest.json: node_modules/.uptodate
$(NPM_BIN)/gulp build-app npm run-script build
node_modules/.uptodate: package.json node_modules/.uptodate:
@echo installing javascript dependencies npm run-script deps 2>/dev/null || npm install
@$(NPM_BIN)/check-dependencies 2>/dev/null || npm install
@touch $@ @touch $@
...@@ -134,5 +134,10 @@ ...@@ -134,5 +134,10 @@
}, },
"hammerjs": "Hammer", "hammerjs": "Hammer",
"jquery": "$" "jquery": "$"
},
"scripts": {
"build": "gulp build-app",
"deps": "check-dependencies",
"test": "gulp test-app"
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment