`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.
This commit is contained in:
parent
920f1bed9a
commit
33f04df029
1 changed files with 9 additions and 3 deletions
|
|
@ -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}`,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue