Skip to content

Claude Code. Any Model. The most powerful AI coding agent now speaks every language.

618 B
Raw Blame
/**
 * Generate version.ts from package.json
 * Run before bundling so the version is baked into compiled binaries.
 */
import { readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";

const pkgPath = join(import.meta.dir, "../package.json");
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
const version = pkg.version;

const outPath = join(import.meta.dir, "../src/version.ts");
writeFileSync(
  outPath,
  `// Auto-generated by scripts/generate-version.ts — do not edit\nexport const VERSION = "${version}";\n`
);

console.log(`[generate-version] ${version} → src/version.ts`);