Makefile & configs cleanup - use local dependencies

This commit is contained in:
Vitaly Puzrin 2014-02-24 07:50:30 +04:00
parent bb7961a6cd
commit 65134c83f8
4 changed files with 9 additions and 28 deletions

View file

@ -1,5 +1,5 @@
language: node_js language: node_js
node_js: node_js:
- "0.10" - "0.10"
before_script: "make dev-deps" before_script: "npm install"
script: "make test" script: "make test"

View file

@ -15,24 +15,18 @@ GITHUB_PROJ := nodeca/${NPM_PACKAGE}
help: help:
echo "make help - Print this help" echo "make help - Print this help"
echo "make lint - Lint sources with JSHint" echo "make lint - Lint sources with JSHint"
echo "make test - Run tests"
echo "make cover - Create coverage report"
echo "make doc - Generate documentation"
echo "make browserify - Build browserified packages"
echo "make publish - Set new version tag and publish npm package" echo "make publish - Set new version tag and publish npm package"
lint: lint:
if test ! `which jshint` ; then \
echo "You need 'jshint' installed in order to run lint." >&2 ; \
echo " $ make dev-deps" >&2 ; \
exit 128 ; \
fi
jshint . --show-non-errors jshint . --show-non-errors
test: lint test: lint
@if test ! `which mocha` ; then \
echo "You need 'mocha' installed in order to run tests." >&2 ; \
echo " $ make dev-deps" >&2 ; \
exit 128 ; \
fi
mocha mocha
cover: cover:
@ -40,18 +34,13 @@ cover:
istanbul cover node_modules/.bin/_mocha -- -t 30000 -R spec istanbul cover node_modules/.bin/_mocha -- -t 30000 -R spec
doc: doc:
@if test ! `which ndoc` ; then \
echo "You need 'ndoc' installed in order to generate docs." >&2 ; \
echo " $ npm install -g ndoc" >&2 ; \
exit 128 ; \
fi
rm -rf ./doc rm -rf ./doc
ndoc --link-format "{package.homepage}/blob/${CURR_HEAD}/{file}#L{line}" ndoc --link-format "{package.homepage}/blob/${CURR_HEAD}/{file}#L{line}"
browserify: browserify:
if test ! `which browserify` ; then npm install browserify ; fi rm -rf ./dist
if test ! `which uglifyjs` ; then npm install uglify-js ; fi mkdir dist
# Browserify # Browserify
( echo -n "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \ ( echo -n "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \
browserify -r ./ -s pako \ browserify -r ./ -s pako \
@ -77,15 +66,6 @@ browserify:
"s/(\"version\":\s*)\"[0-9]+[.][0-9]+[.][0-9]+\"/\1\"${NPM_VERSION}\"/" \ "s/(\"version\":\s*)\"[0-9]+[.][0-9]+[.][0-9]+\"/\1\"${NPM_VERSION}\"/" \
bower.json bower.json
dev-deps:
@if test ! `which npm` ; then \
echo "You need 'npm' installed." >&2 ; \
echo " See: http://npmjs.org/" >&2 ; \
exit 128 ; \
fi
npm install -g jshint
npm install
gh-pages: gh-pages:
@if test -z ${REMOTE_REPO} ; then \ @if test -z ${REMOTE_REPO} ; then \

View file

@ -18,7 +18,7 @@
"Makefile", "Makefile",
"index*", "index*",
"lib", "lib",
"benchmarks", "benchmark",
"coverage" "coverage"
] ]
} }

View file

@ -22,6 +22,7 @@
"uglify-js": "*", "uglify-js": "*",
"jshint": "*", "jshint": "*",
"istanbul": "*", "istanbul": "*",
"ndoc": "*",
"lodash": "2.4.1", "lodash": "2.4.1",
"async": "0.2.10" "async": "0.2.10"
} }