-
Notifications
You must be signed in to change notification settings - Fork 239
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
RFC: Command Specific Configuration #566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes please, this should have been in v1 :-D
Can there be an optional parent scope for a "config version"? It wouldn't be tied directly to the npm version but it would allow us to making breaking config changes and still honor older versions. Concerns:
[config-version=3]
[npm-audit]
fix=true
[config-version=4]
[npm-audit]
fix=false |
I don't think it'd be possible to have more than one config version at a time? since config can come from env vars, CLI args, and any of 4 possible npmrc files (5 if you include child workspaces), i think it's got to be an all or nothing thing. |
😍 Does that mean we'd be able to do [npm-install]
ignore-scripts=true ? How would that interact with other related commands, e.g. Might be out of scope here, but I guess |
@dominykas yes, your example is correct.
This is a good question. IMO, your example shouldn't effect
You're right, there may be a case where you want to do something for |
It seems like they probably should - |
Yeah, I agree - for both cases - Edit: or maybe there's a way to find a syntax that applies to multiple commands? |
Actions
|
Why have a special ini-style syntax for a node program? JSON. Human readable. Machine readable. Easy to integrate with CI. Easy to batch edit with No special dependencies or parsers required. No complexity from YAML. No confusion with TOML. You could easily auto-update existing .npmrc to .npmrc.json and never regret it. I just happened across this due to npm/cli#5279, but it seems an oversight that .npmrc was ever not JSON (especially considering that comments aren't preserved anyway) and no better time to fix it than before it's too late. :) |
@coolaj86 npmrc has been ini since time immemorial and that's unlikely to change; it doesn't really matter why it's that way, but it simply is. It is about 12 years "too late" to make such a breaking change. |
Nonsense. The whole And the whole And a dozen of other instances since at least v5 onwards. npm makes breaking changes all the time. Making a breaking change that requires less custom code and that's easier to implement, verify, and automate will of course get the same backlash of any of the other breaking changes (XKCD: Workflow), but think of all the CI systems that will get to drop a few dozen dependencies and all the supply chain attacks that will save us from, and all the automation it will make easier.
(hopefully most of the automation tooling updated to |
just for perspective if we switched to JSON this would only drop one dependency, that being the |
Rendered RFC