-
Notifications
You must be signed in to change notification settings - Fork 54
feat(commands): add 'deprecate' command #23
Conversation
|
How do you feel about pulling in otplease? |
zkat
left a comment
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.
Looks fine if it works as-is! I'm surprised by yargs magic sometimes
|
|
||
| return BB.try(() => { | ||
| // fetch the data and make sure it exists. | ||
| const p = libnpm.parseArg(argv['pkg@version']) |
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.
This is so strange. Is this seriously handled just like that by yargs?!
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.
I first thought I would have to manually join the package name and the version, but then I ran the debugger and spotted that:

Fortunately it seems to work the way we want, but even the yargs docs don't seem to document what happens when two positional arguments are character-separated instead of whitespace-separated. I can't find a more comprehensive document for how it parses command templates.
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.
mind=blown
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.
From what I can tell from the code it seems to just consider those cases as one positional argument, which makes sense.
I could definitely give it a shot tomorrow. |
|
One more thing: I just pushed test/ping.js as an example of writing network tests for tink. Would you mind adding test cases for this and getting the command some decent coverage %? (if not 100%)? It should be fairly straightforward if you base it off the ping test. |
re: otplease
|
|
Just pull in what you need. We don't need all of |
I added tests for The only coverage that's missing is the
|
|
This is amazing, thank you! Consider this command done! 🎉 |
This PR adds
tink deprecateas a command, based on the functionality ofnpm deprecate.Code ported from: https://github.com/npm/cli/blob/9a564a55c016642bff3e4ae58ed05a0d6370aaf3/lib/deprecate.js
Changes:
otpleaseas it is not included intinkyet.<message>argument, sinceyargsperforms that validation now.figgy-puddingconfig based on the contents oforg.jsx, though no explicit logging is implemented yet.Tested conditions:
tink deprecate <pkg>[@<version>] <message>tink deprecate <pkg>[@<version>]tink deprecate <pkg> <message>tink deprecate <pkg>[@<malformedversion>] <message>Since I don't have an npm account, I just get to the last step of the process before receiving an HTTP 401 Unauthorized response. Is there a test registry that is used for API testing, or should I just work on the main one?