docs: Add 2nd-gen TypeScript style guide and Storybook docs automation#6067
docs: Add 2nd-gen TypeScript style guide and Storybook docs automation#6067caseyisonit wants to merge 11 commits intomainfrom
Conversation
|
There was a problem hiding this comment.
this correctly keeps 1st-types working but closer to 1st-gen. this is the pattern for correcting 1st-gen types while maintaining code quality in 2nd-gen.
There was a problem hiding this comment.
Properly reflects the types patterns we are wanting to enforce, the key update with this is NEVER using s2 in any type declarations so we avoid breaking changes in the future to remove that
There was a problem hiding this comment.
implements the as const pattern that will aid in IDE support for allowed values
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
There was a problem hiding this comment.
script to auto generate contributor docs to mdx files and work in storybook. CONTRIBUTOR-DOCS remains the source of truth. ties in to yarn start/storybook so it runs when you spin up storybook
| ], | ||
| ], | ||
| 'Contributor docs', | ||
| // GENERATED:CONTRIBUTOR-DOCS-SORT - Do not edit manually. Run `yarn generate:contributor-docs` to update. |
There was a problem hiding this comment.
script generates a story sort based on the directory and file structure in CONTRIBUTOR-DOCS
| 2. **Zero-width non-joiner**: Added `⁠` (zero-width non-joiner) between label text and required asterisk icon to prevent text wrapping issues in internationalized content | ||
| 3. **Static color support**: Added support for `--staticBlack` and `--staticWhite` variants through the `staticColor` parameter | ||
|
|
||
| </details> |
There was a problem hiding this comment.
rogue closing tag that broke rendering
Description
Adds a comprehensive TypeScript style guide for 2nd-gen component development and automates publishing contributor docs to Storybook.
Motivation and context
Contributors (human and AI) need clear, consistent guidance for writing 2nd-gen components. This PR provides detailed conventions for file organization, class structure, decorators, types, and composition patterns—all based on the Badge component as the reference implementation.
Additionally, contributor docs are now automatically converted and displayed within Storybook, making them easier to discover and browse alongside component documentation.
Related issue(s)
Screenshots (if appropriate)
N/A - documentation changes
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Verify TypeScript guide renders correctly in Storybook
yarn storybookin2nd-gen/packages/swcVerify navigation structure is accurate
CONTRIBUTOR-DOCS/02_style-guide/02_typescript/README.mdDevice review
Summary of changes:
generate-contributor-docs.mjs