Skip to content

Commit 7c96e51

Browse files
committed
feat: add onlyDeclaration option to config for conditional request AST generation
1 parent ae77c3e commit 7c96e51

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/pipeline/src/compiler/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { compilerTsTypingsDeclaration } from './typings'
44

55
export function compiler(configRead: ApiPipeline.ConfigRead) {
66
for (const output of configRead.outputs) {
7-
if (output.type === 'request')
7+
if (output.type === 'request' && !configRead.config.onlyDeclaration)
88
output.ast = compilerTsRequestDeclaration(configRead)
99
if (output.type === 'typings')
1010
output.ast = compilerTsTypingsDeclaration(configRead)

packages/shared/src/types/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ export namespace ApiPipeline {
7171
}
7272
/** Mandatory parameters optional */
7373
paramsPartial?: boolean
74+
75+
/** Only generate type declaration files */
76+
onlyDeclaration?: boolean
7477
}
7578

7679
export interface Config extends PreInputs, PreOutput, Meta {

0 commit comments

Comments
 (0)