Skip to content

POC Config Generator#16

Open
charlesnutter wants to merge 2 commits into
mainfrom
feat/config-generator
Open

POC Config Generator#16
charlesnutter wants to merge 2 commits into
mainfrom
feat/config-generator

Conversation

@charlesnutter

Copy link
Copy Markdown
Member

Initial POC for the form generator

Dtails

  • Form column (⅓ width, clamped 340–480px), five accordion sections: Site information; Appearance with preset radio cards (color swatches), layout picker with schematic icons, and the nested theme-design overrides (primary color + font); Recipes as checkboxes with descriptions — checking Blog reveals its options subsection with items_per_page; Content layout with add/reorder/remove for advertised blocks (unchecking a recipe pulls its blocks out of the composition); Extra configuration with three curated globals (slogan, site mail, registration policy). Download button at the bottom.
  • Preview pane with two tabs. Preview renders the mock homepage — sidebar or single-column shell, styled entirely by --pv-* CSS variables carrying the real preset tokens I transcribed from the three preset files, dummy content per recipe (the blog list even honors items_per_page, and an empty composition falls back to the blog's /writing front or a "welcome" placeholder). config.dq.yml shows the generated file with a copy button.
  • The emitter is verified, not just eyeballed: I drove the component headlessly in Node with the exact smoke-test inputs, parsed the output with Symfony Yaml, and asserted the structure — recipe entry forms, homepage blocks, parameters all correct. The rendered file matches the smoke-test sample section for section, including the commented block catalog.

After fetching recipes, writes a commented '# ── Available recipe blocks'
section listing every block the installed recipes advertise (keyed as
recipe/block with label and plugin ID), plus the homepage: snippet to
uncomment and edit. The section also serves as a reference for future
placement targets. Replaces the template placeholder on first run;
idempotent on re-runs; skips if homepage: is already active.

- src/Config/RecipeBlocks.php: new class (commentedCatalog, injectCatalog)
- tests/Unit/Config/RecipeBlocksTest.php: 16 tests covering all paths
- bin/dq-install: single read/write pass for options + catalog
- templates/config.dq.yml, docs/workflow.md: updated to reflect new behavior

Suite: 45 tests, 75 assertions.
Static single-page tool (tools/generator/): a form mirroring the config
sections (site, appearance + design overrides, recipes with per-recipe
options, homepage block composition, curated extra config) beside a
two-tab preview pane — a mock homepage styled by the selected preset's
real tokens, and the generated config.dq.yml with copy/download.

Alpine.js + Tailwind browser CDN, no build step. The YAML emitter
reproduces the canonical template comments, RecipeOptions option lines,
and the RecipeBlocks catalog verbatim (sync contract noted in README).
catalog.js hardcodes registry/preset metadata for now; output validated
against Symfony Yaml and eyeball-diffed against the e2e smoke config.

Serve by copying into a docroot, e.g. dq-smoke/web/generator/.
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