-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (40 loc) · 1.35 KB
/
Makefile
File metadata and controls
52 lines (40 loc) · 1.35 KB
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
SRC := tcpie.js
DST := dist/tcpie.js
node_modules: pnpm-lock.yaml
pnpm install
@touch node_modules
.PHONY: deps
deps: node_modules
.PHONY: lint
lint: node_modules
pnpm exec eslint-silverwind --color --quiet .
.PHONY: lint-fix
lint-fix: node_modules
pnpm exec eslint-silverwind --color --quiet . --fix
.PHONY: test
test: lint build node_modules
pnpm exec vitest
.PHONY: build
build: $(DST)
$(DST): $(SRC) node_modules
# workaround for https://github.com/evanw/esbuild/issues/1921
pnpm exec esbuild --log-level=warning --platform=node --target=node16 --format=esm --bundle --minify --legal-comments=none --banner:js="import {createRequire} from 'module';const require = createRequire(import.meta.url);" --define:import.meta.VERSION=\"$(shell jq .version package.json)\" --outfile=$(DST) $(SRC)
chmod +x $(DST)
.PHONY: publish
publish: node_modules
pnpm publish --no-git-checks
.PHONY: update
update: node_modules
pnpm exec updates -cu
rm -rf node_modules pnpm-lock.yaml
pnpm install
@touch node_modules
.PHONY: patch
patch: node_modules test
pnpm exec versions -R -c 'make --no-print-directory build' patch package.json
.PHONY: minor
minor: node_modules test
pnpm exec versions -R -c 'make --no-print-directory build' minor package.json
.PHONY: major
major: node_modules test
pnpm exec versions -R -c 'make --no-print-directory build' major package.json