mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-04 05:38:55 +08:00
build: fix openapi spec path for docs & stats endpoints on dev (@NadAlaba) (#6343)
### Description 1. fix openapi specification path so that /docs endpoint would work on dev. > Error: ENOENT: no such file or directory, stat 'backend/src/static/api/public.html' Stack: Error: ENOENT: no such file or directory 2. fix openapi specification path so that API Operation would work on /stats endpoint on dev. > Cannot read openApi specification from backend/src/api/routes/../../static/api/openapi.json. Swagger stats will not fully work.  3. remove unneeded `files` & `ts-node` options from `tsconfig.json` in various places. > File 'backend/src/types/types.d.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json 4. add the missing `pnpm test` script to the funbox package.
This commit is contained in:
parent
572de8a247
commit
932d0e166e
10 changed files with 3 additions and 27 deletions
|
@ -4,9 +4,6 @@
|
|||
"noEmit": true,
|
||||
"types": ["vitest/globals"]
|
||||
},
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
"files": ["vitest.d.ts"],
|
||||
"include": ["./**/*.ts", "./**/*.spec.ts", "./setup-tests.ts"]
|
||||
}
|
||||
|
|
|
@ -3,9 +3,5 @@
|
|||
"compilerOptions": {
|
||||
"target": "ES6"
|
||||
},
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
"files": ["../src/types/types.d.ts"],
|
||||
"include": ["./**/*"]
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Response, Router } from "express";
|
|||
|
||||
const router = Router();
|
||||
|
||||
const root = __dirname + "../../../static";
|
||||
const root = __dirname + "/../../../dist/static";
|
||||
|
||||
router.use("/internal", (req, res) => {
|
||||
setCsp(res);
|
||||
|
|
|
@ -5,7 +5,7 @@ import { readFileSync } from "fs";
|
|||
import Logger from "../../utils/logger";
|
||||
|
||||
function addSwaggerMiddlewares(app: Application): void {
|
||||
const openApiSpec = __dirname + "/../../static/api/openapi.json";
|
||||
const openApiSpec = __dirname + "/../../../dist/static/api/openapi.json";
|
||||
let spec = {};
|
||||
try {
|
||||
spec = JSON.parse(readFileSync(openApiSpec, "utf8")) as string;
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
"useUnknownInCatchVariables": false,
|
||||
"strictPropertyInitialization": false
|
||||
},
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
"noEmit": true,
|
||||
"types": ["vitest/globals"]
|
||||
},
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
"files": ["vitest.d.ts"],
|
||||
"include": ["./**/*.spec.ts", "./setup-tests.ts"]
|
||||
}
|
||||
|
|
|
@ -4,9 +4,5 @@
|
|||
"noEmit": true,
|
||||
"types": ["vitest/globals"]
|
||||
},
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
"files": ["../src/types/types.d.ts"],
|
||||
"include": ["./**/*.ts", "./**/*.spec.ts", "./setup-tests.ts"]
|
||||
}
|
||||
|
|
|
@ -4,9 +4,5 @@
|
|||
"noEmit": true,
|
||||
"types": ["vitest/globals"]
|
||||
},
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
// "files": ["../src/types/types.d.ts"],
|
||||
"include": ["./**/*.ts", "./**/*.spec.ts", "./setup-tests.ts"]
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"scripts": {
|
||||
"dev": "tsup-node --watch",
|
||||
"build": "npm run madge && tsup-node",
|
||||
"test": "vitest run",
|
||||
"madge": " madge --circular --extensions ts ./src",
|
||||
"ts-check": "tsc --noEmit",
|
||||
"lint": "eslint \"./**/*.ts\""
|
||||
|
|
|
@ -4,9 +4,5 @@
|
|||
"noEmit": true,
|
||||
"types": ["vitest/globals"]
|
||||
},
|
||||
"ts-node": {
|
||||
"files": true
|
||||
},
|
||||
// "files": ["../src/types/types.d.ts"],
|
||||
"include": ["./**/*.ts", "./**/*.spec.ts", "./setup-tests.ts"]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue