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

Storybook: Implement global source code transformer for story "Code" panel #2379

Open
8 tasks
larsrickert opened this issue Dec 19, 2024 · 0 comments
Open
8 tasks
Assignees
Labels
0-refinement All issues that can or need to be estimated in our next refinement dev Requires technical expertise storybook Storybook improve- or adjustments

Comments

@larsrickert
Copy link
Collaborator

Why?

Follow up for #1963

We contributed a "Code" panel to Storybook which shows the source code of an individual story in storybookjs/storybook#29253.

Unfortunately, we noticed that the code panel does not consider the global transformer function that we have set it in onyx to add icon and component imports, see

transform: sourceCodeTransformer,
.

This only works for the generated "Docs" page but not for the code panel. We want to also support this for the code panel to achieve a unified code snippet experience for our users.

Image
Image

Open questions / TODOs

No response

Depends on

No response

Design

No response

Acceptance criteria

  • a Storybook contribution is implement and released that supports source code transformers for the code panel
  • Ideally, all options that are available for the regular code block on the "Docs" page are also applied in the same way to the code panel so they do not differ

Implementation details

Reference implementations

No response

Applicable ARIA Pattern

No response

Definition of Done

  • Should be covered by tests:

    • functional tests (Playwright or unit test)
  • Make sure, that

    • follow-up tickets were created if necessary
    • updated version + documentation is deployed
    • Storybook can show the feature
    • Storybook code snippet of new/changed examples are checked that they are generated correctly

Approval

Storybook
Documentation

  • Checked and approved by
    • dev
@larsrickert larsrickert added 0-refinement All issues that can or need to be estimated in our next refinement dev Requires technical expertise storybook Storybook improve- or adjustments labels Dec 19, 2024
@larsrickert larsrickert self-assigned this Dec 19, 2024
@larsrickert larsrickert added this to onyx Dec 19, 2024
@github-project-automation github-project-automation bot moved this to New in onyx Dec 19, 2024
@larsrickert larsrickert moved this from New to Backlog in onyx Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-refinement All issues that can or need to be estimated in our next refinement dev Requires technical expertise storybook Storybook improve- or adjustments
Projects
Status: Backlog
Development

No branches or pull requests

1 participant