Home

Awesome

<p align="center"> <img src="https://github.com/xeol-io/bumpgen/assets/4740147/8abf2d07-6161-42e6-ad4e-2cc9181ad21a" alt="logo"/> </p> <p align="center"> <a href="https://www.xeol.io/beta"> <img src="https://img.shields.io/badge/Github App Sign Up-FCAE00?logo=googlechrome&logoColor=black&style=for-the-badge"/> </a> <a href="https://github.com/xeol-io/bumpgen?tab=MIT-1-ov-file"> <img src="https://img.shields.io/badge/License-MIT-FCAE00.svg?style=for-the-badge"> </a> <a href="https://github.com/xeol-io/bumpgen/stargazers"> <img src="https://img.shields.io/github/stars/xeol-io/bumpgen?color=FCAE00&style=for-the-badge"> </a> <a href="https://discord.gg/J7E9BqVHkG"> <img src="https://img.shields.io/discord/1233126412785815613?logo=discord&label=discord&color=5865F2&style=for-the-badge"/> </a> </p>

šŸ“ Summary

bumpgen bumps your TypeScript / TSX dependencies and makes code changes for you if anything breaks.

demo

Here's a common scenario:

you: "I should upgrade to the latest version of x, it has banging new features and impressive performance improvements"

you (5 minutes later): nevermind, that broke a bunch of stuff

Then use bumpgen!

How does it work?

[!NOTE] bumpgen only supports typescript and tsx at the moment, but we're working on adding support for other strongly typed languages. Hit the emoji button on our open issues for Java, golang, C# and Python to request support.

šŸš€ Get Started

To get started, you'll need an OpenAI API key. gpt-4-turbo-preview from OpenAI is the only supported model at this time, though we plan on supporting more soon.

Then, run bumpgen:

> export LLM_API_KEY="<openai-api-key>"
> cd ~/my-repository
> npm install -g bumpgen
> bumpgen @tanstack/react-query 5.28.14

where @tanstack/react-query is the package you want to bump and 5.28.14 is the version you want to bump to.

You can also run bumpgen without arguments and select which package to upgrade from the menu. Use bumpgen --help for a complete list of options.

Github Action

We've created a GitHub action that can be used to run bumpgen. The intended usage is to be triggered on dependabot or renovatebot PRs - if breaking changes are detected, bumpgen will commit to the PR branch.

[!NOTE] The action commits changes to the branch it was triggered from. If you would like those commits to trigger other CI workflows, you will need to use a GitHub Personal Access Token.

Example Workflow

name: "Bumpgen"

on:
  pull_request:
    types:
      - opened

permissions:
  pull-requests: read
  contents: write

jobs:
  main:
    name: Run Bumpgen
    runs-on: ubuntu-latest
    if: ${{ github.event.pull_request.user.login == 'dependabot[bot]'}} # Use renovate[bot] for renovate PRs
    steps:
      - uses: actions/checkout@v4
      - name: Setup # Checkout and setup your project before running the bumpgen action
        uses: ./tooling/github/setup
      - name: Bumpgen
        uses: xeol-io/bumpgen@v0.0.1
        with:
          path: "./packages/bumpgen-core/" # The location of your project's package.json file
          llm_key: ${{ secrets.LLM_API_KEY }}
          github_token: ${{ secrets.GITHUB_TOKEN }}

[!NOTE] If you'd like to be first in line to try the bumpgen GitHub App to replace your usage of dependabot + renovatebot, sign up here.

Limitations

There are some limitations you should know about.

šŸ™ļø Architecture

 > bumpgen @tanstack/react-query 5.28.14
       ā”‚
ā”Œā”¬ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
ā”‚ā”‚ CLI                                                                        ā”‚
ā””ā”“ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā–²ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
       ā”‚  ā”‚
