From 0711e129dc67826fa564ddcc2d1ef187a17178fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=82CHES?= Date: Sun, 15 Mar 2026 16:58:37 -0600 Subject: [PATCH] refactor: gate v1 migration code behind dynamic import (#541) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/resources/extensions/gsd/commands.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resources/extensions/gsd/commands.ts b/src/resources/extensions/gsd/commands.ts index 1c130f7f9..56df01e4a 100644 --- a/src/resources/extensions/gsd/commands.ts +++ b/src/resources/extensions/gsd/commands.ts @@ -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; }