@openapi-generator-plus/typescript-express-example-server-generator
Version:
An OpenAPI Generator Plus template for a TypeScript API server using Express to output example responses
25 lines (23 loc) • 637 B
text/typescript
import { ts, each } from '@openapi-generator-plus/template-utils'
import { TypeScriptOptions, TemplateRootContext } from '@openapi-generator-plus/typescript-generator-common'
export function tsconfig(ctx: TemplateRootContext & TypeScriptOptions): string {
const libsBlock = each(ctx.libs, (lib, _i, _f, isLast) => `\t\t\t"${lib}"${isLast ? '' : ','}`, '\n')
return ts`
{
"compilerOptions": {
"declaration": true,
"target": "${ctx.target}",
"module": "commonjs",
"esModuleInterop": true,
"noImplicitAny": true,
"outDir": "dist",
"lib": [
${libsBlock}
]
},
"include": [
"./${ctx.relativeSourceOutputPath}"
]
}
`
}