Skip to content

fix(deps): update nest monorepo to v12 - #788

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-nest-monorepo
Open

fix(deps): update nest monorepo to v12#788
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/major-nest-monorepo

Conversation

@renovate

@renovate renovate Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
@nestjs/cli 11.0.2412.0.0 age confidence
@nestjs/common (source) 11.2.112.0.1 age confidence
@nestjs/config 4.0.412.0.0 age confidence
@nestjs/core (source) 11.2.112.0.1 age confidence
@nestjs/platform-express (source) 11.2.112.0.1 age confidence
@nestjs/schematics 11.1.012.0.0 age confidence
@nestjs/testing (source) 11.2.112.0.1 age confidence

Release Notes

nestjs/nest-cli (@​nestjs/cli)

v12.0.0

Compare Source

nestjs/nest (@​nestjs/common)

v12.0.1

Compare Source

v12.0.0

Compare Source

v11.2.3

Compare Source

v11.2.2

Compare Source

What's changed

nestjs/config (@​nestjs/config)

v12.0.0

Compare Source

What's Changed

@nestjs/config is now a native ES module, environment validation is built on Standard Schema instead of Joi-specific code, and the major version is aligned with the Nest 12 release line (there is no 5.x4.0.4 goes straight to 12.0.0).

ESM migration

The package is published as pure ESM ("type": "module", compiled with NodeNext) behind a proper exports map. The legacy root index.js / index.d.ts shims are gone, and deep imports into build internals are no longer resolvable — import from the package root.

// ✅
import { ConfigModule, ConfigService } from '@nestjs/config';

// ❌ no longer resolvable
import { ConfigService } from '@nestjs/config/dist/config.service';

require(esm) — CommonJS still works

You do not need to convert your app to ESM. Thanks to Node's require(esm) support (Node 20.19+ / 22.12+), a CommonJS app can keep using require('@nestjs/config') unchanged.

Validation is now Standard Schema based

validationSchema accepts any schema implementing the Standard Schema spec — Zod (v3, v4, v4-mini), Valibot, ArkType, Joi 18+, and anything else that adopts it. There is no longer any Joi-specific code path in the module, and Joi is no longer implied as the validation library.

ConfigModule.forRoot({
  validationSchema: z.object({
    PORT: z.coerce.number().default(3000),
    DATABASE_NAME: z.string(),
  }),
});

Joi keeps working — it implements Standard Schema as of v18 — and the historical abortEarly: false / allowUnknown: true defaults are still applied automatically for Joi schemas, so existing Joi setups behave as before.

Breaking: validationOptions shape

Options are now the Standard Schema Options object, and library-specific settings move under libraryOptions:

// Before (4.x)
validationOptions: { allowUnknown: false, abortEarly: true }

// Now (12.x)
validationOptions: { libraryOptions: { allowUnknown: false, abortEarly: true } }

The generic parameter changed accordingly: ConfigModuleOptions<ValidationOptions extends StandardSchemaV1.Options>, and validationSchema is typed as StandardSchemaV1 rather than any — a schema that does not implement the spec is now a compile-time error instead of a runtime one.

Breaking: validation error format

Issues are formatted by this package rather than by the schema library. Each issue is rendered as path: message and issues are newline-separated:

Config validation error: PORT: "PORT" is required
DATABASE_NAME: "DATABASE_NAME" is required

Anything asserting on the old single-line Joi message string needs updating.

Object schemas no longer strip your environment

Schemas like Zod's z.object() drop undeclared keys. Those variables are now merged back into the validated result, so unrelated variables stay reachable through both process.env and ConfigService instead of disappearing after validation.

Breaking: peer dependencies

@nestjs/common is now ^11.0.0 || ^12.0.0. Nest 10 is no longer supported — stay on @nestjs/config@4 if you are still on Nest 10.

Breaking: lodash replaced with es-toolkit

The lodash runtime dependency is gone, replaced by es-toolkit. This is transparent unless you relied on the transitive lodash install.

Breaking: stricter ConfigService.get() inference

The explicit-type parameter on get() / getOrThrow() is now constrained to the value at the given path (R extends PathValue<T, P>), fixing the long-standing bug where an unrelated type could be asserted for a key. Call sites that passed a type inconsistent with the config shape will now fail to compile — that mismatch was always a latent bug.

New: override

Values from .env files can now take precedence over pre-existing process.env variables:

ConfigModule.forRoot({ override: true });

Default remains false — the existing "process.env wins" behavior.

New: custom parser

.env files no longer have to be dotenv-formatted. Supply any function that turns a Buffer into an object — YAML, TOML, JSON, whatever:

ConfigModule.forRoot({
  parser: (buffer) => YAML.parse(buffer.toString()),
});

The parser is used both at bootstrap and for variable re-interpolation inside ConfigService.

Other changes

  • Tests migrated from Jest to Vitest; linting migrated from ESLint to oxlint.
  • dotenv 17.4.2, dotenv-expand 13.
  • Fixed a typo in the ConditionalModule timeout error message ("Bause" → "Because").
nestjs/nest (@​nestjs/core)

v12.0.1

Compare Source

v12.0.0

Compare Source

v11.2.3

Compare Source

v11.2.2

Compare Source

