All jobs

Upgrade a React App's Dependencies Every Week

Yes. Each week an agent bumps your React app's yarn dependencies, runs Vitest, ESLint, tsc and Playwright after the bumps, and opens one PR with what changed.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent reads the manifest and the checks before it touches a version. In an app shaped like the react-vite app of alan2207/bulletproof-react, apps/react-vite/package.json declares react ^18.3.1, react-router ^7.0.2, @tanstack/react-query ^5.32.0, zustand ^4.5.2, zod ^3.23.4, vite ^5.2.10, vitest ^2.1.4, @playwright/test ^1.49.1, storybook ^8.0.9 and eslint pinned to major 8 with a .eslintrc.cjs, with scripts for build (tsc && vite build), test (vitest), lint, check-types and test-e2e, which starts the MSW mock server with pm2 and then runs Playwright. yarn.lock is a v1 lockfile, so the package manager is Yarn classic, and README.md asks for Node 20 or newer.

It runs yarn outdated to list what moved, then bumps in two groups. Patch and minor updates within the declared ranges go first with yarn upgrade, after which it runs yarn lint, yarn check-types, yarn test and yarn build. Major updates are taken one at a time and only where the release notes do not change the code the app uses: vite and vitest majors are checked against vite.config.ts, which sets test.environment to jsdom, a setupFiles entry and coverage.include; a react-router major against src/app/router.tsx; a storybook major against the @storybook/* addons that must move together. ESLint stays on major 8, because .eslintrc.cjs is the legacy config format and major 9 would mean a flat-config migration, which is a separate job.

After each major, the agent reruns the four commands and yarn test-e2e, which the React Vite CI workflow in .github/workflows/react-vite-ci.yml runs with .env.example-e2e and the mock API on port 8080. A bump that fails a check is reverted and listed in the pull request with the failing output, rather than patched around. src/testing/setup-tests.ts mocks zustand and starts an MSW server with onUnhandledRequest: 'error', so a msw major that changes the handler API shows up in the unit run before anything else.

The pull request body is a table: package, old version, new version, major or not, and which check covered it, plus a section for anything held back and why. The lockfile diff is committed with the manifest, and the yarn.lock header stays v1 so the workflow's yarn install keeps working.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Upgrade the dependencies of the React app in apps/react-vite and open one pull request. Read apps/react-vite/package.json, apps/react-vite/yarn.lock, apps/react-vite/vite.config.ts, apps/react-vite/.eslintrc.cjs, apps/react-vite/src/testing/setup-tests.ts, apps/react-vite/playwright.config.ts, apps/react-vite/README.md and .github/workflows/react-vite-ci.yml first. Use Yarn classic as the v1 lockfile requires. Run yarn outdated. Apply patch and minor updates within the declared ranges first, then run yarn lint, yarn check-types, yarn test and yarn build. Take majors one at a time: read the release notes, skip any that changes code this app uses, keep eslint on major 8 because the config is .eslintrc.cjs, and move @storybook/* packages together. After each major rerun the four commands, then run yarn test-e2e with .env.example-e2e as the workflow does. Revert any bump that fails a check and list it with the output. Commit package.json and yarn.lock. Write the pull request body as a table of package, old version, new version, major or not, and which check covered it, plus a held-back section. Do not change application code except where a bump requires it, and say so in the table.",
  "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 that changes apps/react-vite/package.json and apps/react-vite/yarn.lock, and nothing else unless a major required a one-line code change, which the table names. The body lists every bump with the check that covered it and the output of yarn lint, yarn check-types, yarn test, yarn build and yarn test-e2e from the sandbox, plus the packages held back and the failing output for each.

The React Vite CI workflow runs the same commands on the pull request on lts/* Node, both the all-cli-checks job and the e2e job with Playwright and the uploaded report, so the reviewer sees green checks or the same failure the agent saw.

A reviewer reads the held-back section first, since that is where the judgment is, then checks that the lockfile is still v1 and that any code change is confined to the package it names. Then they merge, and the next week's run starts from the new baseline.

Run it on every Monday morning

In the console, add an automation to the Project with this prompt and a schedule trigger, with cron set to Monday morning in your timezone and max_runs_per_hour at 1. Each run reads the current master, runs yarn outdated against that week's registry, and opens one pull request; a week with nothing to bump opens none.

From your own server, POST /o/{org}/sessions with this prompt and the repository in resources does the same on demand, and a webhook_url on the key tells you when the pull request is ready.

The use case this job follows, with its automation and trigger: Upgrade dependencies weekly.

Why run it on Rush?

Dependabot opens one pull request per package, each tested alone, and a Vite major and a Vitest major that only work together never get tested together. In a Rush sandbox the agent bumps, runs the unit suite, the type check, the build and the Playwright suite with the mock server after each group, and keeps every command and its output in the run's record, so one pull request carries the proof for the whole set.

The judgment calls, which majors to take and which to leave, are written down with the failing output, not lost in a closed pull request. The same automation runs on every React app in the org, each in its own sandbox with its own Node and Yarn, and each opening its own pull request.

Frequently asked questions

Does it work with Yarn classic?

Yes. The agent reads the # yarn lockfile v1 header in yarn.lock and uses Yarn 1 commands, yarn outdated and yarn upgrade, so the lockfile format the workflow's yarn install expects does not change.

Will it move ESLint to 9?

No. The app's config is .eslintrc.cjs, the legacy format, and ESLint 9 defaults to flat config, so that bump is a migration rather than an upgrade. The pull request lists it under held back with the reason.

What if the Playwright suite fails on a bump?

The bump is reverted and the failing Playwright output goes in the pull request. yarn test-e2e starts the MSW mock server with pm2 first, as the workflow does, so a failure is about the app, not a missing backend.

Does it touch the Next.js apps in the same repository?

Not in this run. The prompt names apps/react-vite, and the three apps have separate manifests, lockfiles and workflows. A second automation with apps/nextjs-app in the prompt handles that one.

More React jobs

The same job on other stacks

Keep reading