Skip to content

docs(aliases): teach [[aliases.NAME]] pipeline blocks - #2144

Merged
max-sixty merged 1 commit into
mainfrom
alias-block-form
Apr 13, 2026
Merged

max-sixty merged 1 commit into
mainfrom
alias-block-form

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Aliases share the CommandConfig deserializer with hooks, so [[aliases.NAME]] blocks already deserialize into pipeline steps with zero code changes — analogous to the recent [[hook]] cutover in 32bc617. Teach the block form as the canonical shape for multi-step aliases.

Changes:

  • src/cli/mod.rs — new paragraph + [[aliases.release]] example in the wt step Aliases section, explaining sequential blocks with concurrent keys and fail-fast on step failure
  • src/config/project.rs — rewrite the aliases field rustdoc to treat string / named-table / [[aliases.NAME]] as three first-class forms (drops the "single-string is the expected usage" framing)
  • docs/content/step.md + skills/worktrunk/reference/step.md — auto-synced
  • help snapshot re-accepted

No deserializer work — covered by existing test_deserialize_pipeline_named_single in src/config/commands.rs.

This was written by Claude Code on behalf of max-sixty

Aliases already share the `CommandConfig` deserializer with hooks, so
`[[aliases.NAME]]` blocks deserialize into pipeline steps with zero
code changes. Teach the block form as the canonical shape for
multi-step aliases, alongside the existing single-string and
named-table forms.

Also drop the "named-table technically works, single-string is the
expected usage" framing from the `aliases` field rustdoc — all three
shapes are first-class.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 3f44cb5 into main Apr 13, 2026
24 checks passed
@max-sixty
max-sixty deleted the alias-block-form branch April 13, 2026 00:41
max-sixty added a commit that referenced this pull request Apr 13, 2026
…fig::commands (#2149)

Cut over hook pipeline docs from inline-list form (`hook = [{name =
"..."}, ...]`) to `[[hook]]` array-of-tables blocks. The deserializer
already accepts this shape — no code changes were needed; the change is
purely teaching. This mirrors what landed for aliases in #2144.

The summary in `Pipeline Ordering` now foregrounds the TOML shape
progression instead of a labeled taxonomy:

- `post-start = "npm install"` — one command
- `[post-start]` — one section of concurrent commands
- `[[post-start]]` — one of multiple sections, run in order

The bracket count itself tracks the structural escalation (value →
section → array-of-sections).

Also adds a module-level doccomment to `src/config/commands.rs`
describing the three primitive TOML shapes the hook deserializer accepts
(string / dict / list) and the asymmetry between dict-at-top (always
`Concurrent`) vs dict-in-list (1-entry → `Single(named)`). This is the
analysis that motivated the cutover and is retained so future readers
can orient on the deserialization rules without re-deriving them.

The Databases example in `hook.md` and `tips-patterns.md` got its first
pipeline step named (`set-vars`) since `[[post-start]]` blocks can't
hold anonymous bare strings the way inline lists could.

> _This was written by Claude Code on behalf of Maximilian_

---------

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request Apr 13, 2026
…2151)

## Summary

- Pre-\* table-form migration now emits `[[pre-merge]]` array-of-tables
blocks instead of an inline `pre-merge = [{...}, {...}]` pipeline,
matching the block form taught in #2144 for `[[aliases.NAME]]`.
- Sections stay where the user wrote them: iterate pre-\* keys in
document order and replace via `get_mut` rather than `remove` + `insert`
(which appended at the end).

Generated diff before/after:

```diff
-[pre-merge]
-test = "cargo test"
-lint = "cargo clippy"
+[[pre-merge]]
+test = "cargo test"
+
+[[pre-merge]]
+lint = "cargo clippy"
```

## Test plan

- [x] `cargo test --lib config::deprecation` (139 passed)
- [x] `cargo test --test integration config_show` (97 passed)
- [x] Re-accepted two snapshots (`snapshot_migrate_pre_hook_table_form`,
`config_show_displays_pre_hook_table_form_deprecation`)

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude <[email protected]>
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.

2 participants