WORK-450
ID:WORK-450Status:done

Framework-agnostic theme scaffold default with --target opt-in

Per ADR-024, the --type theme scaffold currently emits a Svelte-coupled theme (svelte/ folder, SvelteTheme export, target: 'svelte') that doesn't match the framework-agnostic reference theme (Lumina, which ships zero .svelte). Default it to framework-agnostic; make the framework component layer opt-in via --target.

Priority:highComplexity:moderateMilestone:v0.25.0Source:SPEC-118
claude/milestone-v0-28-0-llvtfa View source

Criteria completion

Criteria completion: 4 of 4 (100%) checked; tracking started on Jul 9, no incremental history yet0%25%50%75%100%Jul 9Jul 11

Tracking started Jul 9 — check back for trends.

Branches 4
History 3
  1. 81896e6
    Created (done)by bjornolofandersson
  2. a62da56
    Content editedby Claude
    feat(create-refrakt): framework-agnostic theme scaffold + --target svelt
  3. a6bdcba
    Content editedby Claude
    plan(v0.25.0): accept specs/ADRs and decompose into 21 work items

Acceptance Criteria

  • --type theme defaults to a framework-agnostic theme: tokens + ./transform config + ./layouts configs + manifest + per-rune CSS + css-coverage test; no svelte/, SvelteTheme, or target
  • --target <framework> opts into the framework component layer (adds svelte/, the ./svelte export, framework layout components)
  • The agnostic scaffold matches the reference theme (Lumina) shape and builds clean
  • Inherits the ADR-023 deps + day-one build wiring (WORK-448)

Approach

Rework scaffoldTheme in packages/create-refrakt/src/scaffold.ts to emit the agnostic core by default (mirroring packages/lumina), gating the svelte/ layer behind --target. Drop target from the default manifest.

Dependencies

  • WORK-447--type dispatch (and the --target flag plumbing)
  • WORK-448 — deps + build wiring

References

  • SPEC-118; ADR-024
  • packages/create-refrakt/src/scaffold.ts; packages/lumina/package.json

Resolution

Completed: 2026-06-24

Branch: claude/v0.25.0-impl-2

What was done

Reworked scaffoldTheme (ADR-024). Default --type theme now emits a framework-agnostic theme mirroring Lumina: src/config.ts (mergeThemeConfig), src/layouts.ts (re-exports defaultLayout/docsLayout/blogArticleLayout from @refrakt-md/transform), tokens/, styles/runes, manifest.json (no target; regions-only layouts; refrakt range), index.css/base.css, css-coverage test. Exports ./transform + ./layouts + ./manifest + CSS; no svelte/, SvelteTheme, or target. @refrakt-md/* are peerDependencies (minor range) mirrored to devDependencies.

--target svelte opts into the component layer — adds svelte/index.ts (SvelteTheme + registry), svelte/layouts/DefaultLayout.svelte, svelte/tokens.css, the ./svelte export, and the @refrakt-md/svelte peer.

bin.ts: --target svelte is parsed as the theme component-layer opt-in (distinct from site adapters), inferred to --type theme, rejected for other kinds; done-message + usage updated.

Verified

Scaffolded both variants: agnostic has no svelte/ and exports ./transform+./layouts only; --target svelte adds the layer + export + peer. Matches the reference theme shape.