storybook [Bug]:在迁移通知中显示缺失的vite.config.js文件,但存在vite.config.ts文件

3hvapo4f  于 7个月前  发布在  其他
关注(0)|答案(2)|浏览(95)

描述问题

我有一个使用React/TypeScript/Vite的项目,已经添加了Storybook一段时间。现在我想升级依赖项,并根据storybook文档执行以下命令:

pnpm dlx storybook@latest upgrade

但是我从横幅中意识到迁移脚本无法在项目的根目录中定位到 vite.config.js 。这是准确的,因为我没有.js文件。相反,我有 vite.config 的TypeScript版本。
作为用户,我看到了这个横幅,并假设这个文件不存在于我的目录中。因此,如果这个横幅默认显示(无论用户是否有该文件),这是一个用户体验和设计问题。也许将其内容更清晰地描述在这个横幅中会更好。

复现链接

https://stackblitz.com/edit/github-f4sm7n

复现步骤

  • 无响应*

系统

Storybook Environment Info:

  System:
    OS: Windows 11 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
  Binaries:
    Node: 20.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.5.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.4 - ~\AppData\Local\pnpm\pnpm.EXE <----- active
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (126.0.2592.56)
  npmPackages:
    @storybook/addon-essentials: ^8.1.10 => 8.1.10
    @storybook/addon-interactions: ^8.1.10 => 8.1.10
    @storybook/addon-links: ^8.1.10 => 8.1.10
    @storybook/blocks: ^8.1.10 => 8.1.10
    @storybook/react: ^8.1.10 => 8.1.10
    @storybook/react-vite: ^8.1.10 => 8.1.10
    @storybook/test: ^8.1.10 => 8.1.10
    eslint-plugin-storybook: ^0.8.0 => 0.8.0
    storybook: ^8.1.10 => 8.1.10
    storybook-addon-remix-react-router: ^3.0.0 => 3.0.0

附加上下文

我使用的是storybook版本8.1.1,在运行升级脚本( pnpm dlx storybook@latest upgrade )时遇到了这个横幅。但在此期间,我的 package.json 文件发生了变化。

fv2wmkja

fv2wmkja1#

你好,@SinaKarimi7,我如何在给定的链接上复现?

vdzxcuhz

vdzxcuhz2#

Also note: the link referenced in this warning is not valid and leads to a 404:
https://storybook.js.org/docs/8.0/migration-guide/#missing-viteconfigjs-file
This is the right one, possibly?
https://storybook.js.org/docs/migration-guide/from-older-version#missing-viteconfigjs-file
But that page is not very helpful, it just links to
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#framework-specific-vite-plugins-have-to-be-explicitly-added
which itself seems to cover the required cases, but not in a "just do this to fix that warning" kind of way. It talks through adding framework plugins which sound like optional add-ons, not base features, leaving one wondering if you actually need to do it or not (since SB does run without it - will adding this file break me?)

相关问题