-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmise.toml
More file actions
137 lines (107 loc) · 3.62 KB
/
Copy pathmise.toml
File metadata and controls
137 lines (107 loc) · 3.62 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
[tools]
bun = "latest"
go = "latest"
"aqua:golangci/golangci-lint" = "latest"
[tasks."install"]
description = "Install all dependencies"
run = "mise run install:server; mise run install:frontend"
[tasks."install:server"]
description = "Install server dependencies"
run = "mise exec -- go mod download"
[tasks."install:frontend"]
description = "Install frontend dependencies"
run = '''
if [ "${GITHUB_ACTIONS}" = "true" ]; then
mise exec -- bun install --frozen-lockfile;
else
mise exec -- bun install;
fi
'''
[tasks."clean"]
description = "Clean project environment"
run = "mise exec -- go clean; mise run clean:server; mise run clean:frontend"
[tasks."clean:server"]
description = "Clean Go artifacts"
run = "mise exec -- bun exec 'rm -f ./dist/server*'"
[tasks."clean:frontend"]
description = "Clean frontend artifacts"
run = "mise exec -- bun exec 'rm -rf ./dist/frontend/ ./node_modules/'"
[tasks."clean:git"]
description = "Clean git (careful)"
run = "mise run clean:git:untracked; mise run clean:git:gc; mise run clean:git:hooks"
[tasks."clean:git:gc"]
run = "git gc --aggressive --prune"
[tasks."clean:git:hooks"]
run = "mise exec -- bun exec 'rm -rf ./.git/hooks/'"
[tasks."clean:git:untracked"]
run = "git clean -d -x -i"
[tasks."build"]
description = "Build"
run = "mise run build:frontend:compress; mise run build:server"
[tasks."build:frontend"]
description = "Build frontend"
depends = ["install:frontend"]
run = "mise exec -- bun vite build; mise run x:script:minify"
[tasks."build:frontend:compress"]
description = "Build frontend (with compression)"
run = "mise run build:frontend; mise run x:script:compress"
[tasks."build:server"]
description = "Build server binary (requires built frontend)"
run = '''
mise exec -- bun exec "mkdir -p ./dist/"
if [ "${GOOS}" = "windows" ]; then
mise exec -- go build -ldflags="-w -s" -trimpath -o ./dist/server.exe .
else
mise exec -- go build -ldflags="-w -s" -trimpath -o ./dist/server .
fi
'''
[tasks."analyze"]
description = "Analyze frontend bundle"
depends = ["install:frontend"]
env.VITE_ANALYZE = "true"
run = "mise exec -- bun vite build"
[tasks."lint"]
description = "Run all linters"
run = "mise run lint:server; mise run lint:frontend"
[tasks."lint:server"]
description = "Run server linters"
run = "mise exec -- golangci-lint run"
[tasks."lint:frontend"]
description = "Run frontend linters"
depends = ["install:frontend"]
run = "mise exec -- bun biome check; mise exec -- bun tsc --noEmit"
[tasks."fix"]
description = "Run all formatters"
run = "mise run fix:server; mise run fix:frontend"
[tasks."fix:server"]
description = "Run server formatters"
run = "mise exec -- go fmt ."
[tasks."fix:frontend"]
description = "Run frontend formatters"
depends = ["install:frontend"]
run = "mise exec -- bun biome check --write; mise exec -- bun sort-package-json --quiet"
[tasks."tidy"]
description = "Tidy all"
run = "mise run tidy:server; mise run tidy:frontend"
[tasks."tidy:server"]
description = "Tidy server dependencies"
run = "mise exec -- go mod tidy"
[tasks."tidy:frontend"]
description = "Tidy frontend dependencies"
run = "mise exec -- bun exec 'rm -f bun.lock'; mise exec -- bun install -f"
[tasks."start"]
description = "Start frontend"
run = "mise run build:frontend:compress; mise run start:server"
[tasks."start:server"]
description = "Start dedicated server (requires built frontend)"
run = "mise exec -- go run ."
[tasks."start:dev"]
description = "Start in HMR"
depends = ["install:frontend"]
run = "mise exec -- bun vite dev"
[tasks."x:script:minify"]
hide = true
run = "mise exec -- go run ./scripts/minify"
[tasks."x:script:compress"]
hide = true
run = "mise exec -- go run ./scripts/compress"