Skip to content

Intent Map

프로젝트 전체 spec을 도메인별로 관리하는 매니페스트 파일이다.

왜 필요한가

개별 .intent.yml 파일이 늘어나면 전체 구조를 파악하기 어렵다. Intent Map은 프로젝트의 모든 spec을 한 파일에서 조망할 수 있게 한다. 새 기능을 어디에 배치할지, 어떤 도메인이 비대한지 판단하는 기준이 된다.

기본 구조

yaml
apiVersion: v1

metadata:
  name: my-project
  title: 프로젝트 제목

domains:
  auth:
    title: 인증
    specs:
      - signup
      - login
  • apiVersion — 형식 버전. .intent.yml과 동일하게 v1을 사용한다.
  • metadata — 프로젝트 식별 정보.
  • domains — 도메인 목록. 각 도메인은 titlespecs 또는 areas를 갖는다.

도메인 규칙

area 없는 도메인

spec이 도메인 바로 아래에 위치한다. 대부분의 도메인은 이 형태로 충분하다.

yaml
auth:
  title: 인증
  specs:
    - signup
    - login
    - password-reset

area 있는 도메인

하위 영역으로 한 단계 더 분류한다. area는 1단까지만 허용된다.

yaml
issue:
  title: 이슈
  areas:
    core:
      title: 핵심
      specs:
        - issue-crud
        - issue-status
    view:
      title: 보기
      specs:
        - issue-board
        - issue-list

areas 아래에 다시 areas를 넣을 수 없다. 깊이가 필요하면 도메인을 분리한다.

접두사로 도메인 분리

도메인이 커지면 이름 접두사로 분리한다. 별도의 네임스페이스 문법은 없다.

yaml
# 하나의 issue 도메인이 너무 커졌을 때
domains:
  issue:
    title: 이슈
    specs:
      - issue-crud
      - issue-status
  issue-comment:
    title: 이슈 댓글
    specs:
      - issue-comment-crud
      - issue-comment-mention

접두사가 같은 도메인은 관련 도메인으로 간주된다. 읽는 순서는 자유이지만, 접두사가 같은 도메인은 인접하게 배치하는 것을 권장한다.

파일 위치

Intent Map은 프로젝트 루트 또는 specs/ 디렉토리에 둔다.

my-project/
├── specs/
│   ├── intent-map.yml        # 매니페스트
│   ├── auth-signup.intent.yml
│   ├── auth-login.intent.yml
│   └── issue-crud.intent.yml
└── ...

spec 이름은 Intent Map의 specs 배열에 나열된 값과 일치해야 한다. 파일명은 <spec-name>.intent.yml 형식을 따른다.

다음 단계