-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Renew the storybook (#1074)
[CLNP-2534](https://sendbird.atlassian.net/browse/CLNP-2534) We use **React & Vite** for **storybook**. ### What has been done * Bump up storybook version from v6 to v8 * Clean up the storybook stories * Explain properties under the each module and component [CLNP-2534]: https://sendbird.atlassian.net/browse/CLNP-2534?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: bang9 <gusrn1423@naver.com>
- Loading branch information
Showing
140 changed files
with
4,462 additions
and
14,932 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 |
---|---|---|
|
@@ -9,7 +9,7 @@ __snapshots__/**/* | |
*.spec.js.snap | ||
*.spec.tsx.snap | ||
|
||
*.stories.js | ||
src/stories/** | ||
|
||
*.css | ||
*.scss | ||
|
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
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
# Workflow name | ||
name: Build and Publish Storybook to GitHub Pages | ||
|
||
on: | ||
# Event for the workflow to run on | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# List of jobs | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
# Job steps | ||
steps: | ||
# Manual Checkout | ||
- uses: actions/checkout@v4 | ||
|
||
# Set up Node | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
|
||
#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow | ||
- uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 | ||
with: | ||
install_command: yarn install # default: npm ci | ||
build_command: yarn build-storybook # default: npm run build-storybook | ||
path: storybook-static # default: dist/storybook | ||
checkout: false # default: true |
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 |
---|---|---|
|
@@ -35,3 +35,5 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
.idea/ | ||
|
||
*storybook.log |
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
import { mergeConfig } from 'vite'; | ||
import svgr from 'vite-plugin-svgr'; | ||
import { dirname, join } from 'path'; | ||
|
||
/** | ||
* This function is used to resolve the absolute path of a package. | ||
* It is needed in projects that use Yarn PnP or are set up within a monorepo. | ||
*/ | ||
function getAbsolutePath(value: string): any { | ||
return dirname(require.resolve(join(value, 'package.json'))); | ||
} | ||
|
||
export default { | ||
stories: ['../src/stories/**/*.mdx', '../src/stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
addons: [getAbsolutePath('@storybook/addon-essentials')], | ||
framework: { | ||
name: getAbsolutePath('@storybook/react-vite'), | ||
options: {}, | ||
}, | ||
viteFinal: (config) => { | ||
return mergeConfig(config, { | ||
plugins: [svgr({ include: '**/*.svg' })], | ||
}); | ||
}, | ||
}; |
Oops, something went wrong.