Skip to content

feat(config): add manifest adapter for non-Gleam workspaces - #106

Open
tylerbutler wants to merge 1 commit into
mainfrom
feat/manifest-adapter
Open

feat(config): add manifest adapter for non-Gleam workspaces#106
tylerbutler wants to merge 1 commit into
mainfrom
feat/manifest-adapter

Conversation

@tylerbutler

Copy link
Copy Markdown
Owner

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 a gleam.toml does otherwise, and its extension picks the format (.toml, .json, .yaml, .yml). name and version are dotted field paths into that manifest, defaulting to name and version.

Trellis also accepts a trellis.toml at the workspace root carrying the same [tools.trellis] table, since an adapter workspace usually has no gleam.toml for it to live in. Root discovery walks up to the first directory whose trellis.toml or gleam.toml carries the table, preferring trellis.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.lifecycle defaults to git_only, and hex anywhere under an adapter is a configuration error, because there is no registry to publish to.

Version write-back

version apply writes the bump into the field [tools.trellis.adapter].version names. The edit is surgical for JSON and YAML as it already was for TOML: only that scalar changes, so a hand-maintained plugin.json or apm.yml keeps 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.toml lockfile patch is skipped in an adapter workspace, which has no Gleam lock to keep in step.

Doctor

doctor checks 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.toml lock drift, shared external dependency agreement, and the gleam-on-PATH toolchain pin. The checked: preamble now names the checks that actually ran rather than a fixed list.

Refusals

build, test, check, docs, deps, format, and clean all shell out to gleam, 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, and trellis exec is unaffected. publish, lockfile refresh, and new are refused for the same reason.

Fix

init refuses a repository already configured by a trellis.toml. It only looked for a [tools.trellis] table in gleam.toml files, 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 test green (171 tests, including a new tests/adapter.rs with 48). cargo fmt --check and cargo clippy --all-targets clean.

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.
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for trellis-gleam ready!

Name Link
🔨 Latest commit e90ce8d
🔍 Latest deploy log https://app.netlify.com/projects/trellis-gleam/deploys/6a8662bdfb3a43000838eb86
😎 Deploy Preview https://deploy-preview-106--trellis-gleam.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown
Contributor

Changelog Preview

This PR adds the following changelog entries:

v0.12.0 - 2026-08-20

trellis

Added

  • [tools.trellis.adapter] lets a workspace's members be something other than Gleam packages. One key is required — manifest, the member manifest's path relative to the member directory, whose presence marks a member the way a gleam.toml does otherwise, and whose extension picks the format (.toml, .json, .yaml, .yml). name and version are dotted field paths into that manifest, defaulting to name and version. Built for repositories distributed by git ref rather than a registry: Claude Code plugin marketplaces, APM monorepos, AI skill collections.

    Trellis also accepts a trellis.toml at the workspace root carrying the same [tools.trellis] table, since an adapter workspace usually has no gleam.toml for it to live in. Root discovery walks up to the first directory whose trellis.toml or gleam.toml carries the table, preferring trellis.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.lifecycle defaults to git_only and hex anywhere under an adapter is a configuration error, because there is no registry to publish to.

run

Changed

  • The built-in verbs are refused in an adapter workspace, and name the tasks you have declared. build, test, check, docs, deps, format, and clean all shell out to gleam, which an adapter workspace's members are not. Declare what you need under [tools.trellis.tasks] — a custom task with a built-in's name still overrides it, and trellis exec is unaffected.

    publish, lockfile refresh, and new are refused for the same reason.

version

Added

  • version apply writes the bump into the field [tools.trellis.adapter].version names. The edit is surgical for JSON and YAML as it already was for TOML: only that scalar changes, so a hand-maintained plugin.json or apm.yml keeps 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.toml lockfile patch is skipped in an adapter workspace, which has no Gleam lock to keep in step.

init

Fixed

  • init refuses a repository already configured by a trellis.toml. It only looked for a [tools.trellis] table in gleam.toml files, 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.

doctor

Added

  • doctor checks 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.toml lock drift, shared external dependency agreement, and the gleam-on-PATH toolchain pin. The checked: preamble now names the checks that actually ran rather than a fixed list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant