Skip to content

Use workspace:^ to specify @babel/ dependencies#13772

Merged
nicolo-ribaudo merged 3 commits intobabel:mainfrom
nicolo-ribaudo:yarn-workspace-implicit-version
Oct 25, 2021
Merged

Use workspace:^ to specify @babel/ dependencies#13772
nicolo-ribaudo merged 3 commits intobabel:mainfrom
nicolo-ribaudo:yarn-workspace-implicit-version

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

@nicolo-ribaudo nicolo-ribaudo commented Sep 16, 2021

Q                       A
Tests Added + Pass? Yes
License MIT

When workspace:^, yarn automatically replaces it with the correct version (still using the ^ marker) at pack time. This has the advantage that we stop getting conflicts due to package.json changes, since dependencies won't be modified on publish anymore. Yarn uses this feature for their monorepo: yarnpkg/berry#3431

@merceyz
Copy link
Copy Markdown
Contributor

merceyz commented Sep 17, 2021

while in theory this should work, I get this error:

The feature was added in yarnpkg/berry#3386 which is currently in a canary release

yarn set version canary

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Sep 17, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e76a1b6:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Sep 17, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/49382/

@nicolo-ribaudo nicolo-ribaudo force-pushed the yarn-workspace-implicit-version branch from a2012c6 to 740f4e5 Compare October 24, 2021 12:52
@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Oct 24, 2021
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review October 24, 2021 12:55
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

I updated this PR to also use workspace:^ in devDependencies: there is no need to distinguish workspace:^ and workspace:*.

@nicolo-ribaudo nicolo-ribaudo force-pushed the yarn-workspace-implicit-version branch from 7d8c4a4 to e76a1b6 Compare October 24, 2021 13:32
@nicolo-ribaudo nicolo-ribaudo requested a review from hzoo October 24, 2021 14:19
Copy link
Copy Markdown
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

Cool, so when we publish it'll auto update to the version, found the url https://yarnpkg.com/features/workspaces/#publishing-workspaces (dont know if we want to specify these kinds of things in our contributing, I guess it's enforced too?)

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

Yeah it's enforced by the constraints file (and rbh I think most contributors won't even notice).

@nicolo-ribaudo nicolo-ribaudo merged commit c7ddb1a into babel:main Oct 25, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the yarn-workspace-implicit-version branch October 25, 2021 05:22
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 25, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants