Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

[WIP] feat: Add ability to deprecate singular config values #68

Closed
wants to merge 1 commit into from

Conversation

jumoel
Copy link

@jumoel jumoel commented Jul 1, 2022

What

Add the ability to deprecate single values for options, instead of just whole options.

Allows definitions to have a deprecatedValues array, that lists the values that are deprecated.

Why

Allows for instance the --auth-type configuration option to have non-deprecated as well as deprecated values.

References

@jumoel jumoel force-pushed the jumoel/deprecate-singular-config-values branch 2 times, most recently from 65af934 to 77e4d70 Compare July 1, 2022 10:10
@jumoel jumoel force-pushed the jumoel/deprecate-singular-config-values branch from 77e4d70 to b619bc8 Compare July 1, 2022 10:10
@@ -507,7 +511,13 @@ class Config {

[_checkDeprecated] (key, where, obj, kv) {
// XXX(npm9+) make this throw an error
if (this.deprecated[key]) {
const value = obj[key]
const hasDeprecatedValues = Array.isArray(this.deprecatedValues[key])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should deprecatedValues perhaps be a function instead, to make it more generic and work on arbitrary types like Number?

@hfaulds
Copy link

hfaulds commented Jul 13, 2022

Superseded by npm/cli#5149

@hfaulds hfaulds closed this Jul 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants