daniel-ac-martin / NotGovUK

An implementation of the GOV.UK Design System in React that provides support for writing internal applications in addition to public ones.
https://not-gov.uk/
MIT License
27 stars 8 forks source link

Storybook is broken in generated projects #991

Open daniel-ac-martin opened 3 months ago

daniel-ac-martin commented 3 months ago

See: https://gist.github.com/easternbloc/73a60ade964215ab342d029a3405f541

Thanks to @easternbloc for pointing this out.

Basically, https://github.com/daniel-ac-martin/NotGovUK/blob/master/.storybook/main.js is copied into the new project, but makes references to explicit components in NotGovUK. Instead we should probably use a wildcard. i.e:

stories: [
    '../components/*/spec/*.stories.@(js|mdx)'
  ],

Additionally, the current storybook requires the ./.jest-results.json file to exist. This doesn't exist when the project is first generated. It can be generated by running npm test but we should probably create a dummy file. e.g:

echo '[]' > .jest-results.json