-
-
Notifications
You must be signed in to change notification settings - Fork 150
try out trpc-cli with separate peerDependencies #528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds @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
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
Poem
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 detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 metadataYou’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.
⛔ 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 strayinitTRPC
imports fromtrpc-cli
—migration is cleanVerified across the repo:
- apps/cli/src/index.ts only imports
createCli
fromtrpc-cli
(as intended)- apps/cli/test/cli.smoke.test.ts imports
FailedToExitError
fromtrpc-cli
(test helper)- No occurrences of
initTRPC
or other server APIs coming fromtrpc-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 dependencyThis 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", |
There was a problem hiding this comment.
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.
"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.
@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 |
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
Refactor
Chores