Skip to content

fix(build): preserve css imports in sideEffects#228

Merged
Yeom-JinHo merged 4 commits intodev/side-v2from
fix/side-effects-jinho
Apr 19, 2026
Merged

fix(build): preserve css imports in sideEffects#228
Yeom-JinHo merged 4 commits intodev/side-v2from
fix/side-effects-jinho

Conversation

@Yeom-JinHo
Copy link
Copy Markdown
Member

Changes

sideEffects: false로 선언된 패키지가 ./styles.css를 함께 export하고 있어, 번들러가 import '@sipe-team/xxx/styles.css'tree-shaking으로 제거해버리는 버그를 수정합니다. 소비자 번들에 스타일이 빠져 UI가 깨지는 원인이 될 수 있음

모든 관련 패키지와 컴포넌트 스캐폴딩 템플릿에서 다음과 같이 변경:

- "sideEffects": false
+ "sideEffects": ["**/*.css"]

수정된 파일 (17개)

  • 기존 패키지 16개: accordion, badge, button, card, checkbox, divider, flex, grid, input, radio, reset, side, skeleton, switch, tooltip, typography
  • 컴포넌트 템플릿 1개: .templates/component/package.json — 앞으로 pnpm create:component로 생성되는 모든 신규 패키지가 올바른 설정을 가집니다.

유지된 패키지 (sideEffects: false 그대로)

CSS export가 없는 다음 패키지는 수정 대상이 아닙니닷:
avatar, icon, theme, tokens, plugin-figma-codegen

Checklist

  • 전체 패키지 pnpm -r build 통과 확인
  • Biome 포맷팅 적용

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: 45ccb05

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

This PR includes changesets to release 17 packages
Name Type
@sipe-team/accordion Patch
@sipe-team/checkbox Patch
@sipe-team/skeleton Patch
@sipe-team/divider Patch
@sipe-team/tooltip Patch
@sipe-team/button Patch
@sipe-team/switch Patch
@sipe-team/badge Patch
@sipe-team/input Patch
@sipe-team/radio Patch
@sipe-team/reset Patch
@sipe-team/card Patch
@sipe-team/flex Patch
@sipe-team/grid Patch
@sipe-team/side Patch
@sipe-team/typography Patch
@sipe-team/avatar Patch

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 15, 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: 8736e8ef-f846-47a7-9b35-550d2829b32d

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 fix/side-effects-jinho

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.

@Yeom-JinHo
Copy link
Copy Markdown
Member Author

Why ["**/*.css"]?

  • "sideEffects": false → 모든 import가 pure로 취급되어 미사용 import는 제거됨 (CSS 포함)
  • CSS import는 전역 스타일 주입이라는 명백한 side effect가 있으므로 예외 처리 필요
  • ["**/*.css"] glob으로 CSS만 보존하고 JS tree-shaking은 그대로 유지

참고:

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 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.

@G-hoon
Copy link
Copy Markdown
Collaborator

G-hoon commented Apr 15, 2026

  1. avatar, theme, chip 패키지가 changeset에 포함된 의도가 궁금합니다. 세 패키지 모두 package.json에 ./styles.css export가 없고 이번 PR diff에도 변경이 없어서요.

  2. typography가 changeset에서 빠진 것도 의도이신가요?
    packages/typography/package.json은 이번에 함께 수정됐는데 changeset에는 누락되어 있습니다!
    이러면 다음 릴리스에서 typography는 버전이 오르지 않을 것 같은데... 의도된 거라면 이유가 궁금합니다.

@Yeom-JinHo
Copy link
Copy Markdown
Member Author

  1. avatar, theme, chip 패키지가 changeset에 포함된 의도가 궁금합니다. 세 패키지 모두 package.json에 ./styles.css export가 없고 이번 PR diff에도 변경이 없어서요.
  2. typography가 changeset에서 빠진 것도 의도이신가요?
    packages/typography/package.json은 이번에 함께 수정됐는데 changeset에는 누락되어 있습니다!
    이러면 다음 릴리스에서 typography는 버전이 오르지 않을 것 같은데... 의도된 거라면 이유가 궁금합니다.

아주 좋은 리뷰이십니다!

changest changed package all을 눌러서 진행했는데,

  1. 3개의 파일은 chore: standardize catalog deps and chip package #210 여기서 changest 누락으로 포함되었네요 😢
  2. typo는 selectet 과정에서 누락된거 같습니다.

요거 방지할 방법을 연구해봐야겠네요 🤔

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.

아마 나머지 패키지들도 한번 버전업 다 시켜서 배포한번 돌려야할거같긴합니다.. ㅎㅎ

Copy link
Copy Markdown
Collaborator

@G-hoon G-hoon left a comment

Choose a reason for hiding this comment

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

코드 변경 자체는 문제없어 보여서 Approve 합니다!

changeset 관련해서 말씀하신 부분만 머지 전에 정리 부탁드립니다:

  • avatar, theme, chip → changeset에서 제거 (이번 PR diff에 변경 없음)

그 외 코드 LGTM 입니다.

@Yeom-JinHo Yeom-JinHo merged commit a5452a2 into dev/side-v2 Apr 19, 2026
4 checks passed
@Yeom-JinHo Yeom-JinHo deleted the fix/side-effects-jinho branch April 19, 2026 11:38
@froggy1014 froggy1014 mentioned this pull request Apr 26, 2026
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