diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index e66802fe..f166ba3c 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -1,12 +1,6 @@ name: Chromatic CI -on: - # push: - # branches: - # - main - pull_request: - branches: - - main +on: push jobs: chromatic: @@ -20,29 +14,15 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - - run: git fetch origin ${{ github.base_ref }} --depth=1 - - - id: diff - run: echo "::set-output name=changed::$(git diff --name-only origin/${{ github.base_ref }} HEAD --relative ./packages/ui/ | wc -l)" - - name: Install packages uses: ./.github/actions/install-packages - if: ${{ steps.diff.outputs.changed != '0' }} - - # - name: Chromatic - # uses: chromaui/action@latest - # if: ${{ steps.diff.outputs.changed != '0' }} - # with: - # projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} - # workingDir: packages/ui - # exitZeroOnChanges: true - # onlyChanged: true - # env: - # LOG_LEVEL: 'debug' - - - name: Chromatic - if: ${{ steps.diff.outputs.changed != '0' }} - run: | - bun build-storybook - bunx chromatic -d ./packages/ui/storybook-static --storybook-base-dir ./packages/ui --project-token ${{ secrets.CHROMATIC_PROJECT_TOKEN }} --exit-zero-on-changes --only-changed + - name: Run Chromatic + uses: chromaui/action@v1 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + workingDir: ./packages/ui + untraced: \"./packages/!(ui)/**\" + exitZeroOnChanges: true + onlyChanged: true + env: + LOG_LEVEL: 'debug' diff --git a/packages/ui/.storybook/main.js b/packages/ui/.storybook/main.js index 36f5a124..05ca5dea 100644 --- a/packages/ui/.storybook/main.js +++ b/packages/ui/.storybook/main.js @@ -25,7 +25,10 @@ module.exports = { return mergeConfig(config, { plugins: configType === 'PRODUCTION' - ? [turbosnap({ rootDir: config.root }), svgLoader({ defaultImport: 'component' })] + ? [ + turbosnap({ rootDir: config.root ?? process.cwd() }), + svgLoader({ defaultImport: 'component' }), + ] : [svgLoader({ defaultImport: 'component' })], resolve: { alias: { diff --git a/packages/ui/components/forms/TextAreaField.stories.ts b/packages/ui/components/forms/TextAreaField.stories.ts index 1fbcb290..8e7f3797 100644 --- a/packages/ui/components/forms/TextAreaField.stories.ts +++ b/packages/ui/components/forms/TextAreaField.stories.ts @@ -15,6 +15,17 @@ const meta: Meta = { label: { control: 'text' }, errorMessage: { control: 'text' }, }, + render: (args) => ({ + components: { TextAreaField }, + setup() { + const detail = ref() + return { args,detail } + }, + template: `
+

v-model value: {{ detail }}

+ +
`, + }) } export default meta @@ -49,19 +60,3 @@ export const withErrorMessage: Story = { errorMessage: 'エラーメッセージを表示します', }, } - -export const vModel: Story = { - name: '[for dev] v-model', - render: (args) => ({ - components: { TextAreaField }, - setup() { - const detail = ref() - return { args,detail } - }, - template: `
-

親コンポーネント側のv-model値: {{ detail }}

- -
`, - }) - -}