Skip to content

chore: enforce package.json consistency across the workspace#252

Merged
Yeom-JinHo merged 16 commits into
dev/side-v2from
chore/package-structure-yeom
Apr 27, 2026
Merged

chore: enforce package.json consistency across the workspace#252
Yeom-JinHo merged 16 commits into
dev/side-v2from
chore/package-structure-yeom

Conversation

@Yeom-JinHo
Copy link
Copy Markdown
Member

Changes

packages/*/package.json이 PR마다 조금씩 달라지는 문제를 막기 위한 논블로킹 일관성 시스템 도입.

  • 정리: chip을 canonical 구조로 normalize, 10개 패키지의 registry·workspace 표기·lint 스크립트·catalog 직접 버전 drift 수정,
    Storybook 스크립트를 root로 통합(18개 패키지)
  • 정책 시스템: package-policy.json + zod 기반 scripts/checkPackageConsistency.ts + 매 PR CI(consistency.yaml)에서 Step Summary에 리포트. continue-on-error로 merge 차단 안 함.(allowlist는 reason 필수.)

Visuals

N/A — 메타데이터/툴링.

Checklist

  • 4종 smoke(잘못된 JSON / 빈 reason / 의도 divergence / allowlist 면제)로 동작 검증. 현재 All 21 packages pass.

Additional Discussion Points

  • Changeset은 기존 2개(chip-normalize,package-json-divergence-cleanup)로 충분. tooling/CI/docs/storybook
    script 제거는 소비자 runtime 영향 없음.
  • @manypkg/clicheck도 고려했으나 빌트인 룰(license/repository/engines/internal dep) 만으로는 부족. scripts 값
    정확 일치, publishConfig.registry 존재, sideEffects 값 enum, catalog 참조 강제, allowlist reason 필수 같은 더 빡빡한 규칙이 필요해 커스컴 checker를 작성(w/ cluade!!).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 24, 2026

🦋 Changeset detected

Latest commit: 9573e3c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • release/v1

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1b27d228-b7df-4a28-b291-455cea38c758

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/package-structure-yeom

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@froggy1014 froggy1014 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI 에러 잡아주세욤 ㅎㅎ

return policySchema.parse(parsed);
}

function isAllowlisted(allowlist: Allowlist, packageName: string, rule: string, fieldPath?: string): boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yeom-JinHo

checkPackage()는 allowlist 항목을 "소비"할 때만 참조하고, 반대로 "한 번도 사용되지 않은 항목"은 감지하지 못합니다.

예를 들어 @sipe-team/tokens에 나중에 test 스크립트가 추가되면 allowlist의 scripts.test 항목은 dead entry가 되지만 checker는 이를 알 수 없습니다.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 정확한 지적입니다.

Allowlist가 20개+로 커지거나 dead entry가 여러 번 실제 문제로 드러나면 별도 PR로 진행하겠습니다! 지금 당장 넣는건 오버엔지니어링 같습니당

추후 운영에는 해당 CI 로직을 제거하는게 최종 goal입니다~~

Comment thread pnpm-lock.yaml
Comment thread package-policy.json
@@ -0,0 +1,78 @@
{
"$schema": "./package-policy.schema.json",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yeom-JinHo

Policy 좋은 아이디어 같네요 ~

혹시 레퍼런스가 있나요 ~ ? 흥미롭네용

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

처음엔 mantine에서 syncpack을 쓰길래 요걸로 셋업했었는데, catelog:, workspace까지만 잡아주길래 살짝 아쉬워서 찾아보니 @manypkg/cli도 있는데 요것도 아쉬워서

직접 package를 순회하면서 제가 설정한 셋업에 깐깐하게 맞추고 싶어서 스크립트를 만들기 위해 선언했습니다!

많은 라이브러리들은 이렇게 깐깐하게 관리는 안합니다만, 초반에 package cleansing과 같이 package sync하는 번거로움을 덜기위해 만들었습니다 -> 솔직히 나중에 운영관점에서는 제거하는 방향으로 가는게 최종 goal 입니다

Comment thread package.json Outdated
Comment thread package.json
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@minji0214 minji0214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Base automatically changed from dev/side-v2 to main April 27, 2026 14:36
@Yeom-JinHo Yeom-JinHo changed the base branch from main to dev/side-v2 April 27, 2026 14:39
@Yeom-JinHo Yeom-JinHo merged commit d1e3a07 into dev/side-v2 Apr 27, 2026
5 checks passed
@Yeom-JinHo Yeom-JinHo deleted the chore/package-structure-yeom branch April 27, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants