fix(rivetkit): remove drizzle-orm peer dep and add runtime version check#4492
Conversation
|
🚅 Deployed to the rivet-pr-4492 environment in rivet-frontend
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR Review: fix(rivetkit): remove drizzle-orm peer dep and add runtime version checkGood approach overall. Removing the pinned peer dependency while adding a soft runtime warning is cleaner than forcing users to match a specific drizzle-orm version. A few issues worth addressing before merge: Bugs / Correctness1. CLAUDE.md references a non-existent symbol The new CLAUDE.md section says:
But mod.ts uses DRIZZLE_MIN and DRIZZLE_MAX, not SUPPORTED_DRIZZLE_RANGE. This will confuse future maintainers searching for that name. Update the doc to reference the actual constant names. 2. declare -A requires Bash 4+, but macOS ships Bash 3.2 rivetkit-typescript/packages/rivetkit/scripts/test-drizzle-compat.sh line 37 uses declare -A RESULTS. macOS ships with Bash 3.2 (GPL v2), which does not support associative arrays. Any macOS developer running this script with the system Bash will get a cryptic error. Consider either adding a Bash version guard at the top, documenting that Homebrew Bash 5+ is required, or rewriting the results summary using parallel indexed arrays. Minor Issues3. DRIZZLE_MAX will need updating as new versions are tested DRIZZLE_MAX = [0, 46, 0] (exclusive) means any 0.46.x+ release will trigger the warning immediately on release. This is intentional and correct, but the automation (CLAUDE.md + the script) only tests up to 0.45. When 0.46 ships, someone will need to add 0.46 to DEFAULT_VERSIONS in the script and bump DRIZZLE_MAX to [0, 47, 0]. This workflow is described in CLAUDE.md, which is good. Just worth calling out explicitly in the review. 4. Cleanup fallback pnpm install without --frozen-lockfile on failure test-drizzle-compat.sh:45 has: cd "$ROOT_DIR" && pnpm install --frozen-lockfile 2>/dev/null || pnpm install The mv restores the original lockfile before this runs, so --frozen-lockfile should succeed. The fallback is a safety net, but it suppresses errors from the first attempt and then freely re-resolves deps, potentially leaving node_modules in an inconsistent state. Consider printing a warning when the fallback fires. 5. drizzle-kit is still declared as an optional peer dep but drizzle-orm is not Users who add drizzle integration will need both drizzle-orm (for queries) and drizzle-kit (for migrations). With this PR, drizzle-kit remains an optional peer dep but drizzle-orm is removed entirely. Consider whether the companion drizzle-kit entry should also be removed for consistency, or add a comment in package.json explaining why one is kept and the other is not. Nits
SummaryThe core design is solid. The main actionable items are:
|

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: