sezna / nps

NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

All help-style (all, scripts, basic) commands fail

deadcoder0904 opened this issue · comments

  • nps version: 5.7.1
  • node version: 9.5.0
  • npm version: 5.6.0

Scripts file (or at least the relevant bits):

"scripts" : {
  "help": "nps help \"--help-style all\""
}

The command executed:

npm run help

The output:

> nps help "--help-style all"

You provided one or more invalid flags: help-style all, helpStyleAll Did you forget to put your command in quotes? https://github.com/kentcdodds/nps/blob/v5.7.1/other/ERRORS_AND_WARNINGS.md#invalid-flags
<my-project>/node_modules/.registry.npmjs.org/nps/5.7.1/node_modules/nps/dist/bin-utils/parser.js:106
    throw new Error(`invalid flag(s) passed: ${invalidFlags}`);
    ^

Error: invalid flag(s) passed: help-style all,helpStyleAll
    at parse (<my-project>/node_modules/.registry.npmjs.org/nps/5.7.1/node_modules/nps/dist/bin-utils/parser.js:106:11)
    at Object.<anonymous> (<my-project>/node_modules/.registry.npmjs.org/nps/5.7.1/node_modules/nps/dist/bin/nps.js:22:33)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Function.Module.runMain (module.js:701:10)
    at startup (bootstrap_node.js:190:16)
    at bootstrap_node.js:662:3

Problem description:

Show help scripts with description. All help-style commands fail.

Suggested solution:

Make --help-style command work.

Hey actually nothing works from https://github.com/kentcdodds/nps/blob/master/src/bin-utils/parser.js#L32-L62

I tried nps help "--log-level info". Is there something I am doing wrong ❓

@kentcdodds it looks like there hasn't been a release auto-published since last August, so anything that has been merged since then hasn't been getting pushed.

Thanks for letting me know @K3TH3R. I've fixed the travis config so the releases should go out, but now the build is failing. I'm unable to dedicate much time to this project at the moment, but will accept a PR from anyone who can fix the build.

Tests failed because of timeout. @kentcdodds can we run build again manually? I pulled the newest version and all tests are passing locally and all snapshots are updated.

@edit Tried restarting but now other tests failed 🤔

Ok, I ran it again and it's green 👍 No idea what's going on... Someone should probably look into this...

I think we can close this issue, the main problem is solved and cli's tests stability improved.

@deadcoder0904 @Miklet this still doesn't work.

screen shot 2018-04-25 at 1 30 39 pm

Getting the same error as above.

Same issue here:

Using:

nps help "--help-style scripts"

Results in:

You provided one or more invalid flags: help-style scripts, helpStyleScripts Did you forget to put your command in quotes? https://github.com/kentcdodds/nps/blob/v5.9.3/other/ERRORS_AND_WARNINGS.md#invalid-flags
/Users/me/Sites/frontend/node_modules/nps/dist/bin-utils/parser.js:112
    throw new Error(`invalid flag(s) passed: ${invalidFlags}`);
    ^

Error: invalid flag(s) passed: help-style scripts,helpStyleScripts
  • "nps": "^5.9.3",
  • "nps-utils": "^1.7.0",

@Miklet Looks like this issue needs to be reopened …

If you do it like this:

nps --help-style basic help

or like this:
nps help --help-style basic

It accepts with no errors.
But if you try it with an invalid argument like:
nps --help-style basic help

Results in:

Invalid values:
  Argument: help-style, Given: "basics", Choices: "all", "scripts", "basic"