What's changed
nestjs/nest (@​nestjs/platform-express)

v12.0.1

Compare Source

v12.0.0

Compare Source

v11.2.3

Compare Source

What's Changed

Full Changelog: nestjs/nest@v11.2.2...v11.2.3

v11.2.2

Compare Source

What's changed
nestjs/schematics (@​nestjs/schematics)

v12.0.0

Compare Source

What's Changed

@nestjs/schematics is now a native ES module, and the major version is aligned with the Nest 12 release line. Beyond the package itself going ESM, the bigger change is what it generates: nest new now scaffolds ESM applications by default, and a brand-new nest upgrade schematic migrates existing v11 projects to v12.

ESM migration

The package is published as pure ESM ("type": "module", compiled with NodeNext). All internal imports carry explicit .js extensions and the build output is ESM-only.

The package now requires Node.js >= 22.12.0 and declares a typescript >= 6.0.0 peer dependency. prettier ^3 remains an optional peer, used only when --format is passed.

require(esm) — CommonJS still works

You do not need to convert your tooling to ESM. Thanks to Node's require(esm) support, CommonJS consumers can still require('@nestjs/schematics') on the supported Node versions, so custom collections and CJS scripts that drive the schematics programmatically keep working unchanged.

nest new generates ESM by default

The application schematic gained a type option (esm | cjs) that defaults to esm:

Which module system would you like to use?
> ESM (ES Modules)         [ with vitest ]
  CJS (CommonJS)           [ with jest ]
  • ESM projects get "type": "module", Vitest as the test runner (vitest.config.ts / vitest.config.e2e.ts), and "types": ["vitest/globals", "node"].
  • CJS projects keep Jest, but the Jest configuration has moved out of package.json into a dedicated jest.config.ts.

Pass --type cjs (or answer the prompt) to keep the classic CommonJS layout.

Generated project defaults

  • TypeScript 6, with module/moduleResolution set to nodenext, resolvePackageJsonExports: true, isolatedModules: true, and target: ES2023.
  • oxlint replaces ESLint. New projects ship an oxlint.json and a "lint": "oxlint src/ test/" script instead of the ESLint config and its plugin chain.
  • Rspack replaces webpack as the default builder in nest-cli.json.
  • Nest dependencies are pinned to the v12 line (@nestjs/common, @nestjs/core, @nestjs/platform-express, @nestjs/testing).

ESM-aware generators

Every element generator (module, controller, service, resource, middleware, pipe, …) now detects whether the target project is ESM and appends .js to generated relative imports accordingly — including the imports it injects into an existing @Module() when wiring up a newly generated element. CJS projects are unaffected.

New: nest upgrade

A new schematic (aliased nest update) migrates a Nest v11 project to v12. It refuses to run on anything that isn't v11, then applies the migration in steps and prints a report of every change, every follow-up action, and every warning.

Dependencies — bumps all known @nestjs/* packages to ^12.0.0 (GraphQL packages to ^14.0.0), raises typescript to ^6.0.0 and engines.node to >=20.19.0, and reports any @nestjs/* package whose v12-compatible release it doesn't know about.

tsconfig — flags module: commonjs with legacy module resolution and any moduleResolution that TypeScript 6 dropped, and points out a missing rootDir in tsconfig.build.json (TS6 error TS5011).

@nestjs/config — moves library-specific validationOptions (Joi's allowUnknown, abortEarly, …) under validationOptions.libraryOptions, and raises joi to ^18 for its Standard Schema support.

GraphQL — renames the removed playground option to graphiql, and switches subscriptions-transport-ws over to graphql-ws, updating package.json to match.

NATS — rewrites nats imports to the v3 @nats-io packages and warns about the dropped StringCodec/JSONCodec helpers and the new packet serialization (custom deserializers now receive the full NATS message; read it with msg.json()).

Testing — raises jest, @types/jest, and ts-jest to Jest 30, and warns that because the Nest 12 packages are ESM-only, Jest can only require() them on Node.js 24.9+ (older versions fail with ERR_REQUIRE_ASYNC_MODULE).

CLI config — migrates nest-cli.json builders from webpack to Rspack, drops the deprecated webpack: false option, updates affected package.json scripts, and asks you to port any custom webpack config file by hand.

Diagnostics — scans the project and warns about the refined PipeTransform#transform signature and generic ArgumentMetadata, the new ConsoleLogger structured-params behaviour (opt out with structuredParams: false), and the change to lifecycle hook ordering by component hierarchy level.

Options: --observe, --skip-install, --tag <dist-tag>, --format.

@nestjs/observe integration

Both nest new --observe and nest upgrade --observe can preconfigure the application with @nestjs/observe — distributed tracing, auto-correlated logs, metrics, and alarms. The schematic adds the dependency and wires createObserveModule() into the root module, then reminds you to set OBSERVE_APP_KEY and OBSERVE_APP_SECRET. It is opt-in and skipped when the package is already installed.


See the migration guide for the full picture.

nestjs/nest (@​nestjs/testing)

v12.0.1

Compare Source

v12.0.0

Compare Source

v11.2.3

Compare Source

What's Changed

Full Changelog: nestjs/nest@v11.2.2...v11.2.3

v11.2.2

Compare Source

What's changed


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants