Delete package-lock.json
I think libraries should not include package-lock.json.
- The
npmcommand does not publish them to npmjs.com, so end users don't get benefit from them. - We shouldn't attempt to lock dependencies using shrinkwrap anyways (increases the chance of duplicate dependencies in end user projects, which can cause issues, I can provide some links if curious).
- The main reason to remove package-lock.json is because as we authors develop Docsify, we can catch in-range breaking changes to any dependencies and fix them before users receive the errors. Having package-lock.json otherwise prevents us from catching those bugs sooner.
- We can manually pin dependencies as a last resort in package.json if we really need to.
Wdyt? Any reason to keep it?
This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/44415l3p5 ✅ Preview: https://docsify-preview-git-delete-package-lock.docsify-core.vercel.app
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 9842b804ae21bf83fbc85503a35ab310559f2f6f:
| Sandbox | Source |
|---|---|
| wonderful-khayyam-opwkm | Configuration |
If we are removing this, I guess we should remove the lockfile for
packages/docsify-server-rendereras well and put them in.gitignore
Good catch! Thanks for reminding me! Good to have multiple :eyes: . :)
There we go. I added the config in .npmrc which tells npm not to generate package-lock.json files, but some tools (like Lerna) don't obey this option so in any other cases beside using npm the .gitignore addition will help.
Let me fix the ironic conflict with package-lock.json. :)
I think there is some problem with CI related to monorepo (lerna). Does lerna requires the lock file in order to have the same env ?
Ah, the tests fail because Lerna is running in ci mode (uses npm ci in the case of npm) which requires package-lock.json. ci mode is good for applications but not necessarily libraries (for the same above reasons).
I'll make an update.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.