@@ -22,7 +22,7 @@ import type {ServerOperationBuilder} from "../server-operation-builder"
2222
2323export type ServerSymbols = {
2424 implPropName : string
25- typeName : string
25+ implTypeName : string
2626 responderName : string
2727 paramSchema : string
2828 querySchema : string
@@ -120,7 +120,7 @@ export class KoaServerRouterBuilder extends AbstractServerRouterBuilder {
120120 kind : "type" ,
121121 } ) ,
122122 buildExport ( {
123- name : symbols . typeName ,
123+ name : symbols . implTypeName ,
124124 value : `(
125125 params: ${ params . type } ,
126126 respond: ${ symbols . responderName } ,
@@ -168,7 +168,7 @@ router.${builder.method.toLowerCase()}('${symbols.implPropName}','${route(builde
168168 private operationSymbolNames ( operationId : string ) : ServerSymbols {
169169 return {
170170 implPropName : operationId ,
171- typeName : titleCase ( operationId ) ,
171+ implTypeName : titleCase ( operationId ) ,
172172 responderName : `${ titleCase ( operationId ) } Responder` ,
173173 paramSchema : `${ operationId } ParamSchema` ,
174174 querySchema : `${ operationId } QuerySchema` ,
@@ -187,7 +187,7 @@ router.${builder.method.toLowerCase()}('${symbols.implPropName}','${route(builde
187187 value : object (
188188 this . operationTypes
189189 . map ( ( it ) => this . operationSymbolNames ( it . operationId ) )
190- . map ( ( it ) => `${ it . implPropName } : ${ it . typeName } ` )
190+ . map ( ( it ) => `${ it . implPropName } : ${ it . implTypeName } ` )
191191 . join ( "," ) ,
192192 ) ,
193193 kind : this . implementationMethod ,
@@ -200,7 +200,7 @@ router.${builder.method.toLowerCase()}('${symbols.implPropName}','${route(builde
200200 value : object (
201201 this . operationTypes
202202 . map ( ( it ) => this . operationSymbolNames ( it . operationId ) )
203- . map ( ( it ) => `abstract ${ it . implPropName } : ${ it . typeName } ` )
203+ . map ( ( it ) => `abstract ${ it . implPropName } : ${ it . implTypeName } ` )
204204 . join ( "\n" ) ,
205205 ) ,
206206 kind : "abstract-class" ,
@@ -254,7 +254,6 @@ export class KoaServerBuilder implements ICompilable {
254254 private readonly input : Input ,
255255 private readonly imports : ImportBuilder = new ImportBuilder ( ) ,
256256 ) {
257- // todo: unsure why, but adding an export at `.` of index.ts doesn't work properly
258257 this . imports
259258 . from ( "@nahkies/typescript-koa-runtime/server" )
260259 . add (
@@ -272,11 +271,9 @@ export class KoaServerBuilder implements ICompilable {
272271 }
273272
274273 toString ( ) : string {
275- const { name} = this
276-
277274 return `
278275 export async function bootstrap(config: ServerConfig) {
279- // ${ name }
276+ // ${ this . name }
280277 return startServer(config)
281278 }
282279 `
0 commit comments