-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
44 lines (34 loc) · 891 Bytes
/
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
RSC_LICENSE ?=
SHELL := bash
VERSION := $(shell node -e 'console.log(require("$(CURDIR)/package.json").version)')
npm-%:
npm run $*
.PHONY: all
all: up npm-lint lib/main.js npm-test
.PHONY: publish
publish: lib/main.js
npm publish
lib/main.js: $(wildcard src/*.ts) src/Version.ts
npm run build
src/Version.ts: package.json
@echo '// WARNING: this file is generated' | tee $@ &>/dev/null
@echo 'export const Version = "$(VERSION)"' | tee -a $@ &>/dev/null
.PHONY: clean
clean:
rm -rf lib/ src/Version.ts
.PHONY: distclean
distclean: clean
rm -rf .cache/
.PHONY: up
up: .require-license
docker compose port connect 3939 2>/dev/null | if ! grep -q ':23939$$'; then \
docker compose up -d --wait; \
fi
.PHONY: down
down:
docker compose down --remove-orphans
.PHONY: .require-license
.require-license:
ifndef RSC_LICENSE
$(error Missing required RSC_LICENSE env var)
endif