Skip to content

fix: make hono & @hono/zod-openapi not optional deps #1066

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NathanFlurry
Copy link
Member

@NathanFlurry NathanFlurry commented Jul 3, 2025

Summary by CodeRabbit

  • Chores
    • Updated dependency metadata to require certain peer dependencies instead of marking them as optional.

Copy link

coderabbitai bot commented Jul 3, 2025

Walkthrough

The peerDependenciesMeta section in the package.json file was updated to set "@hono/zod-openapi" and "hono" as non-optional dependencies instead of optional. Additionally, the order of these entries was changed, moving them to the end of the list. No other changes were made.

Changes

File(s) Change Summary
packages/core/package.json Modified peerDependenciesMeta: "@hono/zod-openapi" and "hono" set to non-optional; reordered entries.

Poem

🐇
In the meadow of dependencies,
Two friends stood tall, no longer optional,
Hono and Zod, now essential,
Their place at the end, intentional.
The package hops with certainty—
No more maybes, just dependency!


🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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
Member Author

NathanFlurry commented Jul 3, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

claude bot commented Jul 3, 2025

Claude finished @NathanFlurry's task —— View job


PR Review: Fix hono & @hono/zod-openapi dependencies

Todo List:

  • Read the changed packages/core/package.json file
  • Analyze the dependency changes
  • Check if dependencies are used in the codebase
  • Evaluate impact on package consumers
  • Provide comprehensive review feedback

Summary

This PR changes hono and @hono/zod-openapi from optional to required peer dependencies. This is a good fix that aligns with the codebase usage and repository guidelines.

Review Findings

Code Quality & Best Practices

  • Correct approach: Making these required peer dependencies instead of optional is the right solution
  • Follows repository guidelines: The CLAUDE.md file explicitly states that "All packages that are libraries should depend on peer deps for: @rivetkit/, @hono/, hono"
  • Proper dependency management: Both packages are correctly listed in peerDependencies and now properly marked as required in peerDependenciesMeta

Usage Verification

  • hono: Extensively used throughout the codebase (found in 23 files)
    • Core routing functionality in topologies, managers, and client drivers
    • Essential for HTTP handling and middleware
  • @hono/zod-openapi: Used in src/manager/router.ts:38-39
    • Imports: OpenAPIHono and createRoute
    • Critical for OpenAPI route definition and documentation

Potential Issues Assessment

  • No runtime errors: Both dependencies are actively used, so marking them as required prevents runtime import failures
  • No version conflicts: The peer dependency versions are consistent with dev dependencies
  • No breaking changes: Consumers should already have these installed due to the existing peer dependency declarations

Performance Considerations

  • No performance impact: This is a package.json metadata change only
  • Improved reliability: Ensures required dependencies are present at install time

Security Concerns

  • No security issues: No changes to actual code, only dependency metadata
  • Dependency clarity: Makes it explicit which packages are required vs optional

⚠️ Test Coverage

  • Cannot verify: Unable to run tests in this environment to confirm the change doesn't break existing functionality
  • Recommendation: Run the test suite to ensure no regressions: pnpm test

Recommendation

✅ APPROVE - This is a well-justified fix that:

  1. Aligns with actual code usage
  2. Follows repository guidelines
  3. Prevents potential runtime errors
  4. Improves developer experience by making dependencies explicit

Suggested Next Steps

  1. Run pnpm test to verify no regressions
  2. Run pnpm check-types to ensure type checking passes
  3. Consider updating the PR description to explain the rationale

Copy link

pkg-pr-new bot commented Jul 3, 2025

Open in StackBlitz

@rivetkit/actor

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/actor@1066

@rivetkit/core

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/core@1066

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/db@1066

rivetkit

pnpm add https://pkg.pr.new/rivet-gg/rivetkit@1066

@rivetkit/redis

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/redis@1066

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/framework-base@1066

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/react@1066

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-gg/rivetkit/@rivetkit/cloudflare-workers@1066

commit: e987ce1

Copy link

@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: 0

🧹 Nitpick comments (2)
packages/core/package.json (2)

202-208: "optional": false is redundant and can be safely omitted

peerDependenciesMeta.*.optional defaults to false; explicitly setting it to false adds noise without changing behaviour.
Removing the property (or deleting the entire entry) will keep the dependency non-optional while tidying the manifest.

-    "@hono/zod-openapi": {
-      "optional": false
-    },
-    "hono": {
-      "optional": false
-    }
+    // meta block not required when `optional` is false

202-208: Double-check downstream impact of making these peers mandatory

Switching @hono/zod-openapi and hono from optional → required peer deps is a breaking change for consumers that relied on installing @rivetkit/core without them.
Please confirm:

  1. All runtime paths in @rivetkit/core actually require these packages (otherwise they should stay optional or move to devDependencies).
  2. The change is reflected in release notes / semver bump (likely 1.0.0).

If the libraries are used only in the dump-openapi script, consider keeping them optional (or moving to devDependencies) instead of forcing every consumer to install them.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a5356a2 and e987ce1.

📒 Files selected for processing (1)
  • packages/core/package.json (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Test
packages/core/package.json

[error] 1-1: Command 'yarn install' failed with exit code 1. Project is configured to use pnpm, but yarn was run.

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: claude-review
  • GitHub Check: publish

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