@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/CHANGELOG.md +8 -0
- package/dist/cli/main.cjs +17 -2
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +17 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs +16 -1
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js +16 -1
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/nest/index.cjs
CHANGED
|
@@ -283,7 +283,6 @@ function resolveImportedType(name, sourceFile, project) {
|
|
|
283
283
|
if (!namedImport) continue;
|
|
284
284
|
const moduleSpecifier = importDecl.getModuleSpecifierValue();
|
|
285
285
|
const candidates = resolveModuleSpecifier(moduleSpecifier, sourceFile, project);
|
|
286
|
-
if (candidates.length === 0) continue;
|
|
287
286
|
for (const candidate of candidates) {
|
|
288
287
|
let importedFile = project.getSourceFile(candidate);
|
|
289
288
|
if (!importedFile) {
|
|
@@ -298,9 +297,25 @@ function resolveImportedType(name, sourceFile, project) {
|
|
|
298
297
|
const viaReExport = resolveReExportedType(name, importedFile, project, /* @__PURE__ */ new Set());
|
|
299
298
|
if (viaReExport) return viaReExport;
|
|
300
299
|
}
|
|
300
|
+
if (candidates.length === 0) {
|
|
301
|
+
const viaCompiler = resolveBareSpecifierType(name, importDecl, project);
|
|
302
|
+
if (viaCompiler) return viaCompiler;
|
|
303
|
+
}
|
|
301
304
|
}
|
|
302
305
|
return resolveReExportedType(name, sourceFile, project, /* @__PURE__ */ new Set());
|
|
303
306
|
}
|
|
307
|
+
function resolveBareSpecifierType(name, importDecl, project) {
|
|
308
|
+
let target;
|
|
309
|
+
try {
|
|
310
|
+
target = importDecl.getModuleSpecifierSourceFile();
|
|
311
|
+
} catch {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
if (!target) return null;
|
|
315
|
+
const direct = findTypeInFile(name, target);
|
|
316
|
+
if (direct) return direct;
|
|
317
|
+
return resolveReExportedType(name, target, project, /* @__PURE__ */ new Set());
|
|
318
|
+
}
|
|
304
319
|
function resolveReExportedType(name, file, project, seen) {
|
|
305
320
|
const filePath = file.getFilePath();
|
|
306
321
|
if (seen.has(filePath)) return null;
|