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 7 #972

Merged
merged 2 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .storybook/docs/assets/favicon.ico
Binary file not shown.
10 changes: 6 additions & 4 deletions .storybook/docs/stories/Typography.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta, Unstyled } from "@storybook/addon-docs";
import { Typeset } from "@storybook/addon-docs";
import {
fontFamilySansSerif,
Expand Down Expand Up @@ -42,7 +42,9 @@ import {
sampleText="The quick brown fox jumps over the lazy dog"
/>
<h2>Heading Text</h2>
<HeadingText1>Heading Text 1</HeadingText1>
<HeadingText2>Heading Text 2</HeadingText2>
<HeadingText3>Heading Text 3</HeadingText3>
<Unstyled>
<HeadingText1>Heading Text 1</HeadingText1>
<HeadingText2>Heading Text 2</HeadingText2>
<HeadingText3>Heading Text 3</HeadingText3>
</Unstyled>
</div>
10 changes: 6 additions & 4 deletions .storybook/docs/stories/Welcome.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta } from "@storybook/addon-docs";
import { Meta, Unstyled } from "@storybook/addon-docs";

import { WelcomeBanner, WelcomeCards, WelcomeFooter } from "../index.ts";

Expand All @@ -11,6 +11,8 @@ import { WelcomeBanner, WelcomeCards, WelcomeFooter } from "../index.ts";
}}
/>

<WelcomeBanner />
<WelcomeCards />
<WelcomeFooter />
<Unstyled>
<WelcomeBanner />
<WelcomeCards />
<WelcomeFooter />
</Unstyled>
17 changes: 12 additions & 5 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
const customWebpack = require("./webpack.config");

module.exports = {
core: {
builder: "webpack5"
},
stories: [
"./docs/stories/Welcome.stories.mdx",
"./docs/stories/Colors.stories.mdx",
"./docs/stories/Typography.stories.mdx",
"../packages/**/*.stories.@(tsx|mdx)"
],
webpackFinal: config => {
return { ...config, ...customWebpack };
return {
...config,
...customWebpack
};
},
addons: [
{
Expand All @@ -24,5 +23,13 @@ module.exports = {
],
features: {
previewMdx2: true
},
framework: {
name: "@storybook/react-webpack5",
options: {}
},
staticDirs: ["../public/assets/images"],
docs: {
autodocs: true
}
};
1 change: 1 addition & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
3 changes: 0 additions & 3 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { addons } from "@storybook/addons";
import Theme from "./theme";
import favicon from "./docs/assets/favicon.ico";

const link = document.createElement("link");
link.setAttribute("rel", "shortcut icon");
link.setAttribute("href", favicon);
document.head.appendChild(link);

addons.setConfig({
Expand Down
2 changes: 1 addition & 1 deletion .storybook/theme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { create } from "@storybook/theming";
import { create } from "@storybook/theming/create";
import logo from "./static/logo.png";

export default create({
Expand Down
3 changes: 0 additions & 3 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ module.exports = ({ config }) => {
config.resolve.extensions = config.resolve.extensions.concat(
webpackBase.getExtensions()
);
config.resolve.alias["core-js"] = path.dirname(require.resolve("core-js"));
config.module.rules[0].use[0].options.sourceType = "unambiguous";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These items are no longer required, and they will not allow Storybook to build.


// Storybook has loaders configured that conflict with what you define in our custom Webpack configuration,
// so if you do not override those then your custom rules will not work.
// Remove the rule that loads SVGs as assets for storybook
Expand Down
Loading