Skip to content

Create configuration override framework for recipes#14

Merged
charlesnutter merged 4 commits into
mainfrom
feat/site-composition
Jul 4, 2026
Merged

Create configuration override framework for recipes#14
charlesnutter merged 4 commits into
mainfrom
feat/site-composition

Conversation

@charlesnutter

Copy link
Copy Markdown
Member

No description provided.

- recipes entries accept {name, options}: options map to the recipe's
  native inputs, passed as `drush recipe --input=<dir>.<key>=<value>`
- dq-install lists each fetched recipe's available options (read from
  its recipe.yml input block) — progressive disclosure, all optional
- theme.layout seeds the starterkit's sidebar|single theme setting
- homepage.blocks composes the front page from recipe-advertised blocks
  (registry carries extra.dq.recipe.blocks): block config in the content
  region, <front>-only, list order = weight; front page becomes /home, a
  dedicated always-empty view the admin can repoint or edit later
- dq-registry-build passes the blocks metadata through; registry rebuilt
- dq-init --interactive now asks page layout, per-recipe options (from
  the registry's input summary), and homepage block composition — all
  default-safe; the options form is written only when a value differs
- layout is baked at scaffold time, not a runtime setting: scaffold
  copies the chosen page-shell--<layout> variant over the shell and
  removes the rest (see dq-starterkit); no theme setting or settings form
- dq-registry-build summarises each recipe's recipe.yml input block into
  the registry (options), with a dependency-free YAML backend chain; CI
  enables the yaml extension
- docs: presets.md content-scale contract section; workflow.md config +
  scaffold steps; dq-add-recipe (inputs, blocks, contract) and
  dq-conventions (site composition, baked layout) skills; README
…ace)

By default, after unpacking recipes, dq-install now writes each recipe's
available options as a commented block under that recipe's own entry in
config.dq.yml — the user uncomments (strip the leading `# `) to enable;
defaults apply until then. Prefixing `# ` to the real lines keeps the
uncommented result valid YAML at the right indent.

- promotes a bare `- "key"` entry to `- name: "key"` so options attach
- idempotent: skips an entry that already has options (commented or active)
- --exclude-options keeps the prior behaviour (list in the terminal only)
- docs/comments (config template, workflow.md, dq-conventions) updated
The fiddly deterministic pieces now live in plain classes instead of
being defined inside the bin scripts and ScaffoldCommand privates:

- src/Config/RecipeOptions  — option-line rendering + commented-block
  injection (from bin/dq-install)
- src/Config/RecipeEntry    — recipe entry normalization + package
  resolution (from ScaffoldCommand)
- src/Config/PresetDiscovery — the package.json "dq" read, now shared
  by ScaffoldCommand AND bin/dq-init (removes the last duplicated copy)
- src/Registry/RegistryEntry — registry entry building, options
  summary, git-URL normalization (from bin/dq-registry-build; takes
  parsed recipe data so the YAML-backend probing stays in the script)

Bin scripts load these via direct require_once, so dq-registry-build
stays standalone (no Composer autoloader needed).

Test infrastructure: phpunit.xml, require-dev phpunit ^10.5,
autoload-dev, `composer test`, a root-only repositories entry so
`composer install` resolves the starterkit for development, gitignored
vendor/lock/cache, and a CI workflow running the suite on every push.

tests/Unit covers all four classes (29 tests, 48 assertions): the
uncomment contract, string->mapping promotion, idempotency, user-edit
preservation, the comment-boundary case, entry forms, preset fallbacks,
and registry building. Verified behaviour unchanged: registry regen is
byte-identical and the dq-init wizard output is identical.
@charlesnutter charlesnutter merged commit e8ec16e into main Jul 4, 2026
2 checks passed
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