Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: storybook@latest upgrade is not idempotent and misleading #30496

Open
ianzone opened this issue Feb 7, 2025 · 1 comment
Open

[Bug]: storybook@latest upgrade is not idempotent and misleading #30496

ianzone opened this issue Feb 7, 2025 · 1 comment

Comments

@ianzone
Copy link

ianzone commented Feb 7, 2025

Describe the bug

When it runs, it

  • found a 'viteConfigFile' migration, but there exists a vite.config.ts
  • found a 'github-flavored-markdown-mdx' migration, but there is no markdown under src/
  • found a 'autodocsTrue' migration, but it's contradicted with the 'autodocs-tags' migration

Reproduction link

https://github.com/ianzone/react-storybook

Reproduction steps

  1. clone https://github.com/ianzone/react-storybook
  2. bun i
  3. bunx storybook@latest upgrade

System

Storybook Environment Info:

  System:
    OS: Linux 5.15 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-13800H
    Shell: 5.9 - /home/linuxbrew/.linuxbrew/bin/zsh
  Binaries:
    Node: 22.13.1 - /home/linuxbrew/.linuxbrew/opt/node@22/bin/node
    Yarn: 1.22.22 - /home/linuxbrew/.linuxbrew/bin/yarn
    npm: 10.9.2 - ~/templates/react-storybook/node_modules/.bin/npm
    pnpm: 10.2.0 - /home/linuxbrew/.linuxbrew/bin/pnpm
  npmPackages:
    @storybook/addon-a11y: ^8.5.3 => 8.5.3
    @storybook/addon-coverage: ^1.0.5 => 1.0.5
    @storybook/addon-essentials: ^8.5.3 => 8.5.3
    @storybook/addon-interactions: ^8.5.3 => 8.5.3
    @storybook/addon-links: ^8.5.3 => 8.5.3
    @storybook/blocks: ^8.5.3 => 8.5.3
    @storybook/react: ^8.5.3 => 8.5.3
    @storybook/react-vite: ^8.5.3 => 8.5.3
    @storybook/test: ^8.5.3 => 8.5.3
    @storybook/test-runner: ^0.21.0 => 0.21.0
    chromatic: ^11.25.2 => 11.25.2
    storybook: ^8.5.3 => 8.5.3

Additional context

No response

Copy link
Contributor

greptile-apps bot commented Feb 7, 2025

** Disclaimer** This information might be inaccurate, due to it being generated automatically
This appears to be related to the upgrade command's migration detection logic. The specific issues can be addressed by: 1. For viteConfigFile migration: Add a check in the migration detection to verify if the found config file is actually a Vite config by checking its contents/exports. 2. For github-flavored-markdown-mdx: The migration detection should be updated to only trigger if .md/.mdx files exist in any directory that's included in the Storybook configuration's stories patterns, not just src/. 3. For autodocsTrue and autodocs-tags conflict: These migrations should be made mutually exclusive in the upgrade logic. The autodocs-tags migration should take precedence if both conditions are met. The relevant code would be in the automigrations system, likely under the code/lib/cli/src/automigrate directory.

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Edit Issue Bot Settings · Greptile

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

No branches or pull requests

1 participant