🔧(deps) upgrade Storybook configuration files
This upgrade requires to update the configuration files.
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { dirname, join } from "path";
|
||||
import { StorybookConfig } from "@storybook/react-vite";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
const config: StorybookConfig = {
|
||||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
||||
addons: [
|
||||
"@storybook/addon-links",
|
||||
"@storybook/addon-essentials",
|
||||
"@storybook/addon-interactions",
|
||||
"@storybook/addon-a11y",
|
||||
"@storybook/preset-scss",
|
||||
getAbsolutePath("@storybook/addon-links"),
|
||||
getAbsolutePath("@storybook/addon-essentials"),
|
||||
getAbsolutePath("@storybook/addon-interactions"),
|
||||
getAbsolutePath("@storybook/addon-a11y"),
|
||||
getAbsolutePath("@storybook/preset-scss"),
|
||||
{
|
||||
name: "@storybook/addon-docs",
|
||||
options: {
|
||||
@@ -20,14 +21,14 @@ const config: StorybookConfig = {
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
framework: {
|
||||
name: "@storybook/react-vite",
|
||||
name: getAbsolutePath("@storybook/react-vite"),
|
||||
options: {},
|
||||
},
|
||||
|
||||
staticDirs: ["../src", "../public"],
|
||||
features: {
|
||||
storyStoreV7: true,
|
||||
},
|
||||
|
||||
async viteFinal(config, options) {
|
||||
// We don't want the Storybook build to generate type definitions.
|
||||
const newConfig = {
|
||||
@@ -41,6 +42,13 @@ const config: StorybookConfig = {
|
||||
};
|
||||
return newConfig;
|
||||
},
|
||||
docs: {
|
||||
autodocs: false
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
||||
|
||||
function getAbsolutePath(value: string): any {
|
||||
return dirname(require.resolve(join(value, "package.json")));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { addons, types, useStorybookApi } from '@storybook/manager-api';
|
||||
import { getThemeFromGlobals, themes } from './themes';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useGlobals } from '@storybook/api';
|
||||
import { useGlobals } from '@storybook/manager-api';
|
||||
|
||||
addons.setConfig({ theme: themes.default });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user