mirror of
https://github.com/0x5eal/rbxts-pako.git
synced 2025-05-04 10:33:48 +01:00
Drop Makefile
This commit is contained in:
parent
2613521920
commit
1f73088efa
1 changed files with 0 additions and 104 deletions
104
Makefile
104
Makefile
|
@ -1,104 +0,0 @@
|
||||||
NPM_PACKAGE := $(shell node -e 'process.stdout.write(require("./package.json").name)')
|
|
||||||
NPM_VERSION := $(shell node -e 'process.stdout.write(require("./package.json").version)')
|
|
||||||
|
|
||||||
TMP_PATH := /tmp/${NPM_PACKAGE}-$(shell date +%s)
|
|
||||||
|
|
||||||
REMOTE_NAME ?= origin
|
|
||||||
REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url)
|
|
||||||
|
|
||||||
CURR_HEAD := $(firstword $(shell git show-ref --hash HEAD | cut -b -6) master)
|
|
||||||
GITHUB_PROJ := nodeca/${NPM_PACKAGE}
|
|
||||||
|
|
||||||
|
|
||||||
help:
|
|
||||||
echo "make help - Print this help"
|
|
||||||
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"
|
|
||||||
|
|
||||||
|
|
||||||
lint:
|
|
||||||
./node_modules/.bin/eslint .
|
|
||||||
|
|
||||||
|
|
||||||
test: lint
|
|
||||||
./node_modules/.bin/mocha
|
|
||||||
|
|
||||||
cover:
|
|
||||||
rm -rf cover
|
|
||||||
./node_modules/.bin/istanbul cover node_modules/.bin/_mocha
|
|
||||||
|
|
||||||
doc:
|
|
||||||
rm -rf ./doc
|
|
||||||
./node_modules/.bin/ndoc --link-format "{package.homepage}/blob/${CURR_HEAD}/{file}#L{line}"
|
|
||||||
|
|
||||||
|
|
||||||
browserify:
|
|
||||||
rm -rf ./dist
|
|
||||||
mkdir dist
|
|
||||||
# Browserify
|
|
||||||
( printf %s "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \
|
|
||||||
./node_modules/.bin/browserify -r ./ -s pako \
|
|
||||||
) > dist/pako.js
|
|
||||||
( printf %s "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \
|
|
||||||
./node_modules/.bin/browserify -r ./lib/deflate.js -s pako \
|
|
||||||
) > dist/pako_deflate.js
|
|
||||||
( printf %s "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" ; \
|
|
||||||
./node_modules/.bin/browserify -r ./lib/inflate.js -s pako \
|
|
||||||
) > dist/pako_inflate.js
|
|
||||||
# Minify
|
|
||||||
./node_modules/.bin/uglifyjs dist/pako.js -c -m \
|
|
||||||
--preamble "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" \
|
|
||||||
> dist/pako.min.js
|
|
||||||
./node_modules/.bin/uglifyjs dist/pako_deflate.js -c -m \
|
|
||||||
--preamble "/* ${NPM_PACKAGE} ${NPM_VERSION} ${GITHUB_PROJ} */" \
|
|
||||||
> dist/pako_deflate.min.js
|
|
||||||
./node_modules/.bin/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
|
|
||||||
|
|
||||||
|
|
||||||
gh-pages:
|
|
||||||
@if test -z ${REMOTE_REPO} ; then \
|
|
||||||
echo 'Remote repo URL not found' >&2 ; \
|
|
||||||
exit 128 ; \
|
|
||||||
fi
|
|
||||||
$(MAKE) doc && \
|
|
||||||
cp -r ./doc ${TMP_PATH} && \
|
|
||||||
touch ${TMP_PATH}/.nojekyll
|
|
||||||
cd ${TMP_PATH} && \
|
|
||||||
git init && \
|
|
||||||
git add . && \
|
|
||||||
git commit -q -m 'Recreated docs'
|
|
||||||
cd ${TMP_PATH} && \
|
|
||||||
git remote add remote ${REMOTE_REPO} && \
|
|
||||||
git push --force remote +master:gh-pages
|
|
||||||
rm -rf ${TMP_PATH}
|
|
||||||
|
|
||||||
|
|
||||||
publish:
|
|
||||||
@if test 0 -ne `git status --porcelain | wc -l` ; then \
|
|
||||||
echo "Unclean working tree. Commit or stash changes first." >&2 ; \
|
|
||||||
exit 128 ; \
|
|
||||||
fi
|
|
||||||
@if test 0 -ne `git fetch ; git status | grep '^# Your branch' | wc -l` ; then \
|
|
||||||
echo "Local/Remote history differs. Please push/pull changes." >&2 ; \
|
|
||||||
exit 128 ; \
|
|
||||||
fi
|
|
||||||
@if test 0 -ne `git tag -l ${NPM_VERSION} | wc -l` ; then \
|
|
||||||
echo "Tag ${NPM_VERSION} exists. Update package.json" >&2 ; \
|
|
||||||
exit 128 ; \
|
|
||||||
fi
|
|
||||||
git tag ${NPM_VERSION} && git push origin ${NPM_VERSION}
|
|
||||||
npm publish https://github.com/${GITHUB_PROJ}/tarball/${NPM_VERSION}
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: publish lint doc
|
|
||||||
.SILENT: help lint
|
|
Loading…
Add table
Reference in a new issue