diff --git a/bds-tools/src/check-update.ts b/bds-tools/src/check-update.ts index 326fd4d7..07bb47ff 100644 --- a/bds-tools/src/check-update.ts +++ b/bds-tools/src/check-update.ts @@ -41,7 +41,7 @@ import { compareVersions, getCurrentVersionAsync, getCurrentVersionSync, saveVer // 独立入口:source = "updater",与 bds-manager 的 "bds-tools" 区分 const updaterFileSink = createFileSink(LOG_PATH); -export const log = createLogger({ source: "updater", sinks: [createStdoutSink({ bare: true }), updaterFileSink] }); +const log = createLogger({ source: "updater", sinks: [createStdoutSink({ bare: true }), updaterFileSink] }); const closeLog = (): void => updaterFileSink.close(); function parseArgs(argv: string[]): Record { diff --git a/bds-tools/src/qqutil.ts b/bds-tools/src/qqutil.ts index 2817b57f..60c38dfc 100644 --- a/bds-tools/src/qqutil.ts +++ b/bds-tools/src/qqutil.ts @@ -15,7 +15,7 @@ import { type QQBridgeConfig, } from "@sfmc-bds/sdk/node/config"; import http from "node:http"; -import { log } from "./check-update.js"; +import { log } from "./log.js"; import { ROOT_DIR } from "./paths.js"; type QqConfig = Pick; diff --git a/db-server/src/domain/economy.ts b/db-server/src/domain/economy.ts index 868d4341..5896e04e 100644 --- a/db-server/src/domain/economy.ts +++ b/db-server/src/domain/economy.ts @@ -19,7 +19,10 @@ import { sql } from "../lib/sql-helpers.js"; import type { TxResult } from "./transaction.js"; export type { TxResult }; -/** 账户表行(与 feature-economy 权威类型结构对齐) */ +/** + * 经济域行模型(原 SDK contracts/economy;契约内聚到表所有者 db-server)。 + * 业务模块应通过 service(economy.*) 消费视图,不依赖这些内部行类型。 + */ export interface EconomyAccountRow { player_id: string; player_name_snapshot: string; diff --git a/sfmc/src/terminal.ts b/sfmc/src/terminal.ts index 59a3c7c3..e4ba5222 100644 --- a/sfmc/src/terminal.ts +++ b/sfmc/src/terminal.ts @@ -55,7 +55,8 @@ function terminalSettingsFiles(): string[] { .filter((file) => fs.existsSync(file)); } -function preferredPowerShell(): string { +/** Windows Terminal profile.commandline:启动 shell 并立即进入 sfmc */ +function preferredSfmcCommandline(): string { const programFiles = [process.env.ProgramW6432, process.env.ProgramFiles].filter((value): value is string => Boolean(value) ); @@ -66,14 +67,18 @@ function preferredPowerShell(): string { ]; const installed = candidates.find((candidate) => fs.existsSync(candidate)); - if (installed) return "pwsh -Command sfmc"; + if (installed) return `"${installed}" -Command sfmc`; if (spawnSync("pwsh.exe", ["-NoProfile", "-Command", "exit"], { stdio: "ignore", windowsHide: true }).status === 0) { - return "pwsh -Command sfmc"; + return "pwsh.exe -Command sfmc"; } - return ( - path.join(process.env.SystemRoot ?? "C:\\Windows", "System32", "WindowsPowerShell", "v1.0", "powershell.exe") + - " -Command sfmc" + const windowsPowerShell = path.join( + process.env.SystemRoot ?? "C:\\Windows", + "System32", + "WindowsPowerShell", + "v1.0", + "powershell.exe" ); + return `"${windowsPowerShell}" -Command sfmc`; } function newGuid(): string { @@ -203,5 +208,5 @@ export function ensureSeaTerminalProfile(): void { const runtimeFile = configPath(ROOT, "runtime.json"); const state = terminalState(runtimeFile, path.dirname(process.execPath)); - for (const settingsFile of settingsFiles) updateProfile(settingsFile, state, preferredPowerShell()); + for (const settingsFile of settingsFiles) updateProfile(settingsFile, state, preferredSfmcCommandline()); }