diff --git a/package.json b/package.json index 5715a51f8a..6684404774 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "dev:storybook": "bun --cwd packages/storybook storybook", "lint": "oxlint", "changeset": "changeset", - "version:http-recorder": "changeset version", + "version:http-recorder": "bun ./packages/http-recorder/script/version.ts", "release:http-recorder": "bun ./packages/http-recorder/script/publish.ts", "typecheck": "bun turbo typecheck", "upgrade-opentui": "bun run script/upgrade-opentui.ts", diff --git a/packages/http-recorder/script/version.ts b/packages/http-recorder/script/version.ts new file mode 100644 index 0000000000..c2f29dae9d --- /dev/null +++ b/packages/http-recorder/script/version.ts @@ -0,0 +1,18 @@ +#!/usr/bin/env bun +import { $ } from "bun" +import { fileURLToPath } from "node:url" + +const packages = await Array.fromAsync( + new Bun.Glob("packages/**/package.json").scan({ + cwd: fileURLToPath(new URL("../../../", import.meta.url)), + absolute: true, + }), +) +const ignored = ( + await Promise.all(packages.map(async (file) => (await Bun.file(file).json()) as { readonly name?: string })) +) + .map((pkg) => pkg.name) + .filter((name): name is string => name !== undefined && name !== "@opencode-ai/http-recorder") + .flatMap((name) => ["--ignore", name]) + +await $`bunx changeset version ${ignored}`