@dudousxd/nestjs-codegen 0.7.0 → 0.7.1

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/index.cjs CHANGED
@@ -106,18 +106,23 @@ async function fileExists(filePath) {
106
106
  }
107
107
  }
108
108
  async function importTs(filePath) {
109
- let tsImport;
109
+ const fileUrl = (0, import_node_url.pathToFileURL)(filePath).href;
110
110
  try {
111
- const tsxEsm = await import("tsx/esm/api");
112
- tsImport = tsxEsm.tsImport;
113
- } catch {
114
- throw new ConfigError(
115
- "Failed to load config: `tsx` is required for loading TypeScript config files. Install it as a dev dependency: pnpm add -D tsx"
116
- );
111
+ return await import(fileUrl);
112
+ } catch (nativeError) {
113
+ let tsImport;
114
+ try {
115
+ const tsxEsm = await import("tsx/esm/api");
116
+ tsImport = tsxEsm.tsImport;
117
+ } catch {
118
+ throw new ConfigError(
119
+ "Failed to load config: `tsx` is required for loading TypeScript config files. Install it as a dev dependency: pnpm add -D tsx",
120
+ { cause: nativeError }
121
+ );
122
+ }
123
+ const parentURL = (0, import_node_url.pathToFileURL)(`${filePath}__parent__`).href;
124
+ return tsImport(fileUrl, { parentURL });
117
125
  }
118
- const parentURL = (0, import_node_url.pathToFileURL)(`${filePath}__parent__`).href;
119
- const fileUrl = (0, import_node_url.pathToFileURL)(filePath).href;
120
- return tsImport(fileUrl, { parentURL });
121
126
  }
122
127
  function resolveAbsolute(cwd, p) {
123
128
  if ((0, import_node_path.isAbsolute)(p)) return p;
@@ -4593,7 +4598,7 @@ function createChainModuleRenderer(opts) {
4593
4598
  }
4594
4599
 
4595
4600
  // src/index.ts
4596
- var VERSION = "0.7.0";
4601
+ var VERSION = "0.7.1";
4597
4602
  // Annotate the CommonJS export names for ESM import in node:
4598
4603
  0 && (module.exports = {
4599
4604
  CodegenError,