noredink-ui/Makefile

52 lines
1.3 KiB
Makefile
Raw Normal View History

NPM_PREFIX=$(realpath .)/node_modules
2018-10-04 12:24:00 +03:00
PATH:="${NPM_PREFIX}/.bin:${PATH}"
SHELL:=env PATH=${PATH} /bin/sh
2018-03-28 06:03:45 +03:00
.PHONY: test
2018-12-08 01:45:08 +03:00
test: node_modules
2018-03-28 06:03:45 +03:00
elm-test
2018-03-28 06:00:47 +03:00
.PHONY: checks
checks:
scripts/check-exposed.py
2018-03-28 06:00:47 +03:00
.PHONY: diff
2018-12-08 01:46:43 +03:00
diff: node_modules
if (elm diff | tee /dev/stderr | grep -q MAJOR); then echo "MAJOR changes are not allowed!"; exit 1; fi
2018-03-28 06:00:47 +03:00
.PHONY: format
format: node_modules
elm-format --validate src && elm-format --validate --elm-version=0.19 tests styleguide-app
2018-03-28 06:00:47 +03:00
.PHONY: clean
clean:
2018-12-13 21:32:19 +03:00
rm -rf node_modules styleguide-app/elm.js styleguide-app/bundle.js $(shell find . -type d -name 'elm-stuff')
.PHONY: styleguide-app
styleguide-app: styleguide-app/elm.js
@echo "Visit http://localhost:8000/index.html to see the styleguide app in your browser"
cd styleguide-app && elm reactor
2018-05-17 16:59:35 +03:00
documentation.json: node_modules
elm make --docs $@
2018-05-17 16:59:35 +03:00
2018-12-13 21:32:19 +03:00
styleguide-app/bundle.js: lib/index.js node_modules
npx browserify --entry styleguide-app/manifest.js --outfile styleguide-app/bundle.js
2018-12-13 21:32:19 +03:00
styleguide-app/elm.js: styleguide-app/bundle.js $(shell find src styleguide-app -type f -name '*.elm')
cd styleguide-app; elm make Main.elm --output=$(@F)
2018-03-28 01:00:46 +03:00
# plumbing
node_modules: package.json
npm install
touch -m $@
2018-03-28 06:03:45 +03:00
# special targets for travis, but anyone can use them, really.
.PHONY: setup
setup: node_modules
2018-03-28 06:03:45 +03:00
.PHONY: ci
ci: checks test format documentation.json diff styleguide-app/elm.js