Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

@nicolo-ribaudo
Copy link
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
Contributor

@merceyz 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
Copy link

@codesandbox codesandbox 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
Collaborator

@babel-bot 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 Oct 24, 2021
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review Oct 24, 2021
@nicolo-ribaudo
Copy link
Member Author

@nicolo-ribaudo nicolo-ribaudo commented Oct 24, 2021

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 Oct 24, 2021
@nicolo-ribaudo nicolo-ribaudo requested a review from hzoo Oct 24, 2021
hzoo
hzoo approved these changes Oct 25, 2021
Copy link
Member

@hzoo hzoo left a comment

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
Member Author

@nicolo-ribaudo nicolo-ribaudo commented Oct 25, 2021

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
27 of 29 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the yarn-workspace-implicit-version branch Oct 25, 2021
@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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants