Skip to content

Non-interactive dependency upgrade tool for Yarn 2

License

Notifications You must be signed in to change notification settings

cometkim/yarn-plugin-bump

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

yarn-plugin-bump

A Yarn 2 plugin for upgrading PnP-mode dependencies easily with a dead-simple command and no waste of interactions.

Why

Roadmap

These plugins will be used in the very short term while waiting for a better option.

Only essential features would be implemented.

  • Package bumping (yarn up is used as it is)
  • Package filtering
  • Workspace support (unstable yet, see #9)
  • Simple markdown formatting

Advanced features like semver range support and fetching release notes are not planned for now.

But feel free to fork this project, or send an issue about any idea you have.

Install

yarn plugin import https://github.com/cometkim/yarn-plugin-bump/releases/download/v0.0.7/plugin-bump.js

How to use

Simple run to upgrade all your dependencies

yarn bump

There's more options to specify the range, See yarn bump --help.

A Yarn 2 plugin to easily upgrade dependencies.

Usage:

$ yarn bump [--exclude #0] [--kind #0] ...

Details:

A Yarn 2 plugin for upgrading PnP-mode dependencies easily with a dead-simple
command and no waste of interactions.

Examples:

Upgrade all dependencies
  $ yarn bump

Upgrade only the lodash package
  $ yarn bump ^lodash$

Upgrade packages match with "^gatsby-*"
  $ yarn bump "^gatsby-*"

Upgrade only exclude react and react-dom
  $ yarn bump --exclude react --exclude react-dom

Upgrade only development dependencies
  $ yarn bump --kind development

Upgrade only production dependencies
  $ yarn bump --kind production

Using the plugin through GitHub action

Example 1. Bumping all dependencies and devDependencies and push it to bump-all branch every saturday.

on:
  schedule: "0 0 * * 6"

name: Bumping dependencies

jobs:
  bump-all:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        ref: master

    - name: Bump up Yarn 2 dependencies
      uses: cometkim/yarn-plugin-bump@master
      with:
        branch: dependencies/all

    - name: Sync dependency update branch with Pull Request
      uses: vsoch/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        PULL_REQUEST_FROM_BRANCH: dependencies/all