Skip to content

[cli] 리포지토리/엔티티 템플릿이 존재하지 않는 repository-core 계약을 생성함 #693

Description

@kang-heewon

Problem

CLI의 도메인/리포지토리/엔티티 생성 템플릿이 repository-core의 실제 공개 계약과 맞지 않는 코드를 만듭니다. Repository는 interface인데 class처럼 extends하고, Entity@croco/repository-core에서 export되지 않습니다.

Evidence

  • packages/cli/src/commands/makeRepository.ts:46-50export class XRepository extends Repository<XEntity, string> {}를 생성합니다.
  • packages/cli/src/commands/createDomain.ts:177-182도 같은 리포지토리 형태를 생성합니다.
  • packages/repository-core/src/libs/Repository.ts:28Repository<T, ID>를 class가 아니라 interface로 export합니다.
  • packages/cli/src/commands/makeEntity.ts:46-53packages/cli/src/commands/createDomain.ts:185-194Entity를 import하지만 packages/repository-core/src/index.ts:5-20에는 해당 export가 없습니다.

Desired Outcome

새로 생성한 도메인의 repository/entity 코드가 현재 repository-core 공개 API와 맞아야 하며, 생성 직후 typecheck가 깨지지 않아야 합니다.

Suggested Approach

  • Repositoryimplements할 구체 구현 예제로 바꾸거나 실제 제공되는 추상/베이스 구현체에 맞춥니다.
  • Entity import/decorator가 필요한지 결정하고, 필요 없다면 템플릿에서 제거합니다.
  • 생성 템플릿을 repository-core의 export smoke test와 연결합니다.

Acceptance Criteria

  • croco make repository, croco make entity, croco create domain 결과가 존재하지 않는 export를 참조하지 않습니다.
  • Repository interface를 class 상속 대상으로 사용하지 않습니다.
  • CLI 생성물에 대한 fixture typecheck 또는 snapshot 테스트가 추가됩니다.

Validation

  • pnpm test --filter=@croco/cli
  • pnpm typecheck --filter=@croco/cli
  • 생성 fixture에 대해 tsc --noEmit

Metadata

Metadata

Assignees

Labels

P1Priority 1 issuebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions