You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a monorepo where sometimes I only want to release one package only. I want to start using changesets. My current monorepo has 2 packages where packageA has 1.6.0-alpha.1 and packageB has 1.8.1. Ofc, I also want to be doing pre-releases. Let's say I want to release packageB in a pre-release mode.
I added changeset code.
I run npx changeset pre enter alpha.
For changeset action, I pass my command of yarn run version. Note that changeset action allows you to pass version and publish commands.
yarn run version runs my code which basically does: npx changeset version --ignore packageA
The PR is created.
If you look at the PR, it contains the change of updating packageB's package.json from 1.8.1 to 1.8.1-alpha.0. So far so good. Assume that I decided to release this with non-prerelease. I changed my mind, so I re-run the workflow which basically exists the pre mode and updates the PR. Now, the PR contains packageB's package.json change from 1.8.1 to 1.9.0 (assuming I used minor). So far so good, but here is the problem. The PR now also contains packageA's package.json version change from 1.6.0-alpha.1 to 1.7.0 which is NOT correct.
There's a link on top of this line: #382 (comment) and reading it makes sense why you're doing this, but the problem is that my packages don't depend on each other., but your discussion explains this when there's dependency. Since my packages don't depend on each other, your solution seems wrong(i.e doesn't handle my scenario).
Tagging @emmatown for visibility due to her explanation on the link.
Is this clear ?
The text was updated successfully, but these errors were encountered:
Affected Packages
Problem
I have a monorepo where sometimes I only want to release one package only. I want to start using changesets. My current monorepo has 2 packages where
packageA
has1.6.0-alpha.1
andpackageB
has1.8.1
. Ofc, I also want to be doing pre-releases. Let's say I want to release packageB in a pre-release mode.npx changeset pre enter alpha
.yarn run version
. Note that changeset action allows you to pass version and publish commands.yarn run version
runs my code which basically does:npx changeset version --ignore packageA
If you look at the PR, it contains the change of updating packageB's package.json from 1.8.1 to 1.8.1-alpha.0. So far so good. Assume that I decided to release this with non-prerelease. I changed my mind, so I re-run the workflow which basically exists the pre mode and updates the PR. Now, the PR contains packageB's package.json change from 1.8.1 to 1.9.0 (assuming I used
minor
). So far so good, but here is the problem. The PR now also containspackageA
's package.json version change from 1.6.0-alpha.1 to 1.7.0 which is NOT correct.After looking into the src code, I found:
changesets/packages/assemble-release-plan/src/index.ts
Line 218 in f0270f6
There's a link on top of this line: #382 (comment) and reading it makes sense why you're doing this, but the problem is that my packages don't depend on each other., but your discussion explains this when there's dependency. Since my packages don't depend on each other, your solution seems wrong(i.e doesn't handle my scenario).
Tagging @emmatown for visibility due to her explanation on the link.
Is this clear ?
The text was updated successfully, but these errors were encountered: