-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
260 lines (226 loc) · 7.53 KB
/
mise.toml
File metadata and controls
260 lines (226 loc) · 7.53 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# SPDX-FileCopyrightText: 2025 Knitli Inc. <knitli@knit.li>
# SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
#
# SPDX-License-Identifier: MIT OR Apache-2.0
#:tombi schema.strict = false
experimental_monorepo_root = true
[monorepo]
config_roots = ["crates/*", "xtask/"]
[tools]
act = "latest"
actionlint = "latest"
ast-grep = "latest"
bun = "latest"
cargo-binstall = "latest"
"cargo:cargo-audit" = "latest"
"cargo:cargo-deny" = "latest"
"cargo:cargo-edit" = "latest"
"cargo:cargo-generate" = "latest"
"cargo:cargo-nextest" = "latest"
"cargo:cargo-smart-release" = "latest"
"cargo:cargo-watch" = "latest"
"cargo:git-cliff" = "latest"
gh = "latest"
hk = "latest"
node = "24"
"npm:wasm-opt" = "latest"
"npm:wasm-pack" = "latest"
"pipx:SuperClaude" = "latest"
"pipx:reuse" = "latest"
pkl = "latest"
python = "3.13"
ripgrep = "latest"
rust = "nightly"
tombi = "latest"
typos = "latest"
usage = "latest"
uv = "latest"
yq = "latest"
# environment variables for every environment
[env]
MISE_EXPERIMENTAL = 1
CARGO_TARGET_DIR = "target"
HK_MISE = 1
[settings]
idiomatic_version_file_enable_tools = []
[hooks]
enter = '''
echo "Activating environment..."
mise run enter
'''
# deactivate/unhook when you leave
leave = '''eval "$(mise deactivate)" &>/dev/null || true
echo "Environment deactivated"
'''
# Tasks are run by using `mise run taskname`, like `mise run build`
# run tasks run as simple shell commands
# ** -------------------- Tool and Setup Tasks --------------------
[tasks.enter]
hide = true # hide this task from the list
description = "activate the development environment"
silent = true
depends = ["install-tools", "installhooks"]
[tasks.update-tools]
description = "update all dev tools and mise"
run = '''
mise -yq upgrade
mise -yq self-update
'''
[tasks.install-tools]
description = "setup dev tooling and development hooks"
run = '''
mise -yq trust || true
mise -yq install || true
'''
[tasks.install-tools.env]
MISE_YES = 1
MISE_TRUST = 1
[tasks.installhooks]
depends = ["install-tools"]
description = "only install development hooks"
run = "hk install --mise &>/dev/null || true"
[tasks.update]
description = "update dependencies"
run = ["cargo update", "cargo update --workspace"]
# ** -------------------- Cleaning Tasks --------------------
[tasks.cleancache]
description = "delete the cache"
run = ["rm -rf .cache", "mise -yq prune || true"]
hide = true # hide this task from the list
[tasks.clean]
depends = ["cleancache"]
description = "Removes caches and build artifacts."
run = ["cargo clean", "rm -rf crates/thread-wasm/pkg &>/dev/null || true"]
# ** -------------------- Build Tasks --------------------
[tasks.build]
description = "Build everything (except wasm)"
run = "cargo build --workspace"
alias = "b" # `mise run b` = build
[tasks.build-fast]
tools.rust = "nightly"
description = "Build with cranelift backend for faster debug builds (requires nightly)"
run = """
rustup component add rustc-codegen-cranelift-preview --toolchain nightly 2>/dev/null || true
RUSTFLAGS="-Zcodegen-backend=cranelift" cargo +nightly build --workspace
"""
alias = "bf"
[tasks.build-release]
description = "Build everything in release mode (except wasm)"
run = "cargo build --workspace --release --features inline"
alias = "br" # `mise run br` = build release
[tasks.build-wasm]
description = "Build WASM target for development"
run = "cargo run -p xtask build-wasm"
alias = "bw" # `mise run bw` = build wasm
[tasks.build-wasm-browser-dev]
description = "Build WASM target for browser development" # we don't use the browser target, so currently this is just for testing purposes
run = "cargo run -p xtask build-wasm --multi-threading"
alias = "bwd" # `mise run bwd` = build wasm browser dev
[tasks.build-wasm-profile]
description = "Build WASM target with profiling"
run = "cargo run -p xtask build-wasm --profiling"
alias = "bwp" # `mise run bwp` = build wasm profiling
[tasks.build-wasm-browser-profile]
description = "Build WASM target for browser to profile"
run = "cargo run -p xtask build-wasm --profiling --multi-threading"
alias = "bwpd" # `mise run bwpd` = build wasm browser prod
[tasks.build-wasm-release]
description = "Build WASM target in release mode."
run = "cargo run -p xtask build-wasm --release"
alias = "bwr" # `mise run bwr` = build wasm release
# ** -------------------- Testing/Linting/Formatting Tasks --------------------
[tasks.update-licenses]
description = "Update license headers for all files"
run = "./scripts/update-licenses.py"
[tasks.test]
description = "Run automated tests"
# multiple commands are run in series
run = "hk run test"
alias = "t" # `mise run t` = test
[tasks.list-steps]
usage = '''
flag "-t --task <task>" help="Task to list steps for" {
choices "check" "fix"
default "check"
}
flag "--delimiter <delim>" help="optional different delimiter, defaults to newline" {
choices "line" "space"
default "line"
}
'''
description = "List steps for a check or fix command. Defaults to 'check'"
run = '''
evaluation="hooks[\"${usage_task:-check}\"].steps.keys"
pkl_out="$(pkl eval -x "$evaluation" hk.pkl)"
if [ "${usage_delimiter:-line}" == "line" ]; then
output="$(echo "$pkl_out" | grep -oP '\"[^\"]+\"' - | tr -d '\"')"
else
output="$(echo "$pkl_out" | sed 's/Set(\(.*\))%\?/[\1]/')"
fi
echo "$output"
'''
[tasks.lint]
usage = '''
flag "-a --all" help="Run linting against all files. If not provided, only runs against changed files"
flag "--skip-steps <steps>..." help="Optional steps to skip"
complete "steps" run="mise run list-steps"
'''
description = "Full linting of the codebase"
run = '''
step_flag="${usage_skip_steps:+' --skip-step '}"
if "$step_flag"; then
# replace spaces with step_flags and add one to the beginning
steps_to_skip=$(echo "${usage_skip_steps}" | sed "s/ /${step_flag}/g")
steps_to_skip="${step_flag}${steps_to_skip}"
else
steps_to_skip=""
fi
exec_cmd="hk check ${usage_all:+--all} ${steps_to_skip}"
eval "$exec_cmd"
'''
alias = "check" # `mise run check` = check
[tasks.fix]
usage = '''
flag "-a --all" help="Run fixes against all files. If not provided, only runs against changed files" default=#false
flag "--skip-steps <steps>..." help="Optional steps to skip"
complete "steps" run="mise run list-steps -t fix"
'''
description = "fix formatting and apply lint fixes"
alias = "fix" # `mise run fix` = fix
run = '''
step_flag="${usage_skip_steps:+' --skip-step '}"
if "$step_flag"; then
# replace spaces with step_flags and add one to the beginning
steps_to_skip=$(echo "${usage_skip_steps}" | sed "s/ /${step_flag}/g")
steps_to_skip="${step_flag}${steps_to_skip}"
else
steps_to_skip=""
fi
exec_cmd="hk fix ${usage_all:+--all} ${steps_to_skip}"
eval "$exec_cmd"
'''
[tasks.release]
usage = '''
arg "[bump]" help="bump level: major, minor, patch, or keep; omit to auto-detect from commits" {
choices "major" "minor" "patch" "keep"
}
'''
description = "Dry-run release preview using cargo smart-release — actual releases happen in CI"
run = '''
if [ -n "${usage_bump}" ]; then
cargo smart-release --bump "${usage_bump}"
else
cargo smart-release
fi
'''
[tasks.changelog]
usage = '''
flag "-o --output <output>" help="optional alternative output path" default="CHANGELOG.md"
'''
description = "Generate/update CHANGELOG.md from conventional commits"
env.GITHUB_TOKEN = { value = '''{% if env.MISE_GITHUB_TOKEN %}{{ env.MISE_GITHUB_TOKEN }}{% elif env.GITHUB_TOKEN %}{{ env.GITHUB_TOKEN }}{% else %}{{ env.GH_TOKEN | default(value="") }}{% endif %}''', redact = true }
run = "git cliff --output ${usage_output:-CHANGELOG.md}"
alias = "cl"
[tasks.ci] # only dependencies to be run
description = "Run CI tasks"
depends = ["build", "lint", "test"]