Skip to content

Core: Limit stories glob in CSF factories codemod to only match js/ts files#33594

Closed
ghengeveld wants to merge 1 commit into
nextfrom
csf-factories-stories-glob
Closed

Core: Limit stories glob in CSF factories codemod to only match js/ts files#33594
ghengeveld wants to merge 1 commit into
nextfrom
csf-factories-stories-glob

Conversation

@ghengeveld
Copy link
Copy Markdown
Member

@ghengeveld ghengeveld commented Jan 20, 2026

What I did

In order to prevent errors while running the CSF factories codemod, this prevents the default stories glob from matching against CSS, MDX and template files, among others.

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

Caution

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 publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Improved the default file pattern suggestion in the story migration prompt to be more selective, reducing unnecessary file scanning and providing better default behavior when migrating stories.

✏️ Tip: You can customize this high-level summary in your review settings.

@ghengeveld ghengeveld added bug ci:merged Run the CI jobs that normally run when merged. labels Jan 20, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Jan 20, 2026

View your CI Pipeline Execution ↗ for commit 431ab52

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ✅ Succeeded 11m 45s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-20 07:56:15 UTC

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

Updated the default glob pattern in a CSF factories codemod from **/*.stories.* to **/*.stories.@(js|jsx|mjs|ts|tsx) to restrict matching to common JavaScript and TypeScript story file extensions, affecting only the initial prompt value.

Changes

Cohort / File(s) Summary
Glob pattern restriction
code/lib/cli-storybook/src/codemod/csf-factories.ts
Changed default glob pattern from overly broad **/*.stories.* to explicit extension list `**/*.stories.@(js

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@storybook-app-bot
Copy link
Copy Markdown

Package Benchmarks

Commit: 431ab52, ran on 20 January 2026 at 07:52:15 UTC

The following packages have significant changes to their size or dependencies:

@storybook/nextjs

Before After Difference
Dependency count 538 538 0
Self size 646 KB 646 KB 🎉 -10 B 🎉
Dependency size 59.22 MB 59.28 MB 🚨 +58 KB 🚨
Bundle Size Analyzer Link Link

@storybook/nextjs-vite

Before After Difference
Dependency count 127 127 0
Self size 1.12 MB 1.12 MB 🚨 +14 B 🚨
Dependency size 21.82 MB 21.87 MB 🚨 +49 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 159 159 0
Self size 30 KB 30 KB 🚨 +8 B 🚨
Dependency size 23.00 MB 23.17 MB 🚨 +164 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 117 117 0
Self size 35 KB 35 KB 🎉 -26 B 🎉
Dependency size 19.62 MB 19.66 MB 🚨 +49 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react-webpack5

Before After Difference
Dependency count 278 278 0
Self size 24 KB 24 KB 🎉 -10 B 🎉
Dependency size 44.13 MB 44.19 MB 🚨 +58 KB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 183 183 0
Self size 775 KB 775 KB 🚨 +158 B 🚨
Dependency size 67.38 MB 67.46 MB 🚨 +79 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 176 176 0
Self size 30 KB 30 KB 🎉 -4 B 🎉
Dependency size 65.95 MB 66.03 MB 🚨 +79 KB 🚨
Bundle Size Analyzer Link Link

@storybook/react

Before After Difference
Dependency count 57 57 0
Self size 732 KB 781 KB 🚨 +49 KB 🚨
Dependency size 12.94 MB 12.94 MB 🚨 +409 B 🚨
Bundle Size Analyzer Link Link

@ghengeveld
Copy link
Copy Markdown
Member Author

Closing in favor of #33592

@ghengeveld ghengeveld closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ci:merged Run the CI jobs that normally run when merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants