Skip to content

Commit

Permalink
chore: setup storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagoporto committed Nov 9, 2024
1 parent eaf5730 commit 7ec2b62
Show file tree
Hide file tree
Showing 9 changed files with 3,526 additions and 725 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@ jobs:
- name: Install Dependencies
run: npm ci --ignore-scripts

# - name: Build app
# env:
# VITE_GTM_ID: ${{ vars.VITE_GTM_ID }}
# run: npm run build
- name: Build app
run: npm run build:site

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './demo'
path: './storybook-static'

- name: Deploy to GitHub Pages
id: deployment
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@

storybook-static
custom-elements.json

*storybook.log
15 changes: 15 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { StorybookConfig } from '@storybook/web-components-vite'

const config: StorybookConfig = {
stories: [
'../src/**/*.story.@(js|jsx|ts|tsx|mdx)',
'../src/**/*.stories.@(js|jsx|ts|tsx|mdx)',
],
addons: ['@storybook/addon-essentials', '@chromatic-com/storybook'],
framework: {
name: '@storybook/web-components-vite',
options: {},
},
staticDirs: ['../demo'],
}
export default config
14 changes: 14 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Preview } from '@storybook/web-components'

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
}

export default preview
34 changes: 19 additions & 15 deletions docs/web-components.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7ec2b62

Please sign in to comment.