feat(web): add OpenAPI TypeScript codegen and CI freshness check

Генерируем api.gen.ts из docs/openapi.yaml (openapi-typescript), добавляем scripts/check-openapi-gen.sh в CI. Закрываем решение по X-Tenant-Id как unimplemented; обновляем docs/README под React/ReUI и apps/web.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-31 12:19:02 +07:00
co-authored by Cursor
parent a0cfbcdab1
commit 13e3d21ce2
9 changed files with 6782 additions and 32 deletions
+7 -4
View File
@@ -9,7 +9,9 @@
"preview": "vite preview",
"typecheck": "tsr generate && tsc --noEmit",
"lint": "eslint .",
"test": "vitest run"
"test": "vitest run",
"openapi:gen": "openapi-typescript ../../docs/openapi.yaml -o src/types/api.gen.ts",
"openapi:check": "openapi-typescript ../../docs/openapi.yaml -o src/types/api.gen.check.ts && diff -q src/types/api.gen.ts src/types/api.gen.check.ts && rm -f src/types/api.gen.check.ts"
},
"dependencies": {
"@base-ui/react": "^1.0.0",
@@ -40,22 +42,23 @@
"zod": "^3.25.0"
},
"devDependencies": {
"@eslint/js": "^9.0.0",
"@tailwindcss/vite": "^4.1.0",
"@tanstack/router-plugin": "^1.130.0",
"@tanstack/router-cli": "^1.130.0",
"@tanstack/router-plugin": "^1.130.0",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.1",
"eslint": "^9.0.0",
"@eslint/js": "^9.0.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.0",
"globals": "^15.0.0",
"typescript-eslint": "^8.0.0",
"happy-dom": "^18.0.0",
"openapi-typescript": "^7.13.0",
"tailwindcss": "^4.1.0",
"tw-animate-css": "^1.0.0",
"typescript": "^5.9.2",
"typescript-eslint": "^8.0.0",
"vite": "^7.3.1",
"vitest": "^3.0.0"
}
File diff suppressed because it is too large Load Diff
+10
View File
@@ -1,3 +1,13 @@
/**
* Hand-written UI DTO aliases used by routes/queries.
* Machine SoT from OpenAPI: `./api.gen.ts` (regenerate: `pnpm --filter @evobgp/web run openapi:gen`).
* Prefer aligning new fields with schemas in docs/openapi.yaml + regenerating api.gen.ts.
*/
import type { components } from './api.gen'
/** Re-export generated OpenAPI components for gradual adoption. */
export type OpenAPISchemas = components['schemas']
// ---- Pagination ----
export type Page<T> = {
items: T[]