File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 1+ # 1.3.9 - 4 Sep 2025
2+ Bug fix:
3+ - type generator: loose path generated file mapping
4+
15# 1.3.8 - 4 Sep 2025
26Bug fix:
37- type generator: if failed, do not generate empty JSON
Original file line number Diff line number Diff line change 11{
22 "name" : " @elysiajs/openapi" ,
3- "version" : " 1.3.8 " ,
3+ "version" : " 1.3.9 " ,
44 "description" : " Plugin for Elysia to auto-generate API documentation" ,
55 "author" : {
66 "name" : " saltyAom" ,
Original file line number Diff line number Diff line change @@ -147,16 +147,35 @@ export const fromTypes =
147147 . replace ( / .t s x $ / , '.ts' )
148148 . replace ( / .t s $ / , '.d.ts' )
149149
150- const targetFile =
150+ let targetFile =
151151 ( overrideOutputPath
152152 ? typeof overrideOutputPath === 'string'
153153 ? overrideOutputPath . startsWith ( '/' )
154154 ? overrideOutputPath
155155 : join ( tmpRoot , 'dist' , overrideOutputPath )
156156 : overrideOutputPath ( tmpRoot )
157- : undefined ) ?? join ( tmpRoot , 'dist' , fileName )
157+ : undefined ) ??
158+ join (
159+ tmpRoot ,
160+ 'dist' ,
161+ // remove leading like src or something similar
162+ fileName . slice ( fileName . indexOf ( '/' ) + 1 )
163+ )
164+
165+ let existed = existsSync ( targetFile )
166+
167+ if ( ! existed && overrideOutputPath ) {
168+ targetFile = join (
169+ tmpRoot ,
170+ 'dist' ,
171+ // use original file name as-is eg. in monorepo
172+ fileName
173+ )
174+
175+ existed = existsSync ( targetFile )
176+ }
158177
159- if ( ! existsSync ( targetFile ) ) {
178+ if ( ! existed ) {
160179 rmSync ( join ( tmpRoot , 'tsconfig.json' ) )
161180
162181 console . warn (
You can’t perform that action at this time.
0 commit comments