@dudousxd/nestjs-codegen 0.5.2 → 0.6.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
@@ -289,6 +289,6 @@ interface FastDiscoveryOptions {
289
289
  }
290
290
  declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
291
291
 
292
- declare const VERSION = "0.5.2";
292
+ declare const VERSION = "0.6.0";
293
293
 
294
294
  export { type ChainModuleRendererOptions, CodegenError, ConfigError, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type Watcher, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
package/dist/index.d.ts CHANGED
@@ -289,6 +289,6 @@ interface FastDiscoveryOptions {
289
289
  }
290
290
  declare function discoverContractsFast(opts: FastDiscoveryOptions): Promise<RouteDescriptor[]>;
291
291
 
292
- declare const VERSION = "0.5.2";
292
+ declare const VERSION = "0.6.0";
293
293
 
294
294
  export { type ChainModuleRendererOptions, CodegenError, ConfigError, type FastDiscoveryOptions, type JsonSchema, type MocksEmitOptions, type OpenApiDocument, type OpenApiEmitOptions, type OpenApiInfo, RenderContext, RenderedModule, ResolvedConfig, RouteDescriptor, SchemaModule, SchemaNode, type TsTypeContext, UserConfig, VERSION, ValidationAdapter, type Watcher, acquireLock, buildMocksFile, buildOpenApiSpec, createChainModuleRenderer, defineConfig, discoverContractsFast, emitApi, emitForms, emitMocks, emitOpenApi, emitRoutes, extractSchemaFromDto, generate, loadConfig, renderTsType, resolveConfig, schemaModuleToJsonSchema, schemaNodeToJsonSchema, toObjectKey, typeNameFor, watch };
package/dist/index.js CHANGED
@@ -2254,7 +2254,6 @@ function resolveImportedType(name, sourceFile, project) {
2254
2254
  if (!namedImport) continue;
2255
2255
  const moduleSpecifier = importDecl.getModuleSpecifierValue();
2256
2256
  const candidates = resolveModuleSpecifier(moduleSpecifier, sourceFile, project);
2257
- if (candidates.length === 0) continue;
2258
2257
  for (const candidate of candidates) {
2259
2258
  let importedFile = project.getSourceFile(candidate);
2260
2259
  if (!importedFile) {
@@ -2269,9 +2268,25 @@ function resolveImportedType(name, sourceFile, project) {
2269
2268
  const viaReExport = resolveReExportedType(name, importedFile, project, /* @__PURE__ */ new Set());
2270
2269
  if (viaReExport) return viaReExport;
2271
2270
  }
2271
+ if (candidates.length === 0) {
2272
+ const viaCompiler = resolveBareSpecifierType(name, importDecl, project);
2273
+ if (viaCompiler) return viaCompiler;
2274
+ }
2272
2275
  }
2273
2276
  return resolveReExportedType(name, sourceFile, project, /* @__PURE__ */ new Set());
2274
2277
  }
2278
+ function resolveBareSpecifierType(name, importDecl, project) {
2279
+ let target;
2280
+ try {
2281
+ target = importDecl.getModuleSpecifierSourceFile();
2282
+ } catch {
2283
+ return null;
2284
+ }
2285
+ if (!target) return null;
2286
+ const direct = findTypeInFile(name, target);
2287
+ if (direct) return direct;
2288
+ return resolveReExportedType(name, target, project, /* @__PURE__ */ new Set());
2289
+ }
2275
2290
  function resolveReExportedType(name, file, project, seen) {
2276
2291
  const filePath = file.getFilePath();
2277
2292
  if (seen.has(filePath)) return null;
@@ -4520,7 +4535,7 @@ function createChainModuleRenderer(opts) {
4520
4535
  }
4521
4536
 
4522
4537
  // src/index.ts
4523
- var VERSION = "0.5.2";
4538
+ var VERSION = "0.6.0";
4524
4539
  export {
4525
4540
  CodegenError,
4526
4541
  ConfigError,