Skip to content

Commit 27d0d84

Browse files
committed
ci(#10336): use TurboSnap
1 parent bc5be83 commit 27d0d84

File tree

4 files changed

+77
-66
lines changed

4 files changed

+77
-66
lines changed

.github/workflows/storybook.yml

+9-12
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ name: Storybook
22

33
on:
44
push:
5-
branches:
6-
- master
7-
- develop
8-
pull_request:
9-
branches-ignore:
10-
- l10n_develop
115

126
jobs:
137
build:
@@ -43,14 +37,17 @@ jobs:
4337
uses: chromaui/action@v1
4438
with:
4539
exitOnceUploaded: true
40+
externals: |
41+
- "assets/**"
42+
- "fluent-emojis/**"
43+
- "locales/**"
44+
- "misskey-assets/**"
45+
- "packages/frontend/assets/**"
46+
- "packages/frontend/public/**"
47+
onlyChanged: "!(l10n_develop)"
4648
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
49+
storybookBaseDir: packages/frontend
4750
storybookBuildDir: storybook-static
48-
workingDir: packages/frontend
49-
- name: Compare on Chromatic
50-
if: github.event_name == 'pull_request_target'
51-
run: pnpm --filter frontend chromatic -d storybook-static --exit-once-uploaded --patch-build ${{ github.head_ref }}...${{ github.base_ref }}
52-
env:
53-
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
5451
- name: Upload Artifacts
5552
uses: actions/upload-artifact@v3
5653
with:

packages/frontend/.storybook/main.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { resolve } from 'node:path';
22
import type { StorybookConfig } from '@storybook/vue3-vite';
33
import { mergeConfig } from 'vite';
4+
import turbosnap from 'vite-plugin-turbosnap';
45
const config = {
56
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
67
addons: [
@@ -22,6 +23,11 @@ const config = {
2223
},
2324
async viteFinal(config, options) {
2425
return mergeConfig(config, {
26+
plugins: [
27+
turbosnap({
28+
rootDir: config.root ?? process.cwd(),
29+
}),
30+
],
2531
build: {
2632
target: [
2733
'chrome108',

packages/frontend/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"storybook": "7.0.2",
132132
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
133133
"summaly": "github:misskey-dev/summaly",
134+
"vite-plugin-turbosnap": "^1.0.1",
134135
"vitest": "^0.29.8",
135136
"vitest-fetch-mock": "^0.2.2",
136137
"vue-eslint-parser": "9.1.0",

pnpm-lock.yaml

+61-54
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)