figma / code-connect

A tool for connecting your design system components in code with your design system in Figma
MIT License
486 stars 44 forks source link

`publish` command error caused by Storybook params #25

Open majouji opened 4 weeks ago

majouji commented 4 weeks ago

Trying to publish a sample component and I’m getting the following error for multiple components (not the component I’m trying to publish, but colocated components in the parent directory:

Error parsing story /Users/ramy/GitHub/metal-design-system/packages/component-library/src/components/Banner/Banner.stories.tsx: ParserError: "url" property not found in "design" object in story metadata
 -> /Users/ramy/GitHub/metal-design-system/packages/component-library/src/components/Banner/Banner.stories.tsx:154:11

The url prop is present and filled in the story file, but it’s pointing to an object in a different file, like so (we keep all the links in one place for Storybook for easier updating):

export default {
  component: Banner,
  decorators: [colorModeDecorator(), paddingDecorator()],
  parameters: {
    chromatic: { viewports: chromaticViewportParameters() },
    design: {
      type: "figma",
      url: FigmaLinks.web.v1.Banner,
    },
  },
};

Guessing this is some kind of conflict with the design add-on?

It’s also unclear to me why it’s trying to do anything with those files since I don’t have a .figma.tsx file for those. I’m only trying to publish one component but it’s returning this error for many unrelated components.

Happy to provide more details here!

ptomas-figma commented 3 weeks ago

Thanks for reaching out. The storybook parser checks for any usage of design.url in story files, but, unfortunately, we only parse strings for the url field at the moment.