@dudousxd/nestjs-codegen 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @dudousxd/nestjs-codegen
2
2
 
3
+ ## 0.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5a2619c: perf(core): make the boot-time watcher production-safe, non-blocking, and idempotent.
8
+
9
+ Three changes to the `NestjsCodegenModule` `onApplicationBootstrap` path so dev-watch
10
+ restarts no longer pay the full codegen cost on time-to-ready:
11
+
12
+ - **Skip in production.** `NODE_ENV` is now normalized (trimmed + lowercased) before the
13
+ production check, and the watcher is skipped with a single concise log line when it is
14
+ `production`. A new `runInProduction?: boolean` option (default `false`) forces it on if
15
+ ever needed; explicit `enabled` still overrides both.
16
+
17
+ - **Non-blocking boot.** The initial discover + generate triggered by
18
+ `onApplicationBootstrap` now runs fire-and-forget (`watch(config, undefined, { deferInitialGenerate: true })`)
19
+ so it no longer blocks `NestFactory.create`. The lock and the chokidar watchers are
20
+ still set up synchronously, lock NO_OP semantics are preserved, and a rejected initial
21
+ generate is caught and logged rather than crashing the process. The one-shot CLI
22
+ (`nestjs-codegen codegen`) stays fully synchronous.
23
+
24
+ - **Skip-when-unchanged.** `generate()` now records a content hash (over all discovered
25
+ controller/DTO/page source files + the serialized resolved config + the lib version) and
26
+ the emitted output file list in `<outDir>/.codegen-manifest.json`. When the hash matches
27
+ and every recorded output still exists, the pass is skipped — stopping HMR from rewriting
28
+ `api.ts` (and churning downstream `tsbuildinfo`) when nothing changed. Any input change,
29
+ a missing output, or a lib upgrade invalidates the manifest and regenerates.
30
+
3
31
  ## 0.11.0
4
32
 
5
33
  ### Minor Changes