import { readFile } from "node:fs/promises"; const tag = process.argv[2]; if (!tag?.startsWith("v")) throw new Error("Release tag must have the form v"); const packageJson = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8")); const manifest = JSON.parse(await readFile(new URL("../install-manifest.json", import.meta.url), "utf8")); const expected = tag.slice(1); if (packageJson.version !== expected || manifest.version !== expected) { throw new Error( `Version mismatch: tag=${tag}, package=${packageJson.version}, manifest=${manifest.version}`, ); }