-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Add package lock to fix CI #624
Conversation
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 41bec35:
|
Codecov Report
@@ Coverage Diff @@
## master #624 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 24
Lines ? 559
Branches ? 140
==========================================
Hits ? 559
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
About that last part, I have my doubts.
Besides that, I'm okay with adding |
I'm pretty sceptical of using lock files in libraries. But if one other maintainer gives their approval then we can merge this. |
@smeijer Since we're just talking about users manually installing to contribute here (and not CI), they should only be using
@smeijer This sounds like a workaround that could have unintended issues. This behavior is just there for automated installs. Users should always be keeping the
@kentcdodds npm refuses to publish |
No, my concern is that if you use That means, that if we both keep our Yes, I'm using |
I understand that lock files aren't perfect (especially npm because of how unstable the format is), but they solve this CI issue pretty easily, and I can't really think of a better alternative in this situation. |
I definitely recommend lockfiles in apps. But for libraries, I'm mostly concerned with the stuff I publish to work with the latest versions (including transitive dependencies) of everything and if we use lockfiles then we have to regularly update those versions (no I don't want to use a bot to keep things updated, that's a nightmare). It's unfortunate that we can't use lockfiles for only our devDeps because that would be nice. However, even in that case, @smeijer's arguments are solid. Any time I've tried to use a lockfile in an open source project that I get contributions to, people inevitably and inexplicably update the lockfile. That leads to confusion (and is potentially a security vulnerability if someone manually updates the lockfile to install a malicious package). The alternative that I prefer is figure out why the latest resolved version of packages is breaking our build and fix that. If it means we need to remove a |
Unfortunately it's hard to fix these issues without a package lock tracked in version control. I personally find it easier to just commit them and be cautious about when updates are needed. |
I deleted the cache and re-ran the build and now it's passing. |
What: Enables npm's package lock (
package-lock.json
) and keeps it committedWhy: The CI build is currently failing because it is installing dependencies differently from my local machine, in such a way that for some reason
dtslint
's version is causing dozens of errors. My local build validates just fine, so I uploaded my ownpackage-lock.json
, which is now working perfectly in CI. It's important that we keep it committed to avoid issues like this in the future. Fortunately npm obeys, updates, and even resolves merge conflicts in the lock file automatically, so we shouldn't have any issues with contributors understanding how to use it.How: Removed npm config and committed
package-lock.json
Checklist:
docs site N/A