aboutsummaryrefslogtreecommitdiff
path: root/static/Makefile
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-20 22:09:57 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-20 22:09:57 +0100
commitd75ebbab2a414fe1a9a09d703a3bc7be782f1f1e (patch)
tree0de4f1c17afd6fbefbafc3a0a8a91bc85cb30355 /static/Makefile
parentDocument testrunner syntax. (diff)
parentDocumentation updates for util. (diff)
downloadcalp-d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e.tar.gz
calp-d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e.tar.xz
Merge Javascript rewrite.
Diffstat (limited to 'static/Makefile')
-rw-r--r--static/Makefile26
1 files changed, 24 insertions, 2 deletions
diff --git a/static/Makefile b/static/Makefile
index 821489bc..b85422a3 100644
--- a/static/Makefile
+++ b/static/Makefile
@@ -1,12 +1,34 @@
.PHONY: all clean watch
-TARGETS := style.css smallcal.css
+TARGETS := style.css smallcal.css script.out.js
WATCH=
+# script explicitly named, since that is our entry point
+TS_FILES = script.ts $(shell find . -type f -name \*.ts -not -path */node_modules/*)
+
+export PATH := $(shell npm bin):$(PATH)
+
all: $(TARGETS)
+%.map.json: %.out.js
+ tail -n1 $< | tail -c+65 | base64 --decode | jq '.' > $@
+
+# r!browserify --list script.ts -p tsify | xargs -L1 basename | tac
+script.out.js: $(TS_FILES)
+ browserify $< -p tsify --noImplicitAny --debug -o $@
+
+deps.svg: $(TS_FILES)
+ madge --image $@ $^
+
+# Note that 'tsc --watch' doesn't provide the files we are using. It's
+# just here for debug.
watch:
- $(MAKE) WATCH=--watch all
+ tmux \
+ new-session "scss --watch -I. style.scss:style.css" \; \
+ split-window "tsc --watch" \; \
+ rename-session "calp watch" \; \
+ select-layout even-vertical
+
clean:
rm $(TARGETS)