Repository navigation
CLI: Find main.mts and main.cts configs in automigrations - #36538
Conversation
findConfigFile kept its own extension list, so for a main.mts project getStorybookData returned no mainConfigPath and every automigration that edits main skipped it. Use the shared storybookConfigExtensions, which also matches the loader's lookup order.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. Walkthrough
ChangesStorybook config lookup
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Automigrations can now discover main.mts and main.cts alongside other supported main configs. No material merge risk remains in the supplied changes. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #
What I did
Automigrations that edit the main config silently skip projects whose config is
main.mtsormain.cts.This PR makes the CLI find those configs the same way Storybook itself loads them.
findConfigFilekept its own extension list (ts, js, tsx, jsx, mjs, cjs), while Storybook loads configs with the sharedstorybookConfigExtensions, which also includes.mts,.cts,.mtsx, and.ctsx.For a
main.mtsprojectgetStorybookDatareturned nomainConfigPath, so every automigration that editsmaintreated the project as having none.In dxos, 127 of 131 configs are
main.mts.The lookup order now also matches the loader's.
Split out of #36476, which collected the bugs that running
storybook upgradeagainst ten open-source Storybook 10 monorepos turned up onnext.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
.storybook/main.mts, runnpx storybook@<canary> automigrate --yes.main(for exampleenable-experimental-review --yes) now updatemain.mtsinstead of skipping the project.Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake 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.🤖 Generated with Claude Code