Skip to content
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

v14.2.0 adds new required getIncrement method breaking existing plugins #713

Closed
rwjblue opened this issue Oct 19, 2020 · 4 comments
Closed

Comments

@rwjblue
Copy link
Contributor

rwjblue commented Oct 19, 2020

Existing plugins generally depend on release-it itself in order to extend from the built-in Plugin base class. Unfortunately, that means (due to lock files with both yarn and npm) that often times multiple versions of release-it's Plugin base class.

For example, a sample project using `release-it` and `release-it-lerna-changelog` has these versions
at 15:03:07 ❯ y why release-it
yarn why v1.22.10
[1/4] 🤔  Why do we have the module "release-it"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "release-it@14.2.0"
info Has been hoisted to "release-it"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "848KB"
info Disk size with unique dependencies: "9.2MB"
info Disk size with transitive dependencies: "41.11MB"
info Number of shared dependencies: 124
=> Found "release-it-lerna-changelog#release-it@13.7.1"
info This module exists because "release-it-lerna-changelog" depends on it.
info Disk size without dependencies: "412KB"
info Disk size with unique dependencies: "8.86MB"
info Disk size with transitive dependencies: "40.96MB"
info Number of shared dependencies: 124
✨  Done in 0.81s.

As a result, the change in #710 is basically a breaking change for users of plugins.

@rwjblue
Copy link
Contributor Author

rwjblue commented Oct 19, 2020

I think personally that I'd like to resolve this by making release-it a peerDependencies of my various release-it plugins (since we are very confident that the host has to actually provide release-it itself), but I'd love to see official guidance here and to surface the general concern.

hjdivad added a commit to hjdivad/release-it-yarn-workspaces that referenced this issue Oct 19, 2020
This is important because a release-it setup created by
rwjblue/create-release-it-setup should generally have all release-it
dependencies be a similar range (so that they can be de-duplicated) to
avoid issues like release-it/release-it#713
@webpro
Copy link
Collaborator

webpro commented Oct 20, 2020

Yes, release-it should be a peerDependency for plugins.

It's in https://github.com/release-it/plugin-starterkit/blob/master/package.json, but I didn't really think ahead of the issue you faced (i.e. for existing plugins) and document/announce this properly. Apologies for any issues you may have had! Will try to do better next time.

@rwjblue
Copy link
Contributor Author

rwjblue commented Oct 20, 2020

It's in https://github.com/release-it/plugin-starterkit/blob/master/package.json,

Gotcha, yeah. Though the starter kit only recently moved release-it into peerDependencies (in release-it/plugin-starterkit@005713b) and I wasn't watching that repo for changes / releases so I didn't notice it.

I didn't really think ahead of the issue you faced (i.e. for existing plugins) and document/announce this properly

I think it may make sense to explicitly call this out in the plugin documentation for new plugin authors.

Apologies for any issues you may have had! Will try to do better next time.

Absolutely no worries here! I mostly just wanted to raise the issue so folks using my release setup have a chance to find the issue when they search github for it 😄.

I'll cross link here when I've got new versions of release-it-yarn-workspaces and release-it-lerna-changelog published that work properly with v14.2.0.

@webpro
Copy link
Collaborator

webpro commented Oct 20, 2020

...and I wasn't watching that repo for changes / releases so I didn't notice it.

Didn't expect you to! Just pointing that new plugin authors hopefully see it. It wasn't even linked to from the plugin docs, so now it is.

I think it may make sense to explicitly call this out in the plugin documentation for new plugin authors.

Yes! Just did. Thank you very much for the suggestion.

Thanks again, Robert! Closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants