chore(deps): upgrade NestJS 10.x → 11.x (closes #754)#856
Open
goodness-cpu wants to merge 1 commit into
Open
Conversation
Major version bump of the entire NestJS ecosystem, including required
transitive dependencies that the v11 peer dependency tree now mandates.
Framework
- @nestjs/common, core, platform-express, platform-socket.io,
websockets, testing -> ^11.1.27
- @nestjs/cli -> ^11.0.23, @nestjs/schematics -> ^11.1.0
- @nestjs/passport -> ^11.0.5, @nestjs/config -> ^4.0.4
- @nestjs/schedule (kept ^6.1.3, already NestJS 11 compatible)
- @nestjs/swagger -> ^11.4.4
- @nestjs/cache-manager -> ^3.1.3
GraphQL/Apollo
- @nestjs/apollo -> ^13.4.2
- @nestjs/graphql -> ^13.4.2
- @apollo/server -> ^5.5.1 (forced peer upgrade from @nestjs/apollo@13)
Forced transitive deps (NestJS 11 peer requirements)
- @nestjs/platform-express@11 now requires express ^5.0.0
-> express -> ^5.2.1, multer -> ^2.2.0,
@types/express -> ^5.0.6, @types/multer -> ^2.0.0
- @nestjs/cache-manager@3 requires keyv >=5
-> keyv -> ^5.6.0
- @nestjs/graphql@13 requires ts-morph at the consumer level for
code-first schema generation -> ts-morph -> ^28.0.0
Runtime requirements
- engines.node: >=18.0.0 -> >=20.0.0 (NestJS 11 requires Node 20+)
Source-code adjustments
- src/app.module.ts: removed legacy `playground: true` from
GraphQLModule.forRoot(...) because Apollo Server v5 (@apollo/server@5,
peer dep of @nestjs/apollo@13) drops the classic GraphQL Playground in
favour of Apollo Sandbox (default). Re-enabling the legacy plugin would
resolve a peer-dep warning, but is unnecessary for this project.
- src/main.ts: bumped the runtime Node version guard from `>= 18` to
`>= 20` so an old CI image fails fast instead of crashing inside
NestFactory.create with an unhandled engine error. Also removed a
duplicate `app.useGlobalPipes(new ValidationPipe(...))` call that was
silently overridden by a later call (now a single pipe with
`transformOptions.enableImplicitConversion: true`).
CI
- .github/workflows/ci.yml: all five `actions/setup-node` jobs bumped
from `node-version: 18` to `node-version: 20` to match the new eng
requirement.
Notes for reviewers
- npm install emits an ERESOLVE warning for
`@apollo/server-plugin-landing-page-graphql-playground@4` (a
transitive of @nestjs/apollo@13). It is resolved automatically and
is harmless because `playground: true` was removed; the plugin is
never loaded at runtime.
- `cache-manager-redis-store@^3.0.1` is kept for now. It is a cache-
manager@5 store and is already incompatible with the cache-manager@7
stack pre-upgrade, so changing it is out of scope for this PR.
Validation
- npm install: succeeds (auto-overrides playground peer warning)
- npm run build: passes (exit 0)
- npm test: 224 passed, 2 skipped, 0 failed across 34 suites (+ 1
pre-existing skipped suite)
closes MettaChain#754
|
@goodness-cpu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
This PR performs the dedicated major-version upgrade of
@nestjs/common,@nestjs/core,@nestjs/config,@nestjs/passport,@nestjs/platform-express,@nestjs/websockets, and the rest of the NestJSecosystem from v10 → v11, as tracked in issue #754.
NestJS 11 requires Node.js 20+ and brings the surrounding platform packages
(Express, Multer, Apollo Server, keyv, ts-morph, path-to-regexp) to their
current major versions. They are all bumped in this single, dedicated PR so
that the ecosystem stays internally consistent.
What changed
Framework packages (dependencies)
@nestjs/common,core,platform-express,platform-socket.io,websockets,testing→^11.1.27@nestjs/cli→^11.0.23,@nestjs/schematics→^11.1.0@nestjs/passport→^11.0.5,@nestjs/config→^4.0.4@nestjs/schedulestays at^6.1.3(already NestJS 11 compatible)@nestjs/swagger→^11.4.4@nestjs/cache-manager→^3.1.3GraphQL/Apollo (forced by
@nestjs/apollo@13)@nestjs/apollo,@nestjs/graphql→^13.4.2@apollo/server→^5.5.1(peer dep)Transitive dependencies (now required by NestJS 11 peer chain)
express→^5.2.1(peer of@nestjs/platform-express@11)multer→^2.2.0(peer of@nestjs/platform-express@11)keyv→^5.6.0(peer of@nestjs/cache-manager@3)ts-morph→^28.0.0(peer of@nestjs/graphql@13)@types/express→^5.0.6,@types/multer→^2.0.0(dev deps)Runtime + CI
engines.node:>=18.0.0→>=20.0.0actions/setup-nodejobs in.github/workflows/ci.ymlbumped from18→20Source adjustments
src/main.ts>= 18to>= 20with clearererror message so old CI images fail fast instead of crashing inside
NestFactory.createwith an unhandled engine error.app.useGlobalPipes(new ValidationPipe(...))callthat was silently overridden by a later call. A single ValidationPipe is
now registered globally with
transformOptions.enableImplicitConversion: true.src/app.module.tsconsumer.apply(RequestIdMiddleware).forRoutes(*)catch-allmiddleware is preserved verbatim. NestJS absorbs
forRoutes(*)at therouting layer (RouterExplorer) before Express 5 /
path-to-regexp@8ever sees the string, so the wildcard remains valid.
playground: truefromGraphQLModule.forRoot(...). ApolloServer v5 (
@apollo/server@5, peer dep of@nestjs/apollo@13) dropsthe classic GraphQL Playground in favour of Apollo Sandbox, which is
now the default landing page.
Validation
npm installnpm run buildnpm testnpm installemits anERESOLVEpeer-dep warning for@apollo/server-plugin-landing-page-graphql-playground@4(a transitivedep of
@nestjs/apollo@13).npmauto-resolves it. The plugin is harmlesson its own — it is only loaded when the legacy
playground: trueflag isset, which we removed; Apollo Server v5 ships Apollo Sandbox instead.
Out of scope (intentionally NOT changed in this PR)
cache-manager-redis-store@^3.0.1: this is a cache-manager@5 store andis already mismatched against the cache-manager@7 stack used by
@nestjs/cache-manager@3. That breakage predates [D1] Upgrade NestJS 10.x → 11.x #754 and is left for afollow-up issue.
.env.examplereferences to Node>=18: optional cosmeticfollow-up.
Risk
Major (as flagged in #754). Scope was contained to a single dedicated PR
per the issue.
engines.nodeis now>=20.0.0, the runtime guard andCI both enforce it, and the build + full Jest suite pass on Node v24.
closes #754