Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve abbrevs for install and help #1622

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/config/cmd-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ const affordances = {
verison: 'version',
ic: 'ci',
innit: 'init',
isntall: 'install',
// manually abbrev so that install-test doesn't make insta stop working
in: 'install',
ins: 'install',
inst: 'install',
insta: 'install',
instal: 'install',
isnt: 'install',
isnta: 'install',
isntal: 'install',
'install-clean': 'ci',
'isntall-clean': 'ci',
hlep: 'help',
'dist-tags': 'dist-tag',
apihelp: 'help',
upgrade: 'update',
udpate: 'update',
login: 'adduser',
Expand Down Expand Up @@ -95,7 +103,6 @@ const cmdList = [
'org',

'help',
'help-search',
'ls',
'll',
'search',
Expand Down Expand Up @@ -124,7 +131,7 @@ const cmdList = [
'exec'
]

const plumbing = ['birthday']
const plumbing = ['birthday', 'help-search']
module.exports = {
aliases: Object.assign({}, shorthands, affordances),
shorthands,
Expand Down
24 changes: 19 additions & 5 deletions tap-snapshots/test-lib-config-cmd-list.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,23 @@ Object {
"affordances": Object {
"add": "install",
"add-user": "adduser",
"apihelp": "help",
"author": "owner",
"dist-tags": "dist-tag",
"find": "search",
"hlep": "help",
"home": "docs",
"ic": "ci",
"in": "install",
"info": "view",
"innit": "init",
"ins": "install",
"inst": "install",
"insta": "install",
"instal": "install",
"install-clean": "ci",
"isntall": "install",
"isnt": "install",
"isnta": "install",
"isntal": "install",
"isntall-clean": "ci",
"issues": "bugs",
"la": "ll",
Expand All @@ -40,7 +47,6 @@ Object {
"aliases": Object {
"add": "install",
"add-user": "adduser",
"apihelp": "help",
"author": "owner",
"c": "config",
"cit": "install-ci-test",
Expand All @@ -50,13 +56,21 @@ Object {
"ddp": "dedupe",
"dist-tags": "dist-tag",
"find": "search",
"hlep": "help",
"home": "docs",
"i": "install",
"ic": "ci",
"in": "install",
"info": "view",
"innit": "init",
"ins": "install",
"inst": "install",
"insta": "install",
"instal": "install",
"install-clean": "ci",
"isntall": "install",
"isnt": "install",
"isnta": "install",
"isntal": "install",
"isntall-clean": "ci",
"issues": "bugs",
"it": "install-test",
Expand Down Expand Up @@ -125,7 +139,6 @@ Object {
"fund",
"org",
"help",
"help-search",
"ls",
"ll",
"search",
Expand Down Expand Up @@ -154,6 +167,7 @@ Object {
],
"plumbing": Array [
"birthday",
"help-search",
],
"shorthands": Object {
"c": "config",
Expand Down
24 changes: 12 additions & 12 deletions tap-snapshots/test-lib-utils-update-notifier.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,73 +6,73 @@
*/
'use strict'
exports[`test/lib/utils/update-notifier.js TAP notification situations color and unicode major > must match snapshot 1`] = `
New major version of npm available! <<major>>-beta.0 → 7.0.0
New major version of npm available! <<major>>-beta.1 → 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm install -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations color and unicode minor > must match snapshot 1`] = `
New minor version of npm available! <<minor>>-beta.0 → 7.0.0
New minor version of npm available! <<minor>>-beta.1 → 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm install -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations color and unicode minor > must match snapshot 2`] = `
New patch version of npm available! <<patch>>-beta.0 → 7.0.0
New patch version of npm available! <<patch>>-beta.1 → 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm install -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations color, no unicode major > must match snapshot 1`] = `
New major version of npm available! <<major>>-beta.0 -> 7.0.0
New major version of npm available! <<major>>-beta.1 -> 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm install -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations color, no unicode minor > must match snapshot 1`] = `
New minor version of npm available! <<minor>>-beta.0 -> 7.0.0
New minor version of npm available! <<minor>>-beta.1 -> 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm install -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations color, no unicode minor > must match snapshot 2`] = `
New patch version of npm available! <<patch>>-beta.0 -> 7.0.0
New patch version of npm available! <<patch>>-beta.1 -> 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm install -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations no color, no unicode major > must match snapshot 1`] = `
New major version of npm available! <<major>>-beta.0 -> 7.0.0
New major version of npm available! <<major>>-beta.1 -> 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm i -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations no color, no unicode minor > must match snapshot 1`] = `
New minor version of npm available! <<minor>>-beta.0 -> 7.0.0
New minor version of npm available! <<minor>>-beta.1 -> 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm i -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations no color, no unicode minor > must match snapshot 2`] = `
New patch version of npm available! <<patch>>-beta.0 -> 7.0.0
New patch version of npm available! <<patch>>-beta.1 -> 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm i -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations unicode, no color major > must match snapshot 1`] = `
New major version of npm available! <<major>>-beta.0 → 7.0.0
New major version of npm available! <<major>>-beta.1 → 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm i -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations unicode, no color minor > must match snapshot 1`] = `
New minor version of npm available! <<minor>>-beta.0 → 7.0.0
New minor version of npm available! <<minor>>-beta.1 → 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm i -g npm to update!
`

exports[`test/lib/utils/update-notifier.js TAP notification situations unicode, no color minor > must match snapshot 2`] = `
New patch version of npm available! <<patch>>-beta.0 → 7.0.0
New patch version of npm available! <<patch>>-beta.1 → 7.0.0
Changelog: https://github.com/npm/cli/releases/tag/v7.0.0
Run npm i -g npm to update!
`
2 changes: 1 addition & 1 deletion tap-snapshots/test-lib-view.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ dist
dist-tags:


published 12 months ago
published a year ago
`

exports[`test/lib/view.js TAP should log package info package with no versions > must match snapshot 1`] = `
Expand Down