rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[heft] update storybook plugin to be compatible with v9

Open UberMouse opened this issue 1 month ago • 0 comments

Summary

  1. updates the heft-storybook-plugin to be compatible with storybook v9, this only required adapting to the bin change from an object pointing at different files depending on whether doing a watch/package build, to a single binary file for both
  2. updates the storybook build samples to storybook v9, I mostly did this to try and reproduce an issue at our work rush monorepo around storybook and watch mode, which turned out to be related to the heft-rspack-plugin instead
  3. added support for detecting the --serve flag when using the heft-rspack-plugin via the same method as the webpack plugins

Details

3 is not done correctly, when adding a dependency on the heft-rspack-plugin to import the same types as the heft-webpack plugins I started getting the following typescript errors

ncountered 3 errors
 [build:typescript] /home/taylorl/code/rushstack/common/temp/default/node_modules/.pnpm/@[email protected]/node_modules/@rspack/core/dist/builtin-plugin/css-extract/index.d.ts:9:34 - (TS2304) Cannot find name 'HTMLLinkElement'.
 [build:typescript] /home/taylorl/code/rushstack/common/temp/default/node_modules/.pnpm/[email protected][email protected]/node_modules/webpack-dev-server/types/lib/Server.d.ts:1810:5 - (TS2717) Subsequent property declarations must have the same type.  Property 'devServer' must be of type 'DevServerConfiguration | undefined', but here has type 'DevServerConfiguration | undefined'.
 [build:typescript] /home/taylorl/code/rushstack/heft-plugins/heft-rspack-plugin/dist/heft-rspack-plugin.d.ts:13:10 - (TS2614) Module '"@rspack/core"' has no exported member 'rspackCore'. Did you mean to use 'import rspackCore from "@rspack/core"' instead?

I'm not really sure what is going on there, so I opted to just drop the dependency and work around the missing types. This was enough to generate a patch for our internal Rush monorepo which is what I am after.

How it was tested

Built the storybook sample project

Impacted documentation

I don't think so?

UberMouse avatar Dec 09 '25 01:12 UberMouse