Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init Storybook and replace from Vite.js #73

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
- name: Install and Build 🔧
run: |
npm ci
npm run build
npm run build-storybook
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'dist'
path: 'storybook-static'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

*storybook.log
storybook-static
9 changes: 9 additions & 0 deletions .storybook/CustomTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { create } from "@storybook/theming/create";

export default create({
base: "light",
brandTitle: "FOIL4G",
brandUrl: "https://unopengis.github.io/foil4g/",
brandImage: "https://i.gyazo.com/a19117e21c1c918c2218a337877ed77e.jpg",
brandTarget: "_blank",
});
11 changes: 11 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
framework: {
name: "@storybook/react-vite",
options: {},
},
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [],
};
export default config;
24 changes: 24 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { addons } from "@storybook/manager-api";

import CustomTheme from "./CustomTheme.ts";

addons.setConfig({
theme: CustomTheme,
navSize: 300,
bottomPanelHeight: 100,
rightPanelWidth: 100,
enableShortcuts: true,
showToolbar: true,
showPanel: false,
initialActive: "sidebar",
sidebar: {
showRoots: true,
},
toolbar: {
title: { hidden: false },
zoom: { hidden: true },
eject: { hidden: false },
copy: { hidden: false },
fullscreen: { hidden: true },
},
});
21 changes: 21 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react";
import type { Preview } from "@storybook/react";
import { themes } from "@storybook/theming";

const preview: Preview = {
parameters: {
docs: { theme: themes.dark },
options: {
bottomPanelHeight: 0,
},
},
decorators: [
(Story) => (
<div style={{ width: "100vw", height: "100vh" }}>
<Story />
</div>
),
],
};

export default preview;
Loading