WORK-173
ID:WORK-173Status:draft

Update create-refrakt scaffolds for the unified config shape

create-refrakt currently writes a flat-shape site/refrakt.config.json for site projects and (via plan init) no config at all for plan projects. Update both paths to produce the new unified root-shape config — site projects get a sites.main section, plan projects get a plan section, and any combined scaffolds (future) declare both.

Priority:mediumComplexity:moderateMilestone:v0.11.0Source:ADR-010

Criteria completion

Criteria completion: 0 of 8 (0%) checked; tracking started on May 1, no incremental history yet0%25%50%75%100%May 1May 11

Tracking started May 1 — check back for trends.

Branches 2
History 3
  1. ce8fb3c
    Created (draft)by bjornolofandersson
  2. 5127eee
    Content editedby Claude
    plan(v0.11.0): drop plan.specsDir, expand WORK-166 to all five adapters
  3. 2b1f874
    Content editedby Claude
    plan(v0.11.0): scaffold milestone and 17 work items

Acceptance Criteria

  • create-refrakt --type site produces a root-level refrakt.config.json with plugins and sites.main, not the old flat shape
  • The site name in the config (sites.main or whatever default we pick) is documented in the scaffold's README so users know how to add a second site later
  • create-refrakt --type plan ends up with a refrakt.config.json containing only a plan section — produced by plan init (per WORK-168)
  • create-refrakt --type theme is unaffected (themes don't ship a project-level config)
  • Generated vite.config.ts for site scaffolds passes site: 'main' to the refrakt plugin
  • Generated package.json for site scaffolds lists the rune packages under both dependencies and the config's plugins array (where appropriate) and sites.main.packages (for site rune merging)
  • Tests in packages/create-refrakt/test/ cover the new config shape for both site and plan types
  • Smoke test: npx create-refrakt my-site --type site --target svelte && cd my-site && npm install && npm run build succeeds

Approach

  1. Update the site scaffold templates in packages/create-refrakt/src/templates/site/ (or wherever the templates live) to emit the new config shape.

  2. Update scaffoldSite() (or equivalent) to populate plugins and sites.main.packages based on the user's selections.

  3. Update vite.config.ts template to include site: 'main'.

  4. Plan scaffolding is delegated to plan init (WORK-168); confirm the integration produces a valid config.

  5. Update test fixtures that assert on the generated config shape.

Dependencies

  • WORK-159, WORK-166, WORK-168 — config shape, framework adapter site option, plan init scaffolding

References

  • ADR-010 — Unified root-level refrakt config
  • packages/create-refrakt/src/scaffold.ts — site scaffolding
  • packages/create-refrakt/src/templates/ — template files
  • packages/create-refrakt/test/ — existing tests to extend