Skip to content

release: v12.0.0 major release (approx. Q3 2026)#3280

Draft
kamilmysliwiec wants to merge 32 commits intomasterfrom
v12.0.0
Draft

release: v12.0.0 major release (approx. Q3 2026)#3280
kamilmysliwiec wants to merge 32 commits intomasterfrom
v12.0.0

Conversation

@kamilmysliwiec
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe: v12.0.0 release

Description

Approximate release window: early Q3 2026

A brief list of changes:

  • nest new will now prompt users asking whether they want to use ESM or CJS for their project (ESM is the new default with vitest instead of jest)
  • the entire source code has been migrated to ESM
  • jest -> vitest for tests
  • e2e tests added for all commands
  • command classes have been refactored, and they now take context objects as inputs instead of non-types input and options arrays
  • webpack builder has been deprecated
  • rspack is the new default for monorepos

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@kamilmysliwiec
Copy link
Member Author

A current version of this PR has been published under the next tag - @nestjs/cli@12.0.0-alpha.5

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the Nest CLI v12 major release by migrating the codebase to ESM/NodeNext, switching the test runner from Jest to Vitest, and introducing rspack support (with webpack deprecated) alongside expanded e2e coverage.

Changes:

  • Add Vitest configuration (unit + e2e) and migrate existing unit tests from Jest to Vitest.
  • Migrate CLI/runtime code to ESM ("type": "module", .js import specifiers, NodeNext TS config) and refactor commands/actions to use typed context objects.
  • Add rspack compiler + defaults and add e2e tests across core CLI commands.

Reviewed changes

Copilot reviewed 128 out of 131 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
vitest.e2e.config.ts Adds Vitest config for e2e suite (timeouts, includes).
vitest.config.ts Adds Vitest config for unit tests and excludes e2e.
tsconfig.json Switches TS compilation to NodeNext/ES2022 and removes Jest types.
tools/postinstall.cjs Post-install helper for test fixtures + vitest timeout patching.
tools/clean.js Replaces gulp-based clean with a Node script to remove build artifacts.
test/lib/utils/get-default-tsconfig-path.spec.ts Migrates test from Jest to Vitest + ESM import specifiers.
test/lib/schematics/schematic.option.spec.ts Updates tests for boolean flag serialization changes + Vitest migration.
test/lib/schematics/nest.collection.spec.ts Migrates to Vitest and updates ESM import paths.
test/lib/schematics/custom.collection.spec.ts Migrates to Vitest and adds an ESM-safe mock for schematics tools.
test/lib/runners/schematic.runner.spec.ts Updates module-path resolution expectations for ESM.
test/lib/readers/file-system.reader.spec.ts Migrates to Vitest and updates reader imports.
test/lib/questions/questions.spec.ts Migrates to Vitest and updates ESM import paths/types usage.
test/lib/package-managers/yarn.package-manager.spec.ts Migrates to Vitest and updates ESM import paths/mocks.
test/lib/package-managers/pnpm.package-manager.spec.ts Migrates to Vitest and updates ESM import paths/mocks.
test/lib/package-managers/package-manager.factory.spec.ts Migrates to Vitest and updates typings for mock casting.
test/lib/package-managers/npm.package-manager.spec.ts Migrates to Vitest and updates ESM import paths/mocks.
test/lib/configuration/nest-configuration.loader.spec.ts Migrates to Vitest and updates ESM import paths.
test/lib/compiler/webpack/webpack-compiler.spec.ts Adds coverage for webpack compiler deprecation + ESM rejection behavior.
test/lib/compiler/swc/swc-compiler.spec.ts Updates SWC compiler unit tests for ESM module layout and Vitest mocks.
test/lib/compiler/rspack/rspack-defaults.spec.ts Adds tests for new rspack defaults factory (incl. ESM mode).
test/lib/compiler/rspack/rspack-compiler.spec.ts Adds unit tests for new rspack compiler behavior (watch, config merging).
test/lib/compiler/hooks/tsconfig-paths.hook.spec.ts Reworks hook tests to assert both CJS and ESM output (drops snapshots).
test/lib/compiler/hooks/fixtures/unused-imports/src/main.ts Updates fixture imports to include .js extension for ESM.
test/lib/compiler/hooks/fixtures/type-imports/src/main.ts Updates fixture relative imports to include .js extension for ESM.
test/lib/compiler/hooks/snapshots/tsconfig-paths.hook.spec.ts.snap Removes Jest snapshots now that assertions are explicit.
test/lib/compiler/helpers/get-value-or-default.spec.ts Migrates helper test to Vitest and ESM import specifiers.
test/lib/compiler/helpers/get-rspack-config-path.spec.ts Adds tests for new rspack config-path helper.
test/jest-config.json Removes Jest test configuration.
test/e2e/new.command.e2e-spec.ts Adds e2e coverage for nest new behaviors (language, strict, flags).
test/e2e/jest-e2e.json Adds fixture Jest config used by generated projects in e2e scenarios.
test/e2e/info.command.e2e-spec.ts Adds e2e coverage for nest info with/without deps installed.
test/e2e/helpers.ts Adds shared e2e utilities for running/spawning CLI and scaffolding projects.
test/e2e/generate.command.e2e-spec.ts Adds e2e coverage for nest generate across many schematic types/flags.
test/e2e/build.command.e2e-spec.ts Adds e2e coverage for nest build (tsc/swc + monorepo webpack cases).
test/e2e/add.command.e2e-spec.ts Adds e2e coverage for nest add (install + dry-run/skip-install).
test/actions/info.action.spec.ts Migrates action tests to Vitest and adapts to private method access.
test/actions/build.action.spec.ts Adds unit tests for builder dispatch behavior (webpack vs rspack).
package.json Marks package as ESM, switches to Vitest scripts, updates deps/peers, replaces clean step.
lib/utils/tree-kill.ts Renames internals to clearer “children” naming.
lib/utils/remaining-flags.ts Updates commander integration to use Command + getOptionValue().
lib/utils/project-utils.ts Removes hasValidOptionFlag and updates imports for ESM layout.
lib/utils/local-binaries.ts Converts local command loader to async ESM import of local CLI commands.
lib/utils/load-configuration.ts Updates imports for ESM layout.
lib/utils/is-module-available.ts Uses createRequire for ESM-safe module resolution.
lib/utils/is-esm-project.ts Adds helper to detect ESM projects via package.json "type": "module".
lib/ui/messages.ts Updates ESM import specifier for emojis module.
lib/ui/index.ts Updates barrel exports to explicit .js specifiers.
lib/schematics/schematic.option.ts Changes boolean option rendering to --flag=false for false.
lib/schematics/nest.collection.ts Updates imports for ESM layout.
lib/schematics/index.ts Updates barrel exports to explicit .js specifiers.
lib/schematics/custom.collection.ts Updates NodeWorkflow import to explicit /index.js for ESM.
lib/schematics/collection.factory.ts Updates imports for ESM layout.
lib/schematics/abstract.collection.ts Updates imports for ESM layout.
lib/runners/yarn.runner.ts Updates import specifier for ESM layout.
lib/runners/schematic.runner.ts Reworks module-path resolution to be ESM-safe via createRequire.
lib/runners/runner.factory.ts Changes unsupported runner behavior from warn+continue to throwing an Error.
lib/runners/pnpm.runner.ts Updates import specifier for ESM layout.
lib/runners/npm.runner.ts Updates import specifier for ESM layout.
lib/runners/index.ts Updates barrel exports to explicit .js specifiers.
lib/runners/git.runner.ts Updates import specifier for ESM layout.
lib/runners/abstract.runner.ts Updates UI import for ESM layout and aligns variable naming with lint config.
lib/readers/index.ts Updates barrel exports to explicit .js specifiers.
lib/readers/file-system.reader.ts Updates reader import specifier for ESM layout.
lib/questions/questions.ts Removes any return annotation from generateInput factory.
lib/package-managers/yarn.package-manager.ts Updates imports for ESM layout.
lib/package-managers/pnpm.package-manager.ts Updates imports for ESM layout.
lib/package-managers/package-manager.factory.ts Updates imports for ESM layout and simplifies catch handling.
lib/package-managers/npm.package-manager.ts Updates imports for ESM layout.
lib/package-managers/index.ts Updates barrel exports to explicit .js specifiers.
lib/package-managers/abstract.package-manager.ts Migrates to fs/promises, ESM ora import, and tightens typing for package.json reads.
lib/configuration/nest-configuration.loader.ts Updates imports, fixes a typo in comment, and simplifies defaulting logic.
lib/configuration/index.ts Updates barrel exports to explicit .js specifiers.
lib/configuration/defaults.ts Updates imports and adds default rspack config filename constant.
lib/configuration/configuration.ts Extends builder types to include rspack and tightens several type definitions.
lib/configuration/configuration.loader.ts Updates import specifier for ESM layout.
lib/compiler/webpack-compiler.ts Adds webpack deprecation messaging, ESM project guard, and lazy-loads webpack deps.
lib/compiler/watch-compiler.ts Updates imports for ESM layout.
lib/compiler/typescript-loader.ts Reworks TS binary resolution for ESM (no module.paths reliance).
lib/compiler/swc/type-checker-host.ts Updates imports and logs type-check errors to stderr.
lib/compiler/swc/swc-compiler.ts ESM migration (createRequire/dirname), better error handling, and safer deep-merge own-property checks.
lib/compiler/swc/forked-type-checker.ts Updates imports and sends errors to stderr.
lib/compiler/swc/constants.ts Removes unused constant.
lib/compiler/rspack-compiler.ts Introduces new Rspack compiler implementation with watch/build flows.
lib/compiler/plugins/plugins-loader.ts ESM-safe plugin resolution via createRequire, fixes PluginAndOptions typing, improves error causes.
lib/compiler/plugins/plugin-metadata-printer.ts Updates import specifier for ESM layout.
lib/compiler/plugins/plugin-metadata-generator.ts Updates imports for ESM layout.
lib/compiler/hooks/tsconfig-paths.hook.ts ESM-safe resolution updates and removes os.platform() dependency.
lib/compiler/helpers/tsconfig-provider.ts Updates imports for ESM layout.
lib/compiler/helpers/get-webpack-config-path.ts Updates signature to accept option records instead of Input[] arrays.
lib/compiler/helpers/get-value-or-default.ts Changes option handling from Input[] to Record-based access for context objects.
lib/compiler/helpers/get-tsc-config.path.ts Updates signature to accept option records instead of Input[] arrays.
lib/compiler/helpers/get-rspack-config-path.ts Adds helper for rspack config path resolution from builder config.
lib/compiler/helpers/get-builder.ts Updates signature to accept option records instead of Input[] arrays.
lib/compiler/helpers/delete-out-dir.ts Updates imports for ESM layout.
lib/compiler/defaults/webpack-defaults.ts Lazy-loads webpack-related deps and improves missing-dep errors for optional installation.
lib/compiler/defaults/swc-defaults.ts Updates imports for ESM layout.
lib/compiler/defaults/rspack-defaults.ts Adds rspack defaults factory with ESM/CJS support and optional plugin integration.
lib/compiler/compiler.ts Updates imports and tightens extra arg typing.
lib/compiler/base-compiler.ts Refines abstract method return types and restricts some methods to protected.
lib/compiler/assets-manager.ts Updates imports and improves error message typing with cause.
gulpfile.js Removes legacy gulp entrypoint for cleaning/build tooling.
eslint.config.js Adds new flat-config ESLint setup for TS/ESM repo layout.
commands/start.command.ts Migrates to context-based action invocation and updates commander types.
commands/new.command.ts Migrates to context-based action invocation and updates language normalization logic.
commands/info.command.ts Updates commander types and ESM imports.
commands/index.ts Updates exports and adds context exports.
commands/generate.command.ts Migrates to context-based invocation and updates --spec option default semantics.
commands/context/start.context.ts Adds typed context interface for start command.
commands/context/new.context.ts Adds typed context interface for new command.
commands/context/index.ts Adds context barrel exports.
commands/context/generate.context.ts Adds typed context interface for generate command.
commands/context/build.context.ts Adds typed context interface for build command.
commands/context/add.context.ts Adds typed context interface for add command.
commands/command.loader.ts Adds ESM compatibility guard for global/local CLI mismatches and improves invalid command handling.
commands/build.command.ts Migrates to context-based action invocation and adds rspack to builder help text.
commands/add.command.ts Migrates to context-based action invocation and passes through remaining flags.
commands/abstract.command.ts Updates commander type usage for ESM migration.
bin/nest.ts Switches to new Command() for ESM, marks program as ESM-compatible, awaits local loader import.
actions/start.action.ts Refactors to accept StartCommandContext and adapts runBuild/start lifecycle to ESM.
actions/new.action.ts Refactors to accept NewCommandContext and updates prompting + schematic option mapping.
actions/info.action.ts Refactors internal methods to private, uses padEnd, and updates ESM imports.
actions/index.ts Updates exports to explicit .js specifiers.
actions/generate.action.ts Refactors to accept GenerateCommandContext and updates schematic-option mapping.
actions/build.action.ts Refactors to context-based inputs, adds rspack builder support, and updates ESM imports/dynamic imports.
actions/add.action.ts Refactors to AddCommandContext and removes reliance on Input[] option scanning.
actions/abstract.action.ts Simplifies AbstractAction API to a single context parameter.
.eslintrc.js Removes legacy ESLint RC config in favor of flat config.
.eslintignore Removes legacy ignore file (handled in flat config).
.circleci/config.yml Updates CI to run Vitest and adds separate e2e job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3282, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3283, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3284, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3285, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3287, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3288, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3289, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 11, 2026

@kamilmysliwiec I've opened a new pull request, #3290, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 16 commits March 11, 2026 14:51
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
fix: handle optional `dependencies`/`devDependencies` in package.json parsing
fix: support CLI rspackPath override in getRspackConfigPath
fix: replace `require('fs')` with ESM import in e2e build tests
fix: replace `require('fs')` with ESM import in build e2e spec
Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
fix(test): use mockReturnValue for synchronous fs mocks
fix: correct lifecycle hook name in postinstall.cjs comment
…e-4ec6-9da0-8e942876da1c

Remove unused `execSync` import from postinstall.cjs
…c-4c98-ad4a-1a61bd0ca736

Remove unused `stat` import from tools/clean.js
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 128 out of 131 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants