Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

chore: add storybook #2

Merged
merged 19 commits into from
Nov 16, 2022
Merged

chore: add storybook #2

merged 19 commits into from
Nov 16, 2022

Conversation

tatimblin
Copy link
Contributor

@tatimblin tatimblin commented Nov 3, 2022

Setting up storybook with the vite-builder plugin

J=SLAP-2442
TEST=manual

checked-out address and ran without errors

@tatimblin tatimblin requested a review from a team as a code owner November 3, 2022 19:04
.eslintrc.js Outdated Show resolved Hide resolved
.storybook/main.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@yen-tt yen-tt left a comment

Choose a reason for hiding this comment

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

I believe this item includes creating a Storybook Site that will be kept up-to-date with main branch. Can you add the necessary github actions for that as well?

@tatimblin
Copy link
Contributor Author

I believe this item includes creating a Storybook Site that will be kept up-to-date with main branch. Can you add the necessary github actions for that as well?

@yen-tt I added the workflow to this. I'll add the ci config in that branch directly in a separate pr

Copy link
Contributor

@tmeyer2115 tmeyer2115 left a comment

Choose a reason for hiding this comment

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

As part of SLAP-2442, we'll want to add Yext-specific styling to the Storybook Site. This requires adding some things to the .storybook directory. You can see what we did to add the Yext branding/styling to the Search UI React Site here: yext/search-ui-react@e3d1259.

I think we should keep this PR as is. It's goal is to add Storybook to the repo. Then, you'll have a second PR (once the Address is merged in), creating Address Stories and the Yext branding.

package.json Outdated Show resolved Hide resolved
.storybook/main.js Outdated Show resolved Hide resolved
.eslintrc.js Outdated Show resolved Hide resolved
@tatimblin tatimblin changed the title chore: add storybook 7 chore: add storybook Nov 8, 2022
.prettierrc.json Outdated Show resolved Hide resolved
.storybook/yextTheme.cjs Show resolved Hide resolved
.storybook/yextTheme.cjs Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
.eslintrc.js Outdated Show resolved Hide resolved
.storybook/main.js Outdated Show resolved Hide resolved
.storybook/preview-head.html Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@nmanu1 nmanu1 left a comment

Choose a reason for hiding this comment

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

looks like several tests are failing. I thought they should all (or almost all) be passing now?

@tatimblin
Copy link
Contributor Author

@nmanu1 jest tests will also fail because there are currently no tests

@nmanu1
Copy link
Contributor

nmanu1 commented Nov 15, 2022

@nmanu1 jest tests will also fail because there are currently no tests

I thought a test was added for the Address component, which is now in main? Shouldn't at least the tests checks marked as (pull_request) pass? Also, looks like Percy is failing. Is this PR supposed to set up those snapshots now that we have Storybook, or will that be a different item/PR?

@tatimblin
Copy link
Contributor Author

@nmanu1 jest tests will also fail because there are currently no tests

I thought a test was added for the Address component, which is now in main? Shouldn't at least the tests checks marked as (pull_request) pass? Also, looks like Percy is failing. Is this PR supposed to set up those snapshots now that we have Storybook, or will that be a different item/PR?

The checks say no tests were found. Percy fails because there are no stories yet, I will add address stories in a separate PR after Storybook is merged

package.json Outdated
],
"moduleDirectories": [
"node_modules",
"<rootDir>"
],
"testEnvironment": "jsdom",
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was specified on the other branch

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I follow. it looks like all other branches/changes have been merged into main. so, won't this delete the line from main?

Copy link
Contributor

Choose a reason for hiding this comment

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

this is the same concern I had for the test file that's being deleted too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nmanu1 I added it back

Copy link
Contributor

Choose a reason for hiding this comment

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

ok! so the tests checks should pass now, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually it looks like there's an error because of the file extensions in the Jest config

.storybook/preview.js Show resolved Hide resolved
.npmrc Show resolved Hide resolved
tests/components/Address.test.tsx Show resolved Hide resolved
package.json Outdated
@@ -56,10 +83,11 @@
],
"transform": {
"\\.[jt]sx?$": "ts-jest"
},
"globals": {
"ts-jest": {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like specifying the ts-jest config under globals is deprecated and should be moved according to here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes just fixed that. ready now

@tmeyer2115 tmeyer2115 self-requested a review November 16, 2022 13:52
@tatimblin tatimblin merged commit 8806172 into main Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants