@dudousxd/nestjs-codegen 0.29.1 → 0.30.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,21 @@
1
1
  # @dudousxd/nestjs-codegen
2
2
 
3
+ ## 0.30.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#135](https://github.com/DavideCarvalho/nestjs-codegen/pull/135) [`62c0e52`](https://github.com/DavideCarvalho/nestjs-codegen/commit/62c0e528c28f141f7b60315b2615fd0ab629f0eb) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - **Breaking:** require Node.js 24 or newer (`engines.node` is now `>=24`, was `>=20`). CI tests on Node 24 and 26.
8
+
9
+ Also removed (see the Upgrading page in the docs):
10
+
11
+ - `@dudousxd/nestjs-codegen`: the deprecated top-level `scopes` config option, which had no effect, and its `ScopeConfig` type. Use `pages.scopes` for several Inertia apps, or one brace glob in `contracts.glob` for several controller sets.
12
+ - `@dudousxd/nestjs-codegen`: `genuiSandboxKit()` no longer throws a migration error for its pre-0.28 option names (`include`/`entry` → `components`, `css` → `styles`). TypeScript reports them as unknown options.
13
+ - `@dudousxd/nestjs-client`: `TransportResponse.headers` is required. A custom `Transport` returns every response header, with lower-cased keys (`Object.fromEntries(res.headers)` with `fetch`).
14
+
15
+ Fixed: `watch()` (and so `NestjsCodegenModule`'s dev watcher) resolves only after its file watchers finish their initial scan, so an edit made right after it starts is no longer missed.
16
+
17
+ - The CLI/module drift guard no longer fires against a manifest written by another lib version: an upgrade that drops a config key (like `scopes`) is not drift.
18
+
3
19
  ## 0.29.1
4
20
 
5
21
  ### Patch Changes
package/dist/cli/main.cjs CHANGED
@@ -134,11 +134,6 @@ function validateUserConfig(userConfig) {
134
134
  );
135
135
  }
136
136
  }
137
- if (userConfig.scopes && Object.keys(userConfig.scopes).length > 0) {
138
- console.warn(
139
- "[nestjs-codegen] The top-level `scopes` option has no effect and is deprecated. For several Inertia apps use `pages.scopes` (one entry per InertiaModule.forFeature scope); for several controller sets use one `contracts.glob` (e.g. a brace glob)."
140
- );
141
- }
142
137
  }
143
138
  function isGlobInput(value) {
144
139
  if (typeof value === "string") return true;
@@ -186,7 +181,6 @@ function applyDefaults(userConfig, cwd) {
186
181
  glob: userConfig.contracts?.glob ?? "src/**/*.controller.ts",
187
182
  debounceMs: userConfig.contracts?.debounceMs ?? 500
188
183
  },
189
- scopes: userConfig.scopes ?? {},
190
184
  codegen: {
191
185
  outDir,
192
186
  cwd: resolvedCwd
@@ -6023,7 +6017,7 @@ async function generate(config, inputRoutes = [], entryPoint = "cli") {
6023
6017
  }
6024
6018
  const configHash = computeConfigHash(config);
6025
6019
  const configKeyHashes = computeConfigKeyHashes(config);
6026
- if (config.driftGuard && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
6020
+ if (config.driftGuard && manifest?.version === VERSION && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
6027
6021
  throw new DriftGuardError(
6028
6022
  driftGuardMessage(
6029
6023
  config.codegen.outDir,
@@ -6324,6 +6318,11 @@ async function watch(config, onChange, options = {}) {
6324
6318
  trackedWatcher.on("add", (p) => scheduleContractsRegenerate(p, true));
6325
6319
  trackedWatcher.on("change", (p) => scheduleContractsRegenerate(p));
6326
6320
  trackedWatcher.on("unlink", (p) => scheduleContractsRegenerate(p, true));
6321
+ await Promise.all(
6322
+ [pagesWatcher, contractsWatcher, formsWatcher].map(
6323
+ (w) => new Promise((resolveReady) => w.once("ready", () => resolveReady()))
6324
+ )
6325
+ );
6327
6326
  return {
6328
6327
  close: async () => {
6329
6328
  if (pagesDebounceTimer !== void 0) {
@@ -6344,7 +6343,7 @@ async function watch(config, onChange, options = {}) {
6344
6343
  }
6345
6344
 
6346
6345
  // src/index.ts
6347
- var VERSION = "0.29.1";
6346
+ var VERSION = "0.30.0";
6348
6347
 
6349
6348
  // src/cli/codegen.ts
6350
6349
  async function runCodegen(opts = {}) {