-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmise.dev.toml
More file actions
142 lines (131 loc) · 6.21 KB
/
Copy pathmise.dev.toml
File metadata and controls
142 lines (131 loc) · 6.21 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
# Developer-specific mise configuration (e2e tools, tasks)
# Load with: MISE_ENV=dev mise install
# Or set permanently: export MISE_ENV=dev in your shell rc file
#
# For human-only tools (Claude, gh, cloudflared), also add: MISE_ENV=dev,human
#
# Note: Node.js is now in base mise.toml since it's needed for e2e tests in all environments
#
# Task Configuration:
# - Each task can have a 'description' (short summary)
# - Tasks with arguments use 'usage' field with KDL syntax for arg/flag definitions
# - Arguments become available as $usage_<name> env vars (e.g., $usage_url)
# - For complex tasks, consider using file-tasks in .mise/tasks/ for better editing
# Docs: https://mise.jdx.dev/tasks/task-arguments.html
# https://mise.jdx.dev/tasks/file-tasks.html
[tools]
watchexec = "2.5.1"
# --- Protobuf / OpenAPI (API contract is proto-first; see proto/README.md) ---
# buf and api-linter are declared as *task-scoped* tools on the proto:* tasks
# that actually invoke them, not in [tools] above (#510).
#
# Why scoping rather than pinning: both were ALREADY pinned and locked.
# mise.dev.lock carried buf 1.70.0 and api-linter 2.3.1 with checksums and
# asset URLs before this change, and the failure happened anyway. Verified on
# mise 2026.5.8: a lockfile entry does NOT suppress api-linter's SLSA
# provenance call. The download and checksum steps both succeed; only the
# provenance lookup against api.github.com 403s, and MISE_SLSA_VERIFY=0 does
# not disable it. mise had even recorded github_attestations = "unavailable"
# in the lock and still attempted verification.
#
# So what scoping buys is blast radius, and that is the actual bug in #510:
# 1. A proto-only linter should not sit in the critical path of a Dart test
# run. As env-level tools they were provisioned for every `dev`-env task,
# so a failure to fetch them aborted `format`, `analyze`, `test` and
# `check`. On Claude Code Web `.miserc.toml` auto-selects the `dev` env,
# so this hit plain `./bin/mise run check`.
# 2. Task-scoped tools degrade to a warning when provisioning fails, where an
# [tools] entry is a hard error that aborts before any task runs. The
# failure is contained, NOT resolved: the proto:* task itself still runs
# its body and will then fail on `buf: command not found` unless the
# binary is already on PATH. The point is that `check` and `test` are no
# longer collateral damage — not that proto linting works without buf.
#
# KNOWN TRADE-OFF: task-scoped tools are not part of a config's [tools] set,
# so `mise lock` drops them from mise.dev.lock. These two therefore lose
# lockfile coverage and re-resolve on a fresh worktree. Moving them to their
# own env file (MISE_ENV=dev,proto) would keep both properties — off the dev
# critical path AND locked — at the cost of changing the proto:* invocation.
# Not done here; see #510 discussion.
#
# Move both to base mise.toml when the API stabilises and proto tasks enter CI.
[tasks."proto:lint"]
description = "Lint the protobuf API contract (buf STANDARD ruleset)"
dir = "proto"
tools = { buf = "1.70.0" }
run = "buf lint"
[tasks."proto:format"]
description = "Format protobuf files in place"
dir = "proto"
tools = { buf = "1.70.0" }
run = "buf format -w"
[tasks."proto:dep-update"]
description = "Refresh buf.lock from BSR dependencies (googleapis)"
dir = "proto"
tools = { buf = "1.70.0" }
run = "buf dep update"
[tasks."proto:generate"]
description = "Generate OpenAPI spec from the proto contract via BSR remote plugin"
dir = "proto"
tools = { buf = "1.70.0" }
run = "buf generate"
[tasks."proto:clients"]
description = "Generate Worker TS types and Flutter Dart client from OpenAPI spec"
depends = ["proto:clients:types", "proto:clients:dart"]
[tasks."proto:clients:types"]
description = "Generate TypeScript types for the Cloudflare Worker from OpenAPI"
run = """
npx --prefix cloudflare-worker openapi-typescript \
docs/code/api/openapi/openapi.yaml \
-o cloudflare-worker/src/api-types.ts
"""
[tasks."proto:clients:dart"]
description = "Generate Dart/Dio client for Flutter from OpenAPI (requires Java)"
env = { OPENAPI_GENERATOR_JAR = "${HOME}/.cache/openapi-generator/openapi-generator-cli-7.13.0.jar" }
run = """
mkdir -p "${HOME}/.cache/openapi-generator"
if [ ! -f "${OPENAPI_GENERATOR_JAR}" ]; then
echo "Downloading openapi-generator-cli 7.13.0..."
curl -sSfL \
"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.13.0/openapi-generator-cli-7.13.0.jar" \
-o "${OPENAPI_GENERATOR_JAR}"
fi
java -jar "${OPENAPI_GENERATOR_JAR}" generate \
--input-spec docs/code/api/openapi/openapi.yaml \
--generator-name dart-dio \
--output packages/myfestival_client \
--additional-properties=pubName=myfestival_client,pubAuthor=Cambridge Beer Festival,browserClient=false,nullSafe=true,dateLibrary=core
cd packages/myfestival_client
dart pub get
dart run build_runner build
"""
[tasks."proto:api-lint"]
description = "Lint proto files against Google AIP design guidelines (googleapis/api-linter)"
dir = "proto"
tools = { buf = "1.70.0", "github:googleapis/api-linter" = "2.3.1" }
run = """
buf build -o /tmp/cambeerfestival.pb
api-linter \
--config .api-linter.yaml \
--descriptor-set-in=/tmp/cambeerfestival.pb \
cambeerfestival/festival/v1alpha/festival.proto \
cambeerfestival/festival/v1alpha/producer.proto \
cambeerfestival/festival/v1alpha/drink.proto \
cambeerfestival/festival/v1alpha/catalog_service.proto \
cambeerfestival/festival/v1alpha/drink_entry.proto \
cambeerfestival/festival/v1alpha/drink_summary.proto \
cambeerfestival/festival/v1alpha/my_festival_service.proto
"""
# All tasks moved to mise-tasks/ for better maintainability and shellcheck/shfmt support:
# - dev -> mise-tasks/dev.sh
# - test:e2e -> mise-tasks/test/e2e.sh
# - test:e2e:ui -> mise-tasks/test/e2e/ui.sh
# - test:e2e:headed -> mise-tasks/test/e2e/headed.sh
# - build:web -> mise-tasks/build/web.sh
# - serve:release -> mise-tasks/serve/release.sh
# - test:check-page -> mise-tasks/test/check-page.sh
# - screenshots:batch -> mise-tasks/screenshots/batch.sh
# - setup:tunnel -> mise-tasks/setup/tunnel.sh
# - setup:playwright -> mise-tasks/setup/playwright.sh
# - dev:tunnel -> mise-tasks/dev/tunnel.sh
# - build:web:prod -> mise-tasks/build/web/prod.sh