Skip to content

Commit addaf17

Browse files
authored
Merge pull request #35 from kylekarpack/sb
Add Storybook
2 parents 68e4f86 + b7eaa65 commit addaf17

File tree

13 files changed

+19446
-16545
lines changed

13 files changed

+19446
-16545
lines changed

.github/workflows/storybook.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build and Deploy Storybook
2+
on:
3+
push:
4+
paths: ["stories/**", "src/components/**"] # Trigger the action only when files change in the folders defined here
5+
jobs:
6+
build-and-deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout 🛎️
10+
uses: actions/[email protected]
11+
with:
12+
persist-credentials: false
13+
- name: Install and Build 🔧
14+
run: | # Install npm packages and build the Storybook files
15+
npm ci
16+
npm run build-storybook
17+
- name: Deploy 🚀
18+
uses: JamesIves/[email protected]
19+
with:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
BRANCH: gh-pages # The branch the action should deploy to.
22+
FOLDER: docs-build # The folder that the build-storybook script generates files.
23+
CLEAN: true # Automatically remove deleted files from the deploy branch
24+
TARGET_FOLDER: docs # The folder that we serve our Storybook files from

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ typings/
7676
.fusebox/
7777

7878
dist/
79-
.vscode/
79+
docs-build/

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
legacy-peer-deps=true

.storybook/.babelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react",
5+
"@babel/preset-typescript"
6+
],
7+
"plugins": ["@babel/plugin-transform-modules-commonjs"]
8+
}

.storybook/main.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

.storybook/main.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { StorybookViteConfig } from "@storybook/builder-vite";
2+
3+
const config: StorybookViteConfig = {
4+
stories: ["../stories/**/*.stories.{ts,tsx}"],
5+
addons: ["@storybook/addon-controls"],
6+
core: {
7+
builder: "@storybook/builder-vite",
8+
},
9+
typescript: {
10+
check: false,
11+
checkOptions: {},
12+
},
13+
async viteFinal(config) {
14+
config.base = "/react-github-graph/";
15+
return config;
16+
},
17+
};
18+
19+
export default config;

.storybook/manager.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { addons } from "@storybook/addons";
2+
3+
addons.setConfig({
4+
isFullscreen: false,
5+
showNav: true,
6+
showPanel: true,
7+
showToolbar: true,
8+
panelPosition: "bottom",
9+
sidebarAnimations: true,
10+
enableShortcuts: true,
11+
isToolshown: true,
12+
theme: undefined,
13+
selectedPanel: "controls",
14+
initialActive: "controls",
15+
sidebar: {
16+
showRoots: false,
17+
},
18+
});

.storybook/preview.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": true
3+
}

0 commit comments

Comments
 (0)