import fs from "node:fs";
import path from "node:path";

export const PACKAGE_ROOT = path.resolve(import.meta.dirname, "..");

export function readErpKitVersion(): string {
  const pkg = JSON.parse(fs.readFileSync(path.join(PACKAGE_ROOT, "package.json"), "utf-8")) as {
    version: string;
  };
  return pkg.version;
}