ā”Œā”¬ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
ā”‚ā”‚ Core (Codeplan)                                                            ā”‚
ā”‚ā”‚                                                                            ā”‚
ā”‚ā”‚ ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”‚
ā”‚ā”‚ ā”‚ Plan Graph                        ā”‚ ā”‚ Abstract Syntax Tree             ā”‚ ā”‚
ā”‚ā”‚ ā”‚                                   ā”‚ ā”‚                                  ā”‚ ā”‚
ā”‚ā”‚ ā”‚                                   ā”‚ ā”‚                                  ā”‚ ā”‚
ā”‚ā”‚ ā”‚               ā”Œā”€ā”                 ā”‚ ā”‚                  ā”Œā”€ā”             ā”‚ ā”‚
ā”‚ā”‚ ā”‚            ā”Œā”€ā”€ā”“ā”€ā”˜                 ā”‚ ā”‚               ā”Œā”€ā”€ā”“ā”€ā”“ā”€ā”€ā”          ā”‚ ā”‚
ā”‚ā”‚ ā”‚            ā”‚                      ā”‚ ā”‚               ā”‚       ā”‚          ā”‚ ā”‚
ā”‚ā”‚ ā”‚           ā”Œā–¼ā”                  ā”Œā”€ā”€ā”¼ā”€ā”¼ā”€ā”€ā”           ā”Œā–¼ā”     ā”Œā–¼ā”         ā”‚ ā”‚
ā”‚ā”‚ ā”‚           ā””ā”€ā”“ā”€ā”€ā”               ā”‚  ā”‚ ā”‚  ā”‚        ā”Œā”€ā”€ā”“ā”€ā”“ā”€ā”€ā”  ā””ā”€ā”˜         ā”‚ ā”‚
ā”‚ā”‚ ā”‚                ā”‚                  ā”‚ ā”‚  ā–¼        ā”‚       ā”‚              ā”‚ ā”‚
ā”‚ā”‚ ā”‚               ā”Œā–¼ā”              ā–²  ā”‚ ā”‚          ā”Œā–¼ā”     ā”Œā–¼ā”             ā”‚ ā”‚
ā”‚ā”‚ ā”‚               ā””ā”€ā”“ā”€ā”€ā”           ā”‚  ā”‚ ā”‚  ā”‚       ā””ā”€ā”˜  ā”Œā”€ā”€ā”“ā”€ā”“ā”€ā”€ā”          ā”‚ ā”‚
ā”‚ā”‚ ā”‚                    ā”‚           ā””ā”€ā”€ā”¼ā”€ā”¼ā”€ā”€ā”˜            ā”‚       ā”‚          ā”‚ ā”‚
ā”‚ā”‚ ā”‚                   ā”Œā–¼ā”             ā”‚ ā”‚              ā”Œā–¼ā”     ā”Œā–¼ā”         ā”‚ ā”‚
ā”‚ā”‚ ā”‚                   ā””ā”€ā”˜             ā”‚ ā”‚              ā””ā”€ā”˜     ā””ā”€ā”˜         ā”‚ ā”‚
ā”‚ā”‚ ā”‚                                   ā”‚ ā”‚                                  ā”‚ ā”‚
ā”‚ā”‚ ā”‚                                   ā”‚ ā”‚                                  ā”‚ ā”‚
ā”‚ā”‚ ā”‚                                   ā”‚ ā”‚                                  ā”‚ ā”‚
ā”‚ā”‚ ā”‚                                   ā”‚ ā”‚                                  ā”‚ ā”‚
ā”‚ā”‚ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā”‚
ā”‚ā”‚                                                                            ā”‚
ā””ā”“ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā–²ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
       ā”‚  ā”‚
ā”Œā”¬ā”€ā”€ā”€ā”€ā”€ā–¼ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  ā”Œā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
ā”‚ā”‚ Prompt Context                     ā”‚  ā”‚ā”‚ LLM                               ā”‚
ā”‚ā”‚                                    ā”‚  ā”‚ā”‚                                   ā”‚
ā”‚ā”‚ - plan graph                       ā”‚  ā”‚ā”‚ GPT4-Turbo, Claude 3, BYOM        ā”‚
ā”‚ā”‚ - errors                           ā”œā”€ā”€ā–ŗā”‚                                   ā”‚
ā”‚ā”‚ - code                             ā”‚  ā”‚ā”‚                                   ā”‚
ā”‚ā”‚                                    ā—„ā”€ā”€ā”¼ā”‚                                   ā”‚
ā”‚ā”‚                                    ā”‚  ā”‚ā”‚                                   ā”‚
ā”‚ā”‚                                    ā”‚  ā”‚ā”‚                                   ā”‚
ā”‚ā”‚                                    ā”‚  ā”‚ā”‚                                   ā”‚
ā””ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  ā””ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Abstract Syntax Tree

The AST is generated from ts-morph. This AST allows bumpgen to understand the relationship between nodes in a codebase.

Plan Graph

The plan graph is a concept detailed in codeplan by Microsoft. The plan graph allows bumpgen to not only fix an issue at a point but also fix the 2nd order breaking changes from the fix itself. In short, it allows bumpgen to propagate a fix to the rest of the codebase.

Prompt Context

We pass the plan graph, the error, and the actual file with the breaking change as context to the LLM to maximize its ability to fix the issue.

LLM

We only support gpt-4-turbo-preview at this time.

<p align="center"> <img src="https://s3.amazonaws.com/static.xeol.io/memes/terminator-meme.png" alt="meme"/> </p>

ā±ļø Benchmark

bumpgen + GPT-4 Turbo         ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘ā–‘   45% (67 tasks)

We benchmarked bumpgen with GPT-4 Turbo against a suite of version bumps with breaking changes. You can check out the evals here.

šŸŽ Contributing

Contributions are welcome! To get set up for development, see Development.

Roadmap

Join our Discord community to contribute, learn more, and ask questions!