@elysiajs/openapi 1.3.8 → 1.3.9
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/cjs/gen/index.js +17 -2
- package/dist/gen/index.mjs +17 -2
- package/package.json +1 -1
package/dist/cjs/gen/index.js
CHANGED
|
@@ -78,8 +78,23 @@ var fromTypes = (targetFilePath, {
|
|
|
78
78
|
stdio: debug ? "inherit" : void 0
|
|
79
79
|
});
|
|
80
80
|
const fileName = targetFilePath.replace(/.tsx$/, ".ts").replace(/.ts$/, ".d.ts");
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
let targetFile = (overrideOutputPath ? typeof overrideOutputPath === "string" ? overrideOutputPath.startsWith("/") ? overrideOutputPath : (0, import_path.join)(tmpRoot, "dist", overrideOutputPath) : overrideOutputPath(tmpRoot) : void 0) ?? (0, import_path.join)(
|
|
82
|
+
tmpRoot,
|
|
83
|
+
"dist",
|
|
84
|
+
// remove leading like src or something similar
|
|
85
|
+
fileName.slice(fileName.indexOf("/") + 1)
|
|
86
|
+
);
|
|
87
|
+
let existed = (0, import_fs.existsSync)(targetFile);
|
|
88
|
+
if (!existed && overrideOutputPath) {
|
|
89
|
+
targetFile = (0, import_path.join)(
|
|
90
|
+
tmpRoot,
|
|
91
|
+
"dist",
|
|
92
|
+
// use original file name as-is eg. in monorepo
|
|
93
|
+
fileName
|
|
94
|
+
);
|
|
95
|
+
existed = (0, import_fs.existsSync)(targetFile);
|
|
96
|
+
}
|
|
97
|
+
if (!existed) {
|
|
83
98
|
(0, import_fs.rmSync)((0, import_path.join)(tmpRoot, "tsconfig.json"));
|
|
84
99
|
console.warn(
|
|
85
100
|
"[@elysiajs/openapi/gen] Failed to generate OpenAPI schema"
|
package/dist/gen/index.mjs
CHANGED
|
@@ -61,8 +61,23 @@ var fromTypes = (targetFilePath, {
|
|
|
61
61
|
stdio: debug ? "inherit" : void 0
|
|
62
62
|
});
|
|
63
63
|
const fileName = targetFilePath.replace(/.tsx$/, ".ts").replace(/.ts$/, ".d.ts");
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
let targetFile = (overrideOutputPath ? typeof overrideOutputPath === "string" ? overrideOutputPath.startsWith("/") ? overrideOutputPath : join(tmpRoot, "dist", overrideOutputPath) : overrideOutputPath(tmpRoot) : void 0) ?? join(
|
|
65
|
+
tmpRoot,
|
|
66
|
+
"dist",
|
|
67
|
+
// remove leading like src or something similar
|
|
68
|
+
fileName.slice(fileName.indexOf("/") + 1)
|
|
69
|
+
);
|
|
70
|
+
let existed = existsSync(targetFile);
|
|
71
|
+
if (!existed && overrideOutputPath) {
|
|
72
|
+
targetFile = join(
|
|
73
|
+
tmpRoot,
|
|
74
|
+
"dist",
|
|
75
|
+
// use original file name as-is eg. in monorepo
|
|
76
|
+
fileName
|
|
77
|
+
);
|
|
78
|
+
existed = existsSync(targetFile);
|
|
79
|
+
}
|
|
80
|
+
if (!existed) {
|
|
66
81
|
rmSync(join(tmpRoot, "tsconfig.json"));
|
|
67
82
|
console.warn(
|
|
68
83
|
"[@elysiajs/openapi/gen] Failed to generate OpenAPI schema"
|