Add [tools.trellis.adapter] so a workspace's members can be something
other than Gleam packages. The required `manifest` key gives the member
manifest path relative to the member dir; its presence marks a member the
way gleam.toml does otherwise, and its extension picks the format (toml,
json, yaml, yml). `name` and `version` are dotted field paths, defaulting
to `name` and `version`.
Also accept a root trellis.toml carrying [tools.trellis], since an adapter
workspace usually has no gleam.toml. Root discovery walks up to the first
dir whose trellis.toml or gleam.toml carries the table, preferring
trellis.toml; both at once is an error.
- version apply writes the bump surgically into the adapter's version
field for JSON and YAML as it already did for TOML, preserving
comments, key order, indentation, and quoting.
- doctor checks the adapter workspace's own invariants (semver-parseable
version, name matching directory) instead of Gleam's, and drops the
checks with nothing to read.
- The gleam-shelling verbs (build, test, check, docs, deps, format,
clean, publish, lockfile refresh, new) are refused under an adapter and
name the declared tasks instead. exec is unaffected.
- init now refuses a repo already configured by a trellis.toml, which
previously produced a second, ambiguous config home.
The dependency graph is flat under an adapter, so topological order is
member order and a workspace dep never ripple-bumps. publish.lifecycle
defaults to git_only and hex is a configuration error.
Adds
[tools.trellis.adapter], letting a workspace's members be something other than Gleam packages. Built for repositories distributed by git ref rather than a registry: Claude Code plugin marketplaces, APM monorepos, AI skill collections.The seam
One key is required —
manifest, the member manifest's path relative to the member directory. Its presence marks a member the way agleam.tomldoes otherwise, and its extension picks the format (.toml,.json,.yaml,.yml).nameandversionare dotted field paths into that manifest, defaulting tonameandversion.Trellis also accepts a
trellis.tomlat the workspace root carrying the same[tools.trellis]table, since an adapter workspace usually has nogleam.tomlfor it to live in. Root discovery walks up to the first directory whosetrellis.tomlorgleam.tomlcarries the table, preferringtrellis.toml; carrying it in both at once is an error.The dependency graph is flat under an adapter — no dependency edges are declared, so topological order is member order and a workspace dependency never ripple-bumps.
publish.lifecycledefaults togit_only, andhexanywhere under an adapter is a configuration error, because there is no registry to publish to.Version write-back
version applywrites the bump into the field[tools.trellis.adapter].versionnames. The edit is surgical for JSON and YAML as it already was for TOML: only that scalar changes, so a hand-maintainedplugin.jsonorapm.ymlkeeps its comments, key order, indentation, and quote style byte for byte. A field path that resolves to nothing, or to a mapping, sequence, or non-string, is an error — the bump never inserts a key.The
manifest.tomllockfile patch is skipped in an adapter workspace, which has no Gleam lock to keep in step.Doctor
doctorchecks an adapter workspace's own invariants instead of Gleam's. Every member manifest must declare a version that parses as semver (an error), and a name matching its directory (a warning — nothing downstream requires them to agree, and repositories in the wild do drift here). The checks with nothing to read are dropped:manifest.tomllock drift, shared external dependency agreement, and thegleam-on-PATH toolchain pin. Thechecked:preamble now names the checks that actually ran rather than a fixed list.Refusals
build,test,check,docs,deps,format, andcleanall shell out togleam, which an adapter workspace's members are not — they're refused, and the error names the tasks you have declared under[tools.trellis.tasks]. A custom task with a built-in's name still overrides it, andtrellis execis unaffected.publish,lockfile refresh, andneware refused for the same reason.Fix
initrefuses a repository already configured by atrellis.toml. It only looked for a[tools.trellis]table ingleam.tomlfiles, so in a workspace configured the new way it wrote a second config home — a state every later command then rejects as ambiguous. Member manifests are checked for both spellings too.Testing
cargo testgreen (171 tests, including a newtests/adapter.rswith 48).cargo fmt --checkandcargo clippy --all-targetsclean.