@dudousxd/nestjs-codegen 0.27.1 → 0.27.2

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.
@@ -251,12 +251,18 @@ function findTypeInFile(name, file) {
251
251
  function resolveModuleSpecifier(moduleSpecifier, sourceFile, project) {
252
252
  if (moduleSpecifier.startsWith(".")) {
253
253
  const dir = dirname(sourceFile.getFilePath());
254
- const noExt = moduleSpecifier.replace(/\.(js|ts)$/, "");
255
- return [
256
- resolve2(dir, `${noExt}.ts`),
254
+ const ext = /\.(c|m)?(j|t)sx?$/.exec(moduleSpecifier)?.[0];
255
+ const base = ext ? moduleSpecifier.slice(0, -ext.length) : moduleSpecifier;
256
+ const flavour = ext?.startsWith(".c") ? "c" : ext?.startsWith(".m") ? "m" : "";
257
+ const candidates = [
258
+ resolve2(dir, `${base}.${flavour}ts`),
259
+ ...flavour === "" ? [resolve2(dir, `${base}.tsx`)] : [],
257
260
  resolve2(dir, `${moduleSpecifier}.ts`),
258
- resolve2(dir, moduleSpecifier, "index.ts")
261
+ resolve2(dir, moduleSpecifier, "index.ts"),
262
+ resolve2(dir, `${base}.d.${flavour}ts`),
263
+ ...ext === void 0 ? [resolve2(dir, moduleSpecifier, "index.d.ts")] : []
259
264
  ];
265
+ return [...new Set(candidates)];
260
266
  }
261
267
  const ctx = _ctxFor(project);
262
268
  const baseUrl = ctx.pathsBase ?? ctx.projectRoot;
@@ -5785,7 +5791,7 @@ async function watch(config, onChange, options = {}) {
5785
5791
  }
5786
5792
 
5787
5793
  // src/index.ts
5788
- var VERSION = "0.27.1";
5794
+ var VERSION = "0.27.2";
5789
5795
 
5790
5796
  // src/generate-manifest.ts
5791
5797
  var MANIFEST_FILE = ".codegen-manifest.json";