Setting up your dashboard0 entities found · 7/31 branches scanned
ID:WORK-171Status:draft
Add refrakt config migrate command
Add a small migration command that rewrites a flat-shape refrakt.config.json into the nested form (site.* and explicit plugins). Optional for users — the flat shape stays valid indefinitely — but useful for projects adopting the unified config or moving to multi-site.
Migration is idempotent — running on an already-migrated file is a no-op
When the source file declares both site and sites, the command refuses to migrate and explains the conflict
plugins field is populated from the project's installed @refrakt-md/* packages on first migration if absent (with a comment in the diff explaining the source)
runConfigMigrate(args) reads the raw config (not the normalized form — we need the original shape), applies the requested transform, and either prints a diff or writes the result.
Use a minimal diff library (or hand-roll line diff — the file is small) for the dry-run output.
JSON formatting: preserve tabs/spaces by sniffing the source file's indentation before re-serializing.
Dependencies
WORK-159 — needs the loader to expose the raw config alongside the normalized form
WORK-160 — for plugin enumeration when populating plugins