Replace manually maintained types in src/lib/types.ts with auto-generated types from FastAPI's OpenAPI schema using @hey-api/openapi-ts. The bridge file re-exports generated types with renames, Require<> augmentations for fields that are optional in the schema but always present in responses, and manually added relationship fields excluded from OpenAPI. - Add openapi-ts.config.ts and generate:api npm script - Generate types into src/lib/api/generated/types.gen.ts - Rewrite src/lib/types.ts as bridge with re-exports and augmentations - Fix null vs undefined mismatches in consumer components - Remove unused manual type definitions from api.ts - Update AGENTS.md docs with type generation workflow
49 lines
1.6 KiB
JSON
49 lines
1.6 KiB
JSON
{
|
|
"name": "frontend",
|
|
"private": true,
|
|
"version": "0.0.1",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite dev",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"prepare": "svelte-kit sync || echo ''",
|
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
"lint": "eslint .",
|
|
"format": "prettier --write .",
|
|
"generate:api": "cd ../backend && uv run python -c \"import json; from main import app; print(json.dumps(app.openapi(), indent=2))\" > ../frontend/openapi.json && cd ../frontend && openapi-ts"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@hey-api/openapi-ts": "^0.94.0",
|
|
"@internationalized/date": "^3.11.0",
|
|
"@lucide/svelte": "^0.561.0",
|
|
"@sveltejs/adapter-node": "^5.0.0",
|
|
"@sveltejs/kit": "^2.50.2",
|
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
"@tailwindcss/vite": "^4.2.1",
|
|
"eslint": "^10.0.2",
|
|
"eslint-plugin-svelte": "^3.15.0",
|
|
"globals": "^17.4.0",
|
|
"prettier": "^3.8.1",
|
|
"prettier-plugin-svelte": "^3.5.0",
|
|
"svelte": "^5.51.0",
|
|
"svelte-check": "^4.3.6",
|
|
"svelte-eslint-parser": "^1.5.1",
|
|
"tailwind-variants": "^3.2.2",
|
|
"tailwindcss": "^4.2.1",
|
|
"typescript": "^5.9.3",
|
|
"typescript-eslint": "^8.56.1",
|
|
"vite": "^7.3.1"
|
|
},
|
|
"dependencies": {
|
|
"@inlang/paraglide-js": "^2.13.0",
|
|
"bits-ui": "^2.16.2",
|
|
"clsx": "^2.1.1",
|
|
"lucide-svelte": "^0.575.0",
|
|
"mode-watcher": "^1.1.0",
|
|
"svelte-dnd-action": "^0.9.69",
|
|
"tailwind-merge": "^3.5.0"
|
|
}
|
|
}
|