question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Bulk upgrade dependencies across a single workspace or workset

See original GitHub issue
  • I’d be willing to implement this feature
  • This feature can already be implemented through a plugin

Describe the user story

  • We would like the ability to upgrade all dependencies within a workspace.
  • We would like the ability to upgrade all dependencies within a workset.

Describe the solution you’d like Much like yarn@1 where we could use yarn upgrade or yarn upgrade --latest to upgrade packages in bulk; a similar feature would be appreciated for Berry.

For worksets this could be simply yarn upgrade or yarn up all. For individual workspaces: yarn workspace <workspace> upgrade or yarn workspace <workspace> up all

Describe the drawbacks of your solution The primary risk is that blindly upgrading all your packages could break project tests and these would need to be fixed to accommodate new dependency versions. Arguably, not updating dependencies frequently only adds more debt to the project.

Describe alternatives you’ve considered I have already successfully used @yarnpkg/plugin-interactive-tools to manually select every single package for upgrade, however this already feels tedious to use on a large workset.

Additional context Given the nature of the awesome PnP system and the strict package boundaries; package.json dependencies lists are going to be bigger than ever so this further increases the desire for this feature.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
wesricecommented, Mar 19, 2020

@arcanis Forgive my persistence. I just want a better understanding of this.

I see what you’re saying, but I’m still having a hard time reconciling that Yarn 1 is capable of upgrading all dependencies, which seems contrary to the position you stated for Yarn v2.

I fear that there might be an underlying sentiment that I’m failing to recognize that can help me, and perhaps others, understand what is expected of the users of Yarn v2.

Is the removal of yarn upgrade due to a philosophical shift with Yarn 2 that I need to better understand? Is the Yarn organization implicitly advising against updating all packages at once or perhaps just fails to see the need to do so?

Thanks for your time.

1reaction
arcaniscommented, Mar 3, 2020

You’d write a plugin. As for “what would the code look like”, check up.ts - if you remove the interactive part, it’s only about a hundred lines of significant code.

Basically, the idea is that you instantiate a Project, iterate over the workspaces’ dependencies, call suggestUtils.getSuggestedDescriptors for each one, update the descriptors in the workspaces instances, then call project.install which will persist everything on disk.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aha! Roadmaps | Copy, move, or bulk edit features and activities
You can copy, move, or even bulk edit features and activities in Aha! Roadmaps to save you time and drive consistency across your...
Read more >
Update the dependency details for tasks from Project Workspace
Update the details of the dependency including its type and lag time, from Project Workspace. ... Open the dependency side panel in one...
Read more >
Workspaces - Yarn
Your dependencies can be linked together, which means that your workspaces can depend on one another while always using the most up-to-date code...
Read more >
NetSuite Applications Suite - Table of Contents
Elimination Through the Automated Intercompany Management Feature ... Constructing the Signature for Step One of the TBA Authorization Flow ...
Read more >
lerna-update-wizard - npm Package Health Analysis - Snyk
Command line interface for simplifying the process of bulk updating dependencies across multiple Lerna or Yarn Workspace packages. For more information about ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found