mirror of
https://github.com/langgenius/dify.git
synced 2026-09-05 00:31:19 +08:00
fix: preserve generated API contracts during local development (#41834)
This commit is contained in:
parent
a2acf62bf1
commit
ad90cb9111
@ -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',
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user