farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
60 stars 39 forks source link

Investigate Storybook for documenting component library #410

Closed jgaehring closed 3 years ago

jgaehring commented 3 years ago

Looks pretty straightforward:

https://storybook.js.org/docs/vue/get-started/install

jgaehring commented 3 years ago

A few issues on install, namlely having to install core-js@3 as a dev dep, as explained in https://github.com/storybookjs/storybook/issues/11255. Hopefully https://github.com/storybookjs/storybook/pull/12312 resolves that and I can remove that as a peer dep.

Looks pretty nice at first glance, although there may be some learning curve. I'm test driving it on my fork for now.

Also, there are apparently some specific caveats with Vue props I'll have to explore in more depth later: https://github.com/storybookjs/storybook/blob/master/app/vue/README.md#vue-notes

jgaehring commented 3 years ago

I think I ran up against this bug, although I'm not sure: https://github.com/storybookjs/storybook/issues/11051

I tried upgrading as it describes, with npm i -D @storybook/vue@next, but that caused something to break that I didn't exactly want to troubleshoot any further, so I just reverted.

jgaehring commented 3 years ago

I believe I have a pretty good foundation laid here. I was going to wait to close this once I had stories written for all the existing components, but I don't want to get to far ahead of myself when there will likely be major API changes taking place as I work on #409. I think I should just make sure the documentation work continues in step with that component development, so the API is being documented as its being established.

I'm also going to keep exploring Storybook to see if it will suffice for component testing (#387).

jgaehring commented 3 years ago

One final step: added a link in the docs.