fix: preserve generated API contracts during local development (#41834)

This commit is contained in:
Stephen Zhou 2026-09-04 14:48:46 +00:00 committed by GitHub
parent a2acf62bf1
commit ad90cb9111
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -40,7 +40,6 @@ type ApiSpec = {
}
type ApiJob = {
clean?: boolean
document: SwaggerDocument
outputPath: string
plugins?: UserConfig['plugins']
@ -527,7 +526,6 @@ const writeConsoleRouterContract = (segments: string[]) => {
const createConsoleContractEntryJob = (document: SwaggerDocument, segments: string[]): ApiJob => {
return {
clean: false,
document,
outputPath: 'generated/api/console',
plugins: [],
@ -587,7 +585,7 @@ const createApiConfig = (job: ApiJob): UserConfig => ({
file: false,
},
output: {
...(job.clean === undefined ? {} : { clean: job.clean }),
clean: false,
entryFile: false,
fileName: {
suffix: '.gen',

View File

@ -30,7 +30,7 @@
}
},
"scripts": {
"gen-api-contract": "uv run --project ../../api ../../api/dev/generate_swagger_specs.py --output-dir openapi && uv run --project ../../api ../../api/dev/generate_fastopenapi_specs.py --output-dir openapi && node -e \"fs.rmSync('generated/api', { recursive: true, force: true })\" && openapi-ts -f openapi-ts.api.config.ts && vp fmt generated/api",
"gen-api-contract": "uv run --project ../../api ../../api/dev/generate_swagger_specs.py --output-dir openapi && uv run --project ../../api ../../api/dev/generate_fastopenapi_specs.py --output-dir openapi && node -e \"if (process.env.CI) fs.rmSync('generated/api', { recursive: true, force: true })\" && openapi-ts -f openapi-ts.api.config.ts && vp fmt generated/api",
"gen-enterprise-contract": "openapi-ts -f openapi-ts.enterprise.config.ts",
"gen-enterprise-app-deploy-contract": "openapi-ts -f openapi-ts.enterprise-app-deploy.config.ts",
"gen-knowledge-fs-contract": "node scripts/generate-knowledge-fs-contract.mjs",