-
Notifications
You must be signed in to change notification settings - Fork 119
feat(storybook): working stories #4265
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
Changes from 3 commits
557c8c9
4a4dc23
e8bfbdc
f2bf8ca
7a0a364
c3b65a8
fe21f3a
4429109
33857c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import path from "path"; | |
import type { StorybookConfig } from "@storybook/react-vite"; | ||
import { mergeConfig } from "vite"; | ||
import turbosnap from "vite-plugin-turbosnap"; | ||
|
||
const config: StorybookConfig = { | ||
stories: [ | ||
"../packages/**/*.stories.@(js|jsx|ts|tsx|mdx)", | ||
|
@@ -22,7 +23,9 @@ const config: StorybookConfig = { | |
typescript: { | ||
// enable type checking | ||
check: true, | ||
reactDocgen: "react-docgen-typescript", | ||
}, | ||
|
||
async viteFinal(config, { configType }) { | ||
const isTest = process.env.NODE_ENV === "test"; | ||
return mergeConfig(config, { | ||
|
@@ -57,5 +60,9 @@ const config: StorybookConfig = { | |
}, | ||
}); | ||
}, | ||
|
||
docs: { | ||
autodocs: false, | ||
}, | ||
Comment on lines
+64
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kept this option in as we can set true to create docs. It's pretty cool, creates a prop tables and gives a preview of all storybooks. I disabled though because they could be pretty long depending on how many stories a component has and could potentially hit the chromatic length limit and fail our tests. We can investigate in future but we didn't have it origionally so not required |
||
}; | ||
export default config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -281,7 +281,6 @@ export const decorators = [ | |
|
||
export const parameters = { | ||
isTestEnvironment, | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deprecated |
||
viewport: { | ||
viewports: INITIAL_VIEWPORTS, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,17 +121,16 @@ | |
"@octokit/graphql-schema": "^14.39.1", | ||
"@percy/cli": "^1.10.1", | ||
"@percy/cypress": "^3.1.2", | ||
"@storybook/addon-a11y": "7.6.4", | ||
"@storybook/addon-actions": "7.6.4", | ||
"@storybook/addon-essentials": "7.6.4", | ||
"@storybook/addon-interactions": "7.6.4", | ||
"@storybook/addon-links": "7.6.4", | ||
"@storybook/addons": "7.6.4", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. depricated |
||
"@storybook/cli": "7.6.4", | ||
"@storybook/react": "7.6.4", | ||
"@storybook/react-vite": "7.6.4", | ||
"@storybook/test-runner": "0.16.0", | ||
"@storybook/testing-library": "0.2.2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. depricated |
||
"@storybook/addon-a11y": "^8.6.4", | ||
"@storybook/addon-actions": "^8.6.4", | ||
"@storybook/addon-essentials": "^8.6.4", | ||
"@storybook/addon-interactions": "^8.6.4", | ||
"@storybook/addon-links": "^8.6.4", | ||
"@storybook/cli": "^8.6.4", | ||
"@storybook/manager-api": "^8.6.4", | ||
"@storybook/react": "^8.6.4", | ||
"@storybook/react-vite": "^8.6.4", | ||
"@storybook/test-runner": "^0.22.0", | ||
"@swc/core": "^1.2.160", | ||
"@swc/jest": "^0.2.20", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
|
@@ -176,14 +175,14 @@ | |
"eslint-config-twilio-ts": "2.0.0", | ||
"eslint-plugin-cypress": "2.12.1", | ||
"eslint-plugin-eslint-comments": "3.2.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-import": "2.27.2", | ||
"eslint-plugin-jest": "26.1.3", | ||
"eslint-plugin-jsx-a11y": "6.5.1", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"eslint-plugin-promise": "6.0.0", | ||
"eslint-plugin-react": "7.29.4", | ||
"eslint-plugin-react-hooks": "4.4.0", | ||
"eslint-plugin-storybook": "^0.6.15", | ||
"eslint-plugin-storybook": "0.8.0", | ||
"eslint-plugin-unicorn": "40.1.0", | ||
"evergreen-ui": "^7.0.0", | ||
"git-branch-is": "^3.0.0", | ||
|
@@ -213,7 +212,7 @@ | |
"search-in-file": "^1.2.2", | ||
"shelljs": "^0.8.5", | ||
"start-server-and-test": "^2.0.3", | ||
"storybook": "7.6.4", | ||
"storybook": "^8.6.4", | ||
"terser": "^5.14.2", | ||
"theo": "^8.1.5", | ||
"tslib": "^2.0.3", | ||
|
@@ -242,5 +241,9 @@ | |
"last 2 versions", | ||
"not dead", | ||
"not IE 11" | ||
] | ||
], | ||
"devDependencies": { | ||
"@storybook/test": "^8.6.4", | ||
"@storybook/types": "^8.6.4" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,17 +24,11 @@ import { | |
SidebarNavigationItem, | ||
SidebarPushContentWrapper, | ||
} from "../../src"; | ||
import { AppSwitcher } from "./components/AppSwitcher"; | ||
import { NotificationsDialog } from "./components/NotificationsDialog"; | ||
import { SearchBox } from "./components/SearchBox"; | ||
import { SupportMenu } from "./components/SupportMenu"; | ||
import { UpgradeBadge } from "./components/UpgradeBadge"; | ||
import { UserDialogExample } from "./components/UserDialogSegment"; | ||
import { WorkspaceSwitcherMenu } from "./components/WorkspaceSwitcher"; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default { | ||
title: "Components/Sidebar/FullCompositions", | ||
title: "Components/Sidebar/Docs", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already had another storybook with the same name and the new version failed to compile with it. This is for the docs site so more appropriately named |
||
}; | ||
|
||
/* eslint-disable react/jsx-max-depth */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They deprecated the other package