-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (37 loc) · 1.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
CSS := $(shell find src -type f -name '*.css' ! -name '*.min.css')
MIN_CSS := $(patsubst %.css, %.min.css, $(CSS))
TS := $(shell find src -type f -name '*.ts' ! -name '*.d.ts')
JS := $(patsubst %.ts, %.js, $(TS))
MIN_JS := $(patsubst %.js, %.min.js, $(JS))
.PHONY: all
all: dist/index.html dist/library/index.html
.PHONY: clean
clean:
$(RM) dist/index.html
$(RM) -r dist/library
.PHONY: cleanall
cleanall: clean
$(RM) $(MIN_CSS)
$(RM) $(JS)
$(RM) $(MIN_JS)
.PHONY: dist
dist: all
./bin/publish
.PHONY: deploy
deploy:
git -C dist push
.PHONY: test
test: $(MIN_JS)
yarn run tiddlywiki test/
dist/index.html: $(MIN_CSS) $(MIN_JS)
yarn run tiddlywiki --version
yarn run tiddlywiki doc/ --output dist/ --verbose --build index
dist/library/index.html: dist/index.html
TIDDLYWIKI_PLUGIN_PATH=doc/ yarn run tiddlywiki doc/ --output dist/library --verbose --build library
README.md: doc/tiddlers/systems/README.tid
TIDDLYWIKI_PLUGIN_PATH=doc/ yarn run tiddlywiki doc/ --output . --verbose --build README
%.min.css: %.css
yarn run tailwindcss --input $< --output $@ --minify --content "$(shell echo $< | cut -d/ -f1-3 | sed 's|$$|/**/*.tid|')"
%.min.js: %.ts
yarn run tsc
terser $*.js -o $@