Vue3-Vite: Allow paths in docgen tsconfig option#32310
Conversation
Relative paths are perfectly valid here because it's resolved into a path using path.join at https://github.com/storybookjs/storybook/blob/6ee3f61be916c708e8e4c6629afbd866f13f0500/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts#L179.
|
View your CI Pipeline Execution ↗ for commit a20da40
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: No significant changes detected, all good. 👏 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe TypeScript type definition for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 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 |
What I did
I changed docgen tsconfig option to accept relative paths. They are perfectly valid here because it's resolved into a path using path.join at
storybook/code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts
Line 179 in 6ee3f61
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Verify that paths:
and filenames:
are not reported by TypeScript as errors. No runtime code was changed so nothing else is affected.
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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam 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 fixes a TypeScript type definition issue in the Vue3-Vite framework configuration. The change updates the
tsconfigoption type incode/frameworks/vue3-vite/src/types.tsto accept relative paths in addition to filenames.The existing type definition only allowed patterns like
tsconfig${string}.json, which meant configurations with relative paths (likenuxt-app/.nuxt/tsconfig.app.json) would cause TypeScript errors despite working correctly at runtime. The runtime implementation invue-component-meta.tsalready supports relative paths by usingpath.join(projectRoot, tsconfigPath)to resolve the full path.The fix expands the template literal type from
\tsconfig${string}.json`to`${string}/tsconfig${string}.json` | `tsconfig${string}.json``, allowing both:nuxt-app/.nuxt/tsconfig.app.jsontsconfig.app.jsonThis change aligns the TypeScript type system with the actual runtime behavior, maintaining backward compatibility while enabling more flexible configuration options. The documentation comment was also updated to clarify that paths are resolved relative to the project root.
Confidence score: 5/5
Summary by CodeRabbit
Release Notes