From 33f04df0297ab03d587d7d2884d14383b0698364 Mon Sep 17 00:00:00 2001 From: Rytis Lukosevicius Date: Wed, 18 Mar 2026 08:24:43 +0100 Subject: [PATCH] fix: inline preferences path to fix remote questions setup (#1110) (#1111) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `remote-questions-config.ts` was extracted in #592 to avoid crossing the compiled/uncompiled boundary. However, it still imported `getGlobalGSDPreferencesPath` from `preferences.ts` via a `.js` extension — which fails at runtime because `preferences.ts` is loaded via jiti and never compiled to `.js` in dist/. This caused remote questions setup (Telegram/Slack/Discord) to fail during `gsd config` with: Cannot find module '.../preferences.js' imported from .../remote-questions-config.js Fix: inline the path constant directly. It's a single `join()` call with no logic, so duplicating it is cleaner than adding a build step or creating a separate compiled module just for this one export. --- src/remote-questions-config.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/remote-questions-config.ts b/src/remote-questions-config.ts index 27e98b380..ffa753ecd 100644 --- a/src/remote-questions-config.ts +++ b/src/remote-questions-config.ts @@ -9,11 +9,17 @@ */ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs"; -import { dirname } from "node:path"; -import { getGlobalGSDPreferencesPath } from "./resources/extensions/gsd/preferences.js"; +import { dirname, join } from "node:path"; +import { homedir } from "node:os"; + +// Inlined from preferences.ts to avoid crossing the compiled/uncompiled +// boundary — this file is compiled by tsc, but preferences.ts is loaded +// via jiti at runtime. Importing it as .js fails because no .js exists +// in dist/. See #592, #1110. +const GLOBAL_PREFERENCES_PATH = join(homedir(), ".gsd", "preferences.md"); export function saveRemoteQuestionsConfig(channel: "slack" | "discord" | "telegram", channelId: string): void { - const prefsPath = getGlobalGSDPreferencesPath(); + const prefsPath = GLOBAL_PREFERENCES_PATH; const block = [ "remote_questions:", ` channel: ${channel}`,