jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.2k stars 505 forks source link

outdated storybook configuration with TSDX create #1188

Open FlynnHillier opened 2 months ago

FlynnHillier commented 2 months ago

Current Behavior

When creating a new bootstrapped project with npx tsdx create my-app TSDX installs the latest versions of @storybook/react (currently 8.0.9) and other @storybook dependencies. However, TSDX seems to configure the project to support an outdated version of storybook (I think version 6.x.x). As a result you are unable to use storybook from a freshly built tsdx project.

The project's storybook scripts also reference deprecated storybook scripts that are not installed by tsdx.

"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"

Expected behavior

Be able to run storybook from a fresh project created by tsdx create, without the need for re-configuration.

Suggested solution(s)

With an additional dependency @storybook/cli the storybook scripts should become:

"storybook": "sb dev -p 6006",
"build-storybook": "sb build"

Additional context

Similar to #1179, but re-opening because of storybook V8 release.

It would seem some users have had success running npx storybook@next automigrate in order to migrate the tsdx project to a compatible version of storybook. However, this did not work for me - it is also not really ideal to have to manually patch configuration hence the solution even if it works is not desirable.

Your environment

  System:
    OS: Windows 11 10.0.22631
    CPU: (28) x64 Intel(R) Core(TM) i7-14700K
    Memory: 13.15 GB / 31.78 GB
  Binaries:
    Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.21 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    tsdx: ^0.14.1 => 0.14.1 
    typescript: ^5.4.5 => 5.4.5