Warn library authors about caveats of committing package-lock in the source code version control
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 711
- Forks
- 4.2k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 3
Description
Opening this here again as the repository of the earlier reported issue got archived.
https://github.com/npm/npm/issues/20603
The npm documentation mentions it clearly that package-lock is always meant to be committed, leaving library authors unaware of the risk that their consumers might install different dependency versions than what they're using.
The documentation should be changed to mention that since package-lock files are ignored in published npm packages, library authors should exercise caution when choosing to commit them to source code.
Examples:
It is highly recommended you commit the generated package lock to source control
This file is intended to be committed into source repositories
Article with reasoning:
https://gajus.medium.com/stop-using-package-lock-json-or-yarn-lock-909035e94328
cc: @gajus
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 package-lock documentation pages linked in the issue, especially the v6 “Using locked packages” and v10 “Description” sections. Update the guidance to explain the caveat for library authors and verify that the wording consistently distinguishes source repositories from published packages.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100