Skip to content

Commit

Permalink
Fixed stroybook build issue, added a gh action for storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
metincansiper committed Jan 3, 2024
1 parent 782001c commit 04e263a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Storybook
on:
push:
branches:
- dev

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Install and Build
run: |
npm install
npm run build-storybook
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: storybook-static # output folder from `npm run build-storybook`
9 changes: 9 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { StorybookConfig } from "@storybook/react-vite";
import { withoutVitePlugins } from '@storybook/builder-vite';

const config: StorybookConfig = {
stories: [
Expand All @@ -18,5 +19,13 @@ const config: StorybookConfig = {
docs: {
autodocs: "tag",
},
async viteFinal(config, { configType }) {
// Return the altered config
return {
...config,
plugins: await withoutVitePlugins(config.plugins, ['vite:lib-inject-css']),
};
},
};

export default config;
4 changes: 2 additions & 2 deletions docs/stories/Overlay.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef } from 'react';
import type { Meta, Story } from '@storybook/react';
import type { Meta, StoryFn } from '@storybook/react';
import BoundedOverlayManager, { Overlay, PredefinedPosition } from '../../lib/main';

const meta: Meta = {
Expand Down Expand Up @@ -43,7 +43,7 @@ const meta: Meta = {

export default meta;

const OverlayStory: Story = (args: any) => {
const OverlayStory: StoryFn = (args: any) => {
const boundingComponentRef = useRef(null);

return (
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 04e263a

Please sign in to comment.