Open Bug 1829420 Opened 1 year ago Updated 3 months ago

Update main.js in Storybook to search for stories in more locations

Categories

(Toolkit :: UI Widgets, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: tgiles, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [recomp])

Currently, Storybook will only display stories if they appear in the following locations:

While we have a note describing how to update the stories array if you want to create stories next to your existing code, it would probably be more beneficial if we modified our stories array to search for more potential locations. It also looks like we could simplify our stories array by doing the previous.

As a proof of concept, I went ahead and added the following lines to the beginning of the stories array:

  • ${projectRoot}/toolkit/**/*.stories.@(js|jsx|mjs|ts|tsx|md)
  • ${projectRoot}/browser/**/*.stories.@(js|jsx|mjs|ts|tsx|md)

but this resulted in a ton of errors about "Field 'browser' doesn't contain a valid alias configuration". I haven't worked in Storybook configs enough to understand this error, but this seems like the big hurdle in getting this change to land.

We should also ensure the stories located outside of toolkit/content/widgets get the "Domain-Specific UI Widgets" designation if the story file happens to be a Markdown file. I'm not sure of a way to get the export default { title: "" } functionality in a Markdown file, might need to be another bug to determine how to get the markdown files to adjust accordingly.

Whiteboard: [fidefe-reusable-components]
See Also: → 1844170
Blocks: 1844862
Whiteboard: [fidefe-reusable-components] → [recomp]
You need to log in before you can comment on or make changes to this bug.