Repository navigation
v2.0.0: Node 22+/NestJS 11β12 support, Vitest, and close() fix - #9
Merged
Merged
Conversation
Move agent guidance into AGENTS.md so it can be shared by any AI coding tool, and point CLAUDE.md at it via symlink so Claude Code still picks it up without keeping two copies in sync.
β¦stop listening - Require Node >= 22 and narrow the @nestjs/common peer range to 11 or 12. CI now runs build and test on a Node 22 + 24 matrix, and publish uses Node 24. - Import INestApplication with `import type` so the emitted CJS has no runtime dependency on Nest, which lets Nest 12 (ESM-only) work as a peer. - close() now calls server.close() before closeAllConnections(). Before, the port stayed bound after close(). - Add tsconfig.build.json to build only lib/src into dist/. - Move lint-staged from dependencies to devDependencies. - Bump devDependencies, refresh the lockfile, and update AGENTS.md to match.
Drop the example/ Nest app, its committed self-signed cert and key, and its lockfile. Remove the matching AGENTS.md section and the "example" entry from the root tsconfig exclude list, since the directory no longer exists.
Nest 12 packages are ESM-only, which Jest's CJS loader can't import without experimental flags. Vitest loads ESM natively, so the devDeps can move to Nest 12 while CI still verifies Nest 11 compatibility. - Replace jest, ts-jest, ts-node and @nestjs/testing with vitest and @vitest/coverage-v8; add vitest.config.mjs with 100% thresholds - Port the spec file from jest.* to vi.* APIs - Add a Nest 11/12 matrix to test.yml via npm install --no-save - Update workflow path filters, VS Code settings and AGENTS.md - Drop the unreachable else-if condition in start()
Correct "develoment" to "development" in the package.json description. The file also loses its trailing newline.
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 38 35 -3
Branches 8 7 -1
=========================================
- Hits 38 35 -3 β View full report in Codecov by Harness. π New features to boost your workflow:
|
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.
This pull request targets the current LTS lines of Node.js and the maintained NestJS majors, fixes two defects, switches the test suite from Jest to Vitest, and removes the example app. It is a breaking change: 2.0.0, because it drops support for Node 18/20 and NestJS 9/10.
Breaking changes:
engines.nodeis now>=22.0.0. Node 18 and 20 are end-of-life; 22 and 24 are the current LTS lines.peerDependencies["@nestjs/common"]is now^11.0.0 || ^12.0.0. NestJS 9 and 10 are no longer supported.Fixes:
close()now callsserver.close()beforecloseAllConnections(). Previously the proxy kept listening and accepting connections afterclose()and kept the process alive. A side effect is thatstart()works again afterclose().main/typesagain. The build had started emittingdist/src/...anddist/test/..., so the next release would have been unusable (1.2.0 on npm is fine). The newtsconfig.build.jsoncompiles onlylib/src, and the package again contains exactly threedist/files.NestJS 12 compatibility:
INestApplicationis now imported withimport type, so the emitted JS has no runtime dependency on@nestjs/*. This was verified with real HTTPS requests on NestJS 11 and 12, Express and Fastify, and Node 22 and 24, plus a TypeScript consumer type-check (nodenextandbundler).else ifcondition instart()(it's now a plainelse; behavior is identical).Testing:
--experimental-vm-modules. The spec changes are only thejest.*βvi.*renames.else ifabove.close()stopping the server and forclose()doing nothing when the proxy isn't listening.npm install --no-saveover the NestJS 12 dev dependencies.Dependencies and repo:
@types/node22; addedvitestand@vitest/coverage-v8; removedjest,ts-jest,@types/jest,ts-node, and@nestjs/testing(unused).lint-stagedmoved fromdependenciestodevDependencies, so consumers no longer install it.example/app.lib/test/**,package-lock.json, andtsconfig.build.json.AGENTS.md(withCLAUDE.mdsymlinked to it) and replaced the Jest references in the README badge and VS Code config.