Rulebook

Claude Rules 관리

문서맵
  • component-design
  • entities-api
  • entities-layer
  • entities-model
  • error-handling
  • features-layer
  • fsd-architecture
  • react-hooks
    1
  • security
  • server-components
  • shared-layer
  • tailwind-css
  • tanstack-query
  • testing
  • views-layer
  • widget-layer
  • changelog
  • development-workflow
  • documentation
  • git-commit
  • marketing-seo
  • marketing-ux
  • naming-convention
  • security
  • typescript-standards
  • ux-copy-and-tone
  • api-design
  • database
  • nest
  • security
  • supabase
  • README
전체 룰 다운로드
front/widget-layer
activev12026. 4. 12.

description: "Widget 레이어 개발 규칙 - 독립적인 복합 UI 블록" paths:

  • "src/widgets/**/*.ts"
  • "src/widgets/**/*.tsx"

Widget Layer (위젯 레이어)

여러 feature/entity를 조합한 독립적인 UI 블록을 관리합니다. 페이지에 조립되어 사용되며, 자체적으로 데이터를 가져옵니다.

entities vs features vs widgets 구분 기준

entitiesfeatureswidgets
역할도메인 모델/API단일 사용자 액션복합 UI 블록
UI 포함드물게있을 수도항상
데이터 fetching✅✅✅ (내부에서)

구조

widgets/
└── (위젯명)/
    ├── ui/
    │   ├── (위젯명).tsx         메인 컴포넌트
    │   └── (서브컴포넌트).tsx   내부 전용 컴포넌트
    └── index.ts

언제 widget으로 만드나

  • 여러 feature/entity를 조합해야 할 때
  • 자체 상태와 데이터 fetching이 필요한 UI 블록
  • 여러 페이지에서 독립적으로 재사용될 때

의존성 규칙

  • ✅ features, entities, shared import 가능
  • ❌ views import 금지
  • ❌ 다른 widgets import 금지

index.ts export 규칙

export { XxxWidget } from "./ui/xxx-widget";
// 내부 서브컴포넌트는 export하지 않음

피드백 0

아직 피드백이 없어요. 첫 번째로 의견을 남겨보세요!

목차

entities vs features vs widgets 구분 기준구조언제 widget으로 만드나의존성 규칙index.ts export 규칙