@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.
@@ -126,11 +126,6 @@ function validateUserConfig(userConfig) {
126
126
  );
127
127
  }
128
128
  }
129
- if (userConfig.scopes && Object.keys(userConfig.scopes).length > 0) {
130
- console.warn(
131
- "[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)."
132
- );
133
- }
134
129
  }
135
130
  function isGlobInput(value) {
136
131
  if (typeof value === "string") return true;
@@ -178,7 +173,6 @@ function applyDefaults(userConfig, cwd) {
178
173
  glob: userConfig.contracts?.glob ?? "src/**/*.controller.ts",
179
174
  debounceMs: userConfig.contracts?.debounceMs ?? 500
180
175
  },
181
- scopes: userConfig.scopes ?? {},
182
176
  codegen: {
183
177
  outDir,
184
178
  cwd: resolvedCwd
@@ -5768,7 +5762,7 @@ async function generate(config, inputRoutes = [], entryPoint = "cli") {
5768
5762
  }
5769
5763
  const configHash = computeConfigHash(config);
5770
5764
  const configKeyHashes = computeConfigKeyHashes(config);
5771
- if (config.driftGuard && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
5765
+ if (config.driftGuard && manifest?.version === VERSION && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
5772
5766
  throw new DriftGuardError(
5773
5767
  driftGuardMessage(
5774
5768
  config.codegen.outDir,
@@ -6069,6 +6063,11 @@ async function watch(config, onChange, options = {}) {
6069
6063
  trackedWatcher.on("add", (p) => scheduleContractsRegenerate(p, true));
6070
6064
  trackedWatcher.on("change", (p) => scheduleContractsRegenerate(p));
6071
6065
  trackedWatcher.on("unlink", (p) => scheduleContractsRegenerate(p, true));
6066
+ await Promise.all(
6067
+ [pagesWatcher, contractsWatcher, formsWatcher].map(
6068
+ (w) => new Promise((resolveReady) => w.once("ready", () => resolveReady()))
6069
+ )
6070
+ );
6072
6071
  return {
6073
6072
  close: async () => {
6074
6073
  if (pagesDebounceTimer !== void 0) {
@@ -6089,7 +6088,7 @@ async function watch(config, onChange, options = {}) {
6089
6088
  }
6090
6089
 
6091
6090
  // src/index.ts
6092
- var VERSION = "0.29.1";
6091
+ var VERSION = "0.30.0";
6093
6092
 
6094
6093
  // src/generate-manifest.ts
6095
6094
  var MANIFEST_FILE = ".codegen-manifest.json";