# Add Dependabot to a Vite React Monorepo

Yes. An agent writes a Dependabot config for a monorepo of Vite and Next.js apps, one entry per app and one for Actions, with groups and ignores read from the files.

[Run this on Rush](https://cloud.getrush.ai/run/add-dependabot/vite-react/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent reads the layout before writing any YAML, because a Dependabot config for a monorepo is only as good as its directory list. In a repository laid out like alan2207/bulletproof-react there is no `dependabot.yml` and no Renovate file. Three apps live under `apps/`: `react-vite`, `nextjs-app` and `nextjs-pages`, each with its own `package.json` and its own `yarn.lock`, installed by the root `prepare` script with plain `yarn` in each. There is no `.yarnrc.yml`, so the lockfiles are Yarn classic, which Dependabot updates directly. `.github/workflows` holds one CI workflow per app, each running `yarn install`, `yarn build`, `yarn test`, `yarn lint` and `yarn check-types` from that app's directory, plus a Playwright job, on `actions/checkout@v4` and `actions/setup-node@v4`.

The config is `.github/dependabot.yml` with four entries: `npm` in `/apps/react-vite`, `/apps/nextjs-app` and `/apps/nextjs-pages`, and `github-actions` in `/`, all weekly on the same morning so the pull requests arrive together. Each npm entry groups development dependencies' minor and patch updates into one pull request and production patches into another, the way the CI jobs can absorb them, and leaves production minors as single pull requests a person reads.

The ignores come from the files, not from habit. `apps/react-vite/package.json` pins `eslint` to `"8"` and its `lint` script runs `eslint src --ignore-path .gitignore`; the `--ignore-path` flag does not exist in ESLint 9's flat config, and `@typescript-eslint/parser` and `eslint-plugin` at `^7` are built for ESLint 8. A major bump there would turn every pull request's lint job red, so the agent adds an `ignore` for major updates of `eslint` and the `@typescript-eslint/*` packages, with a comment naming the script that forces it, and does the same check in the two Next.js apps. Storybook, Vitest, Vite and MSW stay eligible for majors, since their tests run in CI and a failing one is information.

In its sandbox the agent runs `yarn outdated` in each app to see what the first week's pull requests would contain, and checks that every group pattern matches names that exist in that app's `package.json` rather than a package from another app. The CI workflows trigger on pushes to any branch, so Dependabot's branches get the same build, test, lint and type check as a person's, which the pull request points out as the reason no workflow needs to change.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Add Dependabot to this monorepo. Read the root package.json, each app's package.json and lockfile under apps/, and every workflow under .github/workflows first. Write .github/dependabot.yml with an npm entry per app directory and a github-actions entry at the root, weekly on the same day. In each npm entry group development minor and patch updates into one pull request and production patches into another. Read each app's lint script and ESLint-related versions and add ignores for major updates that would break the script as written, with a comment naming the script. Run yarn outdated in each app and check every group pattern against that app's package.json. Quote the outdated lists. Do not change any workflow. Open a pull request.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request adding one file, `.github/dependabot.yml`, with four entries, the groups, and the ignores with their reasons in comments. No workflow or `package.json` changes. The description quotes `yarn outdated` from each app so a reviewer sees what the first grouped pull requests would carry, and lists the packages held back from majors with the script line that forces each.

Once merged, Dependabot opens its pull requests on the chosen day, each on its own branch, and the per-app CI workflows run on them as they do on any push. The run's record keeps the three `yarn outdated` runs and every file the agent read.

Before merging, a reviewer sets the day and the open pull request limit to taste, and decides whether the Next.js apps should take `next` majors automatically or stay on the same hold as ESLint.

## Run it on every Monday morning

Dependabot opens the pull requests; what a team still does by hand is read them. Add an automation in the Project with a `schedule` trigger, `cron` set to a Monday hour in the trigger's `timezone`, and a prompt that lists the open Dependabot pull requests, checks out each grouped one, runs `yarn test` and `yarn check-types` in the app it touches, and posts one comment per pull request with the result and the changelog lines that matter.

A pull request whose checks fail for a reason the agent can fix, a renamed export or a changed type, gets a commit on the same branch; one it cannot fix gets a comment naming the package to pin. The run has its own `max_runs_per_hour` cap and is listed in the Project, so a busy Monday starts one run, not one per pull request.

## Why run it on Rush?

A Dependabot file is short and usually wrong in one of two ways: a directory missing, so one app never gets updates, or a major allowed that breaks a lint script the moment it lands. The agent reads the three `package.json` files and the lint scripts, so the ignores have a reason written next to them and the groups name packages that exist in that app.

The `yarn outdated` runs stay with the run and the pull request quotes them, so a reviewer sees the first week's updates before enabling them. Across every repository a team keeps, the same request runs in parallel, one sandbox and one pull request each, and each config reflects that repository's own layout.

## Frequently asked questions

### Why one entry per app instead of the root?

Dependabot reads the manifest and lockfile in the directory an entry names, and the root `package.json` has no dependencies of its own. Each app under `apps/` has its own `yarn.lock`, so each needs its own entry to be updated at all.

### Why hold ESLint at major 8?

Because the `lint` script passes `--ignore-path`, which ESLint 9 removed with flat config, and the `@typescript-eslint` packages at `^7` target ESLint 8. Letting that major through would fail the lint job in every later pull request; the comment in the config says so, and the hold is lifted when the config is migrated.

### Will Dependabot's pull requests run CI?

Yes. The three workflows run on pushes to any branch, so a Dependabot branch gets the build, tests, lint and type check for its app. Nothing in the workflows changes.

### Are Yarn classic lockfiles supported?

Yes. The apps have `yarn.lock` files and no `.yarnrc.yml`, which is Yarn classic, and Dependabot updates those lockfiles directly. The agent checks for a Berry config before assuming this.

## More Vite + React jobs

- [Add i18n to a Vite React App from a Linear Issue](https://getrush.ai/run/add-i18n/vite-react/)
- [Add Lighthouse CI to a Vite React App](https://getrush.ai/run/add-lighthouse-ci/vite-react/)
- [Add PWA Support to a Vite React App](https://getrush.ai/run/add-pwa-support/vite-react/)

## The same job on other stacks

- [Add Dependabot to a VitePress Site](https://getrush.ai/run/add-dependabot/vitepress/)
- [Add Dependabot to a VS Code Extension](https://getrush.ai/run/add-dependabot/vscode-extension/)
- [Add Dependabot to a Chrome Extension Repository](https://getrush.ai/run/add-dependabot/chrome-extension/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
