Repository navigation
Conversation
Docs examples were prose only, so they drifted from what the build
emits. packages/__tests__/docs-conformance.test.ts runs them through the
WASM codeExtract:
- An opted-in example ({/* conformance */} or {/* conformance: theme */}
before its tsx fence) must emit exactly the rules of the next css
fence, and the className values of a rendered tsx fence in between.
- Every row of the style props table and the selector table is checked
against the property or selector it documents.
- Every js/jsx/ts/tsx fence on every docs page must parse on its own.
Opted in: box, center, css, flex, grid, group-selector, input, text,
v-stack, breakpoints, colors, length and shadow. Fix what it found:
component defaults are emitted in @layer b, the css`` literal numbers
its classes differently, group hover sets background (not
background-color), rgb(255, 0, 0) becomes #F00 (not red), two
className lists were out of order, and two fences holding two files
are split. Breakpoints, colors, length and shadow gain the CSS output
of an example.
Refs #693 (DOC-25, DOC-26)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DOC-25 / DOC-26: 문서 예제가 실제 빌드 결과와 어긋나지 않도록 conformance 검사를 추가하고, 이 검사로 찾은 불일치를 고쳤습니다.
검사 (
packages/__tests__/docs-conformance.test.ts)bun test로 실행되며, 실제 WASMcodeExtract(singleCss, 비 debug)를 사용합니다. CI에서는 WASM 빌드가 있는publish검사 job의bun run test에서 그대로 돕니다.{/* conformance */}(또는 바로 위 json fence의theme을 쓰는{/* conformance: theme */})을 둔 예제만 검사합니다.@layer t)는 문서가 보여줄 때만 비교합니다.className목록도 비교합니다.<로 시작하면 fragment로 감쌉니다.첫 대상 페이지와 수정한 불일치
대상 페이지: box, center, css, flex, grid, group-selector, input, text, v-stack, breakpoints(responsive), colors, length, shadow(theme token)
@layer b안에 나옵니다. 출력 예시를 이에 맞추고 이유를 주석으로 적었습니다.a d b c)으로 고쳤습니다.background-color→ 실제 출력인background로 고쳤습니다.rgb(255, 0, 0)은red가 된다"는 설명을 실제 동작(#FF0000,#F00,rgb(255, 0, 0)은 모두#F00한 class, rgba는#FF000080)으로 고치고 출력 CSS를 추가했습니다.참고: 이번에 문서화하지 않은 동작
responsive 배열 안의 length / shadow token(
px={['8px', null, '$containerX']})은 현재 빌드에서var(--containerX)가 아니라 token의 첫 값(16px)이 리터럴로 들어갑니다. 문서는 "token at index 2"로 설명하고 Rust 단위 테스트도$containerX를 유지하는 것으로 기대합니다. 버그일 가능성이 높아서 해당 예제에는 마커를 달지 않았습니다. 별도로 확인이 필요합니다.landing 페이지만 바뀌었고 publish 대상 패키지 변경은 없어서 changepack은 추가하지 않았습니다.
Test plan
bun test packages/__tests__/docs-conformance.test.ts(421 pass): 수정 전에는 위 불일치들로 실패하는 것을 확인했습니다.bunx tsc --ignoreConfig --noEmit --strict ... packages/__tests__/docs-conformance.test.tspublishjob의bun run test통과Refs #693
🤖 Generated with Claude Code