aboutsummaryrefslogtreecommitdiff
path: root/static/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'static/Makefile')
-rw-r--r--static/Makefile30
1 files changed, 21 insertions, 9 deletions
diff --git a/static/Makefile b/static/Makefile
index 2f715f7e..00401503 100644
--- a/static/Makefile
+++ b/static/Makefile
@@ -1,29 +1,30 @@
-.PHONY: all install clean watch watch-esbuild
+.PHONY: all install clean watch watch-esbuild doc
-TARGETS := style.css smallcal.css script.js directory-listing.css
+_TARGETS := style.css smallcal.css script.js directory-listing.css
+TARGETS = $(addprefix out/,$(_TARGETS))
WATCH=
-TS_FILES = $(shell find . -type f -name \*.ts -not -path */node_modules/*)
-JS_FILES = $(TS_FILES:%.ts=%.js)
+TS_FILES = $(shell find ts -type f -name \*.ts)
+JS_FILES = $(TS_FILES:ts/%.ts=out/%.js)
ESBUILD_LOGLEVEL=warning
# Variable for adding extra flags
ESBUILD_FLAGS =
# Used flags
__ESBUILD_FLAGS = --log-level=$(ESBUILD_LOGLEVEL) \
- --sourcemap --bundle --outdir=$(CURDIR) \
+ --sourcemap --bundle --outdir=$(CURDIR)/out \
$(ESBUILD_FLAGS)
-export PATH := $(shell npm bin):$(PATH)
+export PATH := $(CURDIR)/node_modules/.bin/:$(PATH)
all: $(TARGETS)
# script explicitly named, since that is our entry point
-script.js: script.ts $(TS_FILES)
+out/script.js: ts/script.ts $(TS_FILES)
esbuild $< $(__ESBUILD_FLAGS)
watch-esbuild:
- $(MAKE) ESBUILD_FLAGS+='--watch' ESBUILD_LOGLEVEL=info -B script.js
+ $(MAKE) ESBUILD_FLAGS+='--watch' ESBUILD_LOGLEVEL=info -B out/script.js
deps.svg: $(TS_FILES)
madge --image $@ $^
@@ -38,5 +39,16 @@ install: all
clean:
-rm $(TARGETS)
-%.css: %.scss
+out/%.css: scss/%.scss
scss -E UTF-8 $(WATCH) -I. $< $@
+
+# The grep expression is to supress irrelevant warning messages.
+# - __type since the extensions to base classes propagate to many
+# events, but typedoc only documents them if in the entry point
+# - [.]# since it's sometimes sensible to not document
+# implementation details.
+# - connectedCallback, attributeChangedCallabck: These are part
+# of the standard API for Web Components, and usually have nothing
+# interesting to note.
+doc:
+ typedoc --excludeExternals |& grep -vE '(__type|[.]#|connectedCallback|attributeChangedCallback)'