storybookjs / addon-styling

A base addon for configuring popular styling tools
MIT License
44 stars 10 forks source link

auto-configuration: don't duplicate addon registration #67

Open ShaunEvening opened 1 year ago

ShaunEvening commented 1 year ago

The auto configure script doesn't check to see if the addon already exists in the addon array before adding it again

dkario commented 1 year ago

Hi, I'm seeing the duplicate addon warning in a simple Storybook 7 set up with the @storybook/react-webpack5 framework and only '@storybook/addon-styling' in my addons array.

It looks like manager.ts, which includes the addons.register call, is getting included in two bundles that are both imported, so register is called twice. I can't figure out where each one is originally coming from. They each have different file contents since they have different imports that get inlined in the file. I see you followed the addon-kit template pretty closely too.

Screenshot 2023-08-04 at 5 25 49 PM Screenshot 2023-08-04 at 5 30 50 PM
ShaunEvening commented 1 year ago

Hey @dkario your issue pertains to #80, this is a to-do item, specifically for the codemod

dkario commented 1 year ago

Awesome, thanks for the update