readme-md-generator
readme-md-generator copied to clipboard
Available Scripts
What do you think about a session Available Scripts
?
Getting all your scrpts
commands on package.json
file. Like generated apps with create-react-app
.
If is ok I can try to do this.
Hi @davidsonsns
Thanks for opening the issue 👍
I already thought about this feature, but the problem is that the project might be something like a library or a CLI. In this case, suggest scripts command from the package.json
would not make sense unfortunately 😕
Please let me know if you have a solution anyway 😄
I have a partial solution for this. Look for the bin
part of the package.json. If found you know that it is a CLI.
And how to know if it's a standard project (like an app) or a library ?
One Idea that just came to mind is to check the "main" file for exports. If exports are present then we are most likely looking at a library. If there is no export then I would think that the whole thing starts a self contained something...
This could also work with transpiled code like typescript
#justanidea
Hmmm that might be a solution indeed 😉 Are you interested in doing a PR ?
Can give it a try but can not promise that it will happen in a timely fashion. Sadly working on a little thing of my own at the time. But if someone would like to talk about ti I can be reached at
Hey, I think @dejanfajfar idea to detect if the project is a library or an actuel app is great. However, I don't think it makes more sense to display available scripts only for an app or for a library. Both of them could have scripts that would not really make sense to display in a readme - scripts defined only to run on a continious integration server for example.
So here is my proposal : no matter the project type, ask if she/he wants to display the available scripts, if yes, ask if we should display all scripts. Finaly if the answer is no, display a list of all available scripts and allow the user to select which ones he wants to see on the readme.
What do you think :) ?
Or maybe always display the list of all available scripts (items are not selected by default), and let the user choose which one he want to embed?
Hum my guess is it would cause problem if we do that in one step. Like :
Display available scripts ?
- No
- All
- script start
- script build
- script test
If the user chooses "No", we should go to the next step, same for "All". But for the other options, he/she should be able to choose many. It might be confusing to have some option which directly make you go to the next step, and some others not. So maybe it would be simpler to have something like :) ?
Display available scripts ?
- Yes
- No
If "Yes" : Which ones :
- All
- Only some of them
If "Only some of them" : (select multiple)
- script start
- script build
- script test ...
I'll work on it :)