Skip to content

Commit 97fae09

Browse files
committed
chore: extracted make target into own files
1 parent 086f8c2 commit 97fae09

File tree

3 files changed

+118
-117
lines changed

3 files changed

+118
-117
lines changed

Makefile

Lines changed: 2 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include makefiles/*.mk
2+
13
.PHONY: all
24
all: test lint typecheck
35

@@ -40,120 +42,3 @@ test/fetch-api/api.spec.js: test/fetch-api/api.spec.ts
4042
@echo ""
4143
@echo "=> make $@"
4244
@npx tsc
43-
44-
45-
##
46-
# Checks
47-
48-
.PHONY: commitlint
49-
commitlint: node_modules
50-
npx commitlint --from origin/main --to HEAD --verbose
51-
52-
.PHONY: cov
53-
cov:
54-
npx nyc report --reporter=text-lcov > .reports/coverage.lcov && npx codecov
55-
56-
.PHONY: lint
57-
lint:
58-
@echo ""
59-
@echo "=> make $@"
60-
@npx standard
61-
62-
.PHONY: secure
63-
secure:
64-
@echo ""
65-
@echo "=> make $@"
66-
@npx snyk test
67-
68-
.PHONY: typecheck
69-
typecheck:
70-
@echo ""
71-
@echo "=> make $@"
72-
@npx tsc --lib ES6 --noEmit index.d.ts ./test/fetch-api/api.spec.ts
73-
74-
75-
##
76-
# Test groups
77-
78-
.PHONY: test
79-
test: | test-browser test-node
80-
81-
.PHONY: test-browser
82-
test-browser: |\
83-
test-fetch-browser-native \
84-
test-fetch-browser-whatwg \
85-
test-fetch-browser-service-worker \
86-
test-module-web-cjs \
87-
test-module-web-esm \
88-
test-module-react-native
89-
90-
.PHONY: test-node
91-
test-node: |\
92-
test-fetch-node-native \
93-
test-fetch-node-fetch \
94-
test-module-node-cjs \
95-
test-module-node-esm
96-
97-
98-
##
99-
# Test units
100-
101-
.PHONY: test-fetch-browser-native
102-
test-fetch-browser-native: | dist test/fetch-api/api.spec.js
103-
@echo ""
104-
@echo "=> make $@"
105-
@./test/fetch-api/browser/run.sh
106-
107-
.PHONY: test-fetch-browser-whatwg
108-
test-fetch-browser-whatwg: | dist test/fetch-api/api.spec.js
109-
@echo ""
110-
@echo "=> make $@"
111-
@./test/fetch-api/whatwg/run.sh
112-
113-
.PHONY: test-fetch-browser-service-worker
114-
test-fetch-browser-service-worker: dist test/fetch-api/api.spec.js
115-
@echo ""
116-
@echo "=> make $@"
117-
@./test/fetch-api/service-worker/run.sh
118-
119-
.PHONY: test-fetch-node-native
120-
test-fetch-node-native: | dist test/fetch-api/api.spec.js
121-
@echo ""
122-
@echo "=> make $@"
123-
@./test/fetch-api/node/run.sh
124-
125-
.PHONY: test-fetch-node-fetch
126-
test-fetch-node-fetch: | dist test/fetch-api/api.spec.js
127-
@echo ""
128-
@echo "=> make $@"
129-
@./test/fetch-api/node-fetch/run.sh
130-
131-
.PHONY: test-module-web-cjs
132-
test-module-web-cjs: | dist
133-
@echo ""
134-
@echo "=> make $@"
135-
@./test/module-system/web.cjs/run.sh
136-
137-
.PHONY: test-module-web-esm
138-
test-module-web-esm: | dist
139-
@echo ""
140-
@echo "=> make $@"
141-
@./test/module-system/web.esm/run.sh
142-
143-
.PHONY: test-module-node-cjs
144-
test-module-node-cjs: | dist
145-
@echo ""
146-
@echo "=> make $@"
147-
@./test/module-system/node.cjs/run.sh
148-
149-
.PHONY: test-module-node-esm
150-
test-module-node-esm: | dist
151-
@echo ""
152-
@echo "=> make $@"
153-
@./test/module-system/node.esm/run.sh
154-
155-
.PHONY: test-module-react-native
156-
test-module-react-native: | dist
157-
@echo ""
158-
@echo "=> make $@"
159-
@./test/module-system/react-native/run.sh

makefiles/checks.mk

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
##
3+
# Checks
4+
5+
.PHONY: commitlint
6+
commitlint: node_modules
7+
npx commitlint --from origin/main --to HEAD --verbose
8+
9+
.PHONY: cov
10+
cov:
11+
npx nyc report --reporter=text-lcov > .reports/coverage.lcov && npx codecov
12+
13+
.PHONY: lint
14+
lint:
15+
@echo ""
16+
@echo "=> make $@"
17+
@npx standard
18+
19+
.PHONY: secure
20+
secure:
21+
@echo ""
22+
@echo "=> make $@"
23+
@npx snyk test
24+
25+
.PHONY: typecheck
26+
typecheck:
27+
@echo ""
28+
@echo "=> make $@"
29+
@npx tsc --lib ES6 --noEmit index.d.ts ./test/fetch-api/api.spec.ts
30+

makefiles/test.mk

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
2+
##
3+
# Test groups
4+
5+
.PHONY: test
6+
test: | test-browser test-node
7+
8+
.PHONY: test-browser
9+
test-browser: |\
10+
test-fetch-browser-native \
11+
test-fetch-browser-whatwg \
12+
test-fetch-browser-service-worker \
13+
test-module-web-cjs \
14+
test-module-web-esm \
15+
test-module-react-native
16+
17+
.PHONY: test-node
18+
test-node: |\
19+
test-fetch-node-native \
20+
test-fetch-node-fetch \
21+
test-module-node-cjs \
22+
test-module-node-esm
23+
24+
25+
##
26+
# Test units
27+
28+
.PHONY: test-fetch-browser-native
29+
test-fetch-browser-native: | dist test/fetch-api/api.spec.js
30+
@echo ""
31+
@echo "=> make $@"
32+
@./test/fetch-api/browser/run.sh
33+
34+
.PHONY: test-fetch-browser-whatwg
35+
test-fetch-browser-whatwg: | dist test/fetch-api/api.spec.js
36+
@echo ""
37+
@echo "=> make $@"
38+
@./test/fetch-api/whatwg/run.sh
39+
40+
.PHONY: test-fetch-browser-service-worker
41+
test-fetch-browser-service-worker: dist test/fetch-api/api.spec.js
42+
@echo ""
43+
@echo "=> make $@"
44+
@./test/fetch-api/service-worker/run.sh
45+
46+
.PHONY: test-fetch-node-native
47+
test-fetch-node-native: | dist test/fetch-api/api.spec.js
48+
@echo ""
49+
@echo "=> make $@"
50+
@./test/fetch-api/node/run.sh
51+
52+
.PHONY: test-fetch-node-fetch
53+
test-fetch-node-fetch: | dist test/fetch-api/api.spec.js
54+
@echo ""
55+
@echo "=> make $@"
56+
@./test/fetch-api/node-fetch/run.sh
57+
58+
.PHONY: test-module-web-cjs
59+
test-module-web-cjs: | dist
60+
@echo ""
61+
@echo "=> make $@"
62+
@./test/module-system/web.cjs/run.sh
63+
64+
.PHONY: test-module-web-esm
65+
test-module-web-esm: | dist
66+
@echo ""
67+
@echo "=> make $@"
68+
@./test/module-system/web.esm/run.sh
69+
70+
.PHONY: test-module-node-cjs
71+
test-module-node-cjs: | dist
72+
@echo ""
73+
@echo "=> make $@"
74+
@./test/module-system/node.cjs/run.sh
75+
76+
.PHONY: test-module-node-esm
77+
test-module-node-esm: | dist
78+
@echo ""
79+
@echo "=> make $@"
80+
@./test/module-system/node.esm/run.sh
81+
82+
.PHONY: test-module-react-native
83+
test-module-react-native: | dist
84+
@echo ""
85+
@echo "=> make $@"
86+
@./test/module-system/react-native/run.sh

0 commit comments

Comments
 (0)