reg-viz / storycap

A Storybook Addon, Save the screenshot image of your stories :camera: via puppeteer.
https://www.npmjs.com/package/storycap
MIT License
694 stars 89 forks source link

Drop legacy Storybook (<= v6) support #860

Closed Quramy closed 3 months ago

Quramy commented 3 months ago

Motivation

Storycap current version(= v4.3.x) switches dependent module between @storybook/addon and @storybook/preview-api like this:

https://github.com/reg-viz/storycap/blob/237a78176b7c7493d2fc61201c9a97191f6aaaf9/packages/storycap/src/client/with-screenshot.ts#L2-L9

But this is so "hacky" and fragile to maintain because this depends on some bundlers(e.g. webpack or rollup) module resolver implementation.

If we drop Storybook v6 support, we can eliminate this differential require expression and can use import { makeDecorator } from "@storybook/preview-api".

To @indigolain

Thank you for taking the time to discuss this problem.