Skip to content

Commit

Permalink
use Storybook with Vite for demonstration
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxbse committed Jun 26, 2024
1 parent 7f87c05 commit 1f9d48d
Show file tree
Hide file tree
Showing 11 changed files with 19,818 additions and 153 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
/node_modules
/umd
npm-debug.log*
/.idea
/dist
*storybook.log
/storybook-static
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ src
demo
.gitattributes
/.idea
*storybook.log
/storybook-static
18 changes: 18 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/** @type { import('@storybook/react-vite').StorybookConfig } */
const config = {
stories: [
"../src/*.mdx",
"../src/**/*.mdx",
"../src/*.stories.@(js|jsx|mjs|ts|tsx)",
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
],
addons: [
"@storybook/addon-essentials",
"@storybook/blocks",
],
framework: {
name: "@storybook/react-vite",
options: {},
},
};
export default config;
13 changes: 13 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @type { import('@storybook/react').Preview } */
const preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
## Prerequisites

[Node.js](http://nodejs.org/) >= v4 must be installed.
[Node.js](http://nodejs.org/) >= v18 must be installed.

## Installation

- Running `npm install` in the app's root directory will install everything you need for development.

## Development Server

- `npm start` will run the app's demo folder at [http://localhost:3000](http://localhost:3000) with hot module reloading.
- `npm start` will run the app's [Storybook](https://storybook.js.org/) at [http://localhost:3000](http://localhost:3000) with hot module
reloading.

## Building

Expand Down
38 changes: 0 additions & 38 deletions demo/src/index.js

This file was deleted.

Loading

0 comments on commit 1f9d48d

Please sign in to comment.