[RRFC] Ensure that binaries defined by the current package are recognized as available binaries inside itself by npm run
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 778
- Forks
- 266
- PR merge metrics
- No merged PRs in 30d
Description
Motivation ("The Why")
The motivations behind this is that it seems natural to me, even if a bit niche, and scripts defined like this are the cleanest possibly way to write them that I can think of:
{
"name": "pkg",
"bin": "./src/index.js",
"scripts": {
"something": "pkg something"
}
}
Notice how the something script inside pkg references the pkg bin, i.e. itself.
Example
See above.
How
Current Behaviour
Currently running an npm run something leads to an error saying that pkg has not been found.
Desired Behaviour
npm run should take into consideration the binaries defined by the current package, and consider them as available binaries too.
References
- Original npm/cli issue: https://github.com/npm/cli/issues/6141
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the motivation, example package manifest, and the linked original npm/cli issue #6141. Investigate how npm run exposes package binaries and determine the proposal needed so a package's own bin is available to its scripts; done means the behavior is specified clearly enough for implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100