-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathmise.toml
More file actions
138 lines (116 loc) · 3.61 KB
/
mise.toml
File metadata and controls
138 lines (116 loc) · 3.61 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
138
[tools]
go = "latest"
node = "latest"
pnpm = "latest"
svu = "latest"
watchexec = "latest"
[hooks]
postinstall = "npx corepack enable"
[tasks.setup]
description = "Set up the project (install all dependencies, generate code)"
depends = ["deps", "codegen"]
[tasks.deps]
description = "Install all dependencies"
run = { tasks = ["deps:backend", "deps:frontend"] }
[tasks."deps:backend"]
description = "Install backend dependencies"
run = "go mod download"
sources = ["go.mod", "go.sum"]
[tasks."deps:frontend"]
description = "Install frontend dependencies"
dir = "frontend"
run = "pnpm install"
sources = ["frontend/package.json", "frontend/pnpm-lock.yaml"]
[tasks.codegen]
run = ["go generate ./...", "cd frontend && pnpm codegen"]
[tasks.test]
depends = ["codegen", "test:e2e"]
run = "go test ./..."
[tasks."build:frontend"]
description = "Build the SvelteKit frontend"
dir = "frontend"
run = "pnpm build"
[tasks."build:embed"]
description = "Copy frontend build to embed directory"
depends = "build:frontend"
run = """
rm -rf internal/web/dist
mkdir -p internal/web/dist
cp -r frontend/build/* internal/web/dist/
touch internal/web/dist/.gitkeep
"""
[tasks.build]
depends = ["codegen", "build:embed"]
run = """
LDFLAGS="\
-X github.com/hmans/beans/internal/version.Version=$(git describe --tags --always --dirty 2>/dev/null || echo dev) \
-X github.com/hmans/beans/internal/version.Commit=$(git rev-parse --short HEAD 2>/dev/null || echo unknown) \
-X github.com/hmans/beans/internal/version.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ)"
go build -ldflags "$LDFLAGS" -o beans ./cmd/beans
go build -ldflags "$LDFLAGS" -o beans-serve ./cmd/beans-serve
go build -ldflags "$LDFLAGS" -o beans-tui ./cmd/beans-tui
"""
[tasks.beans]
description = "Build and run the beans CLI"
run = "go run ./cmd/beans"
[tasks.beans-serve]
description = "Build and run the beans-serve server"
run = "go build -o /tmp/beans-serve-dev ./cmd/beans-serve && /tmp/beans-serve-dev --port ${BEANS_PORT:-22880}"
sources = ["**/*.go"]
[tasks.beans-tui]
description = "Build and run the beans-tui terminal UI"
run = "go run ./cmd/beans-tui"
[tasks.install]
depends = "build"
run = """
cp beans ~/.local/bin/beans
cp beans-serve ~/.local/bin/beans-serve
cp beans-tui ~/.local/bin/beans-tui
"""
[tasks."release:patch"]
description = "Create a patch version tag (e.g., v0.1.4 → v0.1.5)"
run = """
set -e
NEW_VERSION=$(svu patch)
git tag "$NEW_VERSION"
echo "Created tag: $NEW_VERSION"
echo "To release, run: git push && git push --tags"
"""
[tasks."release:minor"]
description = "Create a minor version tag (e.g., v0.1.4 → v0.2.0)"
run = """
set -e
NEW_VERSION=$(svu minor)
git tag "$NEW_VERSION"
echo "Created tag: $NEW_VERSION"
echo "To release, run: git push && git push --tags"
"""
[tasks."release:major"]
description = "Create a major version tag (e.g., v0.1.4 → v1.0.0)"
run = """
set -e
NEW_VERSION=$(svu major)
git tag "$NEW_VERSION"
echo "Created tag: $NEW_VERSION"
echo "To release, run: git push && git push --tags"
"""
[tasks."test:e2e"]
description = "Run Playwright e2e tests"
depends = "build:embed"
dir = "frontend"
run = "pnpm test:e2e"
[tasks."dev:serve"]
run = "mise watch beans-serve --restart"
[tasks."dev:frontend"]
dir = "frontend"
run = "pnpm dev --port ${VITE_PORT:-5173}"
[tasks.dev]
description = "Run the development server"
depends = "setup"
run = { tasks = ["dev:serve", "dev:frontend"] }
[tasks."dev:kill"]
description = "Kill any lingering dev processes"
run = """
pkill -9 -f "beans-serve" 2>/dev/null && echo "Killed beans-serve processes" || echo "No beans-serve processes"
pkill -9 -f "wgo.*beans" 2>/dev/null && echo "Killed wgo processes" || echo "No wgo processes"
"""