-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 1.12 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
test:
@npx vitest run
test-watch:
@npx vitest
types:
@npx tsc --noEmit
types-watch:
@npx tsc --noEmit --watch
size:
@node ./size.mjs
size-watch:
@node ./size.mjs --watch
benchmark:
@bun ./benchmark.ts
test-types: install-attw build
@cd lib && attw --pack
build: prepare-build
@npx tsc -p tsconfig.lib.json
@env BABEL_ENV=esm npx babel src --config-file ./babel.config.lib.json --source-root src --out-dir lib --extensions .mjs,.ts --out-file-extension .mjs --quiet
@env BABEL_ENV=cjs npx babel src --config-file ./babel.config.lib.json --source-root src --out-dir lib --extensions .mjs,.ts --out-file-extension .js --quiet
@node copy.mjs
@rm -rf lib/types.*js
@make build-mts
@rm lib/types.d.mts
build-mts:
@find lib -name '*.d.ts' | while read file; do \
new_file=$${file%.d.ts}.d.mts; \
cp $$file $$new_file; \
done
prepare-build:
@rm -rf lib
@mkdir -p lib
publish: build
cd lib && npm publish --access public
publish-next: build
cd lib && npm publish --access public --tag next
link:
@cd lib && npm link
install-attw:
@if ! command -v attw >/dev/null 2>&1; then \
npm i -g @arethetypeswrong/cli; \
fi