在Storybook 7.0中,我们引入了概念Frameworks,它包括完全指定的故事书配置,如渲染器(例如preact
)、构建器(例如vite
)和其他一些预设。
我们最近更新了CLI以处理这种新结构在sb init
/sb repro
/等中的新代码。然而,当找不到与用户配置匹配的框架时,新代码会抛出错误。相反,它应该具有一些回退行为,待定。这种行为应与即将设计的“框架弹出”功能保持一致。
建议
core: {
builder: 'builder-name',
renderer: 'renderer-name',
}
为了支持这一点,我们需要添加对新字段core.renderer
的支持,该字段实际上是另一个插件放置在addons
的内容之前(就像framework
已经实现一样)。core.builder
已经得到支持。
6条答案
按热度按时间wgxvkvu91#
In cases where there isn't a predefined version, perhaps the CLI can ask the user to eject their own custom pair of renderer & builder?
8wigbo562#
有任何机会它会被修复吗?
oxiaedzo3#
对于任何在此工作的人,用户最终会出现以下错误信息:
Sorry, for now, you can not do this, please use a framework such as @storybook/react-webpack5
这里是位置:baseGenerator。我们应该尝试让CLI更具交互性,就像Dom在上面提出的建议一样!
w1e3prcc4#
你好,大家好!👋感谢你们在CLI错误中提到这个问题。目前有没有一种临时的解决方法?
我在一个干净的vite应用中看到了这个问题:
如果需要的话,这是仓库链接:https://github.com/9mbs/connect-readme/tree/main/workspaces/components
b0zn9rqh5#
嘿,@9mbs,你能试一下
npx storybook@latest init
吗?配置应该能自动检测到,或者你会收到一个提示,所以不再需要传递--builder
了。你还能告诉我在哪里得到npx sb init --builder @storybook/builder-vite
命令的吗?6yt4nkrj6#
Yowza!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.12 containing PR #22559 that references this issue. Upgrade today to the
@latest
NPM tag to try it out!