uiowa / uids

UI Design System
http://uids.brand.uiowa.edu
7 stars 1 forks source link

4.x - Update Storybook from 6 to 7 #900

Closed bspeare closed 9 months ago

bspeare commented 11 months ago

Update Storybook from 6 to 7

Proposed Solution

bspeare commented 10 months ago

Started this in https://github.com/uiowa/uids/pull/911 during prof dev time.

joewhitsitt commented 10 months ago

Ha. Going to assign and start to pull down and familiarize myself with what is done and where this needs to go. Going to need to do some reading to catch up. @bspeare suggested a huddle to discuss this more in-depth so ping me whenever. I understand there are more priority items going on.

joewhitsitt commented 10 months ago

Look at the log messages and clean up anything not used Does this meaning terminal logs, console logs, both, something different?

Finding myself not being of much help on the actual bullet points.

It seems from the storybook docs, <Source> is probably the best solution for including base styles if we want to try to keep the work of documentation minimal. Wished there was a way to collapse them. Should maybe consider trying to anchor link from the top and move them to the bottom.

I spotted the https://storybook.js.org/docs/api/doc-block-useof type and thought maybe we could use it to create a standalone story doc.

Should we update to yarn 3 as part of this?

yarn -v
1.22.19

Also, according to vscode, there are issues with our typescript which could be solved if we updated. typescript@4.6.4

https://github.com/vuejs/tsconfig/issues/6

otherwise that workaround for tsconfig.app.json, tsconfig.vite-config.json and tsconfig.vitest.json seems to work.

joewhitsitt commented 10 months ago

Let there be HTML!

Image

joewhitsitt commented 10 months ago

Spotted this as a possible path forward for the standalone combined unless we want to stay away from those kinds of stories.

https://github.com/massgov/mayflower/blob/develop/packages/core/stories/components/Template/Template.stories.mdx https://mayflower.digital.mass.gov/core/index.html?path=/docs/components-template--template-basic

joewhitsitt commented 10 months ago

And maybe I didn't understand @pyrello earlier, but regarding

Should we update to yarn 3 as part of this?

and having to deal with different versions per project, I saw here you can control yarn per project using node 18+ corepack

https://yarnpkg.com/getting-started/install, https://yarnpkg.com/migration/guide

jwhitsit@ITS-02342 uids % yarn -v
3.7.0
jwhitsit@ITS-02342 uids % cd ~/Desktop 
jwhitsit@ITS-02342 Desktop % yarn -v
1.22.21

Going to leave that local for now and see if anything broke while I keep poking around.

bspeare commented 10 months ago

Try yarn workspace uids_base build on uiowa?

joewhitsitt commented 10 months ago

Try yarn workspace uids_base build on uiowa?

For the record, I never run this (always ddev blt frontend) so I had to rebuild node-sass or whatever first.

jwhitsit@ITS-02342 uiowa % nvm use
Found '/Users/jwhitsit/acquia/uiowa/.nvmrc' with version <16>
Now using node v16.16.0 (npm v8.11.0)
jwhitsit@ITS-02342 uiowa % yarn -v
1.22.15
jwhitsit@ITS-02342 uiowa % yarn workspace uids_base build
yarn workspace v1.22.15
yarn run v1.22.15
$ gulp --production
[15:55:18] Using gulpfile ~/acquia/uiowa/docroot/themes/custom/uids_base/gulpfile.js
[15:55:18] Starting 'default'...
[15:55:18] Starting 'clean'...
[15:55:18] Finished 'clean' after 108 ms
[15:55:18] Starting 'copyUids3'...
[15:55:18] Starting 'copyUids'...
[15:55:18] Starting 'fontCopy'...
[15:55:18] Finished 'fontCopy' after 352 ms
[15:55:18] Finished 'copyUids' after 641 ms
[15:55:18] Finished 'copyUids3' after 692 ms
[15:55:18] Starting 'css'...
Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
[15:55:23] Finished 'css' after 4.59 s
[15:55:23] Finished 'default' after 5.4 s
✨  Done in 7.13s.
✨  Done in 7.54s.
joewhitsitt commented 10 months ago

Until https://github.com/storybookjs/storybook/issues/13917 has a better solution? We can "hide" the broke code stuff by decorating each story with:

  parameters: {
    docs: {
      source: {
        code: null,
      },

resulting in

Screenshot 2023-12-08 at 3 53 55 PM
joewhitsitt commented 9 months ago

remove card example until we decide about CSS. - https://iowaweb.slack.com/archives/C014UM4F85V/p1702315949150359?thread_ts=1702058289.928859&cid=C014UM4F85V

Done. https://github.com/uiowa/uids/pull/911/commits/53483aa8818f952d3e1fd8ed19c4d0817ad02b62