Skip to content

Commit

Permalink
Merge pull request #117 from vuejs-jp/feature/setup-turbosnap
Browse files Browse the repository at this point in the history
chore: fix turbosnap setting
  • Loading branch information
jiyuujin authored Apr 25, 2024
2 parents 68d1c54 + f2171ee commit 9950a3c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 48 deletions.
42 changes: 11 additions & 31 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Chromatic CI

on:
# push:
# branches:
# - main
pull_request:
branches:
- main
on: push

jobs:
chromatic:
Expand All @@ -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'
5 changes: 4 additions & 1 deletion packages/ui/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
27 changes: 11 additions & 16 deletions packages/ui/components/forms/TextAreaField.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ const meta: Meta<typeof TextAreaField> = {
label: { control: 'text' },
errorMessage: { control: 'text' },
},
render: (args) => ({
components: { TextAreaField },
setup() {
const detail = ref<string>()
return { args,detail }
},
template: `<div style="width: 400px;">
<p>v-model value: {{ detail }}</p>
<TextAreaField v-model:inputted-text="detail" :="args" />
</div>`,
})
}

export default meta
Expand Down Expand Up @@ -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<string>()
return { args,detail }
},
template: `<div style="width: 400px;">
<p>親コンポーネント側のv-model値: {{ detail }}</p>
<TextAreaField v-model:inputted-text="detail" :="args" />
</div>`,
})

}

0 comments on commit 9950a3c

Please sign in to comment.