-
Notifications
You must be signed in to change notification settings - Fork 973
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
improve Upgrade command so -t
accepts any string
#1270
Conversation
@jtoar I was hoping to find a way for yargs to suggest choices and also allow a string. No such luck. As you see here I'm now allowing user to pass any string. And I'm attempting to give good guidance via the description.
|
@thedavidprice I think it's clear; here's a few thoughts:
.option('tag', {
alias: 't',
description:
'[choices: "canary", "rc", or specific-version] WARNING: "canary" and "rc" tags are unstable releases!',
type: 'string',
+ coerce('tag', (arg) => {
+ ...check to see if arg is a valid specific-version string
+ })
}) |
@jtoar Updated copy and added example. New output: Upgrade all @redwoodjs packages via interactive CLI
Options:
--help Show help [boolean]
--version Show version number [boolean]
--dry-run, -d Check for outdated packages without upgrading [boolean]
--tag, -t [choices: "canary", "rc", or specific-version (see example
below)] WARNING: "canary" and "rc" tags are unstable releases!
[string]
Examples:
rw upgrade -t 0.20.1-canary.5 Specify a version. URL for Version History:
https://www.npmjs.com/package/@redwoodjs/core
Thoughts? |
This is great! Was looking for something like this the other day when I wanted to upgrade an old RW project to a newer version, but not the latest. So hoping this means something like this would also work |
@thedavidprice @jtoar added validation in #1304 |
Previously the
--tag
option only acceptedcanary
orrc
. This PR allows user to pass any string as a tag option, which means you can now specific versions e.g.yarn rw upgrade -t 0.19.2-canary.37
I've updated the option description to the following: