diff --git a/.changeset/design-workspace-metadata.md b/.changeset/design-workspace-metadata.md new file mode 100644 index 000000000000..cd38a91351f7 --- /dev/null +++ b/.changeset/design-workspace-metadata.md @@ -0,0 +1,5 @@ +--- +"@reddb-io/redcode": patch +--- + +Include the internal Design workspace in Changesets version planning and validate the real version command before merging release changes. diff --git a/bun.lock b/bun.lock index 9d679f590c10..650a4890a00d 100644 --- a/bun.lock +++ b/bun.lock @@ -402,6 +402,7 @@ }, "packages/design": { "name": "@reddb-io/redcode-design", + "version": "0.0.0", "dependencies": { "@reddb-io/redcode-schema": "workspace:*", }, diff --git a/packages/design/package.json b/packages/design/package.json index 9126a6697a37..ada03457fba8 100644 --- a/packages/design/package.json +++ b/packages/design/package.json @@ -1,5 +1,6 @@ { "name": "@reddb-io/redcode-design", + "version": "0.0.0", "private": true, "type": "module", "exports": { diff --git a/script/test-redcode-release-contract.ts b/script/test-redcode-release-contract.ts index cff7d1bdd462..eb102c23745a 100755 --- a/script/test-redcode-release-contract.ts +++ b/script/test-redcode-release-contract.ts @@ -1,6 +1,8 @@ #!/usr/bin/env bun import path from "path" +import os from "os" +import fs from "fs/promises" const root = path.resolve(import.meta.dir, "..") const workflows = path.join(root, ".github", "workflows") @@ -157,4 +159,27 @@ const staleDefault = sources.flatMap((source) => ) if (staleDefault.length > 0) throw new Error(`workflow still targets dev: ${staleDefault.join(", ")}`) +// `changeset status` does not validate the skipped-package dependency graph. +// Exercise the real version command without changing the checkout's versions. +const preview = await fs.mkdtemp(path.join(os.tmpdir(), "redcode-version-check-")) +try { + const workspace = await Bun.file(path.join(root, "package.json")).json() + await Bun.write(path.join(preview, "package.json"), Bun.file(path.join(root, "package.json"))) + for (const pattern of workspace.workspaces.packages) { + for await (const file of new Bun.Glob(`${pattern}/package.json`).scan({ cwd: root })) { + await Bun.write(path.join(preview, file), Bun.file(path.join(root, file))) + } + } + await fs.cp(path.join(root, ".changeset"), path.join(preview, ".changeset"), { recursive: true }) + await fs.symlink(path.join(root, "node_modules"), path.join(preview, "node_modules"), "junction") + const version = Bun.spawn(["node", path.join(root, "node_modules", "@changesets", "cli", "bin.js"), "version"], { + cwd: preview, + stdout: "inherit", + stderr: "inherit", + }) + if ((await version.exited) !== 0) throw new Error("Changesets version rehearsal failed") +} finally { + await fs.rm(preview, { recursive: true, force: true }) +} + console.log("Redcode release posture: binary-only")