-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from cofacts/storybook
Setup Storybook for LIFF components
- Loading branch information
Showing
11 changed files
with
34,539 additions
and
25,552 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ build/* | |
coverage/* | ||
src/__fixtures__/* | ||
liff/* | ||
storybook-static | ||
!.storybook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build storybook and deploy to gh-pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- run: 'npm i' | ||
|
||
- name: Generate staging .env file | ||
run: 'curl $ENV_URL -o .env' | ||
env: | ||
ENV_URL: ${{ secrets.STAGING_ENV_URL }} | ||
|
||
- run: 'npm run build-storybook' | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,6 @@ client_secret.json | |
data/ | ||
|
||
# Tesseract OCR folder | ||
tmp_image_process | ||
tmp_image_process | ||
|
||
storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
stories: [ | ||
'../src/**/*.stories.mdx', | ||
'../src/**/*.stories.@(js|jsx|ts|tsx|svelte)', | ||
], | ||
addons: [ | ||
'@storybook/addon-links', | ||
{ | ||
name: '@storybook/addon-essentials', | ||
options: { | ||
backgrounds: false, | ||
toolbars: false, | ||
}, | ||
}, | ||
'@storybook/addon-svelte-csf', | ||
], | ||
webpackFinal: async config => { | ||
// Enable project root import paths like 'src/lib/sharedUtils' | ||
// Ref: https://stackoverflow.com/a/65772747/1582110 | ||
config.resolve.modules.push(path.resolve(__dirname, '../')); | ||
|
||
config.module.rules.push({ | ||
test: /\.scss$/, | ||
use: [ | ||
'style-loader', | ||
'css-loader', | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sassOptions: { | ||
// Process svelte-material-ui SCSS files in node_modules as well | ||
includePaths: [ | ||
path.resolve(__dirname, '../node_modules'), | ||
path.resolve(__dirname, '../src/liff'), | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
return config; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'normalize.css'; | ||
import '../src/liff/index.scss'; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.