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

feat(plugin-essentials): upgrade all packages with wildcard #5381

Merged
merged 3 commits into from
May 16, 2023
Merged

feat(plugin-essentials): upgrade all packages with wildcard #5381

merged 3 commits into from
May 16, 2023

Conversation

Gelio
Copy link
Contributor

@Gelio Gelio commented Apr 11, 2023

What's the problem this PR addresses?

yarn up '*' only upgraded unscoped packages. I had to remember to run yarn up '*/*' later to also upgrade scoped packages. I was running these commands with the -i flag.

This PR changes it so yarn up -i '*' upgrades both scoped and unscoped packages.

Closes #3550

How did you fix it?

Use the basename micromatch option so * matches scoped (e.g. @types/node) and unscoped (e.g. react) packages.

Checklist

  • I have set the packages that need to be released for my changes to be effective.

    Although I am not sure I did it right.

  • I will check that all automated PR checks pass before the PR gets reviewed.

Comment on lines 2 to 3
"@yarnpkg/cli": minor
"@yarnpkg/plugin-essentials": minor
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change so these need to be marked as major.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think all of these should be major changes? Technically this could also be thought as a breaking change for the CLI, although only for interactive mode, which users review manually anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I marked this one as a major version bump. I left other ones intact. I also declined some other version bumps. I have no clue if this is correct since I don't know the inter-dependencies between these packages. Feel free to update this file yourself or let me know how it should be configured.

Add support for upgrading both scoped and unscoped packages with
`yarn up -i '*'`. It used to upgrade only unscoped packages.

This change only affects interactive mode, so as not to change the
existing behavior of `yarn up '*'`.

Fixes #3550
@Gelio
Copy link
Contributor Author

Gelio commented Apr 16, 2023

I removed the integration test that I added since this change only affects interactive mode (-i) and I didn't find an easy way to run yarn commands in interactive mode in the integration tests.

@Gelio Gelio requested a review from merceyz April 16, 2023 12:08
@arcanis
Copy link
Member

arcanis commented May 16, 2023

I added back the code that makes yarn up '*' upgrade everything, as I think it's best to keep the logic similar if possible between the interactive and non-interactive filtering. It makes the diff a major for the CLI but it's not a problem, since we want to release the 4.0 soon.

@arcanis arcanis merged commit bf9a113 into yarnpkg:master May 16, 2023
@merceyz merceyz added the major label May 16, 2023
@merceyz merceyz added this to the 4.0.0 milestone May 16, 2023
@Gelio Gelio deleted the yarn-up-scoped-and-unscoped branch May 16, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] yarn up: target both scoped & unscoped
3 participants