-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (34 loc) · 1.04 KB
/
Makefile
File metadata and controls
45 lines (34 loc) · 1.04 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
test:
@env TZ=Asia/Singapore pnpm vitest run
.PHONY: test
test-watch:
@env TZ=Asia/Singapore pnpm vitest
test-node:
./scripts/test/node.sh
types:
@pnpm tsc --noEmit
types-watch:
@pnpm tsc --noEmit --watch
test-types: build
@cd lib && pnpm pack --out ../tmp/lib.tgz
@pnpm attw tmp/lib.tgz
build: prepare-build
@pnpm tsc -p tsconfig.lib.json
@env BABEL_ENV=esm pnpm babel src --config-file ./babel.config.json --source-root src --out-dir lib --extensions .js,.ts --out-file-extension .js --quiet
@env BABEL_ENV=cjs pnpm babel src --config-file ./babel.config.json --source-root src --out-dir lib --extensions .js,.ts --out-file-extension .cjs --quiet
@node copy.mjs
@make build-cts
build-cts:
@find lib -name '*.d.ts' | while read file; do \
new_file=$${file%.d.ts}.d.cts; \
sed 's/\.js"/\.cjs"/g; s/\.ts"/\.cts"/g' $$file > $$new_file; \
done
prepare-build:
@rm -rf lib
@mkdir -p lib
publish: build
cd lib && pnpm publish --access public
publish-next: build
cd lib && pnpm publish --access public --tag next
link:
@cd lib && pnpm link