Skip to content

Commit

Permalink
Storybook 8 Upgrade (#2440)
Browse files Browse the repository at this point in the history
* upgrade storybook to 8.3.5

* remove packages no longer needed

* fix: overwrite storybooks favicon

* chore: replace deprecated `Story` with `StoryFn`

---------

Co-authored-by: Jacob Overgaard <[email protected]>
  • Loading branch information
JesmoDev and iOvergaard committed Oct 10, 2024
1 parent b439900 commit 39d17e9
Show file tree
Hide file tree
Showing 90 changed files with 7,718 additions and 14,310 deletions.
18 changes: 11 additions & 7 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { dirname, join } from 'path';
import { StorybookConfig } from '@storybook/web-components-vite';
import remarkGfm from 'remark-gfm';

const config: StorybookConfig = {
stories: ['../@(src|libs|apps|storybook)/**/*.mdx', '../@(src|libs|apps|storybook)/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-a11y',
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-a11y'),
{
name: '@storybook/addon-docs',
options: {
Expand All @@ -19,12 +20,13 @@ const config: StorybookConfig = {
},
],
framework: {
name: '@storybook/web-components-vite',
name: getAbsolutePath('@storybook/web-components-vite'),
options: {},
},
staticDirs: [
'../public-assets',
'../public',
'../src/assets',
{
from: '../src/packages/core/icon-registry/icons',
to: 'assets/icons',
Expand All @@ -33,9 +35,7 @@ const config: StorybookConfig = {
typescript: {
check: true,
},
docs: {
autodocs: true,
},
docs: {},
managerHead(head, { configType }) {
const base = process.env.VITE_BASE_PATH || '/';
const injections = [
Expand All @@ -51,3 +51,7 @@ const config: StorybookConfig = {
},
};
export default config;

function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
2 changes: 1 addition & 1 deletion .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';

addons.setConfig({
enableShortcuts: false,
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const parameters = {
],
},
},
actions: { argTypesRegex: '^on.*' },
controls: {
expanded: true,
matchers: {
Expand All @@ -140,3 +139,4 @@ export const parameters = {
};

setCustomElements(customElementManifests);
export const tags = ['autodocs'];
Loading

0 comments on commit 39d17e9

Please sign in to comment.