Commit 0ac59030 authored by Mike Bostock's avatar Mike Bostock

Replace Makefile with package.json.

parent 18dd2b97
bower.json -diff merge=ours
component.json -diff merge=ours
d3.js -diff merge=ours
d3.min.js -diff merge=ours
package.js -diff merge=ours
_site
node_modules
.DS_Store
d3.zip
......@@ -3,3 +3,4 @@ test/
lib/
.DS_Store
_site
d3.zip
GENERATED_FILES = \
d3.js \
d3.min.js \
component.json \
package.js
all: $(GENERATED_FILES)
.PHONY: clean all test publish
test:
@npm test
src/start.js: package.json bin/start
bin/start > $@
d3.zip: LICENSE d3.js d3.min.js
zip $@ $^
d3.js: $(shell node_modules/.bin/smash --ignore-missing --list src/d3.js) package.json
@rm -f $@
node_modules/.bin/smash src/d3.js | node_modules/.bin/uglifyjs - -b indent-level=2 -o $@
@chmod a-w $@
d3.min.js: d3.js bin/uglify
@rm -f $@
bin/uglify $< > $@
%.json: bin/% package.json
@rm -f $@
bin/$* > $@
@chmod a-w $@
package.js: bin/meteor package.json
@rm -f $@
bin/meteor > package.js
@chmod a-w $@
publish:
npm publish
meteor publish && rm -- .versions
clean:
rm -f -- $(GENERATED_FILES)
......@@ -15,6 +15,7 @@
"bin",
"component.json",
"composer.json",
"d3.zip",
"index.js",
"lib",
"node_modules",
......
......@@ -58,7 +58,9 @@
"vows": "0.8"
},
"scripts": {
"test": "vows; echo"
"test": "vows && echo",
"prepublish": "npm test && rm -f component.json package.js src/start.js d3.js d3.min.js d3.zip && bin/start > src/start.js && bin/component > component.json && bin/meteor > package.js && smash src/d3.js | uglifyjs - -b indent-level=2 -o d3.js && bin/uglify d3.js > d3.min.js && chmod a-w d3.js d3.min.js component.json package.js && zip d3.zip LICENSE d3.js d3.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git tag -am \"Release $VERSION.\" v${VERSION} && git push --tags && cp -v d3.js ../d3.github.com/d3.v3.js && cp -v d3.min.js ../d3.github.com/d3.v3.min.js && cd ../d3.github.com && git add d3.v3.js d3.v3.min.js && git commit -m \"d3 ${VERSION}\" && git push"
},
"license": "BSD-3-Clause"
}
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