@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/cli/main.js CHANGED
@@ -2246,7 +2246,6 @@ function resolveImportedType(name, sourceFile, project) {
2246
2246
  if (!namedImport) continue;
2247
2247
  const moduleSpecifier = importDecl.getModuleSpecifierValue();
2248
2248
  const candidates = resolveModuleSpecifier(moduleSpecifier, sourceFile, project);
2249
- if (candidates.length === 0) continue;
2250
2249
  for (const candidate of candidates) {
2251
2250
  let importedFile = project.getSourceFile(candidate);
2252
2251
  if (!importedFile) {
@@ -2261,9 +2260,25 @@ function resolveImportedType(name, sourceFile, project) {
2261
2260
  const viaReExport = resolveReExportedType(name, importedFile, project, /* @__PURE__ */ new Set());
2262
2261
  if (viaReExport) return viaReExport;
2263
2262
  }
2263
+ if (candidates.length === 0) {
2264
+ const viaCompiler = resolveBareSpecifierType(name, importDecl, project);
2265
+ if (viaCompiler) return viaCompiler;
2266
+ }
2264
2267
  }
2265
2268
  return resolveReExportedType(name, sourceFile, project, /* @__PURE__ */ new Set());
2266
2269
  }
2270
+ function resolveBareSpecifierType(name, importDecl, project) {
2271
+ let target;
2272
+ try {
2273
+ target = importDecl.getModuleSpecifierSourceFile();
2274
+ } catch {
2275
+ return null;
2276
+ }
2277
+ if (!target) return null;
2278
+ const direct = findTypeInFile(name, target);
2279
+ if (direct) return direct;
2280
+ return resolveReExportedType(name, target, project, /* @__PURE__ */ new Set());
2281
+ }
2267
2282
  function resolveReExportedType(name, file, project, seen) {
2268
2283
  const filePath = file.getFilePath();
2269
2284
  if (seen.has(filePath)) return null;
@@ -4429,7 +4444,7 @@ async function watch(config, onChange) {
4429
4444
  }
4430
4445
 
4431
4446
  // src/index.ts
4432
- var VERSION = "0.5.2";
4447
+ var VERSION = "0.6.0";
4433
4448
 
4434
4449
  // src/cli/codegen.ts
4435
4450
  async function runCodegen(opts = {}) {