MCPcopy Create free account
hub / github.com/FormidableLabs/react-live / loadStories

Function loadStories

packages/react-live/stories/load.ts:26–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 * adding a `*.stories.tsx` file puts it in the sidebar and under test together.
25 */
26export const loadStories = (): LoadedStory[] => {
27 const modules = import.meta.glob<StoryModule>("./*.stories.tsx", {
28 eager: true,
29 });
30
31 return Object.entries(modules).flatMap(([path, mod]) => {
32 const group = mod.title ?? path;
33 return Object.entries(mod).flatMap(([name, value]) =>
34 isStory(value) ? [{ ...value, id: `${group}/${name}`, group, name }] : [],
35 );
36 });
37};

Callers 2

main.tsxFile · 0.90

Calls 1

isStoryFunction · 0.85

Tested by

no test coverage detected