Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

fix: replace require() with ES module imports in map.ts and bootstrap.ts

kagebinary253ada1894aa
diff --git a/ix-cli/src/cli/bootstrap.ts b/ix-cli/src/cli/bootstrap.ts
index 39e32723..5823ecf8 100644
--- a/ix-cli/src/cli/bootstrap.ts
+++ b/ix-cli/src/cli/bootstrap.ts
@@ -1,4 +1,4 @@
-import { mkdirSync, existsSync } from "node:fs";
+import { mkdirSync, existsSync, writeFileSync } from "node:fs";
import { join, basename, resolve } from "node:path";
import { homedir } from "node:os";
import { randomUUID } from "node:crypto";
@@ -21,7 +21,6 @@ export function ensureLocalConfig(): boolean {
const configPath = join(configDir, "config.yaml");
if (existsSync(configPath)) return false;
mkdirSync(configDir, { recursive: true });
- const { writeFileSync } = require("node:fs");
writeFileSync(configPath, `endpoint: ${getEndpoint()}\nformat: text\n`);
return true;
}
diff --git a/ix-cli/src/cli/commands/map.ts b/ix-cli/src/cli/commands/map.ts
index 30f6d5ff..70a56491 100644
--- a/ix-cli/src/cli/commands/map.ts
+++ b/ix-cli/src/cli/commands/map.ts
@@ -1,3 +1,4 @@
+import { resolve } from "node:path";
import type { Command } from "commander";
import chalk from "chalk";
import { IxClient } from "../../client/api.js";
@@ -57,7 +58,7 @@ Examples:
ix map --min-confidence 0.5`
)
.action(async (pathArg: string | undefined, opts: { format: string; level?: string; minConfidence: string }) => {
- const cwd = pathArg ? require("node:path").resolve(pathArg) : process.cwd();
+ const cwd = pathArg ? resolve(pathArg) : process.cwd();
try {
await bootstrap(cwd);