feat: combine mikroorm v6 & v7 implementation - #5
Merged
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
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
MetadataStorage.getAll()returns a plainDictionaryin MikroORM v6 but a realMapin v7 — the adapter previously assumed the v6 shape (Object.values(...)), which under v7 quietly produced an empty diagram instead of erroring. Now branches oninstanceof Mapto handle both.test/adapters/mikroorm-v7.test.ts+v7-basic/v7-compositefixtures using@mikro-orm/decorators) in a separate file/CI job from the v6 suite — mixing a v6-broken import into the same worker was observed to corrupt vitest's own error reporting for unrelated tests, not just fail the one that broke.mikroorm-v7CI job installs@mikro-orm/core@7/@mikro-orm/sqlite@7/@mikro-orm/decorators@7on top ofnpm ci(no--save) and runs just the mikroorm-scoped tests with coverage, uploaded to Codecov under its ownmikroorm-v7flag.docs/adapters.md's MikroORM section updated to describe both versions and the one real behavioral difference above.The committed
@mikro-orm/core/@mikro-orm/sqlitedevDependencies stay pinned to v6 (still what most existing production/NestJS codebases run) — v7 is exercised only via the dedicated CI job swapping the install on the fly, never touchingpackage.json/package-lock.json. Both versions are targeted because the adapter always reads whatever MikroORM version the target project has installed, not orm2erd's own devDependency, so v6-only would silently misbehave for real v7 users and v7-only would break the still-larger v6 user base.Test plan
npx vitest run test/adapters/mikroorm.test.ts test/detect/mikroorm.test.tspasses against the committed v6 devDependency@mikro-orm/core@7/@mikro-orm/sqlite@7/@mikro-orm/decorators@7and confirmedtest/adapters/mikroorm-v7.test.tspasses (skips cleanly under v6)npx vitest run) passes with v6 restorednpm run lint/npx prettier --check .clean