@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.js
CHANGED
|
@@ -257,7 +257,6 @@ function resolveImportedType(name, sourceFile, project) {
|
|
|
257
257
|
if (!namedImport) continue;
|
|
258
258
|
const moduleSpecifier = importDecl.getModuleSpecifierValue();
|
|
259
259
|
const candidates = resolveModuleSpecifier(moduleSpecifier, sourceFile, project);
|
|
260
|
-
if (candidates.length === 0) continue;
|
|
261
260
|
for (const candidate of candidates) {
|
|
262
261
|
let importedFile = project.getSourceFile(candidate);
|
|
263
262
|
if (!importedFile) {
|
|
@@ -272,9 +271,25 @@ function resolveImportedType(name, sourceFile, project) {
|
|
|
272
271
|
const viaReExport = resolveReExportedType(name, importedFile, project, /* @__PURE__ */ new Set());
|
|
273
272
|
if (viaReExport) return viaReExport;
|
|
274
273
|
}
|
|
274
|
+
if (candidates.length === 0) {
|
|
275
|
+
const viaCompiler = resolveBareSpecifierType(name, importDecl, project);
|
|
276
|
+
if (viaCompiler) return viaCompiler;
|
|
277
|
+
}
|
|
275
278
|
}
|
|
276
279
|
return resolveReExportedType(name, sourceFile, project, /* @__PURE__ */ new Set());
|
|
277
280
|
}
|
|
281
|
+
function resolveBareSpecifierType(name, importDecl, project) {
|
|
282
|
+
let target;
|
|
283
|
+
try {
|
|
284
|
+
target = importDecl.getModuleSpecifierSourceFile();
|
|
285
|
+
} catch {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
if (!target) return null;
|
|
289
|
+
const direct = findTypeInFile(name, target);
|
|
290
|
+
if (direct) return direct;
|
|
291
|
+
return resolveReExportedType(name, target, project, /* @__PURE__ */ new Set());
|
|
292
|
+
}
|
|
278
293
|
function resolveReExportedType(name, file, project, seen) {
|
|
279
294
|
const filePath = file.getFilePath();
|
|
280
295
|
if (seen.has(filePath)) return null;
|