Changesets and package interdependence #806
Replies: 2 comments 1 reply
-
|
Double-checking to see if I got it right: |
Beta Was this translation helpful? Give feedback.
-
|
I personally think that we should fix the icon packages together – it's actually what we thought the link config would do initially, but it isn't working as expected (as you explained really well). The reason I think fixing is a good idea for the icon packages is because it avoids any confusion for consumers across our icon packages. When referencing icons, if someone is using v1.3.1 of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
On my latest PR to update
pie-icons, @dandel10n left a comment asking about whether or not the next Version Packages PR would correctly updatepie-icons-vue,pie-icons-webcandpie-icons-react, as they all have a devDependency onpie-icons.Seeing as the generated icons for each of these packages are no longer kept in source control, there were no code changes for any of those packages as far as Git is concerned.
With the help of @siggerzz, we managed to debug the changeset process.
Expand for a step-by-step guide to debugging changeset versioning locally.
read:userandrepo:statuspermissions. I used a classic token rather than fine-grained.GITHUB_TOKENon your console..changesetfolder. Feel free to isolate the effects of a single file by deleting the others (but make sure you don't commit this!)."changeset"line from.changeset/config.json.yarn changeset:versionfrom the root. This will carry out the versioning locally.From this, we determined that changeset would increment the version of
pie-icons(as expected) and update thepackage.jsonof the consuming packages to reference this new version (also as expected). However, the versions of the consuming packages themselves would not be incremented. This meant that the publish step failed as the versions listed in thepackage.jsonfiles had already been published before. Example logThere are a different ways around this:
pie-icons-webc,pie-icons-vueandpie-icons-reactso that changeset would increment their versions. This works perfectly but is prone to human error.pie-iconshas been updated. This would be an improvement but it only captures that particular dependency. What should we do about dependencies between other packages, for examplepie-modaldepending onpie-icon-button,pie-button, etc.We went on to discover that we currently define a number of
linkedpackages in the changeset config.. The documentation for this can be found here but essentially this was not working as intended. (Note thatpie-icons-webcwas missing.) Also note that just above the examples on that page, it says:This is why we needed to add a changeset for
pie-icons-vue,pie-icons-webcandpie-icons-react. This also mentions fixed packages, which are described here. We decided against this because there was no reason to keep the versions for the Vue and React icons aligned, for example, because it is unlikely that they will both be consumed at the same time, so there isn't really a benefit of doing so. It would also mean that if we updated the React icons, a new version would be published forpie-iconsitself, which could also be confusing.Additional notes / complications:
workspace:*dependencies on others, so they pull the latest changes from the repo whether they have been published to npm or not.Beta Was this translation helpful? Give feedback.
All reactions