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

Add 'yarn rw upgrade' helper to upgrade @redwoodjs packages #436

Merged
merged 6 commits into from
Apr 18, 2020

Conversation

thedavidprice
Copy link
Contributor

Step 1 of #271

  • yarn rw upgrade runs an interactive upgrade process
  • yarn rw upgrade --check checks for outdated packages (without upgrading)

Experimented with npm-check-updates, npm-check, and yarn-check. Ended up using yarn built-in checks and upgrade. However, yarn doesn't play nice with its own workspaces, go figure, so I was limited to use yarn upgrade-interactive [packages] --latest. Other commands/options would not work. 👎

I also attempted to first build this without Listr, but Execa didn't play nice with the interactive terminal. So Listr it is (I seem to recall we've had this problem before, yes?).

Note the .strict() in the option -- it does pick up error in the "check" flag, which is an improvement on no error checking at all.

Tested on Windows Bash for Ubuntu and worked fine. Wasn't able to figure out how to test cli package on Powershell... ?

@peterp
Copy link
Contributor

peterp commented Apr 17, 2020

This is awesome, does this modify all 3 the package.json files as well as the yarn.lock?

@thedavidprice
Copy link
Contributor Author

@peterp Yes, it does both 1) modify respective package.json files and 2) install and, therefore, update yarn.lock. You can try with yarn:

  • yarn upgrade-interactive [package-name] —latest
  • yarn outdated [package-name | defaults to checks all]

The interactive cli is nice but a bit more complicated. It will especially be a benefit in the future when people are way behind and will receive visual understanding about how many, and which, patch/minor/major versions they would be skipping to upgrade to latest. —> Downside of the yarn workspace bug (with its own command) is that we can only use this for upgrading to latest. I think this is satisfactory for now.

Copy link
Contributor

@peterp peterp left a comment

Choose a reason for hiding this comment

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

Yay!

@peterp peterp added this to the next-release milestone Apr 18, 2020
@peterp peterp merged commit f087227 into master Apr 18, 2020
@thedavidprice thedavidprice deleted the dsp-add-upgrade-command branch April 18, 2020 15:23
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.

None yet

3 participants