fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add comments option to all plugins

Lubos 7b3c8f20 b94eb932

+93 -173
+5
.changeset/itchy-walls-type.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + **plugin**: add `comments` option to all plugins
+1
packages/openapi-python/src/plugins/@hey-api/sdk/config.ts
··· 8 8 config: { 9 9 // auth: true, 10 10 client: true, 11 + comments: true, 11 12 includeInEntry: true, 12 13 paramsStructure: 'grouped', 13 14 // responseStyle: 'fields',
+2
packages/openapi-python/src/plugins/@hey-api/sdk/types.ts
··· 7 7 8 8 export type UserConfig = Plugin.Name<'@hey-api/python-sdk'> & 9 9 Plugin.Hooks & 10 + Plugin.UserComments & 10 11 Plugin.UserExports & { 11 12 /** 12 13 * Should the generated functions contain auth mechanisms? You may want to ··· 127 128 128 129 export type Config = Plugin.Name<'@hey-api/python-sdk'> & 129 130 Plugin.Hooks & 131 + Plugin.Comments & 130 132 Plugin.Exports & { 131 133 /** 132 134 * Should the generated functions contain auth mechanisms? You may want to
+6 -2
packages/openapi-python/src/plugins/@hey-api/sdk/v1/node.ts
··· 23 23 function attachComment<T extends ReturnType<typeof $.func>>(args: { 24 24 node: T; 25 25 operation: IR.OperationObject; 26 + plugin: HeyApiSdkPlugin['Instance']; 26 27 }): T { 27 - const { node, operation } = args; 28 - return node.$if(createOperationComment(operation), (n, v) => n.doc(v)) as T; 28 + const { node, operation, plugin } = args; 29 + return node.$if(plugin.config.comments && createOperationComment(operation), (n, v) => 30 + n.doc(v), 31 + ) as T; 29 32 } 30 33 31 34 function createShellMeta(node: StructureNode): SymbolMeta { ··· 174 177 attachComment({ 175 178 node: m, 176 179 operation, 180 + plugin, 177 181 }), 178 182 ), 179 183 operation,
+1
packages/openapi-ts/src/plugins/@angular/common/config.ts
··· 7 7 8 8 export const defaultConfig: AngularCommonPlugin['Config'] = { 9 9 config: { 10 + comments: true, 10 11 includeInEntry: false, 11 12 }, 12 13 dependencies: ['@hey-api/client-angular', '@hey-api/sdk'],
+9 -4
packages/openapi-ts/src/plugins/@angular/common/shared/node.ts
··· 26 26 function attachComment<T extends ReturnType<typeof $.var | typeof $.method>>(args: { 27 27 node: T; 28 28 operation: IR.OperationObject; 29 + plugin: AngularCommonPlugin['Instance']; 29 30 }): T { 30 - const { node, operation } = args; 31 - return node.$if(createOperationComment(operation), (n, v) => n.doc(v)) as T; 31 + const { node, operation, plugin } = args; 32 + return node.$if(plugin.config.comments && createOperationComment(operation), (n, v) => 33 + n.doc(v), 34 + ) as T; 32 35 } 33 36 34 37 function createHttpRequestFnMeta(operation: IR.OperationObject): SymbolMeta { ··· 344 347 plugin, 345 348 }), 346 349 ); 347 - node = attachComment({ node, operation }); 350 + node = attachComment({ node, operation, plugin }); 348 351 nodes.push(node); 349 352 } 350 353 return { nodes }; ··· 369 372 attachComment({ 370 373 node: m, 371 374 operation, 375 + plugin, 372 376 }).public(), 373 377 ), 374 378 operation, ··· 411 415 plugin, 412 416 }), 413 417 ); 414 - node = attachComment({ node, operation }); 418 + node = attachComment({ node, operation, plugin }); 415 419 nodes.push(node); 416 420 } 417 421 return { nodes }; ··· 436 440 attachComment({ 437 441 node: m, 438 442 operation, 443 + plugin, 439 444 }).public(), 440 445 ), 441 446 operation,
+2
packages/openapi-ts/src/plugins/@angular/common/types.ts
··· 5 5 6 6 export type UserConfig = Plugin.Name<'@angular/common'> & 7 7 Plugin.Hooks & 8 + Plugin.UserComments & 8 9 Plugin.UserExports & { 9 10 /** 10 11 * Options for generating HTTP Request instances. ··· 22 23 23 24 export type Config = Plugin.Name<'@angular/common'> & 24 25 Plugin.Hooks & 26 + Plugin.Comments & 25 27 Plugin.Exports & { 26 28 /** 27 29 * Options for generating HTTP Request instances.
+1
packages/openapi-ts/src/plugins/@hey-api/sdk/config.ts
··· 9 9 config: { 10 10 auth: true, 11 11 client: true, 12 + comments: true, 12 13 includeInEntry: true, 13 14 paramsStructure: 'grouped', 14 15 responseStyle: 'fields',
+2
packages/openapi-ts/src/plugins/@hey-api/sdk/types.ts
··· 10 10 11 11 export type UserConfig = Plugin.Name<'@hey-api/sdk'> & 12 12 Plugin.Hooks & 13 + Plugin.UserComments & 13 14 Plugin.UserExports & { 14 15 /** 15 16 * Should the generated functions contain auth mechanisms? You may want to ··· 196 197 197 198 export type Config = Plugin.Name<'@hey-api/sdk'> & 198 199 Plugin.Hooks & 200 + Plugin.Comments & 199 201 Plugin.Exports & { 200 202 /** 201 203 * Should the generated functions contain auth mechanisms? You may want to
+7 -3
packages/openapi-ts/src/plugins/@hey-api/sdk/v1/node.ts
··· 38 38 function attachComment<T extends ReturnType<typeof $.var | typeof $.method>>(args: { 39 39 node: T; 40 40 operation: IR.OperationObject; 41 + plugin: HeyApiSdkPlugin['Instance']; 41 42 }): T { 42 - const { node, operation } = args; 43 - return node.$if(createOperationComment(operation), (n, v) => n.doc(v)) as T; 43 + const { node, operation, plugin } = args; 44 + return node.$if(plugin.config.comments && createOperationComment(operation), (n, v) => 45 + n.doc(v), 46 + ) as T; 44 47 } 45 48 46 49 function createShellMeta(node: StructureNode): SymbolMeta { ··· 327 330 plugin, 328 331 }), 329 332 ); 330 - node = attachComment({ node, operation }); 333 + node = attachComment({ node, operation, plugin }); 331 334 nodes.push(node); 332 335 exampleIntent(node, operation, plugin); 333 336 } ··· 358 361 attachComment({ 359 362 node: m, 360 363 operation, 364 + plugin, 361 365 }) 362 366 .public() 363 367 .static(!isAngularClient && !isInstance(plugin)),
+1
packages/openapi-ts/src/plugins/@hey-api/typescript/config.ts
··· 8 8 api: new Api(), 9 9 config: { 10 10 case: 'PascalCase', 11 + comments: true, 11 12 includeInEntry: true, 12 13 topType: 'unknown', 13 14 },
+6 -6
packages/openapi-ts/src/plugins/@hey-api/typescript/shared/export.ts
··· 104 104 }); 105 105 const objectNode = $.const(symbolObject) 106 106 .export() 107 - .$if(createSchemaComment(schema), (c, v) => c.doc(v)) 107 + .$if(plugin.config.comments && createSchemaComment(schema), (c, v) => c.doc(v)) 108 108 .assign( 109 109 $.object( 110 110 ...enumObject.obj.map((item) => 111 111 $.prop({ kind: 'prop', name: item.key }) 112 - .$if(createSchemaComment(item.schema), (p, v) => p.doc(v)) 112 + .$if(plugin.config.comments && createSchemaComment(item.schema), (p, v) => p.doc(v)) 113 113 .value($.fromValue(item.schema.const)), 114 114 ), 115 115 ).as('const'), ··· 129 129 const node = $.type 130 130 .alias(symbol) 131 131 .export() 132 - .$if(createSchemaComment(schema), (t, v) => t.doc(v)) 132 + .$if(plugin.config.comments && createSchemaComment(schema), (t, v) => t.doc(v)) 133 133 .type($.type(symbol).idx($.type(symbol).typeofType().keyof()).typeofType()); 134 134 plugin.node(node); 135 135 return; ··· 154 154 }); 155 155 const enumNode = $.enum(symbol) 156 156 .export() 157 - .$if(createSchemaComment(schema), (e, v) => e.doc(v)) 157 + .$if(plugin.config.comments && createSchemaComment(schema), (e, v) => e.doc(v)) 158 158 .const(plugin.config.enums.mode === 'typescript-const') 159 159 .members( 160 160 ...enumObject.obj.map((item) => 161 161 $.member(item.key) 162 - .$if(createSchemaComment(item.schema), (m, v) => m.doc(v)) 162 + .$if(plugin.config.comments && createSchemaComment(item.schema), (m, v) => m.doc(v)) 163 163 .value($.fromValue(item.schema.const)), 164 164 ), 165 165 ); ··· 182 182 const node = $.type 183 183 .alias(symbol) 184 184 .export() 185 - .$if(createSchemaComment(schema), (t, v) => t.doc(v)) 185 + .$if(plugin.config.comments && createSchemaComment(schema), (t, v) => t.doc(v)) 186 186 .type(type); 187 187 plugin.node(node); 188 188 };
+1 -1
packages/openapi-ts/src/plugins/@hey-api/typescript/shared/webhook.ts
··· 45 45 const node = $.type 46 46 .alias(symbolWebhookPayload) 47 47 .export() 48 - .$if(createSchemaComment(operation.body.schema), (t, v) => t.doc(v)) 48 + .$if(plugin.config.comments && createSchemaComment(operation.body.schema), (t, v) => t.doc(v)) 49 49 .type( 50 50 irSchemaToAst({ 51 51 plugin,
+2
packages/openapi-ts/src/plugins/@hey-api/typescript/types.ts
··· 7 7 8 8 export type UserConfig = Plugin.Name<'@hey-api/typescript'> & 9 9 Plugin.Hooks & 10 + Plugin.UserComments & 10 11 Plugin.UserExports & { 11 12 /** 12 13 * Casing convention for generated names. ··· 230 231 231 232 export type Config = Plugin.Name<'@hey-api/typescript'> & 232 233 Plugin.Hooks & 234 + Plugin.Comments & 233 235 Plugin.Exports & { 234 236 /** 235 237 * Casing convention for generated names.
+1 -1
packages/openapi-ts/src/plugins/@hey-api/typescript/v1/toAst/object.ts
··· 34 34 const isRequired = required.includes(name); 35 35 shape.prop(name, (p) => 36 36 p 37 - .$if(createSchemaComment(property), (p, v) => p.doc(v)) 37 + .$if(plugin.config.comments && createSchemaComment(property), (p, v) => p.doc(v)) 38 38 .readonly(property.accessScope === 'read') 39 39 .required(isRequired) 40 40 .type(propertyType),
+2 -17
packages/openapi-ts/src/plugins/@pinia/colada/types.ts
··· 4 4 5 5 export type UserConfig = Plugin.Name<'@pinia/colada'> & 6 6 Plugin.Hooks & 7 + Plugin.UserComments & 7 8 Plugin.UserExports & { 8 9 /** 9 10 * Casing convention for generated names. ··· 11 12 * @default 'camelCase' 12 13 */ 13 14 case?: Casing; 14 - /** 15 - * Add comments from SDK functions to the generated Pinia Colada code? 16 - * 17 - * Duplicating comments this way is useful so you don't need to drill into 18 - * the underlying SDK function to learn what it does or whether it's 19 - * deprecated. You can set this option to `false` if you prefer less 20 - * comment duplication. 21 - * 22 - * @default true 23 - */ 24 - comments?: boolean; 25 15 /** 26 16 * Configuration for generated mutation options helpers. 27 17 * ··· 184 174 185 175 export type Config = Plugin.Name<'@pinia/colada'> & 186 176 Plugin.Hooks & 177 + Plugin.Comments & 187 178 Plugin.Exports & { 188 179 /** 189 180 * Casing convention for generated names. 190 181 */ 191 182 case: Casing; 192 - /** 193 - * Add comments from SDK functions to the generated Pinia Colada code? 194 - * 195 - * @default true 196 - */ 197 - comments: boolean; 198 183 /** 199 184 * Resolved configuration for generated mutation options helpers. 200 185 */
+2 -17
packages/openapi-ts/src/plugins/@tanstack/angular-query-experimental/types.ts
··· 4 4 5 5 export type UserConfig = Plugin.Name<'@tanstack/angular-query-experimental'> & 6 6 Plugin.Hooks & 7 + Plugin.UserComments & 7 8 Plugin.UserExports & { 8 9 /** 9 10 * Casing convention for generated names. ··· 11 12 * @default 'camelCase' 12 13 */ 13 14 case?: Casing; 14 - /** 15 - * Add comments from SDK functions to the generated TanStack Query code? 16 - * 17 - * Duplicating comments this way is useful so you don't need to drill into 18 - * the underlying SDK function to learn what it does or whether it's 19 - * deprecated. You can set this option to `false` if you prefer less 20 - * comment duplication. 21 - * 22 - * @default true 23 - */ 24 - comments?: boolean; 25 15 /** 26 16 * Configuration for generated infinite query key helpers. 27 17 * ··· 292 282 293 283 export type Config = Plugin.Name<'@tanstack/angular-query-experimental'> & 294 284 Plugin.Hooks & 285 + Plugin.Comments & 295 286 Plugin.Exports & { 296 287 /** 297 288 * Casing convention for generated names. 298 289 */ 299 290 case: Casing; 300 - /** 301 - * Add comments from SDK functions to the generated TanStack Query code? 302 - * 303 - * @default true 304 - */ 305 - comments: boolean; 306 291 /** 307 292 * Resolved configuration for generated infinite query key helpers. 308 293 *
+2 -17
packages/openapi-ts/src/plugins/@tanstack/react-query/types.ts
··· 4 4 5 5 export type UserConfig = Plugin.Name<'@tanstack/react-query'> & 6 6 Plugin.Hooks & 7 + Plugin.UserComments & 7 8 Plugin.UserExports & { 8 9 /** 9 10 * Casing convention for generated names. ··· 11 12 * @default 'camelCase' 12 13 */ 13 14 case?: Casing; 14 - /** 15 - * Add comments from SDK functions to the generated TanStack Query code? 16 - * 17 - * Duplicating comments this way is useful so you don't need to drill into 18 - * the underlying SDK function to learn what it does or whether it's 19 - * deprecated. You can set this option to `false` if you prefer less 20 - * comment duplication. 21 - * 22 - * @default true 23 - */ 24 - comments?: boolean; 25 15 /** 26 16 * Configuration for generated infinite query key helpers. 27 17 * ··· 337 327 338 328 export type Config = Plugin.Name<'@tanstack/react-query'> & 339 329 Plugin.Hooks & 330 + Plugin.Comments & 340 331 Plugin.Exports & { 341 332 /** 342 333 * Casing convention for generated names. 343 334 */ 344 335 case: Casing; 345 - /** 346 - * Add comments from SDK functions to the generated TanStack Query code? 347 - * 348 - * @default true 349 - */ 350 - comments: boolean; 351 336 /** 352 337 * Resolved configuration for generated infinite query key helpers. 353 338 *
+2 -17
packages/openapi-ts/src/plugins/@tanstack/solid-query/types.ts
··· 10 10 11 11 export type UserConfig = Plugin.Name<'@tanstack/solid-query'> & 12 12 Plugin.Hooks & 13 + Plugin.UserComments & 13 14 Plugin.UserExports & { 14 15 /** 15 16 * Casing convention for generated names. ··· 17 18 * @default 'camelCase' 18 19 */ 19 20 case?: Casing; 20 - /** 21 - * Add comments from SDK functions to the generated TanStack Query code? 22 - * 23 - * Duplicating comments this way is useful so you don't need to drill into 24 - * the underlying SDK function to learn what it does or whether it's 25 - * deprecated. You can set this option to `false` if you prefer less 26 - * comment duplication. 27 - * 28 - * @default true 29 - */ 30 - comments?: boolean; 31 21 /** 32 22 * Configuration for generated infinite query key helpers. 33 23 * ··· 299 289 300 290 export type Config = Plugin.Name<'@tanstack/solid-query'> & 301 291 Plugin.Hooks & 292 + Plugin.Comments & 302 293 Plugin.Exports & { 303 294 /** 304 295 * Casing convention for generated names. 305 296 */ 306 297 case: Casing; 307 - /** 308 - * Add comments from SDK functions to the generated TanStack Query code? 309 - * 310 - * @default true 311 - */ 312 - comments: boolean; 313 298 /** 314 299 * Resolved configuration for generated infinite query key helpers. 315 300 *
+2 -17
packages/openapi-ts/src/plugins/@tanstack/svelte-query/types.ts
··· 10 10 11 11 export type UserConfig = Plugin.Name<'@tanstack/svelte-query'> & 12 12 Plugin.Hooks & 13 + Plugin.UserComments & 13 14 Plugin.UserExports & { 14 15 /** 15 16 * Casing convention for generated names. ··· 17 18 * @default 'camelCase' 18 19 */ 19 20 case?: Casing; 20 - /** 21 - * Add comments from SDK functions to the generated TanStack Query code? 22 - * 23 - * Duplicating comments this way is useful so you don't need to drill into 24 - * the underlying SDK function to learn what it does or whether it's 25 - * deprecated. You can set this option to `false` if you prefer less 26 - * comment duplication. 27 - * 28 - * @default true 29 - */ 30 - comments?: boolean; 31 21 /** 32 22 * Configuration for generated infinite query key helpers. 33 23 * ··· 298 288 299 289 export type Config = Plugin.Name<'@tanstack/svelte-query'> & 300 290 Plugin.Hooks & 291 + Plugin.Comments & 301 292 Plugin.Exports & { 302 293 /** 303 294 * Casing convention for generated names. 304 295 */ 305 296 case: Casing; 306 - /** 307 - * Add comments from SDK functions to the generated TanStack Query code? 308 - * 309 - * @default true 310 - */ 311 - comments: boolean; 312 297 /** 313 298 * Resolved configuration for generated infinite query key helpers. 314 299 *
+2 -17
packages/openapi-ts/src/plugins/@tanstack/vue-query/types.ts
··· 10 10 11 11 export type UserConfig = Plugin.Name<'@tanstack/vue-query'> & 12 12 Plugin.Hooks & 13 + Plugin.UserComments & 13 14 Plugin.UserExports & { 14 15 /** 15 16 * Casing convention for generated names. ··· 17 18 * @default 'camelCase' 18 19 */ 19 20 case?: Casing; 20 - /** 21 - * Add comments from SDK functions to the generated TanStack Query code? 22 - * 23 - * Duplicating comments this way is useful so you don't need to drill into 24 - * the underlying SDK function to learn what it does or whether it's 25 - * deprecated. You can set this option to `false` if you prefer less 26 - * comment duplication. 27 - * 28 - * @default true 29 - */ 30 - comments?: boolean; 31 21 /** 32 22 * Configuration for generated infinite query key helpers. 33 23 * ··· 301 291 302 292 export type Config = Plugin.Name<'@tanstack/vue-query'> & 303 293 Plugin.Hooks & 294 + Plugin.Comments & 304 295 Plugin.Exports & { 305 296 /** 306 297 * Casing convention for generated names. 307 298 */ 308 299 case: Casing; 309 - /** 310 - * Add comments from SDK functions to the generated TanStack Query code? 311 - * 312 - * @default true 313 - */ 314 - comments: boolean; 315 300 /** 316 301 * Resolved configuration for generated infinite query key helpers. 317 302 *
+2 -12
packages/openapi-ts/src/plugins/arktype/types.ts
··· 11 11 12 12 export type UserConfig = Plugin.Name<'arktype'> & 13 13 Plugin.Hooks & 14 + Plugin.UserComments & 14 15 Plugin.UserExports & { 15 16 /** 16 17 * Casing convention for generated names. ··· 18 19 * @default 'PascalCase' 19 20 */ 20 21 case?: Casing; 21 - /** 22 - * Add comments from input to the generated Arktype schemas? 23 - * 24 - * @default true 25 - */ 26 - comments?: boolean; 27 22 /** 28 23 * Configuration for reusable schema definitions. 29 24 * ··· 371 366 372 367 export type Config = Plugin.Name<'arktype'> & 373 368 Plugin.Hooks & 369 + Plugin.Comments & 374 370 Plugin.Exports & { 375 371 /** 376 372 * Casing convention for generated names. 377 373 */ 378 374 case: Casing; 379 - /** 380 - * Add comments from input to the generated Arktype schemas? 381 - * 382 - * @default true 383 - */ 384 - comments: boolean; 385 375 /** 386 376 * Configuration for reusable schema definitions. 387 377 *
+2 -17
packages/openapi-ts/src/plugins/swr/types.ts
··· 10 10 11 11 export type UserConfig = Plugin.Name<'swr'> & 12 12 Plugin.Hooks & 13 + Plugin.UserComments & 13 14 Plugin.UserExports & { 14 15 /** 15 16 * Casing convention for generated names. ··· 17 18 * @default 'camelCase' 18 19 */ 19 20 case?: Casing; 20 - /** 21 - * Add comments from SDK functions to the generated SWR code? 22 - * 23 - * Duplicating comments this way is useful so you don't need to drill into 24 - * the underlying SDK function to learn what it does or whether it's 25 - * deprecated. You can set this option to `false` if you prefer less 26 - * comment duplication. 27 - * 28 - * @default true 29 - */ 30 - comments?: boolean; 31 21 /** 32 22 * Configuration for generated infinite query key helpers. 33 23 * ··· 343 333 344 334 export type Config = Plugin.Name<'swr'> & 345 335 Plugin.Hooks & 336 + Plugin.Comments & 346 337 Plugin.Exports & { 347 338 /** 348 339 * Casing convention for generated names. 349 340 */ 350 341 case: Casing; 351 - /** 352 - * Add comments from SDK functions to the generated SWR code? 353 - * 354 - * @default true 355 - */ 356 - comments: boolean; 357 342 /** 358 343 * Resolved configuration for generated infinite query key helpers. 359 344 *
+2 -12
packages/openapi-ts/src/plugins/valibot/types.ts
··· 12 12 13 13 export type UserConfig = Plugin.Name<'valibot'> & 14 14 Plugin.Hooks & 15 + Plugin.UserComments & 15 16 Plugin.UserExports & 16 17 Resolvers & { 17 18 /** ··· 20 21 * @default 'camelCase' 21 22 */ 22 23 case?: Casing; 23 - /** 24 - * Add comments from input to the generated Valibot schemas? 25 - * 26 - * @default true 27 - */ 28 - comments?: boolean; 29 24 /** 30 25 * Configuration for reusable schema definitions. 31 26 * ··· 175 170 176 171 export type Config = Plugin.Name<'valibot'> & 177 172 Plugin.Hooks & 173 + Plugin.Comments & 178 174 Plugin.Exports & 179 175 Resolvers & { 180 176 /** 181 177 * Casing convention for generated names. 182 178 */ 183 179 case: Casing; 184 - /** 185 - * Add comments from input to the generated Valibot schemas? 186 - * 187 - * @default true 188 - */ 189 - comments: boolean; 190 180 /** 191 181 * Configuration for reusable schema definitions. 192 182 *
+2 -12
packages/openapi-ts/src/plugins/zod/types.ts
··· 12 12 13 13 export type UserConfig = Plugin.Name<'zod'> & 14 14 Plugin.Hooks & 15 + Plugin.UserComments & 15 16 Plugin.UserExports & 16 17 Resolvers & { 17 18 /** ··· 20 21 * @default 'camelCase' 21 22 */ 22 23 case?: Casing; 23 - /** 24 - * Add comments from input to the generated Zod schemas? 25 - * 26 - * @default true 27 - */ 28 - comments?: boolean; 29 24 /** 30 25 * The compatibility version to target for generated output. 31 26 * ··· 412 407 413 408 export type Config = Plugin.Name<'zod'> & 414 409 Plugin.Hooks & 410 + Plugin.Comments & 415 411 Plugin.Exports & 416 412 Resolvers & { 417 413 /** 418 414 * Casing convention for generated names. 419 415 */ 420 416 case: Casing; 421 - /** 422 - * Add comments from input to the generated Zod schemas? 423 - * 424 - * @default true 425 - */ 426 - comments: boolean; 427 417 /** 428 418 * The compatibility version to target for generated output. 429 419 *
+15
packages/shared/src/config/shared.ts
··· 53 53 includeInEntry: boolean | ((symbol: Symbol) => boolean); 54 54 }; 55 55 56 + export type UserCommentsOption = { 57 + /** 58 + * Whether to add comments to the generated code. 59 + * 60 + * @default true 61 + */ 62 + comments?: boolean; 63 + }; 64 + export type CommentsOption = { 65 + /** 66 + * Whether to add comments to the generated code. 67 + */ 68 + comments: boolean; 69 + }; 70 + 56 71 export type NamingOptions = { 57 72 /** 58 73 * Casing convention for generated names.
+2
packages/shared/src/index.ts
··· 19 19 BaseOutput, 20 20 BaseUserConfig, 21 21 BaseUserOutput, 22 + CommentsOption, 22 23 FeatureToggle, 23 24 IndexExportOption, 24 25 NamingOptions, 26 + UserCommentsOption, 25 27 UserIndexExportOption, 26 28 } from './config/shared'; 27 29 export type { ValueToObject } from './config/utils/config';
+9 -1
packages/shared/src/plugins/types.ts
··· 1 1 /* eslint-disable @typescript-eslint/no-namespace */ 2 2 import type { AnyString } from '@hey-api/types'; 3 3 4 - import type { IndexExportOption, UserIndexExportOption } from '../config/shared'; 4 + import type { 5 + CommentsOption, 6 + IndexExportOption, 7 + UserCommentsOption, 8 + UserIndexExportOption, 9 + } from '../config/shared'; 5 10 import type { ValueToObject } from '../config/utils/config'; 6 11 import type { Dependency } from '../config/utils/dependencies'; 7 12 import type { Hooks as ParserHooks } from '../parser/hooks'; ··· 71 76 */ 72 77 tags?: ReadonlyArray<PluginTag>; 73 78 }; 79 + 80 + export type Comments = CommentsOption; 81 + export type UserComments = UserCommentsOption; 74 82 75 83 export type Exports = IndexExportOption; 76 84 export type UserExports = UserIndexExportOption;