Skip to content

Commit b419e22

Browse files
authored
chore: upgrade storybook to latest version (#733) (#734)
* chore: upgrade storybook to latest version (#733) * refactor: storybook .main (#733) --------- Co-authored-by: Fran McDade <18710366+frano-m@users.noreply.github.com>
1 parent d3d7ef7 commit b419e22

File tree

84 files changed

+4303
-10415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4303
-10415
lines changed

.storybook/main.ts

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,10 @@
1-
import { StorybookConfig } from "@storybook/nextjs";
2-
import * as path from "path";
1+
import { defineMain } from "@storybook/nextjs-vite/node";
32

4-
const toPath = (filePath: string) => path.join(process.cwd(), filePath);
5-
6-
const config: StorybookConfig = {
3+
export default defineMain({
4+
framework: "@storybook/nextjs-vite",
5+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
76
core: {
7+
builder: "@storybook/builder-vite",
88
disableTelemetry: true,
99
},
10-
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
11-
addons: [
12-
"@storybook/addon-links",
13-
"@storybook/addon-essentials",
14-
"@storybook/addon-interactions",
15-
"@storybook/addon-mdx-gfm",
16-
],
17-
typescript: {
18-
reactDocgen: "react-docgen-typescript",
19-
reactDocgenTypescriptOptions: {
20-
shouldExtractLiteralValuesFromEnum: true,
21-
// Filter out third-party props from node_modules except @mui packages
22-
propFilter: (prop: any) =>
23-
prop.parent
24-
? !/node_modules\/(?!@mui)/.test(prop.parent.fileName)
25-
: true,
26-
},
27-
},
28-
framework: {
29-
name: "@storybook/nextjs",
30-
options: {},
31-
},
32-
webpackFinal: async (config: any) => {
33-
return {
34-
...config,
35-
resolve: {
36-
...config.resolve,
37-
alias: {
38-
...config.resolve.alias,
39-
app: path.resolve(__dirname, "../src"),
40-
//images: path.resolve(__dirname, "../images"),
41-
"@emotion/core": toPath("node_modules/@emotion/react"),
42-
"emotion-theming": toPath("node_modules/@emotion/react"),
43-
},
44-
},
45-
};
46-
},
47-
docs: {
48-
autodocs: true,
49-
},
50-
};
51-
52-
export default config;
10+
});

jest.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
3-
moduleNameMapper: {
4-
"^@storybook/addon-actions$":
5-
"<rootDir>/src/mocks/@storybook/addon-actions.ts",
6-
},
73
preset: "ts-jest/presets/js-with-ts-esm",
84
setupFiles: ["<rootDir>/tests/setup.ts"],
95
testEnvironment: "jest-environment-jsdom",

0 commit comments

Comments
 (0)