Skip to content

chore(monorepo): remove versions from private workspaces - #7306

Merged
KATT merged 3 commits into
mainfrom
cursor/repository-versioning-changes-e0d3
Apr 12, 2026
Merged

KATT merged 3 commits into
mainfrom
cursor/repository-versioning-changes-e0d3

Conversation

@KATT

@KATT KATT commented Mar 30, 2026 •

Copy link
Copy Markdown
Member

Closes #

🎯 Changes

Remove the redundant version field from private/non-published workspace packages.

Update scripts/version.ts because it previously assumed every package in packages/* declared a local version. Once private workspaces like @trpc/tests stop carrying that field, the script still needs a version source for pinning @trpc/* dependencies, so it now falls back to the repo version from lerna.json.

βœ… Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.
Open in WebΒ Open in CursorΒ 

Summary by CodeRabbit

  • Chores
    • Removed top-level package version fields from example and site manifests to simplify metadata.
    • Updated release tooling to derive a fallback version from the repository when individual package versions are absent.

@coderabbitai

coderabbitai Bot commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bcac6550-b167-4425-a7ff-2f94557cc522

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 622797b and c29a887.

πŸ“’ Files selected for processing (1)
  • packages/tests/package.json
βœ… Files skipped from review due to trivial changes (1)
  • packages/tests/package.json

πŸ“ Walkthrough

Walkthrough

Removed explicit "version": "11.16.0" entries from many package.json files across examples, packages, and www; updated scripts/version.ts to read lerna.json and use repository version as a fallback when package.json lacks a version.

Changes

Cohort / File(s) Summary
Example package manifests
examples/.experimental/next-app-dir/package.json, examples/.test/*/package.json, examples/bun/package.json, examples/cloudflare-workers/package.json, examples/express-*/*.package.json, examples/fastify-server/package.json, examples/lambda-*/package.json, examples/lazy-load/package.json, examples/minimal-*/package.json, examples/minimal-react/*/package.json, examples/next-*/package.json, examples/openapi-codegen/package.json, examples/soa/package.json, examples/standalone-server/package.json, examples/vercel-edge-runtime/package.json, examples/next-prisma-*/package.json, examples/next-prisma-websockets-starter/package.json
Removed top-level "version": "11.16.0" from example package.json files and adjusted trailing commas/braces to keep valid JSON.
Core monorepo & site manifests
packages/tests/package.json, www/package.json, www/og-image/package.json
Removed top-level "version": "11.16.0" from core/site package.json files; JSON endings adjusted.
Version script update
scripts/version.ts
Script now reads lerna.json to derive repoVersion and uses package's parsed.version or repoVersion as fallback when package.json lacks a version; affects version resolution and downstream prerelease/dependency pinning logic.

Sequence Diagram(s)

sequenceDiagram
  participant VersionScript as "scripts/version.ts\n(Version Script)"
  participant Lerna as "lerna.json\n(Repository Version)"
  participant Packages as "package.json files\n(Examples, packages, www)"

  rect rgba(200,220,255,0.5)
    VersionScript->>Lerna: read & parse repo version
    Lerna-->>VersionScript: repoVersion
  end

  rect rgba(200,255,220,0.5)
    VersionScript->>Packages: read each package.json
    Packages-->>VersionScript: parsed.package.version? (may be undefined)
    alt package.version present
      VersionScript->>Packages: use parsed.version
    else package.version missing
      VersionScript->>Packages: use repoVersion as fallback
    end
    VersionScript->>Packages: write/update resolved version & continue downstream logic
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • juliusmarminge
  • trpc-bot

Poem

"πŸ‡ Hop, hop β€” the versions flew away,
From many files they did not stay.
Lerna hummed, a single tune,
One repo beat beneath the moon.
πŸ₯•βœ¨"

