Create configuration override framework for recipes#14
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.