-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
65 lines (49 loc) · 1.49 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
63
64
65
.PHONY: app-template-dev
app-template-dev: setup
cd app-template && bun run dev
.PHONY: dev
dev: app-template-dev
.PHONY: app-template-build
app-template-build: setup
cd app-template && bun run build
.PHONY: app-template/node_modules
app-template/node_modules:
# TODO: the `rm -rf ./bun.lock ./bun.lockb` is a workaround for https://github.com/oven-sh/bun/issues/16965
cd app-template && bun install --no-save && rm -f ./bun.lock ./bun.lockb
.PHONY: setup
setup: app-template/node_modules
bun install --no--save
.PHONY: build
build: app-template-build
.PHONY: app-template-clean
app-template-clean:
cd app-template && bun run clean
.PHONY: clean
clean: app-template-clean
rm -rf ./.test/ ./dist/ ./app-template/node_modules/
.PHONY: reset
reset: clean
rm -rf ./node_modules/
.PHONY: auto-publish
auto-publish: setup
bun run ./script/auto-publish.ts
.PHONY: publish
publish: setup
npm publish --globalconfig=$HOME/.config/npm/cubing-publish.npmrc
.PHONY: prepublishOnly
prepublishOnly: clean test
.PHONY: test
test: build test-create-and-build
.PHONY: lint
lint: setup
npx @biomejs/biome check
.PHONY: format
format: setup
npx @biomejs/biome check --write
TEST_CREATE_AND_BUILD_FOLDER = ./.test/create-and-build
.PHONY: test-create-and-build
test-create-and-build:
mkdir -p ${TEST_CREATE_AND_BUILD_FOLDER}
node bin/create-cubing-app ${TEST_CREATE_AND_BUILD_FOLDER}/my-cubing-project
cd ${TEST_CREATE_AND_BUILD_FOLDER}/my-cubing-project && npm run build
rm -rf ${TEST_CREATE_AND_BUILD_FOLDER}