πŸš₯ Pre-merge checks | βœ… 3
βœ… Passed checks (3 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately summarizes the main change: removing version fields from private workspace packages, which is the core modification across 38+ files.
Description check βœ… Passed The description clearly explains what was changed (removing version fields from private packages) and why (script update for fallback logic), and includes a populated checklist.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/repository-versioning-changes-e0d3

Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel

vercel Bot commented Mar 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
next-prisma-starter Ready Ready Preview Apr 12, 2026 1:02pm
og-image Ready Ready Preview, Comment Apr 12, 2026 1:02pm

Request Review

@railway-app

railway-app Bot commented Mar 30, 2026 •

Copy link
Copy Markdown

πŸš… Deployed to the trpc-pr-7306 environment in trpc-sse-and-websockets

Service Status Web Updated (UTC)
next-sse-chat βœ… Success (View Logs) Web Apr 12, 2026 at 1:10 pm
next-prisma-websockets-starter βœ… Success (View Logs) Apr 12, 2026 at 1:08 pm

@cursor cursor Bot changed the title Remove versions from private workspaces chore(monorepo): remove versions from private workspaces Mar 30, 2026
@KATT
KATT marked this pull request as ready for review March 30, 2026 13:40
@KATT
KATT requested review from a team as code owners March 30, 2026 13:40
Copilot AI review requested due to automatic review settings March 30, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes redundant version fields from private/non-published workspace packages, and updates the version-pinning script so it can still derive a version when a workspace package no longer declares one.

Changes:

  • Removed version from multiple private workspace package.json files (examples, tests, docs site).
  • Updated scripts/version.ts to fall back to the monorepo version in lerna.json when a package lacks a local version.

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated no comments.

Show a summary per file
File Description
www/package.json Remove redundant version from a private workspace package.
www/og-image/package.json Remove redundant version from a private workspace package.
scripts/version.ts Fall back to lerna.json version when packages/*/package.json has no version, preserving @trpc/* dependency pinning.
packages/tests/package.json Remove redundant version from a private workspace package.
examples/vercel-edge-runtime/package.json Remove redundant version from a private workspace package.
examples/standalone-server/package.json Remove redundant version from a private workspace package.
examples/soa/package.json Remove redundant version from a private workspace package.
examples/openapi-codegen/package.json Remove redundant version from a private workspace package.
examples/next-websockets-encoder/package.json Remove redundant version from a private workspace package.
examples/next-sse-chat/package.json Remove redundant version from a private workspace package.
examples/next-prisma-websockets-starter/package.json Remove redundant version from a private workspace package.
examples/next-prisma-todomvc/package.json Remove redundant version from a private workspace package.
examples/next-prisma-starter/package.json Remove redundant version from a private workspace package.
examples/next-minimal-starter/package.json Remove redundant version from a private workspace package.
examples/next-formdata/package.json Remove redundant version from a private workspace package.
examples/next-edge-runtime/package.json Remove redundant version from a private workspace package.
examples/next-big-router/package.json Remove redundant version from a private workspace package.
examples/minimal/package.json Remove redundant version from a private workspace package.
examples/minimal-react/server/package.json Remove redundant version from a private workspace package.
examples/minimal-react/package.json Remove redundant version from a private workspace package.
examples/minimal-react/client/package.json Remove redundant version from a private workspace package.
examples/minimal-content-types/server/package.json Remove redundant version from a private workspace package.
examples/minimal-content-types/package.json Remove redundant version from a private workspace package.
examples/minimal-content-types/client/package.json Remove redundant version from a private workspace package.
examples/lazy-load/package.json Remove redundant version from a private workspace package.
examples/lambda-url/package.json Remove redundant version from a private workspace package.
examples/lambda-api-gateway/package.json Remove redundant version from a private workspace package.
examples/lambda-api-gateway-streaming/package.json Remove redundant version from a private workspace package.
examples/fastify-server/package.json Remove redundant version from a private workspace package.
examples/express-server/package.json Remove redundant version from a private workspace package.
examples/express-minimal/package.json Remove redundant version from a private workspace package.
examples/cloudflare-workers/package.json Remove redundant version from a private workspace package.
examples/bun/package.json Remove redundant version from a private workspace package.
examples/.test/ssg/package.json Remove redundant version from a private workspace package.
examples/.test/ssg-infinite-serialization/package.json Remove redundant version from a private workspace package.
examples/.test/monotest-tsconfig/package.json Remove redundant version from a private workspace package.
examples/.test/monotest-trpc/package.json Remove redundant version from a private workspace package.
examples/.test/monotest-app/package.json Remove redundant version from a private workspace package.
examples/.test/monotest-api/package.json Remove redundant version from a private workspace package.
examples/.test/monotest-api-router01/package.json Remove redundant version from a private workspace package.
examples/.test/internal-types-export/package.json Remove redundant version from a private workspace package.
examples/.test/diagnostics-big-router/package.json Remove redundant version from a private workspace package.
examples/.experimental/next-app-dir/package.json Remove redundant version from a private workspace package.

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new

pkg-pr-new Bot commented Mar 30, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@trpc/client

npm i https://pkg.pr.new/@trpc/client@7306

@trpc/next

npm i https://pkg.pr.new/@trpc/next@7306

@trpc/openapi

npm i https://pkg.pr.new/@trpc/openapi@7306

@trpc/react-query

npm i https://pkg.pr.new/@trpc/react-query@7306

@trpc/server

npm i https://pkg.pr.new/@trpc/server@7306

@trpc/tanstack-react-query

npm i https://pkg.pr.new/@trpc/tanstack-react-query@7306

@trpc/upgrade

npm i https://pkg.pr.new/@trpc/upgrade@7306

commit: c29a887

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
scripts/version.ts (1)

6-8: Validate lerna.json version before using it.

as string here can mask malformed config and fail later in less obvious places. A small guard makes failures immediate and clearer.

Proposed hardening
-const repoVersion = JSON.parse(
-  fs.readFileSync(path.join(import.meta.dirname, '..', 'lerna.json'), 'utf8'),
-).version as string;
+const lernaConfig = JSON.parse(
+  fs.readFileSync(path.join(import.meta.dirname, '..', 'lerna.json'), 'utf8'),
+) as { version?: unknown };
+
+if (typeof lernaConfig.version !== 'string' || lernaConfig.version.length === 0) {
+  throw new Error('Invalid lerna.json: expected non-empty string "version"');
+}
+
+const repoVersion = lernaConfig.version;
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/version.ts` around lines 6 - 8, The code assigns repoVersion using a
blind cast ("as string") which can hide malformed lerna.json; change the
repoVersion initialization (the variable assigned from
fs.readFileSync/JSON.parse) to perform a runtime check that the parsed object
has a truthy string property "version" (e.g., typeof parsed.version === 'string'
&& parsed.version.trim() !== ''), and if not throw or log a clear error
mentioning "lerna.json version missing or invalid" before proceeding; remove the
unsafe "as string" cast and use the validated value for the rest of the script.
πŸ€– Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@scripts/version.ts`:
- Around line 6-8: The code assigns repoVersion using a blind cast ("as string")
which can hide malformed lerna.json; change the repoVersion initialization (the
variable assigned from fs.readFileSync/JSON.parse) to perform a runtime check
that the parsed object has a truthy string property "version" (e.g., typeof
parsed.version === 'string' && parsed.version.trim() !== ''), and if not throw
or log a clear error mentioning "lerna.json version missing or invalid" before
proceeding; remove the unsafe "as string" cast and use the validated value for
the rest of the script.

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 956df7ce-da9d-448f-a7f0-85aba8fce69c

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 19c599c and 622797b.

πŸ“’ Files selected for processing (43)
  • examples/.experimental/next-app-dir/package.json
  • examples/.test/diagnostics-big-router/package.json
  • examples/.test/internal-types-export/package.json
  • examples/.test/monotest-api-router01/package.json
  • examples/.test/monotest-api/package.json
  • examples/.test/monotest-app/package.json
  • examples/.test/monotest-trpc/package.json
  • examples/.test/monotest-tsconfig/package.json
  • examples/.test/ssg-infinite-serialization/package.json
  • examples/.test/ssg/package.json
  • examples/bun/package.json
  • examples/cloudflare-workers/package.json
  • examples/express-minimal/package.json
  • examples/express-server/package.json
  • examples/fastify-server/package.json
  • examples/lambda-api-gateway-streaming/package.json
  • examples/lambda-api-gateway/package.json
  • examples/lambda-url/package.json
  • examples/lazy-load/package.json
  • examples/minimal-content-types/client/package.json
  • examples/minimal-content-types/package.json
  • examples/minimal-content-types/server/package.json
  • examples/minimal-react/client/package.json
  • examples/minimal-react/package.json
  • examples/minimal-react/server/package.json
  • examples/minimal/package.json
  • examples/next-big-router/package.json
  • examples/next-edge-runtime/package.json
  • examples/next-formdata/package.json
  • examples/next-minimal-starter/package.json
  • examples/next-prisma-starter/package.json
  • examples/next-prisma-todomvc/package.json
  • examples/next-prisma-websockets-starter/package.json
  • examples/next-sse-chat/package.json
  • examples/next-websockets-encoder/package.json
  • examples/openapi-codegen/package.json
  • examples/soa/package.json
  • examples/standalone-server/package.json
  • examples/vercel-edge-runtime/package.json
  • packages/tests/package.json
  • scripts/version.ts
  • www/og-image/package.json
  • www/package.json
πŸ’€ Files with no reviewable changes (6)
  • examples/.test/monotest-tsconfig/package.json
  • examples/.test/monotest-api-router01/package.json
  • examples/.test/monotest-api/package.json
  • examples/.test/monotest-trpc/package.json
  • examples/.test/ssg-infinite-serialization/package.json
  • examples/.test/monotest-app/package.json

@KATT
KATT enabled auto-merge (squash) April 12, 2026 13:01
@railway-app
railway-app Bot temporarily deployed to trpc-sse-and-websockets / trpc-pr-7306 April 12, 2026 13:01 Destroyed
@KATT
KATT merged commit c188dab into main Apr 12, 2026
44 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 13, 2026
@KATT
KATT deleted the cursor/repository-versioning-changes-e0d3 branch October 31, 2026 21:11

This branch was successfully deployed

5 active deployments
Preview – www β€” c29a887b Deployed Apr 12, 2026 by vercel[bot]
Preview – trpc-next-app-dir β€” c29a887b Deployed Apr 12, 2026 by vercel[bot]
Preview – next-prisma-starter β€” c29a887b Deployed Apr 12, 2026 by vercel[bot]
Preview – examples-todomvc β€” c29a887b Deployed Apr 12, 2026 by vercel[bot]
Preview – og-image β€” c29a887b Deployed Apr 12, 2026 by vercel[bot]
trpc-sse-and-websockets / trpc-pr-7306 β€” c29a887b Deployed Apr 12, 2026 by railway-app[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants