-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathmise.toml
More file actions
132 lines (110 loc) · 4.25 KB
/
mise.toml
File metadata and controls
132 lines (110 loc) · 4.25 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
experimental_monorepo_root = true
[monorepo]
config_roots = [
"apps/*",
"packages/*",
]
[settings]
experimental = true
[hooks]
postinstall = '''
mkdir -p .git/hooks
# commit-msg
cat > .git/hooks/commit-msg <<'EOF'
#!/bin/sh
exec mise run git:commit-msg -- "$1"
EOF
chmod +x .git/hooks/commit-msg
# pre-commit
cat > .git/hooks/pre-commit <<'EOF'
#!/bin/sh
exec mise run git:pre-commit
EOF
chmod +x .git/hooks/pre-commit
# pre-push
cat > .git/hooks/pre-push <<'EOF'
#!/bin/sh
exec mise run git:pre-push
EOF
chmod +x .git/hooks/pre-push
'''
[tools]
node = "24"
python = "3.12"
bun = "latest"
uv = "latest"
flutter = "3.41.6"
terraform = "1"
hadolint = "latest"
monodep = "0.1.1"
"github:Infisical/cli" = "latest"
[plugins]
monodep = "https://github.com/gracefullight/mise-monodep-plugin"
[tasks]
"db:migrate" = { depends = ["//apps/api:migrate"], description = "Run database migrations" }
"dev:web" = { depends = ["//apps/api:dev", "//apps/web:dev"], description = "Start API and Web services" }
"dev:mobile" = { depends = ["//apps/api:dev", "//apps/mobile:dev"], description = "Start API and Mobile services" }
dev = { depends = ["//apps/api:dev", "//apps/web:dev", "//apps/worker:dev"], description = "Start all services" }
format = { depends = ["//apps/api:format", "//apps/web:format", "//apps/worker:format"], description = "Format all apps" }
"gen:api" = { depends = ["//apps/api:gen:openapi"], run = [{ tasks = ["//apps/web:gen:api", "//apps/mobile:gen:api"] }], description = "Generate OpenAPI schema and API clients" }
"i18n:build" = { depends = ["//packages/i18n:build"], description = "Build i18n files" }
"infra:down" = { depends = ["//apps/api:infra:down"], description = "Stop local infrastructure" }
"infra:up" = { depends = ["//apps/api:infra:up"], description = "Start local infrastructure" }
install = { run = "monodep install", description = "Install all dependencies and deduplicate" }
lint = { depends = ["//apps/api:lint", "//apps/web:lint", "//apps/worker:lint"], description = "Lint all apps" }
test = { depends = ["//apps/api:test", "//apps/web:test", "//apps/worker:test"], description = "Test all apps" }
"tokens:build" = { depends = ["//packages/design-tokens:build"], description = "Build design tokens" }
typecheck = { depends = ["//apps/api:typecheck", "//apps/web:typecheck"], description = "Type check all apps" }
[tasks."git:commit-msg"]
description = "Validate commit message using commitlint"
run = "bunx @commitlint/cli@20 --edit $1"
[tasks."git:pre-commit"]
description = "Run conditional checks for staging files"
run = '''
#!/usr/bin/env bash
changed=$(git diff --cached --name-only)
if echo "$changed" | grep -q "^apps/api/"; then
echo "[pre-commit] apps/api detected, running lint..."
mise //apps/api:lint || exit 1
fi
if echo "$changed" | grep -q "^apps/web/"; then
echo "[pre-commit] apps/web detected, running lint..."
mise //apps/web:lint || exit 1
fi
if echo "$changed" | grep -q "^apps/worker/"; then
echo "[pre-commit] apps/worker detected, running lint..."
mise //apps/worker:lint || exit 1
fi
if echo "$changed" | grep -q "^apps/mobile/"; then
echo "[pre-commit] apps/mobile detected, running lint..."
mise //apps/mobile:lint || exit 1
fi
if echo "$changed" | grep -qE "Dockerfile$"; then
echo "[pre-commit] Dockerfile detected, running hadolint..."
echo "$changed" | grep -E "Dockerfile$" | xargs hadolint || exit 1
fi
'''
[tasks."git:pre-push"]
description = "Validate branch name and run tests before push"
run = '''
#!/usr/bin/env bash
bunx @gracefullight/validate-branch || exit 1
# Get changed files compared to origin
changed=$(git diff --name-only origin/main...HEAD 2>/dev/null || git diff --name-only HEAD~1)
if echo "$changed" | grep -q "^apps/api/"; then
echo "[pre-push] apps/api detected, running test..."
mise //apps/api:test || exit 1
fi
if echo "$changed" | grep -q "^apps/web/"; then
echo "[pre-push] apps/web detected, running test..."
mise //apps/web:test || exit 1
fi
if echo "$changed" | grep -q "^apps/worker/"; then
echo "[pre-push] apps/worker detected, running test..."
mise //apps/worker:test || exit 1
fi
if echo "$changed" | grep -q "^apps/mobile/"; then
echo "[pre-push] apps/mobile detected, running test..."
mise //apps/mobile:test || exit 1
fi
'''