-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Generating README.md #1717
Conversation
function printScripts (pkg, packageManager) { | ||
return Object.keys(pkg.scripts).map(key => { | ||
return [ | ||
`\n### ${descriptions[key]}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
about descriptions
, I think it should be decided dynamically according to features selection at vue create
.
In that implementation, the description which is not necessary is generated in the README.md
.
for example, in the features selection, even if unit test feature is not selected, it will be output to README.md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the file is generated based on the keys on the scripts
section of package.json
. That's what Object.keys(pkg.scripts).map
does. If you don't select unit testing, it won't output the description on README.md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true.
In that phase, it's works, due to package.json
contents is resolved with Generator
.
For #1675, There seems to be no problem with implementation. ✨
As the concern, If third party plugin author want to extend README.md
dynamically, I think that it's not that simple implementation, but it need to implement at Generator
or cli-service
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kazupon That would be even better
Closes #1675.
As suggested in the issue, this PR adds a step to the
vue create
process to create aREADME.md
based on the project'spackage.json
.I got some descriptions from the
cli-ui
package and created generic ones to the others. Please let me know if I missed any script/description.Regarding the code, I used
Array.join
s to try to keep the code as clean as possible. I'm not sure if it's the best solution, but using only template strings in this situation is really messy in my opinion.PS: If tests are necessary to this feature, let me know as well.