-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (43 loc) · 1.01 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
.PHONY: install check fix
install: node_modules bun.lock
node_modules: package.json
bun i --frozen-lockfile
bun.lock: package.json
bun update
check: install
bun check
fix: install
bun fix
.PHONY: npm jsr build dist
deno.lock: package.json deno.json
deno install --allow-scripts
npm: check
bun run build
jsr: deno.lock
deno task build
build: npm jsr
dist: build
deno task fix
deno task check
.PHONY: test
IS_CI ?= $(CI)
TEST_CMD = test
PACKAGE_MANAGERS = npm bun deno
FOUND_PM = $(shell which $(firstword $(filter-out $(wildcard /usr/bin/false),$(foreach pm,$(PACKAGE_MANAGERS),$(shell which $(pm) || echo false)))) 2>/dev/null)
test: npm
ifeq ($(IS_CI),true)
npm run $(TEST_CMD)
else
@for pm in $(PACKAGE_MANAGERS); do \
if command -v $$pm >/dev/null 2>&1; then \
echo "Running tests with $$pm..."; \
$$pm run $(TEST_CMD); \
fi; \
done; \
echo "No package manager found!" && exit 1
endif
.PHONY: publish release
publish: dist test
bunx pkg-pr-new publish
release: dist test
bun release