Skip to content

Commit 29f1fc5

Browse files
committed
build(deps-dev): bump chromatic to 11.0.0 and enable TurboSnap
1 parent 48b40b1 commit 29f1fc5

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

.github/workflows/chromatic.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,5 @@ jobs:
6363
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
6464
buildScriptName: 'storybook:build'
6565
exitOnceUploaded: true
66-
onlyChanged: '!(v*/contrib)'
67-
externals: 'packages/uui-css/lib/**/*.css'
66+
onlyChanged: true,
6867
untraced: '.storybook/images/**/*,storyhelpers/**/*'

.storybook/main.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { dirname, join } from 'path';
2+
import turbosnap from 'vite-plugin-turbosnap';
3+
import { mergeConfig } from 'vite';
24
const remarkGfm = require('remark-gfm').default;
35
const tsconfigPaths = require('vite-tsconfig-paths').default;
46

@@ -44,12 +46,21 @@ module.exports = {
4446
const processLitCSSPlugin = (
4547
await import('../scripts/processLitCSSPlugin.mjs')
4648
).default;
47-
config.plugins.push(processLitCSSPlugin());
48-
if (configType === 'DEVELOPMENT') {
49-
// add plugins
50-
config.plugins.push(tsconfigPaths());
51-
}
52-
return config;
49+
50+
return mergeConfig(config, {
51+
plugins: [
52+
processLitCSSPlugin(),
53+
configType === 'PRODUCTION'
54+
? [
55+
turbosnap({
56+
// This should be the base path of your storybook. In monorepos, you may only need process.cwd().
57+
rootDir: process.cwd(),
58+
}),
59+
]
60+
: [],
61+
configType === 'DEVELOPMENT' ? [tsconfigPaths()] : [],
62+
],
63+
});
5364
},
5465
docs: {
5566
autodocs: true,

package-lock.json

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"pack": "node ./scripts/pack-package.js",
4848
"chromatic": "npx chromatic --build-script-name storybook:build",
4949
"storybook": "npm run bootstrap && npm run storybook:analyze && storybook dev -p 6006",
50-
"storybook:build": "npm run bootstrap && npm run storybook:analyze && storybook build --webpack-stats-json",
50+
"storybook:build": "npm run bootstrap && npm run storybook:analyze && storybook build",
5151
"storybook:analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json",
5252
"postinstall": "npm run bootstrap"
5353
},
@@ -82,7 +82,7 @@
8282
"@web/test-runner-playwright": "0.11.0",
8383
"autoprefixer": "10.4.17",
8484
"babel-loader": "9.1.3",
85-
"chromatic": "10.7.1",
85+
"chromatic": "11.0.0",
8686
"element-internals-polyfill": "1.3.10",
8787
"esbuild": "0.20.0",
8888
"eslint": "8.56.0",
@@ -129,6 +129,7 @@
129129
"turbo": "1.12.2",
130130
"typescript": "5.2.2",
131131
"vite": "5.0.12",
132+
"vite-plugin-turbosnap": "^1.0.3",
132133
"vite-tsconfig-paths": "4.3.1",
133134
"web-component-analyzer": "2.0.0"
134135
},

0 commit comments

Comments
 (0)