Skip to content

Commit 28acec1

Browse files
authored
Split mise config by language (#59)
1 parent a486dbe commit 28acec1

23 files changed

Lines changed: 1320 additions & 1005 deletions

.editorconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@ trim_trailing_whitespace = true
1212
[*.md]
1313
indent_size = unset
1414

15-
[.mise.toml]
16-
max_line_length = off
17-
18-
[*.dart]
19-
max_line_length = off
20-
21-
[*.wit]
22-
max_line_length = 300
23-
2415
# License files use the canonical upstream formatting (centred headers, odd
2516
# indent widths, etc.) — leave them alone.
2617
[LICENSE-*]

.github/workflows/check.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ jobs:
3333
with:
3434
tool: cargo-binstall,mise
3535

36+
- name: Select all language envs
37+
run: echo "MISE_ENV=$(mise run print-all-langs)" >> "$GITHUB_ENV"
38+
3639
- name: Install pipx (Windows only — aqua has no Windows build)
3740
if: runner.os == 'Windows'
3841
run: python -m pip install pipx
3942

4043
# Optional npm backend, installed before the main `mise install`.
41-
# See [tasks.setup-aube] in .mise.toml for the full rationale.
44+
# See [tasks.setup-aube] in .mise/config.toml for the full rationale.
4245
- name: Install aube (optional npm backend, allowed to fail)
4346
continue-on-error: true
4447
run: |
@@ -47,7 +50,6 @@ jobs:
4750
env:
4851
GITHUB_TOKEN: ${{ github.token }}
4952
MISE_HTTP_TIMEOUT: "120"
50-
MISE_TASK_RUN_AUTO_INSTALL: "false"
5153

5254
- name: Install mise tools
5355
run: |

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,15 @@ jobs:
8787
with:
8888
tool: cargo-binstall,mise
8989

90+
- name: Select all language envs
91+
run: echo "MISE_ENV=$(mise run print-all-langs)" >> "$GITHUB_ENV"
92+
9093
- name: Install pipx (Windows only — aqua has no Windows build)
9194
if: runner.os == 'Windows'
9295
run: python -m pip install pipx
9396

9497
# Optional npm backend, installed before the main `mise install`.
95-
# See [tasks.setup-aube] in .mise.toml for the full rationale.
98+
# See [tasks.setup-aube] in .mise/config.toml for the full rationale.
9699
- name: Install aube (optional npm backend, allowed to fail)
97100
continue-on-error: true
98101
run: |
@@ -101,7 +104,6 @@ jobs:
101104
env:
102105
GITHUB_TOKEN: ${{ github.token }}
103106
MISE_HTTP_TIMEOUT: "120"
104-
MISE_TASK_RUN_AUTO_INSTALL: "false"
105107

106108
- name: Install mise tools
107109
run: |

.mise.toml

Lines changed: 0 additions & 908 deletions
This file was deleted.

.mise/config.dart.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Dart toolchain + tasks. Loaded when MISE_ENV includes `dart`.
2+
3+
[vars]
4+
# Google dart-archive base URLs — the release tree and the bucket listing —
5+
# referenced by [tools.dart] below so its url/version_list_url stay one line.
6+
dart_release = "https://storage.googleapis.com/dart-archive/channels/stable/release"
7+
dart_bucket = "https://storage.googleapis.com/storage/v1/b/dart-archive/o"
8+
9+
[tools]
10+
"cargo:dart-typegen" = "latest"
11+
12+
# dart isn't an aqua/registry tool — install it straight from Google's dart
13+
# archive, discovering the latest stable from the bucket listing. `{{ version }}`
14+
# etc. resolve in the tool-url context; the static host/path prefix is a var.
15+
[tools.dart]
16+
version = "latest"
17+
url = "{{ vars.dart_release }}/{{ version }}/sdk/dartsdk-{{ os() }}-{{ arch() }}-release.zip"
18+
version_list_url = "{{ vars.dart_bucket }}?prefix=channels/stable/release/&delimiter=/"
19+
version_expr = '''
20+
fromJSON(body).prefixes
21+
| filter({ # matches "^channels/stable/release/(\\d+\\.\\d+\\.\\d+)/$" })
22+
| map({split(#, "/")[3]})
23+
| sortVersions()'''
24+
25+
[tasks.dart-pub-get]
26+
# `dart format` and `dart analyze` walk up to find pubspec.yaml *and* read
27+
# `.dart_tool/package_config.json` if present. With package_config.json, the
28+
# formatter picks the package's exact language version; without it, it
29+
# falls back to a different default — same source file, different output.
30+
# That mismatch is invisible locally (we accumulate .dart_tool/ over time)
31+
# but bites CI's fresh checkout. Run `dart pub get` for every Dart package
32+
# before any dart-* task so .dart_tool/ exists and the format is stable.
33+
run = """
34+
dart pub get --directory generated/dart-ws
35+
dart pub get --directory services/ws-modules/dart-comm1
36+
"""
37+
shell = "bash -euo pipefail -c"
38+
39+
[tasks.dart-check]
40+
depends = ["dart-pub-get"]
41+
run = "dart analyze services/ws-modules/dart-comm1/ generated/dart-ws/"
42+
43+
[tasks.dart-fmt]
44+
depends = ["dart-pub-get"]
45+
run = "dart format services/ws-modules/dart-comm1/ generated/dart-ws/"
46+
47+
[tasks.dart-fmt-check]
48+
depends = ["dart-pub-get"]
49+
# Parallel of cargo-fmt-check: fail if any tracked Dart source would be
50+
# reformatted, so CI enforces the same formatting `dart-fmt` applies.
51+
run = "dart format --output=none --set-exit-if-changed services/ws-modules/dart-comm1/ generated/dart-ws/"
52+
53+
# Namespaced aggregators picked up by the default config's globbed `check`/`fmt`.
54+
[tasks."check:dart"]
55+
depends = ["dart-check", "dart-fmt-check"]
56+
description = "Run Dart checks (analyze + format-check)"
57+
58+
[tasks."fmt:dart"]
59+
depends = ["dart-fmt"]
60+
description = "Format Dart sources"
61+
62+
[tasks.build-ws-dart-comm1-module]
63+
description = "Build the dart-comm1 workflow module"
64+
dir = "services/ws-modules/dart-comm1"
65+
run = """
66+
dart pub get
67+
dart compile js lib/dart_comm1.dart -o pkg/et_ws_dart_comm1_compiled.js --no-source-maps
68+
"""
69+
shell = "bash -euo pipefail -c"
70+
71+
[tasks."prefetch:dart"]
72+
description = "Prefetch Dart (pub) dependencies"
73+
run = "dart pub get --directory services/ws-modules/dart-comm1"
74+
75+
[tasks."gen:dart-ws"]
76+
depends = ["gen:ws-spec"]
77+
description = "Emit the Dart sealed-class WS client via dart-typegen (consumes generated/specs/ws.kdl from gen:ws-spec)"
78+
shell = "bash -euo pipefail -c"
79+
# dart-typegen exits 0 on Windows but writes an empty .dart file, which
80+
# would clobber the committed source and fail gen-specs-check. Skip the
81+
# regen there; the committed file (regenerated on Linux/macOS) stays
82+
# canonical.
83+
run = """
84+
[[ "${OS:-}" == "Windows_NT" ]] && { echo "gen:dart-ws: skipped on Windows (dart-typegen empty output)"; exit 0; }
85+
mkdir -p generated/dart-ws/lib
86+
dart-typegen generate -i generated/specs/ws.kdl -o generated/dart-ws/lib/ws_messages.dart
87+
dart format generated/dart-ws/lib/ws_messages.dart
88+
"""

.mise/config.dotnet.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# .NET (C#) toolchain + tasks. Loaded when MISE_ENV includes `dotnet`.
2+
3+
[tools]
4+
# Pinned: SDK churn re-keys the wasm-tools workload manifest, forcing a ~1.5GB pack re-download on every bump.
5+
dotnet = "10.0.300"
6+
dotnet-core = "10.0.300"
7+
"dotnet:roslynator.dotnet.cli" = "latest"
8+
9+
[tasks.dotnet-fmt]
10+
description = "Format dotnet C# code"
11+
run = "dotnet format"
12+
13+
[tasks.dotnet-check]
14+
description = "Check dotnet C# formatting"
15+
run = "dotnet format --verify-no-changes"
16+
17+
# Namespaced aggregators picked up by the default config's globbed `check`/`fmt`.
18+
[tasks."check:dotnet"]
19+
depends = ["dotnet-check"]
20+
description = "Run .NET checks (format verification)"
21+
22+
[tasks."fmt:dotnet"]
23+
depends = ["dotnet-fmt"]
24+
description = "Format .NET sources"
25+
26+
[tasks.build-ws-dotnet-data1-module]
27+
description = "Build the dotnet-data1 C# WASM workflow module"
28+
dir = "services/ws-modules/dotnet-data1"
29+
run = '''
30+
dotnet workload install wasm-tools --skip-manifest-update
31+
dotnet publish -c Release
32+
33+
PUBLISH=bin/Release/net10.0/publish/wwwroot/_framework
34+
cp "$PUBLISH"/*.js "$PUBLISH"/*.wasm "$PUBLISH"/*.dat pkg/
35+
'''
36+
shell = "bash -euo pipefail -c"
37+
38+
[tasks."prefetch:dotnet"]
39+
description = "Prefetch .NET dependencies and the wasm-tools workload"
40+
run = """
41+
dotnet restore
42+
dotnet workload install wasm-tools --skip-manifest-update
43+
"""
44+
shell = "bash -euo pipefail -c"

.mise/config.java.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Java toolchain + tasks. Loaded when MISE_ENV includes `java`.
2+
3+
[tools]
4+
java = "latest"
5+
maven = "latest"
6+
7+
[env]
8+
# Silence Maven's per-artifact download/upload progress lines (the
9+
# "Downloading from central:" / "Downloaded" spam). Build output and real
10+
# errors still print. MAVEN_ARGS is honored by Maven 3.9+ and prepends to
11+
# every `mvn` invocation.
12+
MAVEN_ARGS = "--no-transfer-progress"
13+
14+
[tasks.build-ws-java-data1-module]
15+
description = "Build the java-data1 workflow module"
16+
run = "mvn package"
17+
18+
[tasks."prefetch:java"]
19+
description = "Prefetch Java (Maven) dependencies"
20+
run = "mvn dependency:resolve --quiet"

0 commit comments

Comments
 (0)