feat: add docs-extractor package for component documentation extraction#423
feat: add docs-extractor package for component documentation extraction#423MaxLee-dev wants to merge 87 commits intomainfrom
Conversation
- Implement SprinklesTypeIntrospector class to extract CSS values from the Sprinkles type generated by rainbow-sprinkles. - Introduce ExternalTypeChecker for identifying external types and properties. - Create PropsFilter to filter React special props and Sprinkles props based on criteria. - Develop TypeFormatter for formatting prop types, including handling render and className props. - Enhance TypeResolver to manage type resolution, including support for synthetic Sprinkles props. - Update PropertyDoc interface to include detailedType for formatted multi-line types. - Add Prettier as a dependency for type formatting.
… include variants
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @MaxLee-dev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 TypeScript 소스 코드에서 컴포넌트 문서를 자동으로 추출하는 새로운 패키지를 도입합니다. 이 패키지는 TypeScript AST를 활용하여 Props, JSDoc 주석, vanilla-extract variants 및 기본값에 대한 정보를 수집합니다. 추출된 데이터는 구조화된 JSON 파일로 생성되며, 이는 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
이 Pull Request는 컴포넌트 문서 자동 추출을 위한 @vapor-ui/docs-extractor 패키지를 추가하고, 이를 웹사이트에 통합하는 내용을 담고 있습니다. 새로운 패키지는 TypeScript AST를 분석하여 Props, Variants, JSDoc 등을 추출하는 핵심 기능을 제공하며, 이는 문서 유지보수 비용을 크게 줄일 수 있는 중요한 기능 개선입니다. 전반적으로 코드 구조가 잘 잡혀있고 모듈화가 잘 되어있습니다. 다만, 웹사이트에 적용된 일부 로직에서 코드 중복, 네이밍 컨벤션 불일치, 특정 케이스를 처리하지 못하는 문제 등이 발견되었습니다. 또한, 새 패키지의 Node.js 버전 요구사항이 저장소 스타일 가이드와 달라 통일이 필요해 보입니다. 아래에 자세한 리뷰 의견을 남겼습니다.
apps/website/src/components/component-props-table/component-props-table.tsx
Outdated
Show resolved
Hide resolved
apps/website/src/components/component-props-table/component-props-table.tsx
Outdated
Show resolved
Hide resolved
7cb0a9e to
b39bf6a
Compare
|
✅ All tests passed!
Click here if you need to update snapshots. |
…agePrimitive, and Root
…n extraction logic
…nd update README - Updated the package name from @vapor-ui/docs-extractor to @vapor-ui/ts-api-extractor in package.json. - Added a new README.md for the @vapor-ui/ts-api-extractor, detailing installation, usage, and configuration. - Removed outdated REFACTORING-SPEC.md and spec.md files. - Updated the example config file to reflect the new output directory structure. - Added integration tests for the CLI to ensure proper functionality and output. - Enhanced vitest configuration to include lcov for coverage reporting and set thresholds for code quality.
- Updated sprinkles-meta.json to include displayTypeName for each property. - Modified generate-sprinkles-meta.ts to map token paths to display type names. - Enhanced props-extractor.ts to utilize displayTypeName for sprinkles properties. - Added support for component-specific extract options in CLI. - Integrated jiti for loading TypeScript/JavaScript config files. - Updated tests to ensure output directory verification. - Improved tsup configuration for library and CLI builds.
- Implement tests for `findTsconfig` to ensure correct resolution of tsconfig.json files. - Add tests for `getDeclarationSourceType` and `isExternalDeclaration` to validate declaration source identification. - Create tests for `findStyleImports`, `findRecipeUsageInComponent`, and `parseRecipeDefaultVariants` to verify default variants handling in components. - Introduce tests for project management functions like `createProject`, `addSourceFiles`, and `getExportedNodes`. - Implement tests for `extractProps` to ensure accurate extraction of component props and their sorting. - Add tests for `findComponentFiles`, `normalizeComponentName`, and `findFileByComponentName` to validate component file discovery. - Create tests for type cleaning and simplification functions to ensure proper handling of complex types. - Add tests for `simplifyNodeModulesImports` to validate import path simplification. - Update `sprinkles-meta.json` fixture for consistency in tests.
…tructuringDefaults functions
- Introduced `prop-classifier.ts` for classifying props into categories such as required, variants, and state. - Added `prop-filter.ts` to filter props based on extraction options and extract documentation metadata. - Implemented `base-ui-type-resolver.ts` to resolve base-ui component types and map them to vapor-ui paths. - Created `declaration-source.ts` to determine the source of declarations and filter external symbols. - Developed `type-cleaner.ts` to simplify callback types and clean up type definitions. - Added `type-resolver.ts` to convert ts-morph Type objects into actual type strings, handling various TypeScript patterns. - Updated index and test files to reflect new module structure and imports.
…reorganized existing functions
Summary
@vapor-ui/docs-extractorpackage for automated component documentation extractionAvatar.Root,Dialog.Content)avatar/root.json)STRUCTURE.mddocumenting the package architecture