sezna / nps

NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
MIT License
1.43k stars 93 forks source link

nps [enter] should list only top level commands by default. #236

Open nagarsuresh opened 2 years ago

nagarsuresh commented 2 years ago

First of all its an awesome tool and I can't imagine how as i was working without it..

nps command by default displays all scripts defined in the package-scripts i.e

nps [enter]

lists down all the nps scripts available, but this lists all the scripts even when they are not TOP level script or dependent scripts. Please change nps default command to only list the TOP level scripts which are not dependent on other scripts and may have additional flag to list all scripts e.g.

module.exports = {
  scripts: {
      build: npsUtils.series.nps('prebuild', 'buildOnly', 'postbuild'),
      prebuild: '...',
      buildOnly: .....
      postbuild: .....
  }
}
nps [enter]

build - ............
prebuild - ..............
buildOnly - ................
postbuild: ...............

It should by default only display "build" script and may be add additional flag like

nps <enter>
build - ............

-------------------------
nps --all

to display all scripts.