@dudousxd/nestjs-codegen 0.21.1 → 0.22.1

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,55 @@
1
1
  # @dudousxd/nestjs-codegen
2
2
 
3
+ ## 0.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - da8ec39: Order routes by file path, so an unchanged source tree always generates the same client
8
+
9
+ Route order decided the order of everything emitted from it — the groups in
10
+ `api.ts`, the entries in `routes.ts` — and it was whatever order discovery
11
+ happened to reach the files in. The cold path adds controllers in `fast-glob`'s
12
+ directory-walk order, which is I/O-completion order from a concurrent walk: it
13
+ holds while the FS cache is warm and can differ on a cold one, so regenerating
14
+ an untouched project could move a controller group to a different position. The
15
+ watcher appended each newly-created controller to the end of its set, so from
16
+ the moment a file was added its output no longer matched a cold run's, for the
17
+ rest of the session.
18
+
19
+ Both extraction entry points now sort their roots by path. `discoverPages` has
20
+ sorted its glob from the start, which is why only the controller-derived
21
+ artifacts ever moved.
22
+
23
+ Nothing about the generated client changes except the order of its blocks —
24
+ same routes, same types, same members. Consumers who commit their generated
25
+ directory should expect one reorder-only diff on the first run after upgrading.
26
+
27
+ ## 0.22.0
28
+
29
+ ### Minor Changes
30
+
31
+ - 4af626a: Hand extensions the tsconfig-seeded Project instead of making each build its own
32
+
33
+ `ExtensionContext` gains `tsconfigProject()`: a lazily-created, memoized ts-morph
34
+ `Project` built from the consumer's tsconfig (`app.tsconfig`, else
35
+ `<cwd>/tsconfig.json`), so `paths` aliases resolve. `project()` is unchanged — it
36
+ stays the bare, paths-less scratch project — and the two are now documented against
37
+ each other.
38
+
39
+ An extension that needs to follow a `@/api/...` import from a controller to the
40
+ decorator target it reads had no way to get one, so it built its own from
41
+ `tsConfigFilePath`. That has a trap: parsing a tsconfig also resolves its FILE LIST,
42
+ and a tsconfig with no `include` walks the entire project root, so one unreadable
43
+ directory (a docker bind mount a container chowned to its own UID) throws
44
+ `EACCES ... scandir`. Every hand-rolled copy then fell back to a paths-less Project
45
+ in silence, and aliased targets resolved to nothing with no error anywhere — the
46
+ same bug, once per extension. The host now loads it correctly, once, and hands it
47
+ out; N extensions share one parse instead of one each.
48
+
49
+ Typed as optional (`tsconfigProject?()`) on purpose: an extension may run against an
50
+ older host that does not provide it, so the ecosystem pattern is
51
+ `ctx.tsconfigProject?.() ?? <own fallback>`.
52
+
3
53
  ## 0.21.1
4
54
 
5
55
  ### Patch Changes