mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 14:52:09 +03:00
fix(cli): implement Node 22 mjs entrypoint to bypass type stripping limit
This commit is contained in:
@@ -372,6 +372,24 @@ if (existsSync(mcpSrcFile)) {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Step 8.7: Bundle CLI Entrypoint ──────────────────────────
|
||||
const cliSrcFile = join(ROOT, "bin", "omniroute.ts");
|
||||
const cliDestFile = join(ROOT, "bin", "omniroute.mjs");
|
||||
|
||||
if (existsSync(cliSrcFile)) {
|
||||
console.log(" 🔨 Bundling CLI Entrypoint (TypeScript → JavaScript)...");
|
||||
try {
|
||||
execSync(
|
||||
`npx esbuild bin/omniroute.ts --bundle --platform=node --packages=external --format=esm --outfile=bin/omniroute.mjs`,
|
||||
{ cwd: ROOT, stdio: "inherit" }
|
||||
);
|
||||
execSync(`chmod +x bin/omniroute.mjs`, { cwd: ROOT });
|
||||
console.log(" ✅ CLI Entrypoint bundled to bin/omniroute.mjs");
|
||||
} catch (err: any) {
|
||||
console.warn(" ⚠️ CLI bundle error:", err.message);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Step 9: Copy shared utilities needed at runtime ────────
|
||||
const sharedApiKey = join(ROOT, "src", "shared", "utils", "apiKey.js");
|
||||
const sharedApiKeyDest = join(APP_DIR, "src", "shared", "utils");
|
||||
|
||||
Reference in New Issue
Block a user