Skip to content

Commit

Permalink
fix(storybook): build
Browse files Browse the repository at this point in the history
  • Loading branch information
LufyCZ committed Dec 19, 2024
1 parent 43ac4e5 commit 1fcb4ad
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 4,558 deletions.
16 changes: 10 additions & 6 deletions apps/storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
// Replace your-framework with the framework you are using (e.g., react-vite, vue3-vite)
import type { StorybookConfig } from '@storybook/react-vite'

import path from 'path'
import path, { dirname, join } from 'path'
import { mergeConfig } from 'vite'

const config: StorybookConfig = {
stories: ['../stories/**/*.stories.tsx'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-styling',
'@storybook/addon-designs',
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@storybook/addon-themes'),
getAbsolutePath('@storybook/addon-designs'),
],
framework: {
name: '@storybook/react-vite',
name: getAbsolutePath('@storybook/react-vite'),
options: {},
},
docs: {
Expand Down Expand Up @@ -61,3 +61,7 @@ const config: StorybookConfig = {
}

export default config

function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')))
}
5 changes: 2 additions & 3 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"@storybook/addon-essentials": "8.4.7",
"@storybook/addon-links": "8.4.7",
"@storybook/addon-mdx-gfm": "8.4.7",
"@storybook/addon-styling": "1.3.7",
"@storybook/builder-vite": "8.4.7",
"@storybook/addon-themes": "^8.4.7",
"@storybook/cli": "8.4.7",
"@storybook/react": "8.4.7",
"@storybook/react-vite": "8.4.7",
Expand All @@ -41,7 +40,7 @@
"chromatic": "7.4.0",
"postcss": "8.4.23",
"serve": "14.2.0",
"storybook": "7.4.6",
"storybook": "8.4.7",
"tailwindcss": "3.3.2",
"typescript": "5.7.2",
"vite": "4.3.9"
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/stories/dialog.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default meta
type Story = StoryObj<typeof Dialog>

export const LosslessDialog = {
storyName: 'Simple dialog with no followup',
name: 'Simple dialog with no followup',
args: {},
render: () => {
return (
Expand Down
8 changes: 4 additions & 4 deletions apps/storybook/stories/dialogconfirm.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default meta
type Story = StoryObj<typeof DialogConfirm>

export const Pending = {
storyName: 'Pending',
name: 'Pending',
args: {},
render: () => {
return (
Expand Down Expand Up @@ -80,7 +80,7 @@ export const Pending = {
</DialogReview>
<DialogConfirm
chainId={1}
status="loading"
status="pending"
testId="incentivize-confirmation-modal"
successMessage={'Successfully incentivized V3 pool'}
txHash="0x58c018d0f15df78c392e0850f5ee5e74e1e919213552646d979c9a37e6f5119a"
Expand All @@ -91,7 +91,7 @@ export const Pending = {
} satisfies Story

export const Success = {
storyName: 'Success',
name: 'Success',
args: { chainId: 1, status: 'success' },
render: () => {
return (
Expand Down Expand Up @@ -146,7 +146,7 @@ export const Success = {

// biome-ignore lint/suspicious/noShadowRestrictedNames: This is a storybook
export const Error = {
storyName: 'Error',
name: 'Error',
args: { chainId: 1, status: 'error' },
render: () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/stories/popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const Default = {
} satisfies Story

export const PopoverWithMenu = {
storyName: 'Popover example with command',
name: 'Popover example with command',
args: {
children: 'Popover',
},
Expand Down
6 changes: 3 additions & 3 deletions apps/storybook/stories/select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const Default = {
} satisfies Story

export const Trigger = {
storyName: 'Custom trigger',
name: 'Custom trigger',
args: {
children: 'Select',
},
Expand All @@ -78,7 +78,7 @@ export const Trigger = {
} satisfies Story

export const Caption = {
storyName: 'Including a caption',
name: 'Including a caption',
args: {
children: 'Select',
},
Expand All @@ -104,7 +104,7 @@ export const Caption = {

// biome-ignore lint/suspicious/noShadowRestrictedNames: This is a storybook
export const Error = {
storyName: 'Error caption',
name: 'Error caption',
args: {
children: 'Select',
},
Expand Down
Loading

0 comments on commit 1fcb4ad

Please sign in to comment.