Skip to content

Commit

Permalink
feat(config): warn on deprecated configs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 13, 2022
1 parent 1f2d89a commit b09a328
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
2 changes: 0 additions & 2 deletions lib/auth/sso.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ function sleep (time) {
}

const login = async (npm, { creds, registry, scope }) => {
log.warn('deprecated', 'SSO --auth-type is deprecated')

const opts = { ...npm.flatOptions, creds, registry, scope }
const { ssoType } = opts

Expand Down
11 changes: 1 addition & 10 deletions lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ class Install extends ArboristWorkspaceCmd {
const isGlobalInstall = this.npm.config.get('global')
const where = isGlobalInstall ? globalTop : this.npm.prefix
const forced = this.npm.config.get('force')
const isDev = this.npm.config.get('dev')
const scriptShell = this.npm.config.get('script-shell') || undefined

// be very strict about engines when trying to update npm itself
Expand Down Expand Up @@ -140,14 +139,6 @@ class Install extends ArboristWorkspaceCmd {
args = ['.']
}

// TODO: Add warnings for other deprecated flags? or remove this one?
if (isDev) {
log.warn(
'install',
'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.'
)
}

const opts = {
...this.npm.flatOptions,
auditLevel: null,
Expand All @@ -163,7 +154,7 @@ class Install extends ArboristWorkspaceCmd {
'preinstall',
'install',
'postinstall',
'prepublish', // XXX should we remove this finally??
'prepublish', // XXX(npm9) should we remove this finally??
'preprepare',
'prepare',
'postprepare',
Expand Down
7 changes: 2 additions & 5 deletions test/lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ t.test('with args, dev=true', async t => {
let REIFY_CALLED = false
let ARB_OBJ = null

const { npm, logs } = await loadMockNpm(t, {
const { npm } = await loadMockNpm(t, {
'@npmcli/run-script': ({ event }) => {
SCRIPTS.push(event)
},
Expand Down Expand Up @@ -41,10 +41,7 @@ t.test('with args, dev=true', async t => {
npm.prefix = path.resolve(t.testdir({}))

await npm.exec('install', ['fizzbuzz'])
t.match(
logs.warn,
[['install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.']]
)

t.match(
ARB_ARGS,
{ global: false, path: npm.prefix, auditLevel: null },
Expand Down

0 comments on commit b09a328

Please sign in to comment.