I'm trying to add the current version of a project (essentially the version
field from package.json
) to storybook so consumers of storybook can tell which version of the project they are looking at. However, I am finding it extremely difficult to do this, I haven't been able to find a way to do it in the config file, and haven't seen any addons that will simply show the current version of the project (other than one that is more made for showing how components have changed over versions, which isn't really what I'm after).
It's easy enough to require the package.json
file in a js file, and grab the version from there, but storybook seems pretty locked down in terms of allowing you to send any addition information to the header/sidebar.
Has anybody done anything like this before? I'd be grateful for any thoughts or theories on how this could be done. Thanks!