diff --git a/Makefile b/Makefile index 8c91cc5..d25d339 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ REMOTE_NAME ?= origin REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url) CURR_HEAD := $(firstword $(shell git show-ref --hash HEAD | cut --bytes=-6) master) -GITHUB_PROJ := fontello/${NPM_PACKAGE} +GITHUB_PROJ := nodeca/${NPM_PACKAGE} help: @@ -49,6 +49,34 @@ doc: ndoc --link-format "{package.homepage}/blob/${CURR_HEAD}/{file}#L{line}" +browserify: + if test ! `which browserify` ; then npm install browserify ; fi + if test ! `which uglifyjs` ; then npm install uglify-js ; fi + # Browserify + ( echo -n "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \ + browserify -r ./ -s pako \ + ) > dist/pako.js + ( echo -n "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \ + browserify -r ./lib/deflate.js -s pako \ + ) > dist/pako_deflate.js + ( echo -n "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \ + browserify -r ./lib/inflate.js -s pako \ + ) > dist/pako_inflate.js + # Minify + uglifyjs dist/pako.js -c -m \ + --preamble "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" \ + > dist/pako.min.js + uglifyjs dist/pako_deflate.js -c -m \ + --preamble "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" \ + > dist/pako_deflate.min.js + uglifyjs dist/pako_inflate.js -c -m \ + --preamble "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" \ + > dist/pako_inflate.min.js + # Update bower package + sed -i -r -e \ + "s/(\"version\":\s*)\"[0-9]+[.][0-9]+[.][0-9]+\"/\1\"${NPM_VERSION}\"/" \ + bower.json + dev-deps: @if test ! `which npm` ; then \ echo "You need 'npm' installed." >&2 ; \ @@ -73,7 +101,7 @@ gh-pages: git commit -q -m 'Recreated docs' cd ${TMP_PATH} && \ git remote add remote ${REMOTE_REPO} && \ - git push --force remote +master:gh-pages + git push --force remote +master:gh-pages rm -rf ${TMP_PATH} diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..573c973 --- /dev/null +++ b/bower.json @@ -0,0 +1,24 @@ +{ + "name": "pako", + "main": "dist/pako.js", + "version": "0.0.0", + "homepage": "https://github.com/nodeca/pako", + "authors": [ + "Andrei Tuputcyn ", + "Vitaly Puzrin " + ], + "description": "deflate / inflate / gzip for bworser - very fast zlib port", + "keywords": ["zlib", "deflate", "inflate", "gzip"], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "Makefile", + "index*", + "lib", + "benchmarks", + "coverage" + ] +} diff --git a/package.json b/package.json index 0c69414..1c5a8de 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name" : "pako", "description" : "zlib port to javascript - fast, modularized, with browser support.", "version" : "0.0.0", - "keywords" : [ "zlib", "deflate", "inflate" ], + "keywords" : [ "zlib", "deflate", "inflate", "gzip" ], "homepage" : "https://github.com/nodeca/pako", "contributors" : [ "Andrei Tuputcyn (https://github.com/andr83)", @@ -18,6 +18,10 @@ "mocha": "*", "benchmark": "*", "ansi": "*", + "browserify":"*", + "uglify-js": "*", + "jshint": "*", + "istanbul": "*", "lodash": "2.4.1", "async": "0.2.10" }