Draft
Conversation
…SM compatibility Co-authored-by: Papooch <46406259+Papooch@users.noreply.github.com>
Co-authored-by: Papooch <46406259+Papooch@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update packages for NestJS v12 peer dependency support
feat: add NestJS v12 peer dependency support
Sep 1, 2026
Co-authored-by: Papooch <46406259+Papooch@users.noreply.github.com>
…ature flags Co-authored-by: Papooch <46406259+Papooch@users.noreply.github.com>
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.
Widens peer dependency ranges to include NestJS v12 and upgrades all devDependencies to test against v12 as the primary target. NestJS v12 is pure ESM, requiring pervasive test infrastructure changes to remain compatible.
Peer dependency ranges (
packages/core,packages/transactional)@nestjs/common/@nestjs/core:>= 10 < 12→>= 10 < 13devDependency upgrades
packages/core: primary@nestjs/*deps bumped to^12; new v11 aliases added (@nestjs/common11,@nestjs/core11, etc.) alongside existing v10 aliases;@nestjs/{apollo,graphql,mercurius}bumped to^14(required for NestJS v12 ESM compatibility)packages/transactional+ all 8 adapter packages:@nestjs/common,@nestjs/core,@nestjs/testing,@nestjs/cli,@nestjs/schematicsbumped to^12Jest / ESM migration
NestJS v12 ships as a pure ES module (
"type": "module"), sorequire('@nestjs/common')from a CJS test harness fails. All 10jest.config.jsfiles were updated to ts-jest ESM mode:NODE_OPTIONS="--experimental-vm-modules"added to test scripts in transactional and all adapter packages.Adapter packages add
moduleNameMapperentries pointingnestjs-clsand@nestjs-cls/transactionalto their TypeScript source so ts-jest compiles them as ESM rather than loading the CJS dist build.Test file fixes required by ESM mode
feature-detection.utils.spec.ts: rewrote to use lightweight mock adapter objects —jest.mock()inside functions cannot be hoisted in ESM modegql-mercurius.spec.ts/gql-apollo.spec.ts: added__dirnamepolyfill viafileURLToPath; mercurius import changed from private deep path (/dist/drivers/mercurius.driver) to public main entry (also valid in@nestjs/mercurius@13)propagation.spec.ts,unit-testing-with-no-op-adapter.spec.ts,unit-testing-with-jest-mock.spec.ts: addedimport { jest } from '@jest/globals'(not auto-injected in ESM mode); rewrotejest.mock('../src')pattern with an inline no-op decorator to avoid ESM hoisting constraintstransactional-adapter-drizzle-orm-sync.spec.ts: samejestimport fix;as anycasts onmock.callsNo production code changes
All
src/library files are unchanged. The peer range widening is purely additive — NestJS v10 and v11 remain supported.