Coder Social home page Coder Social logo

eduardconstantin / storybook-genie Goto Github PK

View Code? Open in Web Editor NEW
98.0 2.0 8.0 15.89 MB

Storybook Genie is a command line interface tool that can generate Storybook stories from React components

License: MIT License

JavaScript 100.00%
cli commandline-interface components genie openai openai-api reactjs storybook tool generator

storybook-genie's Introduction

Hello there!

An image of @eduard26's Holopin badges, which is a link to view their full Holopin profile

divider

I'm Eduard, a passionate full-time application developer from Romania.

Readme Quotes

๐Ÿ†
My Standings in the "Top GitHub Users in Romania" Leaderboards

  • ๐ŸŽฎ In my free time I play open world games like Grand Theft Auto, Red Dead Redemption or Assassin's Creed
  • ๐ŸŒฑ Iโ€™m currently learning Everything, Everywhere, All at Once
  • ๐Ÿ‘จโ€๐Ÿ’ป All my projects are available in my portfolio
  • โšก Fun fact: I like to sketch
Click ๐Ÿ‘†
    

๐Ÿคทโ€โ™‚๏ธ

Jokes Card
divider

โš› Tech & Tools

Frontend Dev
reactJs nextJs typeScript chartJs tailwind bootstrap sass storybook jest graphQL azure vscode vs unity vuforia
Backend Design
nodeJs C# cosmosDB SQL photoshop figma blender
divider

storybook-genie's People

Contributors

datsfilipe avatar dependabot[bot] avatar eduardconstantin avatar hayawata3626 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

storybook-genie's Issues

Execution Error: 'openai' module's 'Configuration' export not provided"

Description

First of all this library is great! Thank you!

I've been trying to clone and run a project locally, and after following the instructions in the README.md, I encountered an error when executing npm run start. The error message is as follows:

> [email protected] start
> node .

storybook-genie/src/converter.js:1
import { Configuration, OpenAIApi } from "openai";
         ^^^^^^^^^^^^^
SyntaxError: The requested module 'openai' does not provide an export named 'Configuration'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.10.0

Describe the solution you'd like

suspect that the issue is related to the openai package version 4.19.0 this library use, which might not have the Configuration export due to changes made in version 4 of the openai API.

Should I follow the migration document here to make the necessary code changes? If needed, I am willing to undertake this task.
openai/openai-node#217

[Feature] Select storybook template for consistency

Description
The CLI currently generates stories using a default template that may not suit the preferences or conventions of some users. For example, some stories follow a particular template for consistency. Iโ€™d like to be able to point to a template file so that the output of the CLI always follows the same structure.

Describe the solution you'd like
The CLI should provide an option to use a custom template for generating stories. The template file should be a valid JS or TS file that contains the story format and syntax that the user wants to use. The CLI should then use the template file as a base and fill in the relevant details from the components and props files.

[Feature] Inquirer file path alternative

Currently the cli uses Inquirer file path to show the user a file selection input in the terminal. This package uses lodash 3.10.1 which has a security warning.
I am looking for an alternative file path selector in order to remove this warning.

[Feature] Generate from usages

Description

Analyzing a component could generate unrealistic stories. By coupling generation with real examples from a codebase, it would lead to more realistic examples generated in stories

Describe the solution you'd like

Optionally, one could pass in a path or glob and the tool would search for components importing the component to generate stories for.

  • each usage would be deduplicated (based on prop values)
  • they'll be passed to the GPT context so that generated stories could reuse this information

[Feature] Add option to generate multiple stories

Description
Currently, the tool allows the users to select one file that can generate a story from.

Describe the solution you'd like
The user should be able to select if it want to create a single story or multiple. The user should specify the location of the components that wants to generate stories for. The CLI should then generate stories for all the matching files and save them in the same directory as the source files. The CLI should also display a message indicating how many stories were generated and where they were saved.

[Feature] Add support for typescript files

Description
The CLI currently only supports JS files, which limits the users who want to use TypeScript for their projects.

Describe the solution you'd like
The tool should support both TS and JS files by identifying the file extension and creating storybook stories with the corresponding extension.

[Feature] Pass a path to file

Description
The CLI currently requires the user to CD into a specific path where the components are located. This can be inconvenient and time-consuming, especially if the user has multiple directories with different components.

Describe the solution you'd like
The CLI should accept a path or a glob as an optional argument to the storybook-genie generate command. The path or glob should specify the location of the components that the user wants to generate stories for. The CLI should then let the user select for which file wants to generate a stories.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.