diff --git a/core/instrument/src/babel/csf-stories.ts b/core/instrument/src/babel/csf-stories.ts index 02e94db63..0d275f660 100644 --- a/core/instrument/src/babel/csf-stories.ts +++ b/core/instrument/src/babel/csf-stories.ts @@ -169,7 +169,7 @@ export const extractCSFStories = ( }); if (store.doc) { //@ts-ignore - store.doc.components = components; + store.doc.componentsLookup = components; } else { throw new Error(`stories should have one default export`); } diff --git a/core/instrument/src/babel/extract-component.ts b/core/instrument/src/babel/extract-component.ts index 6260304a7..6390d4229 100644 --- a/core/instrument/src/babel/extract-component.ts +++ b/core/instrument/src/babel/extract-component.ts @@ -84,8 +84,8 @@ export const extractStoreComponent = async ( ) => { if (store.doc) { const doc: Document = store.doc; - if (doc.components) { - const componentNames = Object.keys(doc.components); + if (doc.componentsLookup) { + const componentNames = Object.keys(doc.componentsLookup); if (componentNames) { for (const componentName of componentNames) { const { component, componentPackage } = await extractComponent( @@ -104,7 +104,7 @@ export const extractStoreComponent = async ( `${component.request ?? filePath}-${componentName}`, ); store.components[componentKey] = component; - doc.components[componentName] = componentKey; + doc.componentsLookup[componentName] = componentKey; } } } diff --git a/core/instrument/src/babel/mdx-stories.ts b/core/instrument/src/babel/mdx-stories.ts index b51c9697d..1e9d92b4c 100644 --- a/core/instrument/src/babel/mdx-stories.ts +++ b/core/instrument/src/babel/mdx-stories.ts @@ -171,7 +171,7 @@ export const extractMDXStories = (props: any) => ( const { title } = attributes; if (title) { const doc: Document = { - components: {}, + componentsLookup: {}, ...attributes, title, }; @@ -196,7 +196,7 @@ export const extractMDXStories = (props: any) => ( if (store.doc && store.doc.title) { //@ts-ignore - store.doc.components = components; + store.doc.componentsLookup = components; return store; } else { return undefined;