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

Feat : Add codesandbox storybook addon #4602

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

H0onnn
Copy link

@H0onnn H0onnn commented May 29, 2024

Description

Added the storybook addon provided by codesandbox.

Related Issue

Not all issues have been resolved yet.

This is an issue related to environment variables, and more details can be found in the comments on the issue.

You need to add environment variables related to apiToken in the storybook/preview.ts file.

Motivation and Context

By automating the creation of codesandbox links, users can more easily test the UI and bug fix.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a storybook story or extended an existing story to show my changes

Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.99%. Comparing base (30acdbf) to head (3bb8be7).
Report is 19 commits behind head on 3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##              3.x    #4602      +/-   ##
==========================================
+ Coverage   95.73%   95.99%   +0.25%     
==========================================
  Files         119      123       +4     
  Lines       22699    23460     +761     
  Branches     3130     3172      +42     
==========================================
+ Hits        21731    22520     +789     
+ Misses        962      934      -28     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -22,6 +22,14 @@ const preview: Preview = {
},
// Sets a delay of 1550ms before each story to give them time to animate (recharts animation default is 1500ms)
chromatic: { delay: 1550 },
codesandbox: {
apiToken: '',
Copy link
Collaborator

Choose a reason for hiding this comment

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

So I would like to use this addon but I can't see how to get this token through. It's private so we cannot just embed it in the source code. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

I changed you to Admin in codesandbox - go to recharts -> settings -> permissions -> API Access

Copy link
Member

Choose a reason for hiding this comment

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

But I agree, there's no great way to use the API token. Env variables aren't safe still even if we did it in CI

@PavelVanecek
Copy link
Collaborator

@ckifer
Copy link
Member

ckifer commented Aug 13, 2024

codesandbox/storybook-addon#17 might resolve once we finish refactoring but idk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use CodeSandbox Storybook Add-on
3 participants