Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add Storybook #4841

Merged
merged 13 commits into from
Sep 10, 2024
Merged

Re-add Storybook #4841

merged 13 commits into from
Sep 10, 2024

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Aug 30, 2024

Fixes

Fixes #4728 by @obulat

Description

This PR adds the nightly version of Storybook to the app.

While it is not ideal to use a nightly version, especially with still existing issues, having Storybook is very important for the development of the interface features such as the Dark mode.

Existing issues in Nuxt storybook module:

Other notable changes

  1. Most stories were converted to TS. When the component rendered in the Story has extra props that do not exist on the component (eg., in VButton story, we also have a variants prop for the Variants stories that does not exist in the VButton component), I left the component in JS because of difficulties with typing
  2. All stories were converted to use the h => () render functions instead of the template string because of the Storybook module error (no vue compiler available, TODO: Add the error message)
  3. Some props were simplified.
  4. Added emits to VButton

Testing Instructions

  1. Install dependencies ov just install and run storybook ov just frontend/run storybook.
  2. View Storybook. While there are some issues logged in the console, all stories should display correctly.
  3. View the CI

Checklist

  • My pull request has a descriptive title (not a vague title likeUpdate index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
  • I ran the DAG documentation generator (ov just catalog/generate-docs for catalog
    PRs) or the media properties generator (ov just catalog/generate-docs media-props
    for the catalog or ov just api/generate-docs for the API) where applicable.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@openverse-bot openverse-bot added 🧱 stack: documentation Related to Sphinx documentation 🧱 stack: frontend Related to the Nuxt frontend 🧱 stack: mgmt Related to repo management and automations 🟨 priority: medium Not blocking but should be addressed soon 🧰 goal: internal improvement Improvement that benefits maintainers, not users 💻 aspect: code Concerns the software code in the repository 🕹 aspect: interface Concerns end-users' experience with the software labels Aug 30, 2024
@obulat obulat force-pushed the add/storybook branch 5 times, most recently from 9eef2ac to 06a1744 Compare August 30, 2024 14:28
Copy link

Full-stack documentation: https://docs.openverse.org/_preview/4841

Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again.

You can check the GitHub pages deployment action list to see the current status of the deployments.

@obulat obulat self-assigned this Aug 30, 2024
@obulat obulat marked this pull request as ready for review August 30, 2024 15:09
@obulat obulat requested review from a team as code owners August 30, 2024 15:09
@obulat obulat requested review from zackkrida, stacimc and dhruvkb and removed request for a team August 30, 2024 15:09
@openverse-bot
Copy link
Collaborator

Based on the medium urgency of this PR, the following reviewers are being gently reminded to review this PR:

@zackkrida
@stacimc
@dhruvkb
This reminder is being automatically generated due to the urgency configuration.

Excluding weekend1 days, this PR was ready for review 4 day(s) ago. PRs labelled with medium urgency are expected to be reviewed within 4 weekday(s)2.

@obulat, if this PR is not ready for a review, please draft it to prevent reviewers from getting further unnecessary pings.

Footnotes

  1. Specifically, Saturday and Sunday.

  2. For the purpose of these reminders we treat Monday - Friday as weekdays. Please note that the operation that generates these reminders runs at midnight UTC on Monday - Friday. This means that depending on your timezone, you may be pinged outside of the expected range.

Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I was able to run Storybook and poke around.

However I have reservations against using an unstable version of Storybook as they have a very lax versioning policy in my mind. But that does not warrant blocking this PR.

Additionally we need to add --no-open because running Storybook inside ov crashes with this error:

Error: spawn xdg-open ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn xdg-open',
  path: 'xdg-open',
  spawnargs: [ 'http://localhost:54000/' ]

@obulat
Copy link
Contributor Author

obulat commented Sep 6, 2024

Additionally we need to add --no-open because running Storybook inside ov crashes with this error:

I added the xdg-utils to ov environment to get this to work. Could you check if this works now, @dhruvkb ? (probably after ov init)

@obulat obulat force-pushed the add/storybook branch 4 times, most recently from 47d7c02 to b3c6545 Compare September 9, 2024 05:02
@obulat obulat merged commit aea8a33 into main Sep 10, 2024
51 checks passed
@obulat obulat deleted the add/storybook branch September 10, 2024 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🕹 aspect: interface Concerns end-users' experience with the software 🧰 goal: internal improvement Improvement that benefits maintainers, not users 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: documentation Related to Sphinx documentation 🧱 stack: frontend Related to the Nuxt frontend 🧱 stack: mgmt Related to repo management and automations
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Re-add Storybook and re-enable Storybook tests
3 participants