Skip to content

Commit

Permalink
feat: storybook 7 and configuration updates
Browse files Browse the repository at this point in the history
Closes D2IQ-92603
  • Loading branch information
nataliepina committed May 30, 2023
1 parent 97cb6b0 commit 4e090ff
Show file tree
Hide file tree
Showing 9 changed files with 24,208 additions and 46,746 deletions.
Binary file removed .storybook/docs/assets/favicon.ico
Binary file not shown.
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";

// 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

0 comments on commit 4e090ff

Please sign in to comment.