@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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as UserConfig, R as ResolvedConfig, a as RouteDescriptor, S as SchemaNode, b as RenderContext, c as SchemaModule, d as RenderedModule, e as ResolvedFormsConfig, V as ValidationAdapter, C as CodegenExtension, E as ExtensionContext, f as SerializationMode } from './index-Dc4s883u.cjs';
2
- export { A as AdapterUsage, g as ContractDescriptor, h as ContractSource, i as ControllerRef, N as NumberCheck, j as ScopeConfig, k as StringCheck, T as TypeRef, l as ValidationOption, r as resolveAdapter } from './index-Dc4s883u.cjs';
1
+ import { U as UserConfig, R as ResolvedConfig, a as RouteDescriptor, S as SchemaNode, b as RenderContext, c as SchemaModule, d as RenderedModule, e as ResolvedFormsConfig, V as ValidationAdapter, C as CodegenExtension, E as ExtensionContext, f as SerializationMode } from './index-D4Blt-RT.cjs';
2
+ export { A as AdapterUsage, g as ContractDescriptor, h as ContractSource, i as ControllerRef, N as NumberCheck, j as StringCheck, T as TypeRef, k as ValidationOption, r as resolveAdapter } from './index-D4Blt-RT.cjs';
3
3
  import { ClassDeclaration, SourceFile, Project } from 'ts-morph';
4
4
 
5
5
  declare function defineConfig(c: UserConfig): UserConfig;
@@ -448,6 +448,6 @@ interface FastDiscoveryOptions {
448
448
  }
449
449
  declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
450
450
 
451
- declare const VERSION = "0.29.1";
451
+ declare const VERSION = "0.30.0";
452
452
 
453
453
  export { type ChainModuleRendererOptions, CodegenError, type CodegenManifest, ConfigError, DEFAULT_SANDBOX_KIT_OUTPUT, DriftGuardError, type EntryPoint, type FastDiscoveryOptions, type GenuiSandboxKitOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type WatchOptions, type Watcher, type WriteSandboxKitDocsOptions, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, genuiSandboxKit, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as UserConfig, R as ResolvedConfig, a as RouteDescriptor, S as SchemaNode, b as RenderContext, c as SchemaModule, d as RenderedModule, e as ResolvedFormsConfig, V as ValidationAdapter, C as CodegenExtension, E as ExtensionContext, f as SerializationMode } from './index-Dc4s883u.js';
2
- export { A as AdapterUsage, g as ContractDescriptor, h as ContractSource, i as ControllerRef, N as NumberCheck, j as ScopeConfig, k as StringCheck, T as TypeRef, l as ValidationOption, r as resolveAdapter } from './index-Dc4s883u.js';
1
+ import { U as UserConfig, R as ResolvedConfig, a as RouteDescriptor, S as SchemaNode, b as RenderContext, c as SchemaModule, d as RenderedModule, e as ResolvedFormsConfig, V as ValidationAdapter, C as CodegenExtension, E as ExtensionContext, f as SerializationMode } from './index-D4Blt-RT.js';
2
+ export { A as AdapterUsage, g as ContractDescriptor, h as ContractSource, i as ControllerRef, N as NumberCheck, j as StringCheck, T as TypeRef, k as ValidationOption, r as resolveAdapter } from './index-D4Blt-RT.js';
3
3
  import { ClassDeclaration, SourceFile, Project } from 'ts-morph';
4
4
 
5
5
  declare function defineConfig(c: UserConfig): UserConfig;
@@ -448,6 +448,6 @@ interface FastDiscoveryOptions {
448
448
  }
449
449
  declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
450
450
 
451
- declare const VERSION = "0.29.1";
451
+ declare const VERSION = "0.30.0";
452
452
 
453
453
  export { type ChainModuleRendererOptions, CodegenError, type CodegenManifest, ConfigError, DEFAULT_SANDBOX_KIT_OUTPUT, DriftGuardError, type EntryPoint, type FastDiscoveryOptions, type GenuiSandboxKitOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type WatchOptions, type Watcher, type WriteSandboxKitDocsOptions, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, genuiSandboxKit, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
package/dist/index.js CHANGED
@@ -105,11 +105,6 @@ function validateUserConfig(userConfig) {
105
105
  );
106
106
  }
107
107
  }
108
- if (userConfig.scopes && Object.keys(userConfig.scopes).length > 0) {
109
- console.warn(
110
- "[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)."
111
- );
112
- }
113
108
  }
114
109
  function isGlobInput(value) {
115
110
  if (typeof value === "string") return true;
@@ -157,7 +152,6 @@ function applyDefaults(userConfig, cwd) {
157
152
  glob: userConfig.contracts?.glob ?? "src/**/*.controller.ts",
158
153
  debounceMs: userConfig.contracts?.debounceMs ?? 500
159
154
  },
160
- scopes: userConfig.scopes ?? {},
161
155
  codegen: {
162
156
  outDir,
163
157
  cwd: resolvedCwd
@@ -6020,7 +6014,7 @@ async function generate(config, inputRoutes = [], entryPoint = "cli") {
6020
6014
  }
6021
6015
  const configHash = computeConfigHash(config);
6022
6016
  const configKeyHashes = computeConfigKeyHashes(config);
6023
- if (config.driftGuard && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
6017
+ if (config.driftGuard && manifest?.version === VERSION && manifest?.entryPoint && manifest.entryPoint !== entryPoint && manifest.configHash && manifest.configHash !== configHash) {
6024
6018
  throw new DriftGuardError(
6025
6019
  driftGuardMessage(
6026
6020
  config.codegen.outDir,
@@ -6321,6 +6315,11 @@ async function watch(config, onChange, options = {}) {
6321
6315
  trackedWatcher.on("add", (p) => scheduleContractsRegenerate(p, true));
6322
6316
  trackedWatcher.on("change", (p) => scheduleContractsRegenerate(p));
6323
6317
  trackedWatcher.on("unlink", (p) => scheduleContractsRegenerate(p, true));
6318
+ await Promise.all(
6319
+ [pagesWatcher, contractsWatcher, formsWatcher].map(
6320
+ (w) => new Promise((resolveReady) => w.once("ready", () => resolveReady()))
6321
+ )
6322
+ );
6324
6323
  return {
6325
6324
  close: async () => {
6326
6325
  if (pagesDebounceTimer !== void 0) {
@@ -6436,11 +6435,6 @@ var DEFAULT_KIT_DIRS = [
6436
6435
  "app/components/ui",
6437
6436
  "components/ui"
6438
6437
  ];
6439
- var LEGACY_OPTIONS = {
6440
- entry: "`entry: X` is now `components: X`",
6441
- include: "`include: G` is now `components: G` (globs, files, directories or packages)",
6442
- css: "`css: G` is now `styles: G` (the app's style entry files)"
6443
- };
6444
6438
  var MIN_CORE = "0.53.0";
6445
6439
  async function loadKitModule(specifier = GENUI_KIT_MODULE) {
6446
6440
  let mod;
@@ -6507,14 +6501,6 @@ function resolveKitFilesLocally(root, options) {
6507
6501
  return { files: [...new Set(files)].sort(), dirs: [...dirs] };
6508
6502
  }
6509
6503
  function genuiSandboxKit(options = {}) {
6510
- const legacy = Object.keys(LEGACY_OPTIONS).filter(
6511
- (key) => options[key] !== void 0
6512
- );
6513
- if (legacy.length > 0) {
6514
- throw new CodegenError(
6515
- `genuiSandboxKit(): ${legacy.map((key) => `\`${key}\``).join(", ")} ${legacy.length > 1 ? "were" : "was"} removed \u2014 ${legacy.map((key) => LEGACY_OPTIONS[key]).join("; ")}. The options are now the agent's Vite plugin's: components, styles, wrapper, stylesDocs.`
6516
- );
6517
- }
6518
6504
  const output = options.output ?? DEFAULT_SANDBOX_KIT_OUTPUT;
6519
6505
  const source = {
6520
6506
  ...options.components !== void 0 ? { components: options.components } : {},
@@ -6576,7 +6562,7 @@ function genuiSandboxKit(options = {}) {
6576
6562
  }
6577
6563
 
6578
6564
  // src/index.ts
6579
- var VERSION = "0.29.1";
6565
+ var VERSION = "0.30.0";
6580
6566
  export {
6581
6567
  CodegenError,
6582
6568
  ConfigError,