Skip to content

TypeScript6対応#180

Open
shinagawa-web wants to merge 3 commits intomainfrom
feat/ts6-support
Open

TypeScript6対応#180
shinagawa-web wants to merge 3 commits intomainfrom
feat/ts6-support

Conversation

@shinagawa-web
Copy link
Copy Markdown
Collaborator

@shinagawa-web shinagawa-web commented Apr 8, 2026

Summary

  • TypeScript 6 サポートを追加
  • peerDependencies^5.3 || ^6 に更新、devDependenciestypescript@^6 を追加
  • FetchT の循環型パラメータ制約を解消(TS6で検出されるようになった Input → Query → CandidatePaths → InputPath → Input の循環を、ヘルパー型への切り出しで解決)
  • ValidateUrl にクエリパラメータが全てオプショナルな場合のチェックを追加
  • erasableSyntaxOnly を有効化し、SpecValidatorError のコンストラクタパラメータプロパティを通常のプロパティ宣言に変更

Test plan

  • npm run test -w pkgs/typed-api-spec が全て通ることを確認
  • 型テスト (index.t-test.ts) の既存テストが全て通ることを確認
  • CI が通ることを確認

- Add typescript@^6 to devDependencies
- Update peerDependencies to accept typescript ^5.3 || ^6
Extract computed type parameters into helper types to break the
circular constraint chain (Input → Query → CandidatePaths → InputPath → Input)
that TS6 now detects. Only Input and InputMethod remain as generic
type parameters; the rest are computed via helper types.

Also update ValidateUrl to allow omitting query string when all query
params are optional, since Input no longer depends on Query.
: never;

/** Extract a specific property (query, headers, body, responses) from the matched endpoint. */
type FetchApiProp<
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Query、Headers、Body、ResponseがApiP<E, CandidatePaths, LM, P> のパターンなのでまとめました。

"supertest": "^7.0.0",
"tsup": "^8.0.0",
"tsx": "^4.0.0",
"typescript": "^6.0.2",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他のパッケージ(tsuptypescript-eslint 等)の依存として間接的にインストールされたものを使っていたようです。たまたま動いていただけなので、明示的に入れました。

@shinagawa-web shinagawa-web changed the title feat: add TypeScript 6 support to peerDependencies and devDependencies TypeScript6対応 Apr 10, 2026
@shinagawa-web shinagawa-web requested a review from yokotaso April 10, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant