readme-md-generator icon indicating copy to clipboard operation
readme-md-generator copied to clipboard

Available Scripts

Open davidsonsns opened this issue 5 years ago • 10 comments

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.

davidsonsns avatar Jun 14 '19 20:06 davidsonsns

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 😄

kefranabg avatar Jun 14 '19 20:06 kefranabg

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.

dejanfajfar avatar Jun 17 '19 07:06 dejanfajfar

And how to know if it's a standard project (like an app) or a library ?

kefranabg avatar Jun 17 '19 07:06 kefranabg

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

dejanfajfar avatar Jun 17 '19 11:06 dejanfajfar

Hmmm that might be a solution indeed 😉 Are you interested in doing a PR ?

kefranabg avatar Jun 17 '19 11:06 kefranabg

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

Gitter

dejanfajfar avatar Jun 17 '19 12:06 dejanfajfar

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 :) ?

Orodan avatar Oct 04 '19 21:10 Orodan

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?

kefranabg avatar Oct 05 '19 09:10 kefranabg

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 ...

Orodan avatar Oct 06 '19 08:10 Orodan

I'll work on it :)

Orodan avatar Oct 15 '19 18:10 Orodan