theKashey / storybook-include

Folder based storybook configuration for monorepos
MIT License
10 stars 2 forks source link

[Feature Request] Dynamic naming #3

Closed matthew-dean closed 2 years ago

matthew-dean commented 2 years ago

This is a great add-on for monorepos w/ decorators per package. However, it would also be great to be able to use this include strategy to dynamically change the title of components per package. e.g. rewrite:

export default {
  title: 'Alert'
}

to:

export default {
  title: 'Foo/Alert'
}

...based on the storybook-include settings.

matthew-dean commented 2 years ago

Oh, I noticed that in Storybook Add-ons, this is listed as Folder based storybook configuration.

Does that mean there's a way to configure Storybook fields like stories? Stories has a titlePrefix property there, for example. https://storybook.js.org/docs/react/configure/overview#with-a-configuration-object

theKashey commented 2 years ago

This is not something this plugin could do. I personally use https://github.com/atlassian-labs/babel-plugin-storybook-csf-title and it can prepend package name to a storyname with no time.

matthew-dean commented 2 years ago

Yeah, I was able to do this with titlePrefix at the root, so it works okay. Thanks!