Skip to content

Conversation

jonniebigodes
Copy link
Contributor

@jonniebigodes jonniebigodes commented Aug 9, 2025

Closes #

What I did

With this pull request, some of the CSF stories constructs were updated to align with the rest of the documentation and prevent misconceptions

What was done:

  • Fixed some of the examples to align with the rest of the documentation on their CSF story constructs

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

Greptile Summary

This PR standardizes CSF (Component Story Format) constructs across Storybook documentation snippets to align with modern TypeScript best practices and ensure consistency throughout the codebase. The changes focus on four documentation files that contain code examples used throughout the Storybook documentation.

The key improvements include:

  1. Modern TypeScript patterns: Updated examples to use the satisfies operator instead of explicit type annotations on meta objects, providing better type inference while maintaining type safety
  2. Consistent type derivation: Changed Story type definitions from StoryObj<typeof Component> to StoryObj<typeof meta> for better type consistency across story definitions
  3. Framework-specific examples: Added Angular-specific examples with proper component imports and type annotations to complement existing examples
  4. Standardized formatting: Unified comment formatting using arrow notation (👇) and consistent placement of export default meta declarations

These documentation snippets are used as reference examples throughout Storybook's documentation system. The updated patterns demonstrate current best practices that provide better TypeScript support and align with how modern Storybook applications should be structured. The changes ensure that developers copying these examples will use the most effective patterns available, preventing the propagation of outdated or suboptimal CSF constructs.

The affected files (play-function.md, my-component-skip-tags.md, my-component-include-tags.md, and my-component-exclude-tags.md) serve as template snippets that are likely referenced across multiple documentation pages, making this standardization effort particularly valuable for maintaining consistency across the entire documentation ecosystem.

Confidence score: 5/5

  • This PR is extremely safe to merge with virtually no risk of breaking changes
  • Score reflects documentation-only changes that improve consistency and modernize examples without affecting functionality
  • No files require special attention as these are purely documentation improvements

Context used:

Context - When documenting code snippets, ensure to include Svelte CSF and CSF examples, and also include JS and TypeScript variants. (link)

@jonniebigodes jonniebigodes self-assigned this Aug 9, 2025
@jonniebigodes jonniebigodes requested a review from kylegach as a code owner August 9, 2025 21:56
@jonniebigodes jonniebigodes added documentation patch:yes Bugfix & documentation PR that need to be picked to main branch ci:docs Run the CI jobs for documentation checks only. labels Aug 9, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Aug 9, 2025

View your CI Pipeline Execution ↗ for commit b1d992e

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 9s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-11 18:28:25 UTC

Copy link
Contributor

@kylegach kylegach left a comment

Choose a reason for hiding this comment

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

LGTM

@jonniebigodes jonniebigodes merged commit 737cabc into next Aug 11, 2025
8 checks passed
@jonniebigodes jonniebigodes deleted the docs_snippets_fix_incorrect_csf_constructs branch August 11, 2025 18:32
@ndelangen ndelangen changed the title Docs: Fix incorrect CSF constructs CSF: Fix incorrect CSF constructs Aug 20, 2025
ndelangen pushed a commit that referenced this pull request Aug 20, 2025
…t_csf_constructs

Docs: Fix incorrect CSF constructs
(cherry picked from commit 737cabc)
ndelangen pushed a commit that referenced this pull request Aug 21, 2025
…t_csf_constructs

Docs: Fix incorrect CSF constructs
(cherry picked from commit 737cabc)
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:docs Run the CI jobs for documentation checks only. documentation patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants