/** * Helpers — 发布层模块。 * * 职责边界: * - 负责:safeReadCached 等 发布层职责 * - 不负责:不属于本模块的职责由对应模块承担 * * 被谁调用:发布工具(sf_release)、门禁 * 调用谁:node:fs、node:path、types、helpers * * 数据流:项目状态 → 门禁检查 → 发布决策 * 持久化:读写本地文件(详见代码内路径) */ import type { GateContext } from "./types.js"; /** * 从缓存读取文件,避免重复 I/O。 */ export declare function safeReadCached(filePath: string, cache: Map): string | null; /** * 安全读取文件(无缓存)。 */ export declare function safeRead(filePath: string): string | null; /** * 递归查找指定扩展名的文件。 */ export declare function findFilesRecursive(dir: string, ext: string): string[]; /** * 动态 import 并验证导出存在性。 */ export declare function importAndVerify(_ctx: GateContext, distPath: string, exportName: string): Promise<{ mod: T; error?: string; } | null>; /** * 构建门禁上下文(在入口处调用一次)。 */ export declare function buildGateContext(rootDir: string): GateContext;