Skip to content

Commit bf9a428

Browse files
claude: Make command-utils import dynamic to fix build cycle
Changed execute/engine.ts to use dynamic import for initializeProjectContextAndEngines from command/command-utils.ts. This breaks a circular dependency that was causing the build to fail. The cycle was: execute/engine.ts → command/command-utils.ts → ... → execute/engine.ts The import is only used in the engine command action handler, so making it dynamic has no performance impact on normal operations while fixing the build. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 274e1e5 commit bf9a428

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/execute/engine.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ import { Command } from "cliffy/command/mod.ts";
4040
import { quartoAPI } from "../core/api/index.ts";
4141
import { satisfies } from "semver/mod.ts";
4242
import { quartoConfig } from "../core/quarto.ts";
43-
import { initializeProjectContextAndEngines } from "../command/command-utils.ts";
43+
// Dynamic import to break circular dependency
44+
// import { initializeProjectContextAndEngines } from "../command/command-utils.ts";
4445

4546
const kEngines: Map<string, ExecutionEngineDiscovery> = new Map();
4647

@@ -386,6 +387,9 @@ export const engineCommand = new Command()
386387
.arguments("<engine-name:string> [args...:string]")
387388
.action(async (options, engineName: string, ...args: string[]) => {
388389
// Initialize project context and register external engines
390+
const { initializeProjectContextAndEngines } = await import(
391+
"../command/command-utils.ts"
392+
);
389393
await initializeProjectContextAndEngines();
390394

391395
// Get the engine (now includes external ones)

0 commit comments

Comments
 (0)