WORK-446
ID:WORK-446Status:ready

Multi-site --site targeting and config read/write helpers

Multi-site projects currently make theme install hard-error ("cannot pick a target automatically"). SPEC-110 §3 replaces that with a --site selector and extends the config read/write helpers. The flag's existence rules differ by apply-mode (select an existing site vs. name a new one), so the helpers must support both.

Priority:highComplexity:moderateMilestone:v0.25.0Source:SPEC-110
claude/v0.25.0-workitems View source

Criteria completion

Criteria completion: 0 of 5 (0%) checked; tracking started on Jun 23, no incremental history yet0%25%50%75%100%Jun 23Jul 11

Tracking started Jun 23 — check back for trends.

Branches 3
claude/v0.25.0-workitems current ready
main donechangeset-release/main doneclaude/v0.25.0-impl done
History 1
  1. a6bdcba
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • --site <name> selects the target site; inferred when exactly one site exists; when multiple exist and --site is absent, list the site names and exit cleanly (no dead end)
  • readThemeFromConfig / writeThemeIntoConfig accept an explicit site key and can create a new site entry, not only update an existing one
  • Adding a second site to a singular site: config rewrites it to plural sites: { default, <new> }
  • Helpers are shared so the theme / template / preset apply-modes reuse them
  • Tests cover single-site infer, multi-site select, missing-flag listing, and singular→plural rewrite

Approach

Extend the helpers in packages/cli/src/commands/theme.ts / config-file.ts to take a site key and to distinguish "update existing" from "create new" (the latter is what full-site template install needs). Normalise singular↔plural config shapes in one place.

References

  • SPEC-110 §3
  • packages/cli/src/commands/theme.ts, packages/cli/src/config-file.ts, packages/types/src/theme.ts