Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to pass micromatch options when configuring story loading #15913

Closed
brandonferrua opened this issue Aug 25, 2021 · 5 comments
Closed

Comments

@brandonferrua
Copy link

Is your feature request related to a problem? Please describe
I have a need to parse out documentation stories within a monorepo. Due to our monorepo structure, matching the glob pattern is adding complexity to parse the stories I want to showcase in our documentation. Per https://storybook.js.org/docs/react/configure/overview#configure-story-loading it does not seem possible to pass in micromatch options into the configuration, even though it's using micromatch to parse the files behind the scenes.

Describe the solution you'd like
The ability to pass in an object with micromatch options to the stories key.

module.exports = {
  stories: {['../src/**/*.stories.@(js|mdx)'], options},
}

Describe alternatives you've considered
I can get the paths of all story files and then build my own filtered array using #11181 (comment). Though it seems like I'm just recreating this feature request at that point?

Are you able to assist to bring the feature to reality?
no

@shilman
Copy link
Member

shilman commented Aug 31, 2021

what options do you want to provide?

@brandonferrua
Copy link
Author

We currently have a need for the ignore option to be passed into micromatch. Could it just accept an object with any of the micromatch options? Would be happy with just ignore though.

@dannyhw
Copy link
Member

dannyhw commented Sep 3, 2021

By chance I was looking at this today and from what I can tell micromatch is only used to generate a regex that is used in a require.context. I don't think passing micromatch options would work unless the options are specific to the makeRe function (the makeRe function doesn't have the ignore option).

I could be wrong but the only reference I found to micromatch is this one, so that's what I based this observation on.
https://github.com/storybookjs/storybook/blob/master/lib/core-common/src/utils/to-require-context.ts

D1no added a commit to hundertschaft/flywheel that referenced this issue Mar 6, 2023
…ook recursively sourcing symlinked workspace components.

Added note to .storybook/main.ts

Related to Issues:
storybookjs/storybook#15913
storybookjs/storybook#11181
@shilman
Copy link
Member

shilman commented Jun 17, 2023

Partially addressed by #22873

@shilman
Copy link
Member

shilman commented Jun 17, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if this is still relevant in SB 7.x.

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants