Skip to content

[release] Standardize package entrypoint contracts across all public packages #618

Description

@kang-heewon

배경

Croco는 98개 패키지를 가진 TypeScript 모노레포인데, public package의 배포 엔트리포인트 계약이 패키지마다 다릅니다. 현재 조사 기준으로 53개 패키지가 root main/types./src/index.ts로 가리키면서 filesdist만 포함합니다.

예시:

  • packages/framework-context/package.json:4-20files: ["dist"]인데 root main/types./src/index.ts, publishConfigdist를 가리킴
  • packages/impersonation-core/package.json:8-23 — root main/module/types/exports가 dist 기반이지만 types가 배열 형태
  • package.json:18 — release는 pnpm build && changeset publish 흐름
  • 관련 기존 이슈: [storage packages] Published manifests point package roots at src while only dist is shipped #578 은 storage package 한정 manifest 문제. 이 이슈는 전 public package 정책과 CI gate를 다룸

왜 중요한가

world-class 프레임워크는 npm 소비자가 ESM/CJS/TypeScript 환경에서 동일하게 패키지를 해석할 수 있어야 합니다. entrypoint drift는 release 직후 런타임 import 실패, 타입 해상도 실패, bundler별 동작 차이로 이어집니다.

외부 기준:

제안 범위

  • public package manifest 표준 결정
    • root main, module, types, exports, type, files
    • publishConfig 사용 여부와 root field 중복 정책
    • CJS/ESM/type declaration 확장자 정책
  • scripts/normalize-packages.mjs를 write 모드와 check 모드로 분리
  • CI에서 manifest drift를 hard fail
  • 기존 package별 예외가 필요하면 allowlist와 사유 문서화

완료 기준

Metadata

Metadata

Assignees

Labels

P0Priority 0 issuearchitectureArchitecture and module boundary issuestech-debtTechnical debt

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions