Skip to content

Commit c4cd5c2

Browse files
feature: project upgraded to typescript (#5)
* upgraded project to typescript removed all js files * added a github workflow for deployment * split github actions into separate files * storybook upgraded * updates * storybook deploy branch switched
1 parent c4e8709 commit c4cd5c2

14 files changed

Lines changed: 6562 additions & 26386 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy Storybook
2+
3+
on:
4+
push:
5+
branches: [gh-pages]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "20"
23+
cache: "npm"
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build Storybook
29+
run: npm run build-storybook
30+
31+
- name: Deploy to GitHub Pages
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: ./storybook-static

.github/workflows/publish-npm.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '18'
18+
registry-url: 'https://registry.npmjs.org'
19+
cache: 'npm'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build package
25+
run: npm run compile
26+
27+
- name: Publish to npm
28+
run: npm publish
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.storybook/main.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1-
import type { StorybookConfig } from "@storybook/react-webpack5";
1+
import type { StorybookConfig } from "@storybook/react-vite";
22

33
const config: StorybookConfig = {
4-
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(ts|tsx)"],
55
addons: [
66
"@storybook/addon-links",
77
"@storybook/addon-essentials",
8-
"@storybook/addon-onboarding",
98
"@storybook/addon-interactions",
109
],
1110
framework: {
12-
name: "@storybook/react-webpack5",
13-
options: {
14-
builder: {
15-
useSWC: true,
16-
},
17-
},
18-
},
19-
docs: {
20-
autodocs: "tag",
11+
name: "@storybook/react-vite",
12+
options: {},
2113
},
2214
};
2315
export default config;

.storybook/preview.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Preview } from "@storybook/react";
22

33
const preview: Preview = {
44
parameters: {
5-
actions: { argTypesRegex: "^on[A-Z].*" },
65
controls: {
76
matchers: {
87
color: /(background|color)$/i,

babel.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"presets": [
3-
"@babel/preset-typescript",
3+
["@babel/preset-typescript", { "isTSX": true, "allExtensions": true }],
44
"@babel/preset-env",
5-
"@babel/preset-react"
5+
["@babel/preset-react", { "runtime": "automatic" }]
66
]
77
}

0 commit comments

Comments
 (0)