storybook-gpt
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Storybook-GPT

Storybook-GPT is a tool designed to automate the creation of Storybook stories for React components. The tool leverages the power of GPT-4 to generate clean, readable, and standardized story code. This generated code adheres strictly to CSF3 (Component Story Format 3) conventions.

Installation

pnpm i storybook-gpt

Usage

You have to provide an OpenAi key through a env variable

OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Then you can generate your stories with the following command

pnpm run storybook-gpt

Configuration

A storybook-gpt-config.json file must be created before launching the script.

The config file accept the following properties:

  • components: the path where your components live
  • stories: the path where tout stories love
  • exclude: an array of regex defining paths/files to be excluded when reading components

Example:

{
  "components": "components",
  "stories": "storybook",
  "exclude": ["ui"]
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Dependencies (3)

Dev Dependencies (14)

Package Sidebar

Install

npm i storybook-gpt

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

92.7 kB

Total Files

21

Last publish

Collaborators

  • tommy-bez