`packages` keys do not appear to be true paths
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 711
- Forks
- 4.2k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 3
Description
Documentation for the keys of the packages property in package-lock.json files describes them as "relative paths from the root project folder". This does not appear to be entirely true.
Consider the following package.json:
package.json:
{
"name": "my-project",
"dependencies": {
"@scope/package-a": "^1.0.0",
}
}
Assume also that "@scope/package-a" has a dependency on a package called "@scope.package-b". When npm installs dependencies, the project directory structure looks like this:
my-project
├─node_modules
│ └─@scope
│ ├─package-a
│ └─package-b
├─package.json
└─package-lock.json
However, package-lock.json has the following entry under packages:
"node_modules/@scope/package-a/node_modules/@scope/package-b": {
"version": "1.0.0",
...
},
Notice the path does not actually exist in the directory.
Documentation should be clear about whether this is expected or whether the relative paths, as described, are true paths.
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 locating the documentation for the packages property in package-lock.json and reproduce the shown scoped-dependency layout with npm. Done when the docs explicitly explain whether package keys are logical dependency locations rather than filesystem paths, including the nested scoped-package example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100