2022-11-30 15:09:48 +03:00
|
|
|
DENO := deno
|
|
|
|
COV := $(DENO) coverage cov_profile
|
|
|
|
FMT := $(DENO) fmt *.ts examples/*.ts
|
|
|
|
NPM_PUB := npm publish
|
|
|
|
|
2023-02-17 00:55:25 +03:00
|
|
|
D2 := wd2
|
2022-11-30 15:09:48 +03:00
|
|
|
DIAGRAMS := \
|
2022-11-30 16:50:16 +03:00
|
|
|
turnstile \
|
|
|
|
project
|
2022-11-30 15:09:48 +03:00
|
|
|
|
|
|
|
dev: fmt tests cov
|
|
|
|
|
|
|
|
ci: fmt-check tests-cov
|
|
|
|
|
|
|
|
tests: clean
|
|
|
|
$(DENO) test --coverage=cov_profile *.test.ts
|
|
|
|
|
|
|
|
tests-cov: tests
|
|
|
|
$(COV) --lcov > cov_profile/cov.lcov
|
|
|
|
|
|
|
|
cov:
|
|
|
|
$(COV)
|
|
|
|
|
|
|
|
fmt:
|
|
|
|
$(FMT)
|
|
|
|
|
|
|
|
fmt-check:
|
|
|
|
$(FMT) --check
|
|
|
|
|
|
|
|
build: clean | $(DIAGRAMS)
|
|
|
|
tsc && tsc -p tsconfig.cjs.json
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo clean test coverage data
|
|
|
|
rm -rf cov_profile
|
|
|
|
@echo clean build target
|
|
|
|
rm -rf dist
|
|
|
|
@echo clean diagrams
|
|
|
|
rm -rf assets/*.svg
|
|
|
|
|
|
|
|
define d2rule
|
2022-11-30 16:22:16 +03:00
|
|
|
$(1)_args := $(D2) $$($(1)_theme_args) assets/$(1).d2 assets/$(1).svg
|
2022-11-30 15:09:48 +03:00
|
|
|
|
|
|
|
$(1): ; $$($(1)_args)
|
|
|
|
$(1)-w: ; $$($(1)_args) -w
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach d2name,$(DIAGRAMS),$(eval $(call d2rule,$(d2name))))
|
|
|
|
|
|
|
|
dry-pub:
|
|
|
|
$(NPM_PUB) --dry-run
|
|
|
|
|
|
|
|
pub:
|
|
|
|
$(NPM_PUB)
|
|
|
|
|
|
|
|
help:
|
|
|
|
cat Makefile
|
|
|
|
|