Skip to content

API自動生成型のエイリアス定義をtypeAliases.tsに集約#239

Open
kitsne241 wants to merge 1 commit into
mainfrom
chore/aggregate-type-aliases-re
Open

API自動生成型のエイリアス定義をtypeAliases.tsに集約#239
kitsne241 wants to merge 1 commit into
mainfrom
chore/aggregate-type-aliases-re

Conversation

@kitsne241

Copy link
Copy Markdown
Collaborator

closes #172

古くなってコンフリクトが発生してどうにもならなくなっていた #214 をやり直したもの

これまでのコードでは各コンポーネントで

import type { components } from '@/api/schema'
type Camp = components['schemas']['CampResponse']

のようなボイラープレートによって型を使用していましたが、これを typeAliases.ts に集約します

@kitsne241 kitsne241 requested review from Copilot and mumumu6 June 4, 2026 11:05
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kitsne241, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 2 minutes and 9 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0a11c77d-8cb9-4bc1-9377-b445e8a5bf72

📥 Commits

Reviewing files that changed from the base of the PR and between cc9d723 and 4517aa5.

📒 Files selected for processing (33)
  • src/components/activity/QuestionActivity.vue
  • src/components/activity/RollCallActivity.vue
  • src/components/event/EventBlock.vue
  • src/components/event/EventDialog.vue
  • src/components/event/EventEditor.vue
  • src/components/event/EventEditorSettings.vue
  • src/components/event/EventTimePick.vue
  • src/components/event/ScheduleContent.vue
  • src/components/event/utils/eventColors.ts
  • src/components/event/utils/eventGrid.ts
  • src/components/event/utils/eventLayout.ts
  • src/components/event/utils/eventLib.ts
  • src/components/information/AnswersDialog.vue
  • src/components/information/AnswersDialogContent.vue
  • src/components/information/PaymentInfo.vue
  • src/components/information/QuestionEditField.vue
  • src/components/information/QuestionGroupEditor.vue
  • src/components/information/QuestionGroupPanel.vue
  • src/components/information/QuestionGroupViewer.vue
  • src/components/information/QuestionShowField.vue
  • src/components/information/RoomInfo.vue
  • src/components/rollcall/rollCallStream.ts
  • src/components/room/RoomCard.vue
  • src/components/room/RoomStatusDialog.vue
  • src/mocks/activities.ts
  • src/store.ts
  • src/typeAliases.ts
  • src/views/ActivityView.vue
  • src/views/RegistrationView.vue
  • src/views/RollCallView.vue
  • src/views/RoomInfoView.vue
  • src/views/ScheduleView.vue
  • src/views/UserInfoView.vue
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/aggregate-type-aliases-re

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenAPI 生成型(@/api/schema)のレスポンス型エイリアス定義を src/typeAliases.ts に集約し、各コンポーネント/ストアからのボイラープレートな型定義を削減するPRです。型参照元を統一することで、型の利用方法の一貫性と保守性を高めます。

Changes:

  • src/typeAliases.ts を新設し、components['schemas'][...] ベースの型エイリアスを一箇所に集約
  • 各 Vue コンポーネント/ユーティリティ/ストアで @/api/schema 直接参照を廃止し @/typeAliases 参照へ置換
  • 一部のジェネリクス指定(例: QuestionGroup[])を、新しいエイリアス形に合わせて調整

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/typeAliases.ts OpenAPI schema 由来の型エイリアスを集約する新規ファイルを追加
src/views/UserInfoView.vue QuestionGroup/Dashboard 型参照を typeAliases に統一、useQuery の型を QuestionGroup[] に調整
src/views/ScheduleView.vue CampEvent 型参照を typeAliases に統一
src/views/RoomInfoView.vue RoomGroup 型参照を typeAliases に統一
src/views/RollCallView.vue RollCall 型参照を typeAliases に統一
src/views/RegistrationView.vue Camp 型参照を typeAliases に統一
src/views/ActivityView.vue Activity 型参照を typeAliases に統一(テンプレート整形含む)
src/store.ts User/Camp 型参照を typeAliases に統一、participants 取得の型を User[] に統一
src/mocks/activities.ts Activity 型参照を typeAliases に統一
src/components/room/RoomStatusDialog.vue Room/RoomStatus/RoomStatusLog 型参照を typeAliases に統一
src/components/room/RoomCard.vue Room 型参照を typeAliases に統一
src/components/rollcall/rollCallStream.ts RollCall 系型参照を typeAliases に統一
src/components/information/*.vue Question/Answer/Room/Payment など情報系コンポーネントの型参照を typeAliases に統一
src/components/event/**/*.ts, *.vue Event/Camp 系型参照を typeAliases に統一
src/components/activity/*.vue Activity 型参照を typeAliases に統一

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mumumu6 mumumu6 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

コードはいいと思いました。

ただ見つけてしまったので言うんですが、 npx openapi-typescript https://raw.githubusercontent.com/traPtitech/rucQ/main/openapi.yaml -o src/api/schema.d.ts --root-types --root-types-no-schema-prefix

こういったoptionがあってこれするともしかしたら解決かもしれないです...

Image

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.

型のエイリアス定義・使用様態を改善する

3 participants