Skip to content

Conversation

mmkal
Copy link

@mmkal mmkal commented Aug 18, 2025

Just trying out mmkal/trpc-cli#146 - I want to stop bundling zod+trpc in trpc-cli. It's a good thing for you because there will no longer be an unnecessary version of zod in node_modules (tradeoff is that you have to add @trpc/server to package.json and import separately, but that's about it). Should make bundling CLIs less error-prone too - no more eval hacks.

Summary by CodeRabbit

  • New Features

    • No user-facing features added in this release.
  • Refactor

    • Internal request-handling initialization updated with no changes to CLI behavior or output.
  • Chores

    • Updated CLI dependencies: added a new server library dependency.
    • Replaced an existing CLI dependency source with a direct URL to align with build requirements.

Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

Walkthrough

Adds @trpc/server and switches trpc-cli to a direct URL in apps/cli/package.json. In apps/cli/src/index.ts, TRPC initialization now imports initTRPC from @trpc/server and calls initTRPC.create(), replacing the previous trpcServer.initTRPC.create() usage. Public API shape unchanged.

Changes

Cohort / File(s) Summary of edits
Dependencies update
apps/cli/package.json
Added @trpc/server (^11.4.4). Updated trpc-cli from ^0.10.2 to a direct URL (https://pkg.pr.new/mmkal/trpc-cli@146).
TRPC initialization source switch
apps/cli/src/index.ts
Replaced trpcServer.initTRPC.create() path by importing initTRPC from @trpc/server and calling initTRPC.create(). Router and exported API remain the same.

Sequence Diagram(s)

(Skipped: changes are a dependency/import source swap with no meaningful control-flow change to diagram.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • migrate to trpc-cli #313 — Modifies CLI TRPC initialization and router wiring; closely related to this PR’s change of TRPC initialization source.

Poem

I hopped through pins and package trees,
Swapped a source with nimble ease.
New server badge, same pathway clear,
The CLI hums — I give a cheer. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8485f04 and 3e8a3a3.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • apps/cli/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/cli/package.json
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/cli/src/index.ts (1)

48-48: Optionally type your t.meta() shape for safer metadata

You’re using .meta({ description, default, negateBooleans }) in several procedures. If you want TS to catch typos and ensure consistent meta shape, define the meta type at init time.

Apply this diff:

-const t = initTRPC.create();
+const t = initTRPC
+  .meta<{
+    description?: string;
+    default?: boolean;
+    negateBooleans?: boolean;
+  }>()
+  .create();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 03915b9 and 8485f04.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • apps/cli/package.json (2 hunks)
  • apps/cli/src/index.ts (2 hunks)
🔇 Additional comments (2)
apps/cli/src/index.ts (1)

2-4: No stray initTRPC imports from trpc-cli—migration is clean

Verified across the repo:

  • apps/cli/src/index.ts only imports createCli from trpc-cli (as intended)
  • apps/cli/test/cli.smoke.test.ts imports FailedToExitError from trpc-cli (test helper)
  • No occurrences of initTRPC or other server APIs coming from trpc-cli

All remaining initTRPC usage correctly points to @trpc/server. Approving these changes.

apps/cli/package.json (1)

64-65: Good call adding @trpc/server as a direct dependency

This satisfies trpc-cli’s peer dependency after the split and matches the code change importing from @trpc/server.

@@ -72,14 +70,13 @@
"handlebars": "^4.7.8",
"jsonc-parser": "^3.3.1",
"picocolors": "^1.1.1",
"trpc-cli": "^0.10.2",
"trpc-cli": "https://pkg.pr.new/mmkal/trpc-cli@146",
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Using a PR tarball URL for trpc-cli is brittle; avoid shipping this to npm

The https://pkg.pr.new/mmkal/trpc-cli@146 dependency is great for trialing, but it’s ephemeral and can break consumers if published. Recommend keeping this as a local/CI override only and reverting to a semver range before merging/releasing, or using workspace/root-level overrides/resolutions.

  • Before merge: revert to a version range.
  • Alternatively, keep the semver dep here and override at the workspace root (pnpm.overrides / yarn resolutions) for experimentation.

Diff to revert when ready:

-    "trpc-cli": "https://pkg.pr.new/mmkal/trpc-cli@146",
+    "trpc-cli": "^0.10.2",

You can also sanity-check the URL’s current reachability (for CI flakiness risk):


🏁 Script executed:

#!/bin/bash
set -euo pipefail
URL="https://pkg.pr.new/mmkal/trpc-cli@146"
echo "HEAD $URL"
curl -I -sS "$URL" | head -n1

Length of output: 233


Revert PR tarball URL for trpc-cli before merging

The tarball URL (https://pkg.pr.new/mmkal/trpc-cli@146) now returns HTTP 404 and is too brittle to ship—it will break downstream consumers.

Files to update:

  • apps/cli/package.json (line 73): replace the ephemeral URL with a semver range

Recommended diff:

-    "trpc-cli": "https://pkg.pr.new/mmkal/trpc-cli@146",
+    "trpc-cli": "^0.10.2",

For ongoing experimentation, consider using workspace-level overrides (pnpm.overrides / yarn resolutions) instead of hardcoding the URL here.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"trpc-cli": "https://pkg.pr.new/mmkal/trpc-cli@146",
"trpc-cli": "^0.10.2",
🤖 Prompt for AI Agents
In apps/cli/package.json around line 73, the dependency "trpc-cli" is pinned to
an ephemeral tarball URL that returns 404 and is too brittle; replace the URL
with a stable semver range (e.g. a caret or exact version like "^1.2.3" or
"1.2.3") in the "trpc-cli" entry, update package lock / pnpm-lock.yaml by
running the package manager install to regenerate lockfiles, and if you need
temporary experiment versions in future prefer using workspace-level overrides
(pnpm.overrides or yarn resolutions) rather than hardcoding a tarball URL in
this file.

@mmkal
Copy link
Author

mmkal commented Aug 18, 2025

@AmanVarshney01 sorry I meant to create this as a draft. Just trying out mmkal/trpc-cli#146 - I want to stop bundling zod+trpc in trpc-cli. It's a good thing for you because there will no longer be an unnecessary version of zod in node_modules (tradeoff is that you have to add @trpc/server to package.json and import separately, but that's about it). Should make bundling CLIs less error-prone too - no more eval hacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant