Permalink
Browse files

Use package.json and NPM instead of Makefile.

  • Loading branch information...
mcollina committed Nov 28, 2013
1 parent 1c2aa3e commit 27aca37e1a6f2e2d5bad8e8001ecbcac3a453de3
Showing with 76 additions and 109 deletions.
  1. +0 −101 Makefile
  2. +43 −0 benchmarks/Makefile
  3. +15 −5 package.json
  4. +0 −3 precommit.sh
  5. +18 −0 publish_docs.sh
View
101 Makefile
@@ -1,101 +0,0 @@
-BIN=./node_modules/.bin
-MOCHA=$(BIN)/mocha
-MOCHA_=$(BIN)/_mocha
-JSHINT=$(BIN)/jshint
-ISTANBUL=$(BIN)/istanbul
-
-test:
- $(MOCHA)
-
-clean-coverage:
- rm -rf coverage
-
-coverage: clean-coverage
- $(ISTANBUL) cover $(MOCHA_) -- --reporter spec --bail
- @echo
- @echo open coverage/lcov-report/index.html
-
-publish-coverage: coverage
- cat coverage/lcov.info | $(BIN)/coveralls
-
-bail:
- $(MOCHA) --bail --reporter spec test
-
-ci:
- $(MOCHA) --watch test
-
-jshint:
- find lib -name "*.js" -print0 | xargs -0 $(JSHINT)
- find test -name "*.js" -print0 | xargs -0 $(JSHINT)
-
-BEAUTIFY=node_modules/.bin/js-beautify -r -s 2
-beautify:
- find lib -name "*.js" -print0 | xargs -0 $(BEAUTIFY)
- find test -name "*.js" -print0 | xargs -0 $(BEAUTIFY)
-
-bench-clean:
- rm -rf ./benchmarks/results
-
-bench-setup: bench-clean
- mkdir -p ./benchmarks/results
-
-BENCH_ARGS="-r 100"
-bench-1: bench-setup
- node ./benchmarks/multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 1 -d >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 1 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 1 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 1 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 1 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 1 >> ./benchmarks/results/multi_listeners
-
-bench-10: bench-setup
- node ./benchmarks/multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 10 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 10 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 10 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 10 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 10 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 10 >> ./benchmarks/results/multi_listeners
-
-bench-100: bench-setup
- node ./benchmarks/multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 100 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 100 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 100 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 100 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 100 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 100 >> ./benchmarks/results/multi_listeners
-
-bench-1000: bench-setup
- node ./benchmarks/multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 1000 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 1000 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 1000 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 1000 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 1000 >> ./benchmarks/results/multi_listeners
- node ./benchmarks/multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 1000 >> ./benchmarks/results/multi_listeners
-
-bench: bench-clean bench-1 bench-10 bench-100 bench-1000
-
-docs-clean:
- rm -rf docs
-
-docs: docs-clean
- $(BIN)/dox-foundation --source lib --target docs --title Ascoltatori
-
-publish-docs: docs
- git stash
- rm -rf /tmp/ascoltatori-docs
- cp -R docs /tmp/ascoltatori-docs
- git checkout gh-pages
- git pull origin gh-pages
- rm -rf docs
- cp -R /tmp/ascoltatori-docs docs
- git add docs
- git add -u
- git commit -m "Updated docs"
- git push origin
- git checkout master
- git stash apply
-
-install-pre-commit:
- ln -s precommit.sh .git/hooks/pre-commit
-
-.PHONY: test
View
@@ -0,0 +1,43 @@
+
+bench-clean:
+ rm -rf ./results
+
+bench-setup: bench-clean
+ mkdir -p ./results
+
+BENCH_ARGS="-r 100"
+bench-1: bench-setup
+ node ./multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 1 -d >> ./results/multi_listeners
+ node ./multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 1 >> ./results/multi_listeners
+ node ./multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 1 >> ./results/multi_listeners
+ node ./multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 1 >> ./results/multi_listeners
+ node ./multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 1 >> ./results/multi_listeners
+ node ./multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 1 >> ./results/multi_listeners
+
+bench-10: bench-setup
+ node ./multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 10 >> ./results/multi_listeners
+ node ./multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 10 >> ./results/multi_listeners
+ node ./multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 10 >> ./results/multi_listeners
+ node ./multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 10 >> ./results/multi_listeners
+ node ./multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 10 >> ./results/multi_listeners
+ node ./multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 10 >> ./results/multi_listeners
+
+bench-100: bench-setup
+ node ./multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 100 >> ./results/multi_listeners
+ node ./multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 100 >> ./results/multi_listeners
+ node ./multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 100 >> ./results/multi_listeners
+ node ./multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 100 >> ./results/multi_listeners
+ node ./multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 100 >> ./results/multi_listeners
+ node ./multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 100 >> ./results/multi_listeners
+
+bench-1000: bench-setup
+ node ./multi_listeners.js -c TrieAscoltatore $(BENCH_ARGS) -l 1000 >> ./results/multi_listeners
+ node ./multi_listeners.js -c EventEmitter2Ascoltatore $(BENCH_ARGS) -l 1000 >> ./results/multi_listeners
+ node ./multi_listeners.js -c RedisAscoltatore $(BENCH_ARGS) -l 1000 >> ./results/multi_listeners
+ node ./multi_listeners.js -c ZeromqAscoltatore $(BENCH_ARGS) -l 1000 >> ./results/multi_listeners
+ node ./multi_listeners.js -c AMQPAscoltatore $(BENCH_ARGS) -l 1000 >> ./results/multi_listeners
+ node ./multi_listeners.js -c MQTTAscoltatore $(BENCH_ARGS) -l 1000 >> ./results/multi_listeners
+
+bench: bench-clean bench-1 bench-10 bench-100 bench-1000
+
+.PHONY: bench
View
@@ -4,8 +4,18 @@
"description": "The pub/sub library for node backed by Redis, MongoDB, AMQP (RabbitMQ), ZeroMQ, MQTT (Mosquitto) or just plain node!",
"main": "index.js",
"scripts": {
- "test": "make bail"
+ "test": "mocha --recursive --bail --reporter spec test",
+ "ci": "mocha --recursive --bail --watch test",
+ "coverage": "rm -rf coverage; istanbul cover _mocha -- --reporter spec --bail",
+ "publish-coverage": "npm run coverage && cat coverage/lcov.info | coveralls",
+ "jshint-lib": "jshint lib/*.js",
+ "jshint-test": "jshint test/*.js"
},
+ "pre-commit": [
+ "jshint-lib",
+ "jshint-test",
+ "test"
+ ],
"repository": {
"type": "git",
"url": "https://github.com/mcollina/ascoltatori.git"
@@ -41,12 +51,12 @@
"sinon-chai": "~2.4.0",
"optimist": "~0.6.0",
"async_bench": "~0.1.0",
- "dox-foundation": "0.4.4",
+ "dox-foundation": "0.5.4",
"mosca": "git://github.com/mcollina/mosca.git",
- "jshint": "~2.1.0",
- "js-beautify": "~0.4.2",
+ "jshint": "~2.3.0",
"istanbul": "~0.1.40",
- "coveralls": "~2.0.16"
+ "coveralls": "~2.0.16",
+ "pre-commit": "0.0.4"
},
"dependencies": {
"async": "~0.2.6",
View
@@ -1,3 +0,0 @@
-#! /bin/sh
-
-make jshint test
View
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+set -e
+rm -rf docs
+./node_modules/.bin/dox-foundation --source lib --target docs --title Mosca
+git stash
+rm -rf /tmp/mosca-docs
+cp -R docs /tmp/mosca-docs
+git checkout gh-pages
+git pull origin gh-pages
+rm -rf docs
+cp -R /tmp/mosca-docs docs
+git add -A docs
+git add -u
+git commit -m "Updated docs" -n
+git push origin
+git checkout master
+git stash apply

0 comments on commit 27aca37

Please sign in to comment.