chore: improve npm release scripts#4972
Conversation
419eae8 to
2580a8c
Compare
bajtos
left a comment
There was a problem hiding this comment.
+1 to update peer dependencies as part of our version release process 👍
I'd like to discuss few aspects of the proposal, see my comments below.
bin/update-peer-deps.js
Outdated
| const pkgVersion = lbModuleVersions[d]; | ||
| if (pkgVersion) { | ||
| // Update the version range to be `^<major>.0.0` | ||
| pkgJson.peerDependencies[d] = `^${semver.major(pkgVersion)}.0.0`; |
There was a problem hiding this comment.
Should we use the actual pkgVersion, since that's the version we are testing in our CI? If we use MAJOR.0.0, then it's possible to create a situation where the peer dep spec is too wide, because the extension depends on features introduced in semver-minor version after MAJOR.0.0.
Another aspect to consider: removing a version from peerDependencies range is a breaking change, similarly to how dropping support for a Node.js major version is a breaking change too.
It would be great if lerna was handling these complexities automatically for us, see the discussion in lerna/lerna#955 and lerna/lerna#1018
There was a problem hiding this comment.
Let's be conservative to use the ^<pkgVersion> for peer dependencies as a release is cut.
2580a8c to
9076742
Compare
|
@bajtos PTAL. |
Improve npm build scripts:
update-peer-depsto maintain peer dependencies during the release processversionphase to ensure testing against latest versions and remove duplicate update.Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated👉 Check out how to submit a PR 👈