As began from Better JS dependency management with yarn, we use Yarn to install javascript dependencies specified in package.json
, and lock version numbers in yarn.lock
to ensure all environments are using the exact same versions.
We use Dependabot to suggest updates whenever a new version is released. Currently, it is configured to respect all versions specified in package.json
, with lockfile-only
(see comments about it here)
Most of the versions specified in package.json
only accept a minor update (denoted by ^
). So, based on my understanding, we would not be notified of major version updates and could be missing out.
But apparently this is the industry-standard way to do it, and Yarn automatically adds the restriction (eg yarn add react
=> "react": "^18.2.0",
).
I believe Dependabot can be configured for this, to suggest updates to package.json
.
So I think we need to make a choice:
- Continue to have version restrictions in
package.json
as per industry standard, and configure Dependabot to suggest updates - Remove version restrictions from
package.json
, and Dependabot will suggest updates to the lockfile only (this is how we manage Ruby gems inGemfile
)
Is this correct, have I summarised the current state correctly?
Does anyone have a reason to suggest option 1 or 2?