Skip to content

feat(scaffold): selective example-set removal markers#720

Draft
aryanjasala wants to merge 1 commit into
feat/hmrfrom
feat/example-toggle
Draft

feat(scaffold): selective example-set removal markers#720
aryanjasala wants to merge 1 commit into
feat/hmrfrom
feat/example-toggle

Conversation

@aryanjasala

Copy link
Copy Markdown
Member

What this does

Marks the theme's demo code so npm run init can offer a per-set keep/remove choice on first scaffold.

Changes

  • bin/scaffold.config.jsexamples.groups: the three demo modules (media-text block extension, theme options, author bio), the example components (button/card/carousel), and the page-creation pattern.
  • inc/Main.php — the three demo modules share this file, so each scopes its own region with a keyed wp:example:<key> marker; the combined use is split so each import can be marked individually.

How I verified

Ran the init engine's example step for remove-all, remove-subset (e.g. settings,components), and keep-all: keyed scoping removes only the chosen sets while keeping the rest, markers always stripped, inc/Main.php and all PHP valid (php -l).

Notes

Markers are inert until init processes them — no runtime effect on the built theme. Components and the pattern are delete-only (auto-discovered, nothing to strip).

Mark the demo modules (media-text block extension, theme options, author bio), example components and page-creation pattern with grouped wp:example markers so init can drop selected sets while keeping the rest. The three Main.php modules use keyed markers to scope their shared regions.
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