Code Monkey home page Code Monkey logo

yarn-plugin-bump's Introduction

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

yarn-plugin-bump's People

Contributors

cometkim avatar github-actions[bot] avatar notquiteamonad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vespakoen

yarn-plugin-bump's Issues

Bump all deps

Hi, so when running yarn bump - it bump's all deps in package.json, can we make it so it bumps deps that other deps require on?

ie, @types/mongoose requires on @types/mongodb

Let's say @types/mongodb is out date, so, running yarn bump updates @types/mongodb, and any deps of @types/mongodb that are out date also get updated, and vice verse

Maybe this could be an option like -r for recursive?

Support aliased modules

If I alias modules like below, this plugin does not work.

{
  "dependencies": {
    "@emotion-v11/css": "npm:@emotion/css@^11.0.0-next.15",
    "@emotion-v11/styled": "npm:@emotion/styled@^11.0.0-next.15"
  }
}

image

When running in a Github Action, fails due to use of local

I've pasted the logs below. The issue appears to be with the use of the local keyword in the entrypoint

2021-02-08T08:40:38.0282304Z ##[group]Run cometkim/yarn-plugin-bump@master
2021-02-08T08:40:38.0282758Z with:
2021-02-08T08:40:38.0283087Z   base-ref: main
2021-02-08T08:40:38.0283476Z   branch: dependencies/all
2021-02-08T08:40:38.0283841Z   kind: all
2021-02-08T08:40:38.0284334Z   repository: notquiteamonad/***
2021-02-08T08:40:38.0284862Z   username: GitHub Action
2021-02-08T08:40:38.0285275Z   email: [email protected]
2021-02-08T08:40:38.0285763Z   commit-message: Bump-up dependencies
2021-02-08T08:40:38.0286194Z env:
2021-02-08T08:40:38.0287365Z   GITHUB_TOKEN: ***
2021-02-08T08:40:38.0287723Z ##[endgroup]
2021-02-08T08:40:38.0389987Z ##[command]/usr/bin/docker run --name fa564df85f4942a0addadebdbe944f30_1003c5 --label 442333 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_BASE-REF -e INPUT_BRANCH -e INPUT_PATTERN -e INPUT_EXCLUDE -e INPUT_KIND -e INPUT_REPOSITORY -e INPUT_USERNAME -e INPUT_EMAIL -e INPUT_COMMIT-MESSAGE -e GITHUB_REPOSITORY -e GIT_USERNAME -e GIT_EMAIL -e GIT_BASE_REF -e GIT_BRANCH -e GIT_COMMIT_MSG -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/***/***":"/github/workspace" 442333:fa564df85f4942a0addadebdbe944f30  "" "--exclude \"\"" "--kind \"all\""
2021-02-08T08:40:39.3975622Z From https://github.com/notquiteamonad/***
2021-02-08T08:40:39.3976962Z  * branch            main       -> FETCH_HEAD
2021-02-08T08:40:39.5432632Z Switched to a new branch 'dependencies/all'
2021-02-08T08:40:39.5434179Z Branch dependencies/all set up to track remote branch main from origin.
2021-02-08T08:40:39.5782308Z Current branch dependencies/all is up to date.
2021-02-08T08:40:40.4444153Z /action/entrypoint.sh: line 26: local: can only be used in a function
2021-02-08T08:40:40.4445745Z Download plugin from https://github.com/cometkim/yarn-plugin-bump...
2021-02-08T08:40:40.4446893Z /action/entrypoint.sh: line 27: ARTIFACT_URL: unbound variable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.