-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: command specific configuration #13
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Scoped Command Config | ||
|
||
## Summary | ||
|
||
Implement a mechanism to scope configuration to commands explicitely. | ||
|
||
## Motivation | ||
|
||
This change will help resolve many issues user's face when configuring `npm` as the current strategy is to have a single set of global options available to **all** commands. | ||
|
||
## Detailed Explanation | ||
|
||
- expand `.npmrc` to support command-specific configuration | ||
- changes should be as backwards compatible as possible (old `.npmrc` files should still be supported) | ||
- add clear documentation on configuration precedence (ex. arguments vs. command-specific vs. project, user & global vs. globally set vs. `publishConfig`) | ||
|
||
## Rationale and Alternatives | ||
|
||
Currently, the only alternative strategy users have is to manual pass arguments to `npm`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (documentation): Typo in 'manual pass'. The phrase 'manual pass' should be corrected to 'manually pass'. |
||
|
||
## Implementation | ||
|
||
- `npm` should support `npm-` prefixed command configuration in `.npmrc` files | ||
- prefixed command configuration scopes the nested config | ||
|
||
### Example `.npmrc` | ||
|
||
```ini | ||
omit=dev | ||
|
||
# equivalent to `npm install --no-audit --no-fund` | ||
[npm-install] | ||
audit=false | ||
fund=false | ||
|
||
# equivalent to `npm audit --production` | ||
[npm-audit] | ||
production=true | ||
|
||
# equivalent to `npm audit fix --force` | ||
[npm-audit-fix] | ||
force=true | ||
|
||
# equivalent to `npm list --all` | ||
[npm-list] | ||
all=true | ||
|
||
# equivalent to `npm publish --loglevel=silly` | ||
[npm-publish] | ||
loglevel=silly | ||
``` | ||
|
||
## Prior Art | ||
|
||
- N/A | ||
|
||
## Unresolved Questions and Bikeshedding | ||
|
||
- N/A |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
issue (documentation): Typo in 'explicitely'.
The word 'explicitely' should be corrected to 'explicitly'.