-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (48 loc) · 1.19 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
60
61
62
PACKAGE_VERSION=$(shell node -p -e "require('./package.json').version")
# override this when publishing with an alternative distribution, eg. rc | experimental | demo
NPM_TAG=latest
node_modules/:
npm install
.PHONY: ensure
ensure: node_modules/
.PHONY: test
test: ensure
npx vitest --run
.PHONY: test-watch
test-watch: ensure
npx vitest
.PHONY: update-version
update-version: ensure
bin/update-version.ts
.PHONY: sync-codegen
sync-codegen: ensure
bin/sync-codegen.ts
make update-version
make format-fix
.PHONY: format-check
format-check: ensure
npx prettier . --check
.PHONY: format-fix
format-fix: ensure
npx prettier . --write
.PHONY: build
build: ensure
npx tsup
.PHONY: build-watch
build-watch: ensure
npx tsup --watch
.PHONY: publish-preview
publish-preview: test build
npm publish --tag=${NPM_TAG} --dry-run
.PHONY: verify-publish
verify-publish:
@echo
@echo "🌀 Publishing to NPM"
@echo "Version: ${PACKAGE_VERSION}"
@echo "Distribution Tag: ${NPM_TAG}"
@echo "This will be live. Continue? [y/N] " && read ans && [ $${ans:-N} == y ]
.PHONY: publish
publish: verify-publish test build
npm login
npm publish --tag=${NPM_TAG}
git tag "v${PACKAGE_VERSION}" && git push --tags