feat: add kiqr scaffold theme command (block + classic) - #18
Closed
kjellbergzoey wants to merge 1 commit into
Closed
feat: add kiqr scaffold theme command (block + classic)#18kjellbergzoey wants to merge 1 commit into
kiqr scaffold theme command (block + classic)#18kjellbergzoey wants to merge 1 commit into
Conversation
Add a `kiqr scaffold theme <name> [--type block|classic]` command that generates a production-ready WordPress theme in a new directory so a developer can scaffold and `kiqr init && kiqr up` immediately. Defaults to a modern block (Full Site Editing) theme — theme.json schema v3 with a color palette, fluid type scale, spacing scale and layout sizes, plus templates, template parts, and a registered hero block pattern. Also supports a classic PHP-template theme via `--type classic`. Generation logic lives in a pure, unit-tested `src/lib/scaffold.ts` (`generateTheme` returns a file map; `writeTheme` writes it and refuses to clobber a non-empty directory). The Pastel command stays thin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Adds
kiqr scaffold theme <name> [--type block|classic]— generates a production-ready WordPress theme in a new directory so a developer can scaffold and start developing immediately:This closes the FSE-scaffolding gap from the product strategy. No CLI-first WordPress tool scaffolds a modern, correct Full Site Editing theme well in 2026 — this makes
kiqrthe one that does, while still supporting classic PHP-template themes via--type classic.What gets generated (block / FSE — the default)
--type classicgenerates the standard classic structure:style.css,index.php,functions.php,header.php,footer.php,readme.txt,.gitignore.Design
src/lib/scaffold.tsis pure and fully unit-tested.generateTheme(opts)returns aRecord<relativePath, contents>and touches nothing on disk.writeTheme(targetDir, files)writes the map, creating nested dirs, and refuses to clobber a non-empty existing directory.src/commands/scaffold/theme.tsx) stays thin: validates the name, reusesslugifyfromlib/theme.ts, computes./<slug>, callsgenerateTheme+writeTheme, and renders success/next-steps (or a clean error) via Ink.--typedefaults toblock(alias-t); optional--author.dbsubcommand group: newsrc/commands/scaffold/index.tsxfor group help. Main help list and README command table updated.Tests & checks
tests/lib/scaffold.test.tscovers the block file set + header/theme.json/template-part/pattern/functions assertions, the classic file set, slug handling, andwriteThemeround-trip + clobber refusal in a temp dir.npm run typecheck,npm test(127 passing),npm run build, andbiome check .all pass.node dist/cli.js scaffold theme "Demo Theme"produced the tree above with valid JSON (theme.jsonversion 3) and a correctstyle.cssheader;--type classicand the clobber guard verified too.🤖 Generated with Claude Code