2018-03-28 06:07:51 +03:00
|
|
|
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 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-03-28 06:03:45 +03:00
|
|
|
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-05 01:36:15 +03:00
|
|
|
if (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-05 01:36:15 +03:00
|
|
|
elm-format --validate src && 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"
|
|
|
|
cd styleguide-app && elm reactor
|
|
|
|
|
2018-05-17 16:59:35 +03:00
|
|
|
documentation.json: node_modules
|
2018-12-05 01:36:15 +03:00
|
|
|
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-05 01:36:15 +03:00
|
|
|
cd styleguide-app; 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
|