eduardconstantin / storybook-genie Goto Github PK
View Code? Open in Web Editor NEWStorybook Genie is a command line interface tool that can generate Storybook stories from React components
License: MIT License
Storybook Genie is a command line interface tool that can generate Storybook stories from React components
License: MIT License
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
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
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.
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.
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
Optionally, one could pass in a path or glob and the tool would search for components importing the component to generate stories for.
No problems when running with npx
but at least for local development it probably should be included, I think.
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.
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.
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.
I got this error while generating the story,
Error generating story: 404 The model text-davinci-003
has been deprecated, learn more here: https://platform.openai.com/docs/deprecations
we need to update the model
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.