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.
-
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-webc
andpie-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:user
andrepo:status
permissions. I used a classic token rather than fine-grained.GITHUB_TOKEN
on your console..changeset
folder. 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:version
from 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.json
of 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.json
files had already been published before. Example logThere are a different ways around this:
pie-icons-webc
,pie-icons-vue
andpie-icons-react
so that changeset would increment their versions. This works perfectly but is prone to human error.pie-icons
has 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-modal
depending onpie-icon-button
,pie-button
, etc.We went on to discover that we currently define a number of
linked
packages in the changeset config.. The documentation for this can be found here but essentially this was not working as intended. (Note thatpie-icons-webc
was 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-webc
andpie-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-icons
itself, 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