openpencil/.storybook/main.ts
Danila Poyarkov d44c1f9d82
ci: parallelize quality and trim shard builds (#558)
* ci: parallelize quality and trim shard builds

- Split source, package, repository, and Storybook checks into independent jobs

- Build only Core before quick unit shards instead of all public packages

- Keep full package and dist validation in the dedicated package-quality job

- Disable duplicate Storybook component metadata extraction

* fix(ci): build declarations before source checks

* fix(ci): apply review security and docgen settings

- Pin checkout and disable credential persistence

- Declare read-only workflow permissions

- Explicitly disable Storybook Vue docgen

* ci: clarify check and step names

* fix(ci): cap workflow job runtimes

- Limit the WebView dependency install to three minutes

- Limit native contracts to eight minutes

- Limit all other CI jobs to ten minutes

* ci: retry native contracts on a fresh runner

* ci: move native contracts to Ubuntu 24

- Leave the deprecated Ubuntu 22 hosted image

- Retry WebKit dependency provisioning on the current runner image

* ci: prebuild native contract dependencies

* ci: pin native contracts image digest

* fix(ci): authenticate native image pulls

* fix(ci): include Bun archive tooling

* ci: pin updated native contracts image

* fix(tools): register CI image tooling
2026-08-18 22:52:18 +03:00

31 lines
1,022 B
TypeScript

import type { StorybookConfig } from '@storybook/vue3-vite'
import type { PluginOption } from 'vite'
function flattenPlugins(plugins: PluginOption[]): PluginOption[] {
return plugins.flatMap((plugin) => (Array.isArray(plugin) ? flattenPlugins(plugin) : [plugin]))
}
const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|ts)', '../packages/vue/src/**/*.stories.@(js|ts)'],
addons: ['@storybook/addon-docs', '@storybook/addon-a11y', '@storybook/addon-themes'],
framework: {
name: '@storybook/vue3-vite',
options: { docgen: false }
},
viteFinal(config) {
const excludedPluginPrefixes = [
'copy-canvaskit-wasm',
'open-pencil-automation',
'vite-plugin-pwa'
]
config.plugins = flattenPlugins(config.plugins ?? []).filter((plugin) => {
if (!plugin || typeof plugin !== 'object' || !('name' in plugin)) return true
return !excludedPluginPrefixes.some((prefix) => plugin.name.startsWith(prefix))
})
return config
}
}
export default config