-
Notifications
You must be signed in to change notification settings - Fork 0
Support TypeScript 6.0.x and hey-api/openapi-ts 0.99.x #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d31dc14
adadadf
085fd2f
079b496
169cdf7
6f5af64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| diff --git a/dist/index.d.mts b/dist/index.d.mts | ||
| index f2ca29144731f9320cea459d0e290352e2701e92..4255212e3846fee11fa9dd77a782d5ce1a2e00c9 100644 | ||
| --- a/dist/index.d.mts | ||
| +++ b/dist/index.d.mts | ||
| @@ -1475,6 +1475,7 @@ declare class ImplFuncTsDsl<M extends FuncMode = 'arrow'> extends Mixed$31 { | ||
| decl(): FuncTsDsl<'decl'>; | ||
| /** Switches the function to a function expression form. */ | ||
| expr(): FuncTsDsl<'expr'>; | ||
| + // @ts-ignore TS2416 - bundled declaration has incorrect base type TsDsl<ArrowFunction>; conditional return is valid at source level | ||
| toAst(): M extends 'decl' ? ts.FunctionDeclaration : M extends 'expr' ? ts.FunctionExpression : ts.ArrowFunction; | ||
| $validate(): asserts this; | ||
| private missingRequiredCalls; | ||
| @@ -1848,6 +1849,7 @@ declare class ImplForTsDsl<M extends ForMode = 'for'> extends Mixed$16 { | ||
| of(iterable?: ForIterable): ForTsDsl<'of'>; | ||
| /** Sets the update expression (e.g., `i++`). */ | ||
| update(update: ForIterable): this; | ||
| + // @ts-ignore TS2416 - bundled declaration has incorrect base type TsDsl<ForStatement>; conditional return is valid at source level | ||
| toAst(): M extends 'for' ? ts.ForStatement : M extends 'of' ? ts.ForOfStatement : ts.ForInStatement; | ||
| $validate(): asserts this is this & { | ||
| _iterableOrUpdate: ForIterable; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| diff --git a/dist/index.d.mts b/dist/index.d.mts | ||
| index d4f7acfd6f4b0a65b9de871e7bc88a6151c8a520..1fdc18bb747a9dfc56b74e3e69e1e9ce3275ca85 100644 | ||
| --- a/dist/index.d.mts | ||
| +++ b/dist/index.d.mts | ||
| @@ -3190,6 +3190,7 @@ declare function definePluginConfig<T extends Plugin.Types>(pluginConfig: Plugin | ||
| plugin: PluginInstance<T>; | ||
| }) => void; | ||
| imports?: ((plugin: PluginInstance<T>) => T["imports"]) | undefined; | ||
| + // @ts-ignore TS2749 - bundled declaration references value 'log' as a type; upstream typing bug | ||
| symbolMeta?: (symbol: Omit<log, "name">) => log; | ||
| tags?: ReadonlyArray<PluginTag>; | ||
| }; | ||
|
Comment on lines
+1
to
+12
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. この変更差分を教えてください
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
symbolMeta?: (symbol: Omit<log, "name">) => log;という宣言があり、ここで参照されている
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この変更の意味を教えてください
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このリポジトリは
skipLibCheck: falseでビルドしているため、依存パッケージの型定義ファイル内のエラーもビルドエラーになります。@hey-api/openapi-tsがバンドルするdist/index.d.mtsでは、ImplForTsDsl.toAst()が conditional return type(Mに応じてForStatement | ForOfStatement | ForInStatement)を持つ一方、継承チェーンの基底型TsDsl<ForStatement>はtoAst(): ForStatementを宣言しており、TS2416(プロパティの型非互換)になります。ソースコード上は有効なオーバーライドですが、rollup で単一の宣言ファイルに束ねられた際に矛盾として表面化する upstream の型バグです。0.92.3 の patch で対応していた
ImplFuncTsDsl.toAst()(このファイルの1つ目のハンク)と同種のエラーが、0.99.0 ではこのImplForTsDsl.toAst()にも新たに発生したため、@ts-ignoreを追加しています。upstream で修正されれば patch ごと削除できます。