Skip to content

docs(www): render workspace components in Docusaurus and document Accordion - #297

Merged
Yeom-JinHo merged 3 commits into
devfrom
docs/accordion-docs-jinho
Jul 21, 2026
Merged

docs(www): render workspace components in Docusaurus and document Accordion#297
Yeom-JinHo merged 3 commits into
devfrom
docs/accordion-docs-jinho

Conversation

@Yeom-JinHo

Copy link
Copy Markdown
Member

Changes

문서 사이트에는 워크스페이스 컴포넌트를 렌더할 경로가 아예 없었습니다: www@sipe-team/* 의존성을 하나도 선언하지 않았고, 워크스페이스 exports는 raw src/*.ts로 해석되어 webpack이 그대로 소비할 수 없습니다 (vanilla-extract .css.ts 포함). 이 PR은 그 경로를 처음부터 구축하고, Accordion을 파일럿 문서로 완성합니다. 이 문서는 나머지 컴포넌트로 확산할 표준 템플릿을 겸합니다.

렌더 경로

  • @sipe-team/{accordion,button,icon}을 각 패키지의 빌드된 dist로 webpack alias. build:deps(dev/build/pretypecheck에 체이닝)가 webpack 실행 전에 dist를 위상 순서로 빌드하도록 강제 — 깨끗한 클론에서 수동 사전 빌드 없이 빌드됩니다.
  • tokens는 alias하지 않음 (dist JS에 런타임 import가 남지 않음, CSS만 필요).

Preview 프리미티브

  • children을 서버에서 무조건 렌더하고 code를 "Show code" 토글로 펼칩니다. react-live·BrowserOnly 없음 — 하이드레이션 후에만 나타나는 예제는 SSR 렌더를 증명하지 못하기 때문입니다.
  • CSS Modules + Docusaurus --ifm-* 변수만 사용 (Tailwind 없음). 중립 컨테이너로 accordion의 다크 전용 표면을 감쌉니다.

accordion.mdx

  • Installation / Usage / Examples / Anatomy / API Reference
  • API 표는 소스를 직접 읽고 수동 작성 — props 자동 추출 도구를 쓰지 않으므로 packages/를 건드리지 않습니다. 존재하지 않는 prop(disabled, defaultValue)은 문서화하지 않고, 실제 API(type, initialValue, value/onValueChange, defaultOpen, asChild)만 기술합니다.

_TEMPLATE.md — 고정 섹션 순서/제목 + Preview 사용법 + "API 표 수동 작성, 존재하지 않는 prop 금지" 규칙.

Visuals

스크린샷 2026-07-19 오후 7 27 22

참고: Accordion은 현재 색상을 하드코딩(#1a202c)해 다크 전용이라, 라이트 문서 위에 다크 카드로 표시됩니다. Preview의 중립 컨테이너로 시각적 충돌을 완화했습니다. 이는 컴포넌트의 현재 상태이며 Known limitations에 명시돼 있습니다.

Checklist

  • Have you written the functional specifications? — 문서 자체가 명세. _TEMPLATE.md에 확산 규칙 포함

Additional Discussion Points

⚠️ customCss 배열 순서는 load-bearing입니다 (건드리지 마세요).
tokensCss는 반드시 컴포넌트 스타일시트 뒤에 와야 합니다. cssnano(프로덕션 빌드에서만 실행)가 빈 @layer theme;와 내용 있는 @layer theme { … }를 중복으로 보고 마지막 것을 남기는데, vanilla-extract는 tokens contract 기반 스타일시트마다 상단에 빈 @layer theme;를 방출합니다. 토큰을 앞에 두면 Button의 빈 선언이 --side-* 브릿지를 덮어써서 프로덕션 번들에서 브릿지가 통째로 사라지고, 빌드는 exit 0으로 통과하며, dev 서버는 압축을 안 해 이를 숨깁니다. 실측: 토큰 먼저 → --side-* 정의 0개 / 토큰 나중 → 65개. 설정 파일에 긴 주석으로 경고를 남겨뒀습니다.

Yeom-JinHo and others added 2 commits July 19, 2026 19:09
…ordion

The docs site had no path for rendering a workspace component: www declared no
@sipe-team dependency, and workspace `exports` resolves to raw `src/*.ts`, which
webpack cannot consume. Add the vanilla-extract webpack plugin so Docusaurus
compiles the packages' `.css.ts` from source — docs pages import @sipe-team/*
directly, with no prebuilt dist, alias table, CSS injection, or build ordering.
Adding a component is then just a www dependency plus its MDX page.

- add Preview: renders children server-side with a "Show code" toggle. No
  react-live, no BrowserOnly — an example that only appeared after hydration
  would not prove the component server-renders
- accordion.mdx with hand-written prop tables read off the source. No prop
  extraction, so packages/ stays untouched
- _TEMPLATE.md fixes the five core sections; Accessibility and Known
  limitations are optional trailing sections a component adds when warranted

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dark-only components landed as a dark card floating on a light neutral frame,
which read as a broken render. Add an opt-in `theme="dark"` to Preview that
swaps the stage to a dark canvas, so the example reads as deliberate; the
Accordion examples use it. Also compact the stage padding and fold the
"Show code" toggle into the card as a left-aligned footer instead of a
floating right-aligned button.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e55fcc9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

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: 2852df54-69c5-4ced-a298-a514ddd2ec9d

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 docs/accordion-docs-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.

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

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.

@Yeom-JinHo Yeom-JinHo changed the title docs(www): Docusaurus에서 워크스페이스 컴포넌트 렌더 + Accordion 문서 docs(www): render workspace components in Docusaurus and document Accordion Jul 19, 2026

@3o14 3o14 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

고생하셨습니다 진호님!

#283 에서 작성하셨던 www/scripts/extract-props.mjs 만 같이 적용해보는건 어떨까요?

컴포넌트 개수가 적긴 하지만 유지보수 인원이 변동적이다 보니 컴포넌트 API 변경 발생할 때마다 문서 드리프트가 무조건 예상되어서.. Prop만이라도 추출하는 방식은 어떨까 싶어요

description은 JSDoc으로 추출되도록 하면 될 것 같아요

@Yeom-JinHo

Copy link
Copy Markdown
Member Author

@3o14 문서 드리프트 가능성에는 100% 공감합니다.
다만, 지금 #283 내용을 붙이는건 보류하는게 좋을꺼 같습니다.

  • compound 미대응: 스크립트가 파일 첫 컴포넌트 1개만 추출해서, 파일럿인 Accordion(Root/Item/Trigger/Content 4개)이 1개만 잡혀요. icon(파일 없음)·radio(별도 파일)·checkbox(객체)도 안 잡히고요ㅠㅠ.

  • description 부재: JSDoc이 달린 건 icon뿐이라 지금 추출하면 설명이 전부 공백입니다.

이번엔 수동으로 파일럿을 확정하여 docs를 채우고 다음 phase로 자동화 flow 구축을 재검토해보겠습니다!

@3o14 3o14 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

넵 추후에 script, JSDoc 보강해서 반영되면 좋겠네용

@3o14

3o14 commented Jul 21, 2026

Copy link
Copy Markdown
Member

아! 그리고 SIDE 문서 보시는 분들 중엔 외국인은 없을 것 같아서,
문서 내용은 한글로 작성하는게 어떨까 싶어요! 다른 분들 의견도 궁금합니다

* docs(www): document Button and make the token chain survive production

Button is the only component that reads `vars`, so it's the first to need the
Style Dictionary value layer — and it exposed a production-only break: every
`var(--side-*)` resolved to nothing while dev worked and hid it.

Root cause: under source compilation the token bridge was emitted twice — once
by the injected `@sipe-team/tokens/styles.css`, and again by vanilla-extract
recompiling tokens' `themes.css.ts` through Button's `vars` import. Docusaurus's
advanced cssnano collapses the duplicated `@layer theme { … }` to a bare
`@layer theme;`, stripping the whole bridge.

Fix:
- alias `@sipe-team/tokens` to its built dist so its theme is compiled once
  (via `build:tokens`); the bridge now has a single copy and full CSS
  minification stays on. Components still compile from source
- inject `@sipe-team/tokens/styles.css` for the Style Dictionary value layer
  (`--color-*` etc.), which is not vanilla-extract and can't come from source

button.mdx documents variant/size/leftIcon/rightIcon/asChild from source, with
hand-written prop tables. packages/ is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(www): sharpen Button captions, fix Back arrow, clarify disabled example

- Variant/Size captions now say when to reach for each option instead of just
  restating the names, matching the accordion pilot's teaching tone
- the "With icons" example pointed a right chevron at "Back"; split the inline
  icon into ArrowLeft/ArrowRight so Back points left and Next points right
- the Disabled example showed two identical unlabelled buttons; label them
  Fill/Outline and note that disabled styling is uniform across variants, so the
  sameness reads as an intentional demonstration rather than a mistake

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Yeom-JinHo

Copy link
Copy Markdown
Member Author

@3o14 님이 주신 의견 다들 어떠신지 남겨주시면 감사할꺼 같습니다~~
일단 진행하고 결정되면 추후에 한번에 언어 전환하겠습니다!

@Yeom-JinHo

Copy link
Copy Markdown
Member Author

#298 그냥 머지해버려서 여기 일반머지로 밀어넣을게용~!

@Yeom-JinHo
Yeom-JinHo merged commit 1796e74 into dev Jul 21, 2026
6 checks passed
@Yeom-JinHo
Yeom-JinHo deleted the docs/accordion-docs-jinho branch July 21, 2026 11:19
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.

2 participants