Skip to content

fix(misc): multi-version compliance for @nx/express, @nx/node, and @nx/nest#35807

Merged
AgentEnder merged 4 commits into
masterfrom
gleaming-meal
Jun 1, 2026
Merged

fix(misc): multi-version compliance for @nx/express, @nx/node, and @nx/nest#35807
AgentEnder merged 4 commits into
masterfrom
gleaming-meal

Conversation

@polygraph-snapshot-app

@polygraph-snapshot-app polygraph-snapshot-app Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Current Behavior

@nx/express

  • Peer dep declares express: ^4.21.2 only; Express v5 has been ACTIVE since 2025-03-31 and v4 is in MAINT, so the plugin's advertised window doesn't match the upstream support window.
  • Generators install a single literal express ^4.21.2 regardless of what's installed; no per-major routing for express or @types/express.
  • keepExistingVersions schema default is false, so re-running the generator silently overwrites a user's pinned express version.
  • No floor enforcement: a workspace on an unsupported (sub-floor) express version sees no error.

@nx/node

  • No peerDependencies for express, koa, or fastify. Init/application generators write framework deps unconditionally, ignoring what's installed.
  • keepExistingVersions defaults to false; framework installs override user pins.
  • migrations.json 22.0.2 bumps koa from v2 to v3 with no requires block — every workspace on koa v2 gets pushed to v3 unconditionally.
  • migrations.json 20.4.0 mixes a cross-major fastify v4→v5 bump with same-major express bumps under one entry, with no requires (AND-semantics would gate same-major bumps incorrectly if added naively).
  • No floor enforcement for any framework.

@nx/nest

  • peerDependencies block is missing from package.json entirely; workspaces have no advertised compatible range for any @nestjs/* package.
  • Versions module has flat constants; the plugin ships v11-only even though NestJS v10.4.x still receives upstream patches (N & N-1 baseline calls for v10 + v11).
  • migrations.json 21.2.0-beta.2 uses a bare key nest which is not a real npm package — the entry is effectively a no-op. The real cross-major v10→v11 bump for @nestjs/common, @nestjs/core, @nestjs/platform-express, @nestjs/testing is missing, as is a requires source-major gate.
  • No floor enforcement for any NestJS version.

Expected Behavior

@nx/express (NXC-4390)

  • Per-major versionMap keyed on express major covering both express and @types/express for v4 and v5; fresh installs default to v5.1.0.
  • assertSupportedExpressVersion(tree) (calls shared assertSupportedPackageVersion) is the first statement of initGenerator and applicationGeneratorInternal.
  • Peer widened to express: ">=4.0.0 <6.0.0" (still optional).
  • All addDependenciesToPackageJson call sites from generators pass keepExistingVersions ?? true; schema defaults flipped to true. Init now installs @types/express (previously a dead export).
  • New all-generators-enforce-floor.spec.ts exercises every generator entry at subFloorVersion: '~3.21.0'.
  • Supported-versions docs page updated.

@nx/node (NXC-4396)

  • Per-package versionMap + versions(tree) for express (v4+v5), koa (v2+v3), fastify (v4+v5), and @types/node (v22+v24). Fresh installs default to active LTS / latest stable.
  • assertSupportedFrameworkVersion(tree, schema.framework) (dispatches to one wrapper per framework) is the first statement of applicationGeneratorInternal, only firing when --framework selects a non-none/nest lane.
  • Framework + @types/node installs route through versions(tree) and pass keepExistingVersions ?? true. Init schema default flipped to true.
  • migrations.json: 22.0.2 koa v2→v3 gated with requires: { koa: ">=2.0.0 <3.0.0" }. 22.6.0 koa CVE patch gated bilaterally to v3 only. 20.4.0 split into the original same-major express bumps (no gate) and a new 20.4.0-fastify entry gated on requires: { fastify: ">=4.0.0 <5.0.0" }.
  • Optional peerDependencies declared for express, koa, fastify. Added semver: "catalog:" to deps (now imported by versions.ts). @nx/dependency-checks allow-list updated.

@nx/nest (NXC-4394)

  • Per-major versionMap covering NestJS v10 and v11 for the full @nestjs/* family plus rxjs and reflect-metadata. Fresh installs default to NestJS v11, with reflect-metadata bumped from ^0.1.13 to ^0.2.0 to match v11's requirement.
  • assertSupportedNestJsVersion(tree) is the first statement of the init, application, and library generators.
  • ensureDependencies and the init addDependencies helper route through versions(tree) and pass keepExistingVersions: true (?? true on the init path); init schema default flipped to true.
  • Optional peerDependencies declared for @nestjs/core, @nestjs/common, reflect-metadata, rxjs. Added semver: "catalog:" to deps and extended @nx/dependency-checks allow-list.
  • migrations.json 21.2.0-beta.2 rewritten with real package keys (the previous bare nest key was a typo / no-op) and gated on requires: { "@nestjs/core": ">=10.0.0 <11.0.0" }. The entry now also bumps reflect-metadata to ^0.2.0 for v11 compatibility.
  • Supported-versions docs page updated.

Related Issue(s)

Fixes NXC-4390
Fixes NXC-4396
Fixes NXC-4394

@netlify

netlify Bot commented May 26, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit f47a068
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a18c59cf479440008844224
😎 Deploy Preview https://deploy-preview-35807--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented May 26, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit f47a068
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a18c59cfe61ae0008e4be93
😎 Deploy Preview https://deploy-preview-35807--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud

nx-cloud Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit f47a068

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 15m 2s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 16s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 19s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-28 23:04:58 UTC

@AgentEnder AgentEnder changed the title fix(express,node): multi-version compliance for @nx/express and @nx/node feat(node): multi-version compliance for @nx/express and @nx/node May 26, 2026
@socket-security

socket-security Bot commented May 26, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​nestjs/​core@​11.1.249310010096100
Addednpm/​@​nestjs/​common@​11.1.249910010096100

View full report

@AgentEnder AgentEnder changed the title feat(node): multi-version compliance for @nx/express and @nx/node fix(express,node,nest): multi-version compliance for @nx/express, @nx/node, and @nx/nest May 28, 2026
@socket-security

socket-security Bot commented May 28, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

- Introduce per-major versionMap covering Express v4 + v5 in versions.ts;
  fresh-install defaults to v5.1.0 (paired with @types/express ^5.0.0).
- Add assertSupportedExpressVersion wrapper around the shared
  assertSupportedPackageVersion helper; call it as the first statement
  of init and application generators.
- Widen peer range to >=4.0.0 <6.0.0 (still optional).
- Pass keepExistingVersions: true through generator install sites;
  flip schema defaults to true. Init now also installs @types/express.
- Add parameterized all-generators-enforce-floor spec.
- Update supported-versions docs page.
…floors

- Restructure versions.ts into per-package bundles with versionMap +
  versions(tree) helpers for express (v4 + v5), koa (v2 + v3), fastify
  (v4 + v5), and @types/node (v22 + v24). Default to v5/v3/v5/v22.
- Add assertSupportedFrameworkVersion dispatcher (one wrapper per
  framework) and call it as the first statement of the application
  generator when --framework is selected.
- Route framework + @types/node installs through versions(tree) in
  add-dependencies.ts; pass keepExistingVersions ?? true (was implicitly
  false). Flip init schema default to true.
- migrations.json: add requires gate to 22.0.2 (koa v2 -> v3) and to
  22.6.0 (within-v3 CVE patch). Split 20.4.0 into the original
  same-major express bumps and a new 20.4.0-fastify entry gated on
  fastify v4 -> v5 (avoids AND-semantics on the previous combined
  entry).
- Declare optional peerDependencies for express, koa, fastify; add
  semver to dependencies (now imported). Allow these in @nx/dependency
  -checks' ignoredDependencies (plugin doesn't import them; they are
  referenced only via __tmpl__ files).
Reflects the package.json edits from the prior two commits: widened
express peer in @nx/express, new optional peers on @nx/node (express,
koa, fastify), and the new semver runtime dep in both plugins.
- Restructure versions.ts with per-major versionMap covering NestJS v10
  and v11 for the full @nestjs/* family plus rxjs and reflect-metadata;
  fresh installs default to v11 (with reflect-metadata bumped to
  ^0.2.0 to match NestJS v11's requirement).
- Add assertSupportedNestJsVersion wrapper around the shared
  assertSupportedPackageVersion helper; call it as the first statement
  of init, application, and library generators.
- ensure-dependencies and the init add-dependencies helper route
  through versions(tree) and pass keepExistingVersions: true; flip
  init schema default to true.
- Declare optional peerDependencies for @nestjs/core, @nestjs/common,
  reflect-metadata, rxjs. Add semver to dependencies (now imported)
  and extend @nx/dependency-checks' ignoredDependencies list.
- migrations.json: rewrite 21.2.0-beta.2 with real package keys
  (@nestjs/common, @nestjs/core, @nestjs/platform-express,
  @nestjs/testing, @nestjs/schematics, reflect-metadata) — the
  previous bare "nest" key was not a real npm package and was a
  silent no-op — and gate the v10 -> v11 bump on
  requires: { "@nestjs/core": ">=10.0.0 <11.0.0" }.
- Update lockfile and supported-versions docs page.
@AgentEnder AgentEnder changed the title fix(express,node,nest): multi-version compliance for @nx/express, @nx/node, and @nx/nest fix(core): multi-version compliance for @nx/express, @nx/node, and @nx/nest May 29, 2026
@AgentEnder AgentEnder changed the title fix(core): multi-version compliance for @nx/express, @nx/node, and @nx/nest fix(misc): multi-version compliance for @nx/express, @nx/node, and @nx/nest May 29, 2026
@AgentEnder AgentEnder marked this pull request as ready for review June 1, 2026 11:01
@AgentEnder AgentEnder requested a review from a team as a code owner June 1, 2026 11:01
@AgentEnder AgentEnder self-requested a review June 1, 2026 11:01
@AgentEnder AgentEnder merged commit 412a37a into master Jun 1, 2026
26 of 27 checks passed
@AgentEnder AgentEnder deleted the gleaming-meal branch June 1, 2026 11:01
vrxj81 pushed a commit to vrxj81/nx that referenced this pull request Jun 7, 2026
…x/nest (nrwl#35807)

## Current Behavior

**`@nx/express`**
- Peer dep declares `express: ^4.21.2` only; Express v5 has been ACTIVE
since 2025-03-31 and v4 is in MAINT, so the plugin's advertised window
doesn't match the upstream support window.
- Generators install a single literal `express ^4.21.2` regardless of
what's installed; no per-major routing for `express` or
`@types/express`.
- `keepExistingVersions` schema default is `false`, so re-running the
generator silently overwrites a user's pinned `express` version.
- No floor enforcement: a workspace on an unsupported (sub-floor)
`express` version sees no error.

**`@nx/node`**
- No `peerDependencies` for `express`, `koa`, or `fastify`.
Init/application generators write framework deps unconditionally,
ignoring what's installed.
- `keepExistingVersions` defaults to `false`; framework installs
override user pins.
- `migrations.json` `22.0.2` bumps `koa` from v2 to v3 with no
`requires` block — every workspace on koa v2 gets pushed to v3
unconditionally.
- `migrations.json` `20.4.0` mixes a cross-major fastify v4→v5 bump with
same-major express bumps under one entry, with no `requires`
(AND-semantics would gate same-major bumps incorrectly if added
naively).
- No floor enforcement for any framework.

**`@nx/nest`**
- `peerDependencies` block is missing from `package.json` entirely;
workspaces have no advertised compatible range for any `@nestjs/*`
package.
- Versions module has flat constants; the plugin ships v11-only even
though NestJS v10.4.x still receives upstream patches (N & N-1 baseline
calls for v10 + v11).
- `migrations.json` `21.2.0-beta.2` uses a bare key `nest` which is not
a real npm package — the entry is effectively a no-op. The real
cross-major v10→v11 bump for `@nestjs/common`, `@nestjs/core`,
`@nestjs/platform-express`, `@nestjs/testing` is missing, as is a
`requires` source-major gate.
- No floor enforcement for any NestJS version.

## Expected Behavior

**`@nx/express` (NXC-4390)**
- Per-major `versionMap` keyed on `express` major covering both
`express` and `@types/express` for v4 and v5; fresh installs default to
v5.1.0.
- `assertSupportedExpressVersion(tree)` (calls shared
`assertSupportedPackageVersion`) is the first statement of
`initGenerator` and `applicationGeneratorInternal`.
- Peer widened to `express: ">=4.0.0 <6.0.0"` (still optional).
- All `addDependenciesToPackageJson` call sites from generators pass
`keepExistingVersions ?? true`; schema defaults flipped to `true`. Init
now installs `@types/express` (previously a dead export).
- New `all-generators-enforce-floor.spec.ts` exercises every generator
entry at `subFloorVersion: '~3.21.0'`.
- Supported-versions docs page updated.

**`@nx/node` (NXC-4396)**
- Per-package `versionMap` + `versions(tree)` for `express` (v4+v5),
`koa` (v2+v3), `fastify` (v4+v5), and `@types/node` (v22+v24). Fresh
installs default to active LTS / latest stable.
- `assertSupportedFrameworkVersion(tree, schema.framework)` (dispatches
to one wrapper per framework) is the first statement of
`applicationGeneratorInternal`, only firing when `--framework` selects a
non-`none`/`nest` lane.
- Framework + `@types/node` installs route through `versions(tree)` and
pass `keepExistingVersions ?? true`. Init schema default flipped to
`true`.
- `migrations.json`: `22.0.2` koa v2→v3 gated with `requires: { koa:
">=2.0.0 <3.0.0" }`. `22.6.0` koa CVE patch gated bilaterally to v3
only. `20.4.0` split into the original same-major express bumps (no
gate) and a new `20.4.0-fastify` entry gated on `requires: { fastify:
">=4.0.0 <5.0.0" }`.
- Optional `peerDependencies` declared for `express`, `koa`, `fastify`.
Added `semver: "catalog:"` to deps (now imported by `versions.ts`).
`@nx/dependency-checks` allow-list updated.

**`@nx/nest` (NXC-4394)**
- Per-major `versionMap` covering NestJS v10 and v11 for the full
`@nestjs/*` family plus `rxjs` and `reflect-metadata`. Fresh installs
default to NestJS v11, with `reflect-metadata` bumped from `^0.1.13` to
`^0.2.0` to match v11's requirement.
- `assertSupportedNestJsVersion(tree)` is the first statement of the
`init`, `application`, and `library` generators.
- `ensureDependencies` and the init `addDependencies` helper route
through `versions(tree)` and pass `keepExistingVersions: true` (`??
true` on the init path); init schema default flipped to `true`.
- Optional `peerDependencies` declared for `@nestjs/core`,
`@nestjs/common`, `reflect-metadata`, `rxjs`. Added `semver: "catalog:"`
to deps and extended `@nx/dependency-checks` allow-list.
- `migrations.json` `21.2.0-beta.2` rewritten with real package keys
(the previous bare `nest` key was a typo / no-op) and gated on
`requires: { "@nestjs/core": ">=10.0.0 <11.0.0" }`. The entry now also
bumps `reflect-metadata` to `^0.2.0` for v11 compatibility.
- Supported-versions docs page updated.

## Related Issue(s)

Fixes NXC-4390
Fixes NXC-4396
Fixes NXC-4394

---------

Co-authored-by: Craigory Coppola <craigorycoppola@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants