-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 906 Bytes
/
Makefile
File metadata and controls
43 lines (32 loc) · 906 Bytes
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
NPM := pnpm
DATA := data
DIST := dist
API := src
API_URL := http://localhost:3000
VERSION := $(shell git describe --abbrev=0 --tags)
SDIST := sdist-$(VERSION).tar.gz
.PHONY: all clean sdist
all: $(DIST)
clean:
-rm -rf $(API) $(DIST) $(SDIST)
fullclean: clean
-rm -rf $(DATA)
sdist: $(SDIST)
node_modules: package.json pnpm-lock.yaml
$(NPM) install
$(DATA):
mkdir -p $@
$(DATA)/openapi.json: $(DATA)
wget $(API_URL)/-json -O $@
$(API): node_modules $(DATA)/openapi.json
TS_POST_PROCESS_FILE="prettier --write" pnpx @openapitools/openapi-generator-cli generate \
--skip-validate-spec \
--enable-post-process-file \
--additional-properties=supportsES6=true,typescriptThreePlus=true \
-i $(API_URL)/-json \
-g typescript-fetch \
-o $(API)
$(DIST): node_modules $(API)
pnpx tsc
$(SDIST): README.md LICENSE package.json tsconfig.json $(DATA) $(API) types
tar cvzf $@ $^