patchup
v0.2.3
Published
Automatically update the packages in your projects
Maintainers
Readme
Patchup
Automatically update npm packages one at a time, running tests after each update and committing successful updates to git.
Features
- Updates packages individually with automatic test verification
- Rolls back failed updates automatically
- Creates a git commit for each successful update
- Supports npm and pnpm workspaces
- Interactive package selection
- Filter by workspace, package name, or version diff (patch/minor/major)
- Update related packages together in a single batch
Usage
npx patchup [options]Options
| Option | Alias | Description |
|--------|-------|-------------|
| --help | -h | Display usage guide |
| --workspace <name> | -w | Filter by workspace name (can be used multiple times) |
| --package <name> | -p | Filter by package name (can be used multiple times) |
| --max-version-diff <diff> | -m | Filter by max version diff: patch, minor, or major |
| --test <command> | | Custom test command (default: pnpm test) |
| --pre-update <command> | | Custom command to run before updating packages |
| --auto | -a | Automatically apply all updates matching the filters |
| --combine | -c | Apply all updates together, run the tests once, and commit as a single commit |
| --group <packages> | -g | Comma separated packages to update together (can be used multiple times). Ignored when --combine is used |
Examples
# Update all packages interactively
npx patchup
# Only patch updates in a specific workspace and a with max version diff of patch
npx patchup -w admin -m patch
# Use a custom test command
npx patchup --test "npm run test:ci"
# Filter for specific packages
npx patchup -p sass -p dayjs
# Apply all updates together and run the tests just once
npx patchup -a -c
# Update react and react-dom together in a single commit
npx patchup -g "react,react-dom"Development
# Bump version
pnpm version <patch|minor|major>
# Publish
pnpm test
pnpm build
pnpm publish
# Install globally from local checkout
pnpm add -g .
pnpm remove -g patchup
pnpm list -g