diff --git a/libs/api-client/project.json b/libs/api-client/project.json index 2f27cea..395830d 100644 --- a/libs/api-client/project.json +++ b/libs/api-client/project.json @@ -8,6 +8,13 @@ "targets": { "lint": { "executor": "@nx/eslint:lint" + }, + "generate": { + "executor": "nx:run-commands", + "options": { + "command": "orval --config orval.config.ts", + "cwd": "libs/api-client" + } } } } diff --git a/libs/api-client/src/index.ts b/libs/api-client/src/index.ts index cb0ff5c..304d49d 100644 --- a/libs/api-client/src/index.ts +++ b/libs/api-client/src/index.ts @@ -1 +1,3 @@ -export {}; +// The BFF API client is generated from services/bff/openapi.json (orval); never hand-edit +// src/lib/generated. Re-run `nx run api-client:generate` after the BFF spec changes. +export * from './lib/generated/bff-api'; diff --git a/libs/api-client/src/lib/bff-api.spec.ts b/libs/api-client/src/lib/bff-api.spec.ts index eafc695..5f6451d 100644 --- a/libs/api-client/src/lib/bff-api.spec.ts +++ b/libs/api-client/src/lib/bff-api.spec.ts @@ -8,7 +8,7 @@ import { BffApiV1Service, type OpenbaarEntry, type SubmitAccepted, -} from 'api-client'; +} from '../index'; describe('BffApiV1Service (generated from services/bff/openapi.json)', () => { let service: BffApiV1Service;