Using (or not) package-lock.json
See original GitHub issueWe’ve begun piecemeal removing package-lock.json
, with @brianleroux recently citing the following link re. lockfile (non-)use:
My own conclusions: package-lock.json
provides no benefit in published packages, but remains necessary for deterministic deployments of actual Architect project app repos. So official Architect packages could stand to shed package-lock.json
, while https://github.com/architect-examples
should keep their lockfiles.
That said, in a world constantly creeping entropy, I like to fend off instability with whatever determinism I can find. Some alternative ideas:
- Swap out
package-lock.json
fornpm-shrinkwrap.json
– theoretically solves the issue of npm ignoring the lockfile for published modules adding the determinism of a lockfile to our packages, but we still pay a penalty in dep updating noise, git pack size, etc., and it’s officially warned against for libraries- Further: I’m not sure this is a meaningful real-world issue? Architect has been downloaded and used quite a bit, and I’m unaware of >= second-order dependency mismatches presenting issues to us or our users
- Dependency version pinning – we started pinning first-level dependencies in
@architect/architect
6.0.11 last September; I like this approach, and I’d suggest every official production Architect package should only be allowed to have version-pinneddependencies
(devDependencies
are fine to be ranges)
Thoughts?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Do I commit the package-lock.json file created by npm 5?
Yes, package-lock.json is intended to be checked into source control. If you're using npm 5+, you may see this notice on the command...
Read more >package-lock.json - in GIT or not? - DEV Community
One solution for this problem is to commit the node_modules folder to GIT, which includes all of the code your application uses. This...
Read more >Do I really need package-lock.json file? - Medium
The command npm instal installs all packages defined in package.json file and their dependencies, in the node_modules folder, creating it if ...
Read more >package-lock.json - npm Docs
package -lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json . It describes the exact tree ......
Read more >Why you should use package-lock.json - LogRocket Blog
Make sure you don't change package-lock.json directly. That's being handled automatically by NPM. It reflects changes made to package.json ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
After giving this some further consideration, I’m thinking we’re going to start rolling out with the following
.npmrc
to all packages:This will ensure all packages’ core deps are patch-only (no minors); Dependabot should help manage everything else, and majors and minors will be ensured to only be rolled up into proper Architect releases.
Otherwise: devdeps are still fine to use
^
, andpackage-lock.json
will no longer be checked in (of course).Big ups to my old buddy @celly for his thoughts on this as well!
Will be retired in
6.2.5
, hopefully shipping today!