modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.16k stars 271 forks source link

feat(storybook-builder): support MDX and autodocs #2701

Closed bashmish closed 3 months ago

bashmish commented 3 months ago

What I did

  1. integrated MDX
  2. improved tests to be able to test both docs and stories (there was a race condition, the solution from the Storybook's own tests partially worked, but I still had an issue and needed to find a way to wait till docs are really rendered, so ended up having a bit more complex waiting logic)
  3. autodocs support comes almost for free, but I added tests for it

To make a smooth static build, I rewrite a story import path to have an .mdx.js extension, this also helps with MIME types when in the runtime. Then in the load method of the plugin I convert MDX->JS right away (instead of doing this in transform), so that other plugins get a proper JS in their transform functions.

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: e30da4a0d82ec7fee494b2a55303f57647d17cc6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---------------------- | ----- | | @web/storybook-builder | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR