@@ -234,8 +234,40 @@ jobs:
234234
235235 - name : Build core dist (server bundle)
236236 run : |
237- bunx tsdown
238- echo '{"type":"module"}' > dist/package.json
237+ node --input-type=module <<'NODE'
238+ import fs from "node:fs";
239+ import path from "node:path";
240+
241+ const root = process.cwd();
242+ const hasRootTsdownEntry =
243+ fs.existsSync(path.join(root, "tsdown.config.ts")) ||
244+ fs.existsSync(path.join(root, "tsdown.config.mts")) ||
245+ fs.existsSync(path.join(root, "tsdown.config.js")) ||
246+ fs.existsSync(path.join(root, "src", "index.ts"));
247+
248+ if (hasRootTsdownEntry) {
249+ const { spawnSync } = await import("node:child_process");
250+ const result = spawnSync("bunx", ["tsdown", "--fail-on-warn", "false"], {
251+ cwd: root,
252+ stdio: "inherit",
253+ shell: process.platform === "win32",
254+ });
255+ process.exit(result.status ?? 1);
256+ }
257+
258+ const entryTarget = "../packages/app-core/src/entry.ts";
259+ const entrySource = [
260+ "// auto-generated by release-electrobun.yml",
261+ "// Standalone elizaOS checkouts do not have a root tsdown entry.",
262+ `export * from ${JSON.stringify(entryTarget)};`,
263+ "",
264+ ].join("\n");
265+
266+ fs.mkdirSync(path.join(root, "dist"), { recursive: true });
267+ fs.writeFileSync(path.join(root, "dist", "entry.js"), entrySource);
268+ fs.writeFileSync(path.join(root, "dist", "index.js"), entrySource);
269+ fs.writeFileSync(path.join(root, "dist", "package.json"), '{"type":"module"}\n');
270+ NODE
239271 node --import tsx packages/scripts/write-build-info.ts
240272
241273 - name : Run heavy E2E regression suite
0 commit comments