forked from 0xWheatyz/SPARC
feat: generate TypeScript API client from OpenAPI spec and add CI freshness check
Closes leeworks-agents/SPARC#426 - Generate schema.d.ts from committed openapi.json using openapi-typescript - Rewrite types/index.ts to derive all application types from the generated schema - Add CI step in both build.yaml and test.yaml to verify schema.d.ts stays in sync - TypeScript compilation passes with zero errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,16 @@ jobs:
|
||||
apk add --no-cache nodejs npm
|
||||
cd frontend && npm ci
|
||||
|
||||
- name: Verify generated API types are up to date
|
||||
shell: sh
|
||||
run: |
|
||||
cd frontend && npm run generate:local
|
||||
if ! git diff --quiet src/api/schema.d.ts; then
|
||||
echo "ERROR: src/api/schema.d.ts is out of date. Run 'npm run generate:local' and commit the result."
|
||||
git diff src/api/schema.d.ts
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Run TypeScript type check
|
||||
shell: sh
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user