MCPcopy Create free account
hub / github.com/GTJasonMK/lessAI / loadDocumentFlowNavigationModule

Function loadDocumentFlowNavigationModule

scripts/ui-regression.test.mjs:101–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99}
100
101async function loadDocumentFlowNavigationModule() {
102 const tempRoot = join(process.cwd(), ".tmp");
103 mkdirSync(tempRoot, { recursive: true });
104 const dir = mkdtempSync(join(tempRoot, "lessai-document-flow-navigation-"));
105
106 try {
107 const source = read("src/stages/workbench/document/documentFlowNavigation.ts");
108 const transpiled = ts.transpileModule(source, {
109 compilerOptions: {
110 module: ts.ModuleKind.ES2022,
111 target: ts.ScriptTarget.ES2022
112 },
113 fileName: "documentFlowNavigation.ts"
114 }).outputText;
115 const rewritten = rewriteRelativeImports(transpiled);
116 writeFileSync(join(dir, "documentFlowNavigation.mjs"), rewritten, "utf8");
117
118 return await import(pathToFileURL(join(dir, "documentFlowNavigation.mjs")).href);
119 } finally {
120 rmSync(dir, { recursive: true, force: true });
121 }
122}
123
124async function loadHelpersModule() {
125 const tempRoot = join(process.cwd(), ".tmp");

Callers 1

Calls 2

readFunction · 0.90
rewriteRelativeImportsFunction · 0.85

Tested by

no test coverage detected