refactor: ディレクトリ構造を整理し命名規則をルール化#2823
Merged
Merged
Conversation
- 廃止: src/{features,schemas,config,@types} → 役割に応じて統合
- src/utils と src/lib を副作用の有無で振り分け
- src/hooks/storage/ で localStorage/sessionStorage 系を集約
- src/utils/is/ で type guard 系を集約
- src/components/form/ で Field/Input/Label を集約
- src/lib/queryClient → src/lib/getQueryClient/{,config/} に再編
- ローカル utils はグルーピング扱い、配下を 1機能1ディレクトリに
- src/components/LoadingOverlay/utils/loadingStore/, useIsComposing/utils/compositionStore/ も同様に整理
- createCustomEvent を削除 (未使用)
- .claude/rules/directory-structure.md を新設し決定事項のみ記載
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/配下のディレクトリ構造を整理し、命名規則をルール化.claude/rules/directory-structure.mdを新設して決定事項を明文化主な変更
廃止
src/features/src/schemas/src/config/src/@types/を廃止envはsrc/env.tsルート直置きに.d.tsはsrc/types/に統合utils/とlib/の振り分け(副作用の有無)utils/: 純粋関数(debounce,is/,runtime)lib/: 副作用/外部依存あり(proxy,getQueryClient,WebVitalsReporter,styles)グルーピング再編
src/hooks/storage/にuseLocalStorageuseSessionStorageuseWebStorageutils/webStorageStoreを集約src/utils/is/にisFunctionisKeyOfisValueOfを集約src/components/form/にFieldInputLabelを集約src/lib/queryClient/→src/lib/getQueryClient/{,config/}に再編(entrypoint 名 = export 関数名)ローカル
utils/配下も 1機能1ディレクトリ徹底LoadingOverlay/utils/loadingStore/{loadingStore.ts,index.ts}構造にuseIsComposing/utils/compositionStore/も同様その他
createCustomEventを削除ディレクトリ命名規則(新設)
判定:
index.tsから何かを公開 → entrypoint、束ねるだけ → グルーピング(barrel なし)Test plan
pnpm test:unit422 件パスpnpm check(lint + format + knip) パス🤖 Generated with Claude Code