Skip to content

Commit

Permalink
feat: deps update (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
simboonlong authored Mar 4, 2022
1 parent 861b868 commit 4b42f43
Show file tree
Hide file tree
Showing 7 changed files with 2,821 additions and 5,122 deletions.
36 changes: 19 additions & 17 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
const path = require("path");
const toPath = (_path) => path.join(process.cwd(), _path);

module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-essentials"],
framework: "@storybook/react",
core: {
builder: "webpack5",
},
stories: ["../src/**/*.stories.@(js|mdx)"],
addons: ["@storybook/addon-docs/preset", "@storybook/addon-actions/register", "@storybook/addon-docs/register"],
webpackFinal: async (config) => {
// looks like storybook having trouble with emotion as for now => manually configuration webpack

// re-apply babel configuration as available in package.json (storybook doesn't pick it)
config.module.rules[0].use[0].loader = require.resolve("babel-loader");
config.module.rules[0].use[0].options.presets = [
require.resolve("@babel/preset-env", {
targets: {
node: "current",
webpackFinal: (config) => {
return {
...config,
// https://github.com/storybookjs/storybook/issues/13277#issuecomment-751747964
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
"@emotion/core": toPath("node_modules/@emotion/react"),
"@emotion/styled": toPath("node_modules/@emotion/styled"),
"emotion-theming": toPath("node_modules/@emotion/react"),
},
}),
require.resolve("@babel/preset-typescript"),
require.resolve("@babel/preset-react"),
require.resolve("@emotion/babel-preset-css-prop"),
];
return config;
},
};
},
};
9 changes: 9 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
coverageDirectory: "coverage",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
};
1 change: 1 addition & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "@testing-library/jest-dom";
Loading

0 comments on commit 4b42f43

Please sign in to comment.