Skip to content

Commit

Permalink
updates storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsnow301 committed Dec 24, 2024
1 parent 3b64b1e commit 7a662ee
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 282 deletions.
26 changes: 20 additions & 6 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { dirname, join } from 'node:path';
import type { StorybookConfig } from '@storybook/react-vite';
import sass from 'sass';

const config: StorybookConfig = {
stories: ['../stories/**/*.stories.tsx'],

addons: [
'@storybook/addon-onboarding',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
'@storybook/addon-console',
getAbsolutePath('@storybook/addon-onboarding'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@chromatic-com/storybook'),
getAbsolutePath('@storybook/addon-interactions'),
getAbsolutePath('@storybook/addon-console'),
{
name: 'storybook-addon-sass-postcss',
options: {
Expand All @@ -17,11 +19,23 @@ const config: StorybookConfig = {
},
},
},
'@chromatic-com/storybook',
],

framework: {
name: '@storybook/react-vite',
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},

docs: {},

typescript: {
reactDocgen: 'react-docgen-typescript',
},
};

export default config;

function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')));
}
4 changes: 3 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Preview } from '@storybook/react';
import 'tgui-styles';
import '../stories/assets/fonts.css';
import '../stories/assets/all.min.css';
import { withConsole } from '@storybook/addon-console';
import '../lib/styles/main.scss';

const preview: Preview = {
parameters: {
Expand All @@ -17,7 +17,9 @@ const preview: Preview = {
},
},
},

decorators: [(storyFn, context) => withConsole()(storyFn)(context)],
tags: ['autodocs'],
};

export default preview;
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
"type": "module",
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@chromatic-com/storybook": "3.2.2",
"@chromatic-com/storybook": "^3.2.3",
"@popperjs/core": "^2.11.8",
"@storybook/addon-console": "^3.0.0",
"@storybook/addon-essentials": "8.4.4",
"@storybook/addon-interactions": "8.4.4",
"@storybook/addon-onboarding": "8.4.4",
"@storybook/blocks": "8.4.4",
"@storybook/react": "8.4.4",
"@storybook/react-vite": "8.4.4",
"@storybook/test": "8.4.4",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-onboarding": "^8.4.7",
"@storybook/blocks": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-vite": "^8.4.7",
"@storybook/test": "^8.4.7",
"@types/node": "^22.9.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
Expand All @@ -58,9 +58,8 @@
"prettier": "^3.3.3",
"react-popper": "^2.3.0",
"sass": "^1.81.0",
"storybook": "8.4.4",
"storybook": "^8.4.7",
"storybook-addon-sass-postcss": "^0.3.2",
"tgui-styles": "^0.0.8",
"typescript": "^5.6.3",
"vite": "^5.4.11",
"vite-plugin-dts": "^4.3.0"
Expand All @@ -69,5 +68,5 @@
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"packageManager": "pnpm@9.13.0+sha512.beb9e2a803db336c10c9af682b58ad7181ca0fbd0d4119f2b33d5f2582e96d6c0d93c85b23869295b765170fbdaa92890c0da6ada457415039769edf3c959efe"
"packageManager": "pnpm@9.15.1+sha512.1acb565e6193efbebda772702950469150cf12bcc764262e7587e71d19dc98a423dff9536e57ea44c49bdf790ff694e83c27be5faa23d67e0c033b583be4bfcf"
}
Loading

0 comments on commit 7a662ee

Please sign in to comment.