Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Recipe Resolution

Shadowtree resolves a recipe by combining built-ins, config, flags, and recipe arguments.

Resolution order:

built-in recipes for the selected profile, or for a detected profile when no
config is loaded
then config recipe overrides
then CLI flags
then trailing recipe args

Profile Built-Ins

Built-in recipes come from the selected Go Profile or Node Profile. Profile selection is described in Profile Selection.

Configs that omit profile do not receive detected built-ins. This keeps local config recipes exact unless the config opts into a profile.

Overriding Built-Ins

Config recipes with the same name as a built-in recipe override only specified fields, except for_each and workdir. Those scheduling fields are not inherited from the built-in recipe; set them in the override when the custom recipe should keep or replace built-in fan-out behavior.

profile = "go"

[recipes.test]
help = "Run generated-code tests."
workdir = "."
pre = ['go generate "{pkg}"']
cmd = 'go test "{pkg}" {@}'

[recipes.test.arguments.pkg]
type = "rel_path"
position = 1
required = true
values = "@go-packages"

The Go built-in test normally runs once per module:

for_each = @go-modules
workdir = {item}
cmd = "go test ./... {@}"

The override above runs once from the root workdir and parses CLI args as typed arguments:

shadowtree test ./internal/recipe

That run executes:

go generate ./internal/recipe
go test ./internal/recipe

Use {@} when a typed recipe should forward leftover CLI args after typed argument values.