Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7be97b3
[feat] Add Storybook setup and NodePreview story
snomiao Aug 9, 2025
308b3cd
[feat] Improve Storybook configuration and setup
snomiao Aug 10, 2025
6244caf
[docs] Add comprehensive Storybook documentation
snomiao Aug 10, 2025
2b86f41
[refactor] Remove ts-expect-error comment from Storybook preview
snomiao Aug 11, 2025
88baf87
[bugfix] Fix TypeScript errors in Load3D components and GLTF test
snomiao Aug 12, 2025
799b760
[feat] Add Chromatic GitHub Action for Storybook visual testing
snomiao Aug 12, 2025
1411481
[docs] Add Chromatic documentation to Storybook README
snomiao Aug 12, 2025
1e93567
chore(chromatic.yaml): restrict push branches to main only for better…
snomiao Aug 12, 2025
ac37a5e
[feat] Rebase branch onto main and update Storybook configuration
snomiao Aug 13, 2025
cd787c5
[bugfix] Fix TypeScript errors in SubgraphNode type checking
snomiao Aug 13, 2025
cf4ab95
fix(vite.config.mts): correct path alias for src directory to ensure …
snomiao Aug 13, 2025
ceec83b
[feat] Remove bun.lock as it's now ignored
snomiao Aug 14, 2025
b2a97ee
[bugfix] Fix Storybook builder require() error by converting main.ts …
snomiao Aug 14, 2025
62747ec
chore(storybook): replace main.mjs with main.ts for improved type saf…
snomiao Aug 15, 2025
205f455
[feat] Optimize Chromatic workflow with automated PR status comments
snomiao Aug 15, 2025
a89b9e8
chore(chromatic.yaml): move permissions section inside the chromatic-…
snomiao Aug 15, 2025
74a83fa
[fix] Resolve Vite CJS deprecation warning in Storybook config
snomiao Aug 15, 2025
171d096
fix(chromatic.yaml): change edit-mode from replace to append to prese…
snomiao Aug 15, 2025
c877223
[fix] Replace __dirname with process.cwd() in Storybook config
snomiao Aug 16, 2025
26dbbb1
feature: storybook-setting (#5088)
viva-jinyi Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[feat] Improve Storybook configuration and setup
- Add comprehensive PrimeVue theme setup with ComfyUI preset
- Configure proper Vue app setup with Pinia stores, i18n, and services
- Remove unused onboarding addon from Storybook dependencies
- Improve Vite configuration with better chunking and alias resolution
- Add proper CSS imports and styling for ComfyUI components

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
snomiao and claude committed Aug 19, 2025
commit 308b3cd334913fd479ae23ccfb088b29a1f85a8f
42 changes: 37 additions & 5 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,53 @@
import type { StorybookConfig } from '@storybook/vue3-vite'
import { mergeConfig } from 'vite'
import { type InlineConfig, mergeConfig } from 'vite'
import path from 'path'
import { fileURLToPath } from 'url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: ['@storybook/addon-docs', '@storybook/addon-onboarding'],
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: ['@storybook/addon-docs'],
framework: {
name: '@storybook/vue3-vite',
options: {}
},
async viteFinal(config) {
return mergeConfig(config, {
server: {
allowedHosts: true
},
resolve: {
alias: {
'@': '/src'
'@': __dirname + '/../src'
}
},
build: {
rollupOptions: {
external: (id) => {
// Suppress warnings for unused Vue internal imports
return false
},
onwarn: (warning, warn) => {
// Suppress specific warnings
if (warning.code === 'UNUSED_EXTERNAL_IMPORT' && warning.message?.includes('resolveComponent')) {
return
}
warn(warning)
},
output: {
manualChunks: {
'vue-vendor': ['vue', 'vue-router'],
'primevue': ['primevue/config', 'primevue'],
'storybook-docs': ['@storybook/docs-tools'],
'litegraph': ['./src/lib/litegraph']
}
}
},
chunkSizeWarningLimit: 1000
}
})
} satisfies InlineConfig)
}
}
export default config
46 changes: 44 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,53 @@
import { definePreset } from '@primevue/themes'
import Aura from '@primevue/themes/aura'
import { setup } from '@storybook/vue3'
import type { Preview } from '@storybook/vue3-vite'
import { createPinia } from 'pinia'
import 'primeicons/primeicons.css'
import PrimeVue from 'primevue/config'
import ConfirmationService from 'primevue/confirmationservice'
import ToastService from 'primevue/toastservice'
import Tooltip from 'primevue/tooltip'

import '../src/assets/css/style.css'
import { i18n } from '../src/i18n'
import '../src/lib/litegraph/public/css/litegraph.css'
import { useWidgetStore } from '../src/stores/widgetStore'
import { useColorPaletteStore } from '../src/stores/workspace/colorPaletteStore'

const ComfyUIPreset = definePreset(Aura, {
semantic: {
// @ts-expect-error fixme ts strict error
primary: Aura['primitive'].blue
}
})

// Setup Vue app for Storybook
setup((app) => {
// Add Pinia store
app.use(createPinia())
app.directive('tooltip', Tooltip)
const pinia = createPinia()
app.use(pinia)

// Initialize stores
const colorPaletteStore = useColorPaletteStore(pinia)
const widgetStore = useWidgetStore(pinia)

app.use(i18n)
app.use(PrimeVue, {
theme: {
preset: ComfyUIPreset,
options: {
prefix: 'p',
cssLayer: {
name: 'primevue',
order: 'primevue, tailwind-utilities'
},
darkModeSelector: '.dark-theme, :root:has(.dark-theme)'
}
}
})
app.use(ConfirmationService)
app.use(ToastService)
})

const preview: Preview = {
Expand Down
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@pinia/testing": "^0.1.5",
"@playwright/test": "^1.52.0",
"@storybook/addon-docs": "^9.1.1",
"@storybook/addon-onboarding": "^9.1.1",
"@storybook/vue3-vite": "^9.1.1",
"@trivago/prettier-plugin-sort-imports": "^5.2.0",
"@types/dompurify": "^3.0.5",
Expand Down
2 changes: 1 addition & 1 deletion vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default defineConfig({

resolve: {
alias: {
'@': '/src'
'@': './src'
}
},

Expand Down