Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-09-08 20:01:20 +0300
committerGitHub <noreply@github.com>2022-09-08 20:01:20 +0300
commit49bbb2fb9d56e02d94da652befaa3d445283090b (patch)
tree22a797d230c641cb99cd4a2bc3679674af5c167a
parent285b39f8d6915823fb424cca7161a0b445b86bd3 (diff)
feat: remove `npm birthday` (#5455)
BREAKING CHANGE: this removes the `npm birthday` command
-rw-r--r--lib/commands/birthday.js17
-rw-r--r--lib/utils/cmd-list.js2
-rw-r--r--tap-snapshots/test/lib/load-all-commands.js.test.cjs9
-rw-r--r--tap-snapshots/test/lib/utils/cmd-list.js.test.cjs1
-rw-r--r--test/lib/commands/birthday.js15
-rw-r--r--test/lib/npm.js4
6 files changed, 3 insertions, 45 deletions
diff --git a/lib/commands/birthday.js b/lib/commands/birthday.js
deleted file mode 100644
index cdd6db628..000000000
--- a/lib/commands/birthday.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const BaseCommand = require('../base-command.js')
-const log = require('../utils/log-shim')
-
-class Birthday extends BaseCommand {
- static name = 'birthday'
- static description = 'Birthday, deprecated'
- static ignoreImplicitWorkspace = true
- static isShellout = true
-
- async exec () {
- this.npm.config.set('yes', true)
- log.warn('birthday', 'birthday is deprecated and will be removed in a future release')
- return this.npm.exec('exec', ['@npmcli/npm-birthday'])
- }
-}
-
-module.exports = Birthday
diff --git a/lib/utils/cmd-list.js b/lib/utils/cmd-list.js
index d74f9878f..c712ece0d 100644
--- a/lib/utils/cmd-list.js
+++ b/lib/utils/cmd-list.js
@@ -138,7 +138,7 @@ const cmdList = [
'whoami',
]
-const plumbing = ['birthday', 'help-search']
+const plumbing = ['help-search']
const abbrevs = abbrev(cmdList.concat(Object.keys(aliases)))
module.exports = {
diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs
index 251aa0ec6..d4a340431 100644
--- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs
+++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs
@@ -57,15 +57,6 @@ Options:
Run "npm help audit" for more info
`
-exports[`test/lib/load-all-commands.js TAP load each command birthday > must match snapshot 1`] = `
-Birthday, deprecated
-
-Usage:
-npm birthday
-
-Run "npm help birthday" for more info
-`
-
exports[`test/lib/load-all-commands.js TAP load each command bugs > must match snapshot 1`] = `
Report bugs for a package in a web browser
diff --git a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs
index 062f9fefd..e76f89014 100644
--- a/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs
+++ b/tap-snapshots/test/lib/utils/cmd-list.js.test.cjs
@@ -474,7 +474,6 @@ Object {
"whoami",
],
"plumbing": Array [
- "birthday",
"help-search",
],
}
diff --git a/test/lib/commands/birthday.js b/test/lib/commands/birthday.js
deleted file mode 100644
index 9156d3df0..000000000
--- a/test/lib/commands/birthday.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const t = require('tap')
-const { load: loadMockNpm } = require('../../fixtures/mock-npm')
-
-t.test('birthday', async t => {
- t.plan(2)
- const { npm } = await loadMockNpm(t, {
- mocks: {
- libnpmexec: ({ args, yes }) => {
- t.ok(yes)
- t.match(args, ['@npmcli/npm-birthday'])
- },
- },
- })
- await npm.exec('birthday', [])
-})
diff --git a/test/lib/npm.js b/test/lib/npm.js
index d9201c8a6..135a02cc9 100644
--- a/test/lib/npm.js
+++ b/test/lib/npm.js
@@ -574,10 +574,10 @@ t.test('aliases and typos', async t => {
const { npm } = await loadMockNpm(t, { load: false })
await t.rejects(npm.cmd('thisisnotacommand'), { code: 'EUNKNOWNCOMMAND' })
await t.rejects(npm.cmd(''), { code: 'EUNKNOWNCOMMAND' })
- await t.rejects(npm.cmd('birt'), { code: 'EUNKNOWNCOMMAND' })
+ await t.rejects(npm.cmd('birthday'), { code: 'EUNKNOWNCOMMAND' })
await t.resolves(npm.cmd('it'), { name: 'install-test' })
await t.resolves(npm.cmd('installTe'), { name: 'install-test' })
- await t.resolves(npm.cmd('birthday'), { name: 'birthday' })
+ await t.resolves(npm.cmd('access'), { name: 'access' })
})
t.test('explicit workspace rejection', async t => {