2024-08-16 09:28:29 +02:00
|
|
|
import { dirname, join } from "path";
|
2023-05-26 15:58:06 +02:00
|
|
|
import { StorybookConfig } from "@storybook/angular";
|
|
|
|
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
|
|
|
|
import remarkGfm from "remark-gfm";
|
|
|
|
|
|
|
|
const config: StorybookConfig = {
|
|
|
|
stories: [
|
2024-05-07 03:34:40 +02:00
|
|
|
"../libs/auth/src/**/*.mdx",
|
2023-09-28 16:52:05 +02:00
|
|
|
"../libs/auth/src/**/*.stories.@(js|jsx|ts|tsx)",
|
2024-07-19 21:17:52 +02:00
|
|
|
"../libs/tools/send/send-ui/src/**/*.mdx",
|
|
|
|
"../libs/tools/send/send-ui/src/**/*.stories.@(js|jsx|ts|tsx)",
|
2024-07-02 22:22:51 +02:00
|
|
|
"../libs/vault/src/**/*.mdx",
|
|
|
|
"../libs/vault/src/**/*.stories.@(js|jsx|ts|tsx)",
|
2023-05-26 15:58:06 +02:00
|
|
|
"../libs/components/src/**/*.mdx",
|
|
|
|
"../libs/components/src/**/*.stories.@(js|jsx|ts|tsx)",
|
|
|
|
"../apps/web/src/**/*.mdx",
|
|
|
|
"../apps/web/src/**/*.stories.@(js|jsx|ts|tsx)",
|
2024-04-26 15:35:32 +02:00
|
|
|
"../apps/browser/src/**/*.mdx",
|
|
|
|
"../apps/browser/src/**/*.stories.@(js|jsx|ts|tsx)",
|
2023-05-26 15:58:06 +02:00
|
|
|
"../bitwarden_license/bit-web/src/**/*.mdx",
|
|
|
|
"../bitwarden_license/bit-web/src/**/*.stories.@(js|jsx|ts|tsx)",
|
|
|
|
],
|
|
|
|
addons: [
|
2024-08-16 09:28:29 +02:00
|
|
|
getAbsolutePath("@storybook/addon-links"),
|
|
|
|
getAbsolutePath("@storybook/addon-essentials"),
|
|
|
|
getAbsolutePath("@storybook/addon-a11y"),
|
|
|
|
getAbsolutePath("@storybook/addon-designs"),
|
|
|
|
getAbsolutePath("@storybook/addon-interactions"),
|
2023-05-26 15:58:06 +02:00
|
|
|
{
|
|
|
|
name: "@storybook/addon-docs",
|
|
|
|
options: {
|
|
|
|
mdxPluginOptions: {
|
|
|
|
mdxCompileOptions: {
|
|
|
|
remarkPlugins: [remarkGfm],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
framework: {
|
2024-08-16 09:28:29 +02:00
|
|
|
name: getAbsolutePath("@storybook/angular"),
|
2023-05-26 15:58:06 +02:00
|
|
|
options: {},
|
|
|
|
},
|
|
|
|
core: {
|
|
|
|
disableTelemetry: true,
|
|
|
|
},
|
|
|
|
env: (config) => ({
|
|
|
|
...config,
|
2024-04-08 17:46:24 +02:00
|
|
|
FLAGS: JSON.stringify({}),
|
2023-05-26 15:58:06 +02:00
|
|
|
}),
|
|
|
|
webpackFinal: async (config, { configType }) => {
|
|
|
|
if (config.resolve) {
|
|
|
|
config.resolve.plugins = [new TsconfigPathsPlugin()] as any;
|
|
|
|
}
|
|
|
|
return config;
|
|
|
|
},
|
2024-08-16 09:28:29 +02:00
|
|
|
docs: {},
|
2023-05-26 15:58:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|
2024-08-16 09:28:29 +02:00
|
|
|
|
|
|
|
// Recommended for mono-repositories
|
|
|
|
function getAbsolutePath(value: string): any {
|
|
|
|
return dirname(require.resolve(join(value, "package.json")));
|
|
|
|
}
|