Skip to content

v1.0.0-beta.14

@koehler8 koehler8 tagged this 03 May 18:10
Two new bin scripts (with shared scaffold.mjs core) that scaffold
a starter theme or extension into the current site:

  npx cms-create-theme <slug>
  npx cms-create-extension <slug>

Each writes the canonical file set to ./themes/<slug>/ or
./extensions/<slug>/, applying __SLUG__ / __DISPLAY_NAME__
substitutions to the templates under templates/scaffolds/. The
generated theme manifest validates against themeValidator
immediately (placeholder slate-and-sand palette); the generated
extension manifest ships with components: [] (supported since
beta.11, no stub needed).

The CLI does NOT auto-modify the site's package.json or
vite.config.js — wiring is left to a copy/paste from the printed
next-steps message. Auto-editing those files would risk corrupting
custom formatting and is harder to reverse than three lines of JSON.

Tests: 12 new specs in tests/scripts/scaffold.spec.js covering both
kinds, slug validation, --force/--out flags, substitution, and
manifest validation. Outputs go to tests/_tmp/ (gitignored) so
Vite's dynamic-import resolver can load the generated files.

Defensive default-frameworkRoot resolution avoids vitest's
happy-dom URL polyfill breaking module-eval-time path computation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Assets 2
Loading