default: build

.PHONY: lint clear compile bundle deploy build doc

build: clear compile bundle deploy

install:
	sudo npm install tnpm -g --registry=http://registry.npm.alibaba-inc.com
	sudo tnpm install -g grunt-cli bower webpack
	tnpm install

lint:
	node_modules/.bin/eslint src/

clear:
	rm -fr lib

compile:
	NODE_ENV=production node_modules/.bin/babel src --out-dir lib

bundle:
	NODE_ENV=production node_modules/.bin/webpack --config webpack.config.js

deploy:
	cp dist/cuz.js docs/js/cuz.js
	cp node_modules/cuz-ui/lib/components/index.css dist/cuz.css
	cp node_modules/cuz-ui/lib/components/index.css docs/css/cuz.css

doc:
	bundle exec rake
	jekyll server -s ./docs -d ./docs/_site
