2018-10-04 12:24:00 +03:00
|
|
|
SHELL:=env PATH=${PATH} /bin/sh
|
2018-03-28 00:58:12 +03:00
|
|
|
|
2018-03-28 06:03:45 +03:00
|
|
|
.PHONY: test
|
2018-12-08 01:45:08 +03:00
|
|
|
test: node_modules
|
2018-12-19 01:46:32 +03:00
|
|
|
npx elm-test
|
2018-03-28 06:00:47 +03:00
|
|
|
|
2018-10-25 10:13:29 +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
|
2018-12-19 01:46:32 +03:00
|
|
|
if (npx elm diff | tee /dev/stderr | grep -q MAJOR); then echo "MAJOR changes are not allowed!"; exit 1; fi
|
2018-03-28 00:58:12 +03:00
|
|
|
|
2018-03-28 06:00:47 +03:00
|
|
|
.PHONY: format
|
|
|
|
format: node_modules
|
2018-12-19 01:46:32 +03:00
|
|
|
npx elm-format --validate src && npx elm-format --validate --elm-version=0.19 tests styleguide-app
|
2018-03-28 06:00:47 +03:00
|
|
|
|
|
|
|
.PHONY: clean
|
2018-03-28 00:58:12 +03:00
|
|
|
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')
|
2018-03-28 00:58:12 +03:00
|
|
|
|
2018-12-08 01:55:15 +03:00
|
|
|
.PHONY: styleguide-app
|
|
|
|
styleguide-app: styleguide-app/elm.js
|
|
|
|
@echo "Visit http://localhost:8000/index.html to see the styleguide app in your browser"
|
2018-12-19 01:46:32 +03:00
|
|
|
cd styleguide-app && npx elm reactor
|
2018-12-08 01:55:15 +03:00
|
|
|
|
2018-05-17 16:59:35 +03:00
|
|
|
documentation.json: node_modules
|
2018-12-19 01:46:32 +03:00
|
|
|
npx 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-06-11 21:08:49 +03:00
|
|
|
|
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')
|
2018-12-19 01:46:32 +03:00
|
|
|
cd styleguide-app; npx elm make Main.elm --output=$(@F)
|
2018-03-28 01:00:46 +03:00
|
|
|
|
2018-03-28 00:58:12 +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
|
2018-12-05 01:36:15 +03:00
|
|
|
setup: node_modules
|
2018-03-28 06:03:45 +03:00
|
|
|
|
|
|
|
.PHONY: ci
|
2018-10-25 10:13:29 +03:00
|
|
|
ci: checks test format documentation.json diff styleguide-app/elm.js
|