Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UpCommand

Hierarchy

Properties

caret

caret: boolean = Option.Boolean(`-C,--caret`, false, {description: `Use the \`^\` semver modifier on the resolved range`,})

cwd

cwd: undefined | string = Option.String(`--cwd`, {hidden: true})

exact

exact: boolean = Option.Boolean(`-E,--exact`, false, {description: `Don't use any semver modifier on the resolved range`,})

interactive

interactive: undefined | false | true = Option.Boolean(`-i,--interactive`, {description: `Offer various choices, depending on the detected upgrade paths`,})

mode

mode: undefined | UpdateLockfile | SkipBuild = Option.String(`--mode`, {description: `Change what artifacts installs generate`,validator: t.isEnum(InstallMode),})

patterns

patterns: string[] = Option.Rest()

recursive

recursive: boolean = Option.Boolean(`-R,--recursive`, false, {description: `Resolve again ALL resolutions for those packages`,})

tilde

tilde: boolean = Option.Boolean(`-T,--tilde`, false, {description: `Use the \`~\` semver modifier on the resolved range`,})

Static paths

paths: string[][] = [[`up`],]

Static schema

schema: (function & object)[] = [t.hasKeyRelationship(`recursive`, t.KeyRelationship.Forbids, [`interactive`, `exact`, `tilde`, `caret`], {ignore: [undefined, false]}),]

Static usage

usage: Usage = Command.Usage({description: `upgrade dependencies across the project`,details: `This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of \`dependencies\` or \`devDependencies\` - \`peerDependencies\` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.If \`-R,--recursive\` is set the command will change behavior and no other switch will be allowed. When operating under this mode \`yarn up\` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both \`yarn up\` and \`yarn up -R\` to cover all bases.If \`-i,--interactive\` is set (or if the \`preferInteractive\` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.The, \`-C,--caret\`, \`-E,--exact\` and \`-T,--tilde\` options have the same meaning as in the \`add\` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.Generally you can see \`yarn up\` as a counterpart to what was \`yarn upgrade --latest\` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike \`yarn upgrade\` which only upgraded dependencies in the current workspace, \`yarn up\` will upgrade all workspaces at the same time.This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.**Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.`,examples: [[`Upgrade all instances of lodash to the latest release`,`$0 up lodash`,], [`Upgrade all instances of lodash to the latest release, but ask confirmation for each`,`$0 up lodash -i`,], [`Upgrade all instances of lodash to 1.2.3`,`$0 up lodash@1.2.3`,], [`Upgrade all instances of packages with the \`@babel\` scope to the latest release`,`$0 up '@babel/*'`,], [`Upgrade all instances of packages containing the word \`jest\` to the latest release`,`$0 up '*jest*'`,], [`Upgrade all instances of packages with the \`@babel\` scope to 7.0.0`,`$0 up '@babel/*@7.0.0'`,]],})

Methods

execute

  • execute(): Promise<0 | 1>

executeUpClassic

  • executeUpClassic(): Promise<0 | 1>

executeUpRecursive

  • executeUpRecursive(): Promise<0 | 1>

Generated using TypeDoc