noredink-ui/Makefile

105 lines
3.6 KiB
Makefile
Raw Normal View History

2018-10-04 12:24:00 +03:00
SHELL:=env PATH=${PATH} /bin/sh
2019-12-06 05:58:17 +03:00
export DEPRECATED_MODULES=Html,Accessibility,Accessibility.Aria,Accessibility.Key,Accessibility.Landmark,Accessibility.Live,Accessibility.Role,Accessibility.Style,Accessibility.Widget
2018-03-28 06:03:45 +03:00
.PHONY: test
test: node_modules tests/elm-verify-examples.json
2020-03-31 23:03:11 +03:00
npx elm-verify-examples
npx elm-test
make axe-report
2019-11-15 14:17:24 +03:00
make percy-tests
2019-12-05 01:22:29 +03:00
make deprecated-imports-report
2018-03-28 06:00:47 +03:00
tests/elm-verify-examples.json: $(shell find src -name '*.elm') elm.json
jq --indent 4 '{ root: "../src", tests: .["exposed-modules"] }' elm.json > $@
2019-07-24 00:55:31 +03:00
tests/axe-report.json: public script/run-axe.sh script/axe-puppeteer.js
script/run-axe.sh > $@
.PHONY: axe-report
axe-report: tests/axe-report.json script/format-axe-report.sh script/axe-report.jq
script/format-axe-report.sh $<
2019-07-24 00:55:31 +03:00
2019-11-15 14:16:25 +03:00
.PHONY: percy-tests
percy-tests:
script/percy-tests.sh
tests/deprecated-imports-report.txt: $(shell find src tests -type f) script/deprecated-imports.py
2019-12-05 01:22:29 +03:00
script/deprecated-imports.py report > $@
script/deprecated-imports.csv: $(shell find src tests -type f) script/deprecated-imports.py
script/deprecated-imports.py --imports-file $@ update
2019-12-06 05:58:17 +03:00
2019-12-05 01:22:29 +03:00
.PHONY: deprecated-imports-report
deprecated-imports-report: tests/deprecated-imports-report.txt script/deprecated-imports.py
@cat tests/deprecated-imports-report.txt
2019-12-06 05:58:17 +03:00
@script/deprecated-imports.py --check-message-fix-command='make script/deprecated-imports.csv' check
2019-12-05 01:22:29 +03:00
.PHONY: checks
checks:
script/check-exposed.py
2018-03-28 06:00:47 +03:00
.PHONY: diff
2018-12-08 01:46:43 +03:00
diff: node_modules
true
# if (npx 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
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
clean:
2019-04-01 17:26:15 +03:00
rm -rf node_modules styleguide-app/elm.js styleguide-app/bundle.js $(shell find . -type d -name 'elm-stuff') public
.PHONY: styleguide-app
styleguide-app:
2019-04-02 23:53:48 +03:00
./script/develop.sh
2018-05-17 16:59:35 +03:00
documentation.json: node_modules
npx elm make --docs $@
2018-05-17 16:59:35 +03:00
2019-11-26 00:55:09 +03:00
styleguide-app/bundle.js: lib/index.js styleguide-app/manifest.js node_modules
2018-12-13 21:32:19 +03:00
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')
2019-07-19 15:34:39 +03:00
cd styleguide-app && npx elm make Main.elm --output=$(@F)
2018-03-28 01:00:46 +03:00
2019-04-01 17:26:15 +03:00
# for publishing styleguide
# We don't want to have to generate new rules for every single asset, so we find
# all the ones that exist (`STYLEGUIDE_ASSETS`) then replace the roots
# (`PUBLIC_ASSETS`). The `%` wildcard works like it does in `public/%` below.
STYLEGUIDE_ASSETS=$(shell find styleguide-app/assets -type f)
PUBLIC_ASSETS=$(STYLEGUIDE_ASSETS:styleguide-app/assets/%=public/assets/%)
public: public/index.html public/elm.js public/bundle.js $(PUBLIC_ASSETS)
touch -m $@
# wildcard rule: % on the left-hand side will be matched and replaced on the
# right-hand side. So `public/index.html` depends on `styleguide-app/index.html`
#
# - automatic variables: `$@` is the target (left-hand side of the rule.) `$<`
# is the first dependency.
# - about the leading `@` in `mkdir`: leading `@` turns off echoing the
# command. We're just reducing log spam here.
# - about `$(@D)`: $@ gets the target (left-hand side of the rule). Any
# automatic variable plus `D` gets the directory of that file, so `$(@D)` is
# the target's directory.
public/%: styleguide-app/%
@mkdir -p $(@D)
cp $< $@
# 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
2019-07-24 13:37:30 +03:00
ci: checks test format documentation.json diff styleguide-app/elm.js