@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/dist/cli/main.js CHANGED
@@ -100,11 +100,6 @@ function validateUserConfig(userConfig) {
100
100
  );
101
101
  }
102
102
  }
103
- if (userConfig.scopes && Object.keys(userConfig.scopes).length > 0) {
104
- console.warn(
105
- "[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)."
106
- );
107
- }
108
103
  }
109
104
  function isGlobInput(value) {
110
105
  if (typeof value === "string") return true;
@@ -152,7 +147,6 @@ function applyDefaults(userConfig, cwd) {
152
147
  glob: userConfig.contracts?.glob ?? "src/**/*.controller.ts",
153
148
  debounceMs: userConfig.contracts?.debounceMs ?? 500
154
149
  },
155
- scopes: userConfig.scopes ?? {},
156
150
  codegen: {
157
151
  outDir,
158
152
  cwd: resolvedCwd
@@ -6012,7 +6006,7 @@ async function generate(config, inputRoutes = [], entryPoint = "cli") {
6012
6006
  }
6013
6007
  const configHash = computeConfigHash(config);
6014
6008
  const configKeyHashes = computeConfigKeyHashes(config);
6015
- if (config.driftGuard && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
6009
+ if (config.driftGuard && manifest?.version === VERSION && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
6016
6010
  throw new DriftGuardError(
6017
6011
  driftGuardMessage(
6018
6012
  config.codegen.outDir,
@@ -6313,6 +6307,11 @@ async function watch(config, onChange, options = {}) {
6313
6307
  trackedWatcher.on("add", (p) => scheduleContractsRegenerate(p, true));
6314
6308
  trackedWatcher.on("change", (p) => scheduleContractsRegenerate(p));
6315
6309
  trackedWatcher.on("unlink", (p) => scheduleContractsRegenerate(p, true));
6310
+ await Promise.all(
6311
+ [pagesWatcher, contractsWatcher, formsWatcher].map(
6312
+ (w) => new Promise((resolveReady) => w.once("ready", () => resolveReady()))
6313
+ )
6314
+ );
6316
6315
  return {
6317
6316
  close: async () => {
6318
6317
  if (pagesDebounceTimer !== void 0) {
@@ -6333,7 +6332,7 @@ async function watch(config, onChange, options = {}) {
6333
6332
  }
6334
6333
 
6335
6334
  // src/index.ts
6336
- var VERSION = "0.29.1";
6335
+ var VERSION = "0.30.0";
6337
6336
 
6338
6337
  // src/cli/codegen.ts
6339
6338
  async function runCodegen(opts = {}) {