fix(core): support Zod imports under Bun Vitest - #347
Draft
M-DGayle wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use Zod's namespace import in the core app-catalog schema so the schema loads when Vitest runs directly on Bun.
Motivation
The repository pins Bun 1.3.10. In a Bun-only Linux environment, Vitest 4.0.18 resolves Zod's named
zexport asundefined, socatalog.test.tsaborts during module evaluation atz.object()and none of its 20 tests run.Zod's namespace export works in that same environment and under Node. The runtime schema behavior is unchanged; this only uses the interoperable ESM import form.
Related issue
None.
Changes
packages/core: import Zod as a namespace insrc/apps/schema.ts.Verification
Before the change, using the repository's pinned Bun version:
After the change:
I also ran the root test command in Linux Docker. The changed core suite passed, but the root command is not green in a container because existing
@repo/adaptersand@repo/dbtests assume/.dockerenvis absent and/etc/machine-idis stable. Those failures reproduce independently of this one-line change.prettier --check packages/core/src/apps/schema.tsreports an existing formatting mismatch on both untouchedmainand this branch.git diff --checkpasses, and I left the unrelated formatting untouched.Checklist
bun run test,bun run --cwd <workspace> lint, andbun formatall pass locally — targeted lint/tests pass; root/container and pre-existing formatting limitations are documented above