fix(packaging): distribute plugin archives without tracking dist

This commit is contained in:
gitea committed 2026-10-26 11:54:37 +08:00
1 parent 8571390f15
commit f4788375a1
11 files changed
+159 -2430

No files matched your search

+5 -1
View File
@@ -5,6 +5,10 @@ import { fileURLToPath } from "node:url";
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const bun = process.env.BUN_BIN || "bun";
const args = process.argv.slice(2);
if (args.some(arg => !arg.startsWith("--outfile="))) {
throw new Error("Usage: build-plugin.mjs [--outfile=<path>]");
}
function run(args) {
const result = spawnSync(bun, args, {
@@ -17,7 +21,7 @@ function run(args) {
}
}
const mcpOutput = resolve(root, "dist/mcp/server.js");
const mcpOutput = resolve(args.find(arg => arg.startsWith("--outfile="))?.slice("--outfile=".length) || resolve(root, "dist/mcp/server.js"));
mkdirSync(dirname(mcpOutput), { recursive: true });
// The shared CLI uses bun:sqlite; the plugin manifest must use this runtime too.
// Embedded CommonJS loaders must use the bundle path, not the build host's absolute checkout path.