fix(rivetkit): remove drizzle-orm peer dep and add runtime version check#4492
Conversation
|
🚅 Deployed to the rivet-pr-4492 environment in rivet-frontend
|
PR Review: fix(rivetkit): remove drizzle-orm peer dep and add runtime version checkOverall this is a clean, focused change. The approach of removing the peer dep and adding a runtime warning is a good pattern for handling version compatibility. A few observations: Correctness test-drizzle-compat.sh - missing final newline in results table. The summary loop at the end has no trailing echo after the loop, so the last result line may get concatenated with the shell prompt in some terminals. Minor, but easy to fix by adding a closing echo after the for loop. test-drizzle-compat.sh - set -e + cleanup trap interaction. The script uses set -euo pipefail. If pnpm install inside cleanup() fails on restore (e.g., network issue), the trap exits with an error and the calling process may see a misleading exit code. Consider adding || true to the restore pnpm install call - the goal of cleanup is best-effort restoration, not failure propagation. Version check - createRequire is Node-specific. The node:module import works fine for Node.js but will throw in edge runtimes (Cloudflare Workers, Deno, Bun with strict mode, etc.). The try/catch already handles this gracefully, but a comment explaining why the catch is silent would help future maintainers understand it is intentional. Design DRIZZLE_MAX is exclusive but the constant name does not make that clear. The comment helps, but renaming to DRIZZLE_MAX_EXCLUSIVE or DRIZZLE_UPPER_BOUND would self-document the intent and prevent an off-by-one if someone edits the bounds later. Module-level drizzleVersionChecked flag. Fine for typical usage, but because the flag is module-level it persists across tests in the same Node.js process. If a test wants to verify the warning fires, it will not unless the flag is reset. Not a blocker, just worth noting. Style and Conventions
Summary: The set -e/cleanup interaction in the shell script is the only item worth addressing before merge; the rest are low-priority suggestions. |
5478836 to
1514f08
Compare
86c1c7d to
2f7fec2
Compare
Merge activity
|
2f7fec2 to
37824e5
Compare

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: