@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.
@@ -279,12 +279,18 @@ function findTypeInFile(name, file) {
279
279
  function resolveModuleSpecifier(moduleSpecifier, sourceFile, project) {
280
280
  if (moduleSpecifier.startsWith(".")) {
281
281
  const dir = (0, import_node_path2.dirname)(sourceFile.getFilePath());
282
- const noExt = moduleSpecifier.replace(/\.(js|ts)$/, "");
283
- return [
284
- (0, import_node_path2.resolve)(dir, `${noExt}.ts`),
282
+ const ext = /\.(c|m)?(j|t)sx?$/.exec(moduleSpecifier)?.[0];
283
+ const base = ext ? moduleSpecifier.slice(0, -ext.length) : moduleSpecifier;
284
+ const flavour = ext?.startsWith(".c") ? "c" : ext?.startsWith(".m") ? "m" : "";
285
+ const candidates = [
286
+ (0, import_node_path2.resolve)(dir, `${base}.${flavour}ts`),
287
+ ...flavour === "" ? [(0, import_node_path2.resolve)(dir, `${base}.tsx`)] : [],
285
288
  (0, import_node_path2.resolve)(dir, `${moduleSpecifier}.ts`),
286
- (0, import_node_path2.resolve)(dir, moduleSpecifier, "index.ts")
289
+ (0, import_node_path2.resolve)(dir, moduleSpecifier, "index.ts"),
290
+ (0, import_node_path2.resolve)(dir, `${base}.d.${flavour}ts`),
291
+ ...ext === void 0 ? [(0, import_node_path2.resolve)(dir, moduleSpecifier, "index.d.ts")] : []
287
292
  ];
293
+ return [...new Set(candidates)];
288
294
  }
289
295
  const ctx = _ctxFor(project);
290
296
  const baseUrl = ctx.pathsBase ?? ctx.projectRoot;
@@ -5806,7 +5812,7 @@ async function watch(config, onChange, options = {}) {
5806
5812
  }
5807
5813
 
5808
5814
  // src/index.ts
5809
- var VERSION = "0.27.1";
5815
+ var VERSION = "0.27.2";
5810
5816
 
5811
5817
  // src/generate-manifest.ts
5812
5818
  var MANIFEST_FILE = ".codegen-manifest.json";