mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-15 10:05:14 +00:00
Complete the remaining pi-to-companion rename across companion-os, web, vm-orchestrator, docker, and archived fixtures. Verification: - semantic rg sweeps for Pi/piConfig/getPi/.pi runtime references - npm run check in apps/companion-os (fails in this worktree: biome not found) Co-authored-by: Codex <noreply@openai.com>
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
import { mkdir } from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { build } from "esbuild";
|
|
|
|
const sourceRoot = process.env.COMPANION_BUILTIN_EXTENSIONS_SRC
|
|
? path.resolve(process.env.COMPANION_BUILTIN_EXTENSIONS_SRC)
|
|
: path.resolve(process.cwd(), "packages");
|
|
const outputRoot = process.env.COMPANION_BUILTIN_EXTENSIONS_OUT
|
|
? path.resolve(process.env.COMPANION_BUILTIN_EXTENSIONS_OUT)
|
|
: path.resolve(process.cwd(), ".tmp/builtins");
|
|
|
|
const entries = [
|
|
{
|
|
name: "companion-channels",
|
|
entry: path.join(sourceRoot, "companion-channels", "src", "index.ts"),
|
|
},
|
|
{
|
|
name: "companion-teams",
|
|
entry: path.join(sourceRoot, "companion-teams", "extensions", "index.ts"),
|
|
},
|
|
{
|
|
name: "companion-grind",
|
|
entry: path.join(sourceRoot, "companion-grind", "src", "index.ts"),
|
|
},
|
|
];
|
|
|
|
const external = [
|
|
"@mariozechner/companion-agent-core",
|
|
"@mariozechner/companion-ai",
|
|
"@mariozechner/companion-ai/oauth",
|
|
"@mariozechner/companion-coding-agent",
|
|
"@mariozechner/companion-tui",
|
|
"@sinclair/typebox",
|
|
];
|
|
|
|
await mkdir(outputRoot, { recursive: true });
|
|
|
|
for (const { name, entry } of entries) {
|
|
const outdir = path.join(outputRoot, name);
|
|
await mkdir(outdir, { recursive: true });
|
|
await build({
|
|
entryPoints: [entry],
|
|
outfile: path.join(outdir, "index.js"),
|
|
bundle: true,
|
|
format: "esm",
|
|
platform: "node",
|
|
target: "node22",
|
|
sourcemap: false,
|
|
logLevel: "info",
|
|
external,
|
|
});
|
|
console.log(`Bundled ${name} -> ${path.join(outdir, "index.js")}`);
|
|
}
|