@dudousxd/nestjs-codegen 0.10.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,52 @@
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
+
31
+ ## 0.11.0
32
+
33
+ ### Minor Changes
34
+
35
+ - b9efd1c: fix(core): emit a clean prefix `queryKey` when a query handle is called with no input.
36
+
37
+ Previously the generated `queryKey()` was always `[name, input]`, so calling it with
38
+ no argument produced `[name, undefined]` — a two-element key whose trailing `undefined`
39
+ does NOT partial-match the parametrized live queries (`[name, { params, query }]`).
40
+ That made the bare `api.x.y().queryKey()` useless for `invalidateQueries`: it silently
41
+ matched nothing.
42
+
43
+ The key now omits the trailing element when `input === undefined`
44
+ (`input === undefined ? [name] : [name, input]`), so `api.x.y().queryKey()` is a proper
45
+ prefix that partial-matches every parametrized variant. Invalidating a whole route is now
46
+ just `queryClient.invalidateQueries({ queryKey: api.x.y().queryKey() })` — no manual
47
+ key construction or slicing. Passing the real input still yields `[name, input]` for an
48
+ exact match. Keys carrying input are unchanged.
49
+
3
50
  ## 0.10.0
4
51
 
5
52
  ### Minor Changes