refactor: gate v1 migration code behind dynamic import (#541)

The migrate/ directory (1,862 lines across 9 files) is one-time migration
code for .planning/ → .gsd/ conversion. Replace the static top-level
import with a dynamic import() that only loads when `/gsd migrate` is
invoked, matching the existing pattern used for hooks and metrics.

Closes #523

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
TÂCHES 2026-03-15 16:58:37 -06:00 committed by GitHub
parent bc4d4fcf48
commit 0711e129dc

View file

@ -31,7 +31,7 @@ import {
filterDoctorIssues,
} from "./doctor.js";
import { loadPrompt } from "./prompt-loader.js";
import { handleMigrate } from "./migrate/command.js";
import { handleRemote } from "../remote-questions/remote-command.js";
import { handleHistory } from "./history.js";
import { handleUndo } from "./undo.js";
@ -249,6 +249,7 @@ export function registerGSDCommand(pi: ExtensionAPI): void {
}
if (trimmed === "migrate" || trimmed.startsWith("migrate ")) {
const { handleMigrate } = await import("./migrate/command.js");
await handleMigrate(trimmed.replace(/^migrate\s*/, "").trim(), ctx, pi);
return;
}