Skip to content

Commit d85c782

Browse files
committed
fix: include scripts/ in tsconfig and fix generate-openapi imports
1 parent 54434b7 commit d85c782

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

scripts/generate-openapi.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* and methods from the handler declarations. No manual annotations needed.
99
*/
1010

11-
import { readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
12-
import { join, relative, sep } from "node:path";
11+
import { readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
12+
import { join, relative } from "node:path";
1313

1414
const ROUTES_DIR = join(process.cwd(), "src", "routes", "api");
1515
const OUTPUT = join(process.cwd(), "public", "openapi.json");
@@ -106,7 +106,10 @@ function generateSpec(): object {
106106
}
107107

108108
for (const method of methods) {
109-
const operationId = `${method}_${apiPath.replace(/[/{}\-]/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "")}`;
109+
const operationId = `${method}_${apiPath
110+
.replace(/[/{}-]/g, "_")
111+
.replace(/_+/g, "_")
112+
.replace(/^_|_$/g, "")}`;
110113

111114
const operation: PathItem[string] = {
112115
operationId,

tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"~/*": ["./src/*"]
1818
}
1919
},
20-
"include": ["src/**/*", "server.ts", "vite.config.ts", "drizzle.config.ts"],
20+
"include": [
21+
"src/**/*",
22+
"scripts/**/*",
23+
"server.ts",
24+
"vite.config.ts",
25+
"drizzle.config.ts"
26+
],
2127
"exclude": ["node_modules", "dist", "drizzle"]
2228
}

0 commit comments

Comments
 (0)