Skip to content

Vue3-Vite: Allow paths in docgen tsconfig option#32310

Merged
valentinpalkovic merged 2 commits into
storybookjs:nextfrom
Thomaash:next
Mar 11, 2026
Merged

Vue3-Vite: Allow paths in docgen tsconfig option#32310
valentinpalkovic merged 2 commits into
storybookjs:nextfrom
Thomaash:next

Conversation

@Thomaash
Copy link
Copy Markdown
Contributor

@Thomaash Thomaash commented Aug 21, 2025

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

const projectTsConfigPath = join(projectRoot, tsconfigPath);
anyway.

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

Verify that paths:

export default {
  framework: {
    name: "@storybook-vue/nuxt",
    options: {
      docgen: {
        plugin: "vue-component-meta",
        tsconfig: "nuxt-app/.nuxt/tsconfig.app.json",
      },
    },
  },
};

and filenames:

export default {
  framework: {
    name: "@storybook-vue/nuxt",
    options: {
      docgen: {
        plugin: "vue-component-meta",
        tsconfig: "tsconfig.app.json",
      },
    },
  },
};

are not reported by TypeScript as errors. No runtime code was changed so nothing else is affected.

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 fixes a TypeScript type definition issue in the Vue3-Vite framework configuration. The change updates the tsconfig option type in code/frameworks/vue3-vite/src/types.ts to accept relative paths in addition to filenames.

The existing type definition only allowed patterns like tsconfig${string}.json, which meant configurations with relative paths (like nuxt-app/.nuxt/tsconfig.app.json) would cause TypeScript errors despite working correctly at runtime. The runtime implementation in vue-component-meta.ts already supports relative paths by using path.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:

  • Path patterns: nuxt-app/.nuxt/tsconfig.app.json
  • Filename patterns: tsconfig.app.json

This 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

  • This PR is safe to merge with minimal risk as it only fixes a type definition mismatch
  • Score reflects a simple, well-understood change that aligns types with existing runtime behavior
  • No files require special attention as this is a straightforward type fix

Summary by CodeRabbit

Release Notes

  • New Features
    • Vue component meta plugin configuration now supports both direct and nested TypeScript configuration file paths.

Copy link
Copy Markdown
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.

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Aug 21, 2025

View your CI Pipeline Execution ↗ for commit a20da40

Command Status Duration Result
nx run-many -t build -c production --parallel=3 ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-01 09:13:17 UTC

@valentinpalkovic valentinpalkovic changed the title fix(vue3-vite): allow paths in docgen tsconfig option Vue3-Vite: Allow paths in docgen tsconfig option Mar 11, 2026
@valentinpalkovic valentinpalkovic moved this to In Progress in Core Team Projects Mar 11, 2026
@storybook-app-bot
Copy link
Copy Markdown

storybook-app-bot Bot commented Mar 11, 2026

Package Benchmarks

Commit: adf45e5, ran on 11 March 2026 at 12:34:32 UTC

No significant changes detected, all good. 👏

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc05da22-f99a-483a-9f7e-1af4ee64b7b8

📥 Commits

Reviewing files that changed from the base of the PR and between 56a530e and adf45e5.

📒 Files selected for processing (1)
  • code/frameworks/vue3-vite/src/types.ts

📝 Walkthrough

Walkthrough

The TypeScript type definition for the vue-component-meta plugin's tsconfig configuration field is expanded from a single string literal pattern to a union type, permitting both root-level and nested tsconfig file paths.

Changes

Cohort / File(s) Summary
Type Definition Update
code/frameworks/vue3-vite/src/types.ts
Modified the tsconfig field in the FrameworkOptions type to accept a union of two patterns: tsconfig${string}.json or ${string}/tsconfig${string}.json, allowing both root-level and nested path configurations.

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.

❤️ Share

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants