Skip to content

Add support for workspace version alias#585

Merged
Andarist merged 6 commits intochangesets:mainfrom
javier-garcia-meteologica:add-workspace-version-alias
Nov 8, 2021
Merged

Add support for workspace version alias#585
Andarist merged 6 commits intochangesets:mainfrom
javier-garcia-meteologica:add-workspace-version-alias

Conversation

@javier-garcia-meteologica
Copy link
Contributor

Adds support for workspace:^ and workspace:~.

@atlassian-cla-bot
Copy link

atlassian-cla-bot bot commented May 4, 2021

Hooray! All contributors have signed the CLA.

@changeset-bot
Copy link

changeset-bot bot commented May 4, 2021

🦋 Changeset detected

Latest commit: cef173a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@changesets/apply-release-plan Patch
@changesets/cli Patch
@changesets/get-dependents-graph Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Andarist
Copy link
Member

Andarist commented May 4, 2021

Could you point to any documentation about those two?

@javier-garcia-meteologica
Copy link
Contributor Author

This feature was recently merged into pnpm and at yarn they are working to implement it.

pnpm/pnpm#3368
yarnpkg/berry#2658

There is no documentation yet about this feature, but I should probably write about it.

@javier-garcia-meteologica
Copy link
Contributor Author

I was wrong, it's already documented in the workspaces section of pnpm

Copy link
Member

@Andarist Andarist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great - I still need to review added tests carefully but I don't expect that there is anything wrong with them. It might take me a couple of days to merge this in so please be patient. In the meantime, you still need to sign the CLA so I could merge this.

@NMinhNguyen
Copy link
Contributor

Sorry for being annoying, but wanted to ask if there's still plans to merge this?

@belgattitude
Copy link

belgattitude commented Oct 12, 2021

Interested as well, I've been hit too.

My current workaround is to use yarn pack before release and make use of publishConfig.directory... Not very nice 😄

If it helps: https://github.com/soluble-io/cache-interop/pull/135/files#diff-f9597f851def3b5a8f4d951c4ce8490c1a972cc8efef475f954e01fcae9fedb3

@Andarist Andarist enabled auto-merge (squash) November 8, 2021 11:24
@Andarist Andarist merged commit 74dda8c into changesets:main Nov 8, 2021
@github-actions github-actions bot mentioned this pull request Nov 8, 2021
@Andarist
Copy link
Member

Andarist commented Nov 8, 2021

@javier-garcia-meteologica thank you for your contribution. This was well implemented and you have followed up on my suggestions and questions promptly. I'm very sorry I couldn't get to this sooner - I've only found some new energy to work on Changesets recently and I hope to get to any future PRs way quicker.

@belgattitude
Copy link

@Andarist, just to say: huge thanks for your work. It's really appreciated.

@Andarist
Copy link
Member

Andarist commented Nov 8, 2021

Thank you - it means a lot. :)

]);
});

it("should bump dependant package when bumping a `workspace:^` dependency", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found out that perhaps this test is incorrect. I would appreciate some second eyes on my reasoning though.

workspace:^ is basically equivalent to the ^${currentVersionOfThatDependency}. So in this case this would be an equivalent of ^1.0.0. Therefore if we just bump the pkg-b with a patch bump then... it shouldn't update the dependent pkg (pkg-a) as the new version fo the pkg-b (1.0.1) doesn't leave the current dependency range.

There are options for always bumping dependent packages etc but that's not the default.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should not bump in this test. I tried to switch from ^1.0.0 to workspace:^ to reference packages inside my monorepo and found the behavior is different.

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

Successfully merging this pull request may close these issues.

5 participants