diff options
author | Gar <gar+gh@danger.computer> | 2022-08-25 19:46:12 +0300 |
---|---|---|
committer | Luke Karrys <luke@lukekarrys.com> | 2022-08-25 22:08:08 +0300 |
commit | d94a9f56cce1de32bfd87f841d7678e8394d8ea6 (patch) | |
tree | c824d24fbaba33dd99ac923549428126e43fda42 /lib | |
parent | 25618229b7698aa8abbfcd2ef32024809f05a1a1 (diff) |
feat: add deprecation warnings to access commands
Diffstat (limited to 'lib')
-rw-r--r-- | lib/commands/access.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/commands/access.js b/lib/commands/access.js index 0a80da8dd..362186153 100644 --- a/lib/commands/access.js +++ b/lib/commands/access.js @@ -5,6 +5,7 @@ const readPackageJson = require('read-package-json-fast') const otplease = require('../utils/otplease.js') const getIdentity = require('../utils/get-identity.js') +const log = require('../utils/log-shim.js') const BaseCommand = require('../base-command.js') const subcommands = [ @@ -19,6 +20,15 @@ const subcommands = [ '2fa-not-required', ] +const deprecated = [ + '2fa-not-required', + '2fa-required', + 'ls-collaborators', + 'ls-packages', + 'public', + 'restricted', +] + class Access extends BaseCommand { static description = 'Set access level on published packages' static name = 'access' @@ -78,6 +88,10 @@ class Access extends BaseCommand { throw this.usageError(`${cmd} is not a recognized subcommand.`) } + if (deprecated.includes(cmd)) { + log.warn('access', `${cmd} subcommand will be removed in the next version of npm`) + } + return this[cmd](args, { ...this.npm.flatOptions, }) @@ -175,7 +189,7 @@ class Access extends BaseCommand { } async edit () { - throw new Error('edit subcommand is not implemented yet') + throw new Error('edit subcommand is not implemented') } modifyPackage (pkg, opts, fn, requireScope = true) { |