@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/CHANGELOG.md +6 -0
- package/dist/cli/main.cjs +16 -11
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +16 -11
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +16 -11
- 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 +16 -11
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -44,18 +44,23 @@ async function fileExists(filePath) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
async function importTs(filePath) {
|
|
47
|
-
|
|
47
|
+
const fileUrl = pathToFileURL(filePath).href;
|
|
48
48
|
try {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
return await import(fileUrl);
|
|
50
|
+
} catch (nativeError) {
|
|
51
|
+
let tsImport;
|
|
52
|
+
try {
|
|
53
|
+
const tsxEsm = await import("tsx/esm/api");
|
|
54
|
+
tsImport = tsxEsm.tsImport;
|
|
55
|
+
} catch {
|
|
56
|
+
throw new ConfigError(
|
|
57
|
+
"Failed to load config: `tsx` is required for loading TypeScript config files. Install it as a dev dependency: pnpm add -D tsx",
|
|
58
|
+
{ cause: nativeError }
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
const parentURL = pathToFileURL(`${filePath}__parent__`).href;
|
|
62
|
+
return tsImport(fileUrl, { parentURL });
|
|
55
63
|
}
|
|
56
|
-
const parentURL = pathToFileURL(`${filePath}__parent__`).href;
|
|
57
|
-
const fileUrl = pathToFileURL(filePath).href;
|
|
58
|
-
return tsImport(fileUrl, { parentURL });
|
|
59
64
|
}
|
|
60
65
|
function resolveAbsolute(cwd, p) {
|
|
61
66
|
if (isAbsolute(p)) return p;
|
|
@@ -4457,7 +4462,7 @@ async function watch(config, onChange) {
|
|
|
4457
4462
|
}
|
|
4458
4463
|
|
|
4459
4464
|
// src/index.ts
|
|
4460
|
-
var VERSION = "0.7.
|
|
4465
|
+
var VERSION = "0.7.1";
|
|
4461
4466
|
|
|
4462
4467
|
// src/cli/codegen.ts
|
|
4463
4468
|
async function runCodegen(opts = {}) {
|