Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Chromatic PR Preview

on:
pull_request:
branches:
- main

jobs:
chromatic:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- run: npm ci

- name: Build Storybook
run: npm run build-storybook

- name: Run Chromatic
id: chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: storybook-static
exitZeroOnChanges: true

- name: Post Storybook link as PR comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `📚 **Storybook Preview**: ${{ steps.chromatic.outputs.storybookUrl }}`
})
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- run: npm ci
- run: npm run lint
- run: npm test
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
node_modules
.mypy_cache
.vscode
build
dist
node_modules
storybook.log
storybook-static
.mypy_cache
.vscode
debug-storybook.log
10 changes: 6 additions & 4 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const config = {
stories: ["../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
stories: [
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
],

addons: [
"@storybook/addon-links",
Expand All @@ -20,10 +23,9 @@ const config = {
typescript: {
reactDocgen: "react-docgen-typescript"
},
previewBody: (body: any) => `
previewBody: (body: any) => `
${body}
${
`<script
${`<script
src="syncTheme.js"
type="application/javascript"
></script>`
Expand Down
Loading
Loading