Repository navigation
Version Packages - #67
Merged
Merged
Conversation
WhiteKiwi
added a commit
that referenced
this pull request
Oct 6, 2026
## Summary Prepare the next **major** release on top of the 2.2.1 main-branch baseline. NestJS 12 support was introduced in 2.2.0. Related to #59; independent of the typed-decorator work in #63. - Drop NestJS 8/9 peers; retain NestJS 10/11/12. - Ship one ESM build with `type: module`, explicit types/default root export (no legacy main), NodeNext build resolution and .js relative specifiers. - Propose Node.js >=22.12.0 as the new runtime floor. - Keep decorator runtime behavior intact; make erased imports explicit. - Use native ESM Jest/Prettier configuration files and a NodeNext root TypeScript config. - Keep the [migration guide](https://github.com/toss/nestjs-aop/blob/2e1b7f486d69d3e7152013e708b94adc3ac2a93d/docs/migrations/v3.md) under docs/migrations/v3.md in the repository only, with maintained main-branch README/changelog links. Publish only dist, retain top-level types, build in prepack, and embed sources in JS source maps without shipping the source tree or declaration maps. - Add packed-tarball consumer CI for Nest 10.4.22/11.2.6/12.1.0 × Node 22.12.0/24.19.0/26.10.0, plus baseline and latest-per-major Nest cases on Node 24.19.0. ## Release boundary **Draft only: do not merge or publish until the support policy below is reviewed.** The package version remains 2.2.1; `changeset status` reports one major release to 3.0.0. No version command or publish was run. Includes main `be825e60e62351dbc222030d57c623349317d0db` (2.2.1, including #66 and #67), integrated without rewriting the reviewed branch history. PR #63 is not included. If it merges first, rebase and rerun the consumer matrix; do not inadvertently combine an intended separate minor release into the major. ## Published 2.2.0 baseline (fresh npm consumer) On Node 24.19.0, independently installed `@toss/nestjs-aop@2.2.0` + Nest 12.1.0 peers, with no workspace symlinks: - Native CJS and ESM applications pass actual Nest bootstrap/aspect wrapping, before/original/after order, return values, undecorated method, lifecycle completion and repeated-call checks. - Jest 30.4.2 CJS passes with `--experimental-vm-modules`; default Jest without the flag fails on Nest's ESM. - Static ESM imports hit Jest's mixed CJS/ESM concurrent-loader error. Sequentially awaiting Nest common/core imports before dynamically importing the consumer passes. - The v3 candidate passes that static-import ESM Jest fixture directly. ## Candidate verification Current head: `2e1b7f486d69d3e7152013e708b94adc3ac2a93d`. - Frozen-lockfile install, lint, root NodeNext typecheck (including tests), build and pack pass. Four focused source-map regression tests also pass. - Repository Jest suite: 5 suites / 22 tests / 12 snapshots pass. - [CI #129](https://github.com/toss/nestjs-aop/actions/runs/36974513302) passes all 16 jobs: the base job, all 9 pinned Node/Nest pairs and 6 baseline/latest packed-consumer jobs. - Every packed-consumer job verifies native CJS/ESM runtime, plain-JS ESM Jest, the migration guide's exact ts-jest ESM configuration with Jest 29.7.0 and 30.4.2, compiler compatibility boundaries, and the dist-only/source-map packaging contract. - TypeScript 5.8.3 NodeNext .mts/.cts, TypeScript 5.7.3 NodeNext .mts, and both versions in CommonJS/node10 mode pass. Expected TS1479 failures are asserted for TypeScript 5.7.3 CJS/NodeNext and TypeScript 5.8.3 CJS/node16. - CJS Jest 30.4.2 with the VM flag passes on Node 24.19/26.10. Node 22 CJS Jest remains explicitly migration-required and visibly skipped after validating ESM tests; it is not claimed as a pass. - The new TypeScript fixture checks actual Nest bootstrap, constructor injection, aspect order, return values, lifecycle and repeated calls. The guide/config comparison works with LF and CRLF checkouts. - Local Node 24.19 checks cover root NodeNext typechecking and all 22 tests on Nest 10.4.22, 11.2.6 and 12.1.0, plus the four map regressions and packed Nest 12.1 consumer. The full pinned and baseline/latest matrices pass in CI. ## Review follow-up - Document the conditional TS 5.8 floor for CJS/NodeNext, node16/node18 limitations and the existing CommonJS/node10 path. Jest 29 remains supported in ESM mode; upgrading to Jest 30 is not universally required. - Keep ESM-only packaging, Nest 10/11/12 peers and Node >=22.12. Document the Node 22.12 require(esm) warning rather than changing the runtime floor. - Replace stale commit-pinned published documentation links with maintained main-branch links and remove PR-process notes from the migration guide. - Keep reproducible pins and add baseline/current-major checks. The baseline pairs are 10.0.0, 11.0.0 and 12.0.1. Nest 12.0.0 has inconsistent upstream peers (core requires common ^11), so 12.0.1 is used without bypassing peer validation. - The Nest 10.0.0 baseline explicitly uses skipLibCheck:true for its upstream file-validator TS2416 errors. Application import/compiler-boundary checks still run; the other pinned/latest cases retain skipLibCheck:false. - Pack under the matrix Node version. The verifier can invoke npm's JS entry point through `npm run test:packed`, avoiding Windows .cmd execution. Windows itself was not run locally. - Remove unused Babel configuration/devDependencies, stale esm exclusions and the Nest 8 comment. Lockfile pruning removes 116 unused entries without changing retained dependency versions. - Keep the root-only export contract, existing v2 guide path and npm-based prepack build. No dual build, package.json subpath export or unrelated runtime change is introduced. The existing Aspect/Injectable defect was fixed separately in #66 and is now included through the main integration. ## Second review follow-up - Integrate main's 2.2.1 release and resolve package.json while retaining the ESM root exports and no legacy main field. - Update the imported Aspect regression test's four relative imports to .js, make LazyDecorator/WrapParams type-only, and use @nestjs/common/constants.js for NodeNext compatibility with Nest 10/11 as well as 12. - Add root source/test typechecking and packaging-regression gates to the base job and all nine pinned compatibility jobs. These cover test files excluded from the package build. - Scan source maps recursively, including dist/core and dist/utils. The packed verifier reports all nine JavaScript maps checked. Four red/green tests cover traversal, nested missing embedded source, nested absolute paths and nested declaration maps. ## Proposed support contract — maintainer decision Keep Node >=22.12 runtime support and require Node 22 users to migrate Jest tests to ESM mode. Modern Node 24.9+ / recent Jest may use synchronous ESM loading with the VM flag, but old CJS test/mocking workflows are not universally compatible. This policy is a **proposal in this draft**, not a final approval of the migration cost. No dual build is introduced. The migration guide also records the exports/deep-import break and ESM mock differences. ### Why this draft uses one ESM artifact A dual build is a viable alternative for preserving Nest 10/11's default CommonJS toolchain. This draft favors one implementation artifact for both import and supported require consumers, avoiding separate CJS/ESM module copies and parallel build/export/declaration outputs. The cost is the explicitly documented compiler and Jest migration. With the current ASPECT = Symbol('ASPECT'), independently loaded CJS and ESM builds would not share the aspect metadata key. A dual-build implementation would need a namespaced shared key such as Symbol.for, plus mixed-loader regression tests; the hazard is manageable, not a claim that dual publishing is impossible. Maintainers still need to decide whether this single-artifact tradeoff is appropriate before merging. ## Pure-ESM packaging references Reviewed current [p-queue](https://github.com/sindresorhus/p-queue/blob/main/package.json) (TypeScript), [p-limit](https://github.com/sindresorhus/p-limit/blob/main/package.json), [p-retry](https://github.com/sindresorhus/p-retry/blob/main/package.json) and [Sindre Sorhus's guide](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). Adopted type:module, types/default exports in that order, no legacy main, dist-only allowlist, a top-level types pointer, Node-aware compiler resolution and prepack build. Keep the tested Node floor and Nest legacy decorator metadata rather than copying unrelated compiler/test presets. ES2022 output retains the previous class-field semantics explicitly. No blanket sideEffects:false assertion is added to this decorator/metadata library. Local build, lint, 22 tests and fresh packed Nest 12 consumer pass. Packed artifact has 30 files, no source/doc trees or declaration maps, and all 9 JS maps contain embedded source without absolute source paths. The CI consumer test now also enforces this packaging contract. ## CI [CI #129](https://github.com/toss/nestjs-aop/actions/runs/36974513302) passed on exact head `2e1b7f486d69d3e7152013e708b94adc3ac2a93d`: all 16 jobs, including 15 packed-consumer jobs with the expanded compiler/Jest and packaging checks. The PR remains draft and has not been merged into main. No version command or publish was run for this proposal. The support-policy decision above is still required before release.
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 PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@toss/nestjs-aop@2.2.1
Patch Changes
3eb1595Thanks @WhiteKiwi! - Apply Nest'sInjectable()decorator in@Aspectso aspect classes receive injectable metadata.