-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
160 lines (141 loc) · 4 KB
/
Copy pathmise.toml
File metadata and controls
160 lines (141 loc) · 4 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
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.2"
terraform = "1"
hadolint = "latest"
"github:Infisical/cli" = "latest"
[tasks]
"db:migrate" = { run = [
{ task = "infra:up" },
{ task = "//apps/api:migrate" },
], description = "Run database migrations" }
"dev:mobile" = { depends = [
"//apps/api:dev",
"//apps/mobile:dev",
], description = "Start API and Mobile services" }
dev = { depends = [
"db:migrate",
], run = [
{ tasks = [
"//apps/api:dev",
"//apps/worker:dev",
"//apps/mobile:dev",
] },
], description = "Start all services" }
format = { depends = [
"//apps/api:format",
"//apps/worker:format",
], description = "Format all apps" }
"gen:api" = { depends = [
"//apps/api:gen:openapi",
], run = [
{ tasks = [
"//apps/mobile:gen:api",
] },
], description = "Generate OpenAPI schema and mobile API client" }
"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 = { depends = [
"//apps/api:install",
"//apps/worker:install",
"//apps/mobile:install",
"//packages/design-tokens:install",
"//packages/i18n:install",
], description = "Install all dependencies" }
lint = { depends = [
"//apps/api:lint",
"//apps/worker:lint",
], description = "Lint all apps" }
test = { depends = [
"//apps/api:test",
"//apps/worker:test",
], description = "Test all apps" }
"tokens:build" = { depends = [
"//packages/design-tokens:build",
], description = "Build design tokens" }
typecheck = { depends = [
"//apps/api: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/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
dockerfiles=$(git diff --cached --name-only --diff-filter=d | grep -E "Dockerfile$" || true)
if [ -n "$dockerfiles" ]; then
echo "[pre-commit] Dockerfile detected, running hadolint..."
echo "$dockerfiles" | 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/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
'''