Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(publish): clean opencode-plugin node_modules after tsup build to prevent E415 hard-link tarball rejection

diegosouzapwec78fe3d2c3b
diff --git a/scripts/build/prepublish.ts b/scripts/build/prepublish.ts
index b5c2e14dfb..afcdca2be3 100644
--- a/scripts/build/prepublish.ts
+++ b/scripts/build/prepublish.ts
@@ -309,6 +309,15 @@ if (existsSync(opencodePluginSrc) && existsSync(join(opencodePluginSrc, "package
} else {
console.log(" ✅ @omniroute/opencode-plugin dist/ already present (skipping rebuild)");
}
+ // Remove plugin node_modules after build — hard links created by npm install on Linux
+ // (CI runner) end up in the tarball as LINK entries, which npm registry rejects with
+ // E415 "Hard link is not allowed". The node_modules are only needed for the tsup build;
+ // they must not ship in the published package.
+ const pluginNodeModules = join(opencodePluginSrc, "node_modules");
+ if (existsSync(pluginNodeModules)) {
+ rmSync(pluginNodeModules, { recursive: true, force: true });
+ console.log(" 🧹 Removed @omniroute/opencode-plugin/node_modules (hard link guard)");
+ }
} else {
console.log(" ⏭️ @omniroute/opencode-plugin not found in workspace (skipping build)");
}