Core: Improve path handling in arg types data extraction#33536
Conversation
…support absolute paths
|
View your CI Pipeline Execution ↗ for commit 9c4b46d
☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 9c4b46d ☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 9c4b46d
☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughModifies the React preset's path resolution logic to conditionally check if a component file path is absolute before prepending the project root, preventing double-prefixing of already absolute paths. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (4)**/*.{js,jsx,ts,tsx,json,md,html,css,scss}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{js,jsx,json,html,ts,tsx,mjs}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (2)📚 Learning: 2025-10-01T15:24:01.060ZApplied to files:
📚 Learning: 2025-12-22T22:03:40.123ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting Comment |
Closes #
What I did
The argtypes data extraction is called from multiple places, both the Storybook UI and Vitest plugin. Through the UI, the paths are not absolute, and through the Vitest plugin they are. So this fix makes sure to normalize the path if needed.
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!
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.tsMake 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 pull request has been released as version
0.0.0-pr-33536-sha-9c4b46d4. Try it out in a new sandbox by runningnpx storybook@0.0.0-pr-33536-sha-9c4b46d4 sandboxor in an existing project withnpx storybook@0.0.0-pr-33536-sha-9c4b46d4 upgrade.More information
0.0.0-pr-33536-sha-9c4b46d4yann/fix-ghost-stories-flow9c4b46d41768399488)To request a new release of this pull request, mention the
@storybookjs/coreteam.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=33536Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.