-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (46 loc) · 1.3 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
GEN_DIR := ./.gen
TARGET_DIR := src/generated
OPENAPI_SPEC_URL := https://api.corbado.com/docs/api/openapi/backend_api_public.yml
OPENAPI_IMAGE := openapitools/openapi-generator-cli
SOURCE_FILES := $(shell find src/ -type f -name '*.ts')
.PHONY:all
all: build
.PHONY:build
build: cjs/build esm/build
.PHONY:lint
lint:
npx eslint --quiet 'src/**/*.ts' 'tests/**/*.ts'
.PHONY:lint-fix
lint-fix: fix
.PHONY:fix
fix:
npx eslint --quiet 'src/**/*.ts' 'tests/**/*.ts' --fix
.PHONY:watch
watch:
npx tsc --watch
.PHONY:start
start: build
.PHONY: openapi_generate
openapi_generate:
npx @openapitools/openapi-generator-cli generate -i src/specs/backend_api_public_v2.yml -g typescript-axios -o src/generated --additional-properties=invokerPackage=Corbado\\Generated
.PHONY:clean
clean:
rm -rf esm cjs $(TARGET_DIR)
.PHONY: test
test:
@npx jest --coverage
.PHONY: unittests
unittests:
@npx jest --coverage "/tests/unit"
.PHONY: cjs/build
cjs/build: $(SOURCE_FILES)
npx tsc -p tsconfig.cjs.json
echo '{"type": "commonjs"}' > cjs/package.json
@# Creating a small file to keep track of the last build time
touch cjs/build
.PHONY: esm/build
esm/build: $(SOURCE_FILES)
npx tsc -p tsconfig.esm.json
echo '{"type": "module"}' > esm/package.json
@# Creating a small file to keep track of the last build time
touch esm/build