Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antongolub/npm-upgrade-monorepo
Wrapper to use npm-upgrade with monorepos
https://github.com/antongolub/npm-upgrade-monorepo
npm
Last synced: 7 days ago
JSON representation
Wrapper to use npm-upgrade with monorepos
- Host: GitHub
- URL: https://github.com/antongolub/npm-upgrade-monorepo
- Owner: antongolub
- License: mit
- Created: 2020-09-30T17:10:29.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-26T09:06:57.000Z (7 months ago)
- Last Synced: 2024-04-26T10:26:27.460Z (7 months ago)
- Topics: npm
- Language: TypeScript
- Homepage:
- Size: 1.3 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# npm-upgrade-monorepo
Apply [npm-upgrade](https://github.com/th0r/npm-upgrade) to monorepos. The wrapper just parses `workspaces` field of package.json, and invokes **npm-upgrade** for each internal package dir.
[![CI](https://github.com/antongolub/npm-upgrade-monorepo/workflows/CI/badge.svg)](https://github.com/antongolub/npm-upgrade-monorepo/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/ba54d6fecd9b4d088387/maintainability)](https://codeclimate.com/github/antongolub/npm-upgrade-monorepo/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/ba54d6fecd9b4d088387/test_coverage)](https://codeclimate.com/github/antongolub/npm-upgrade-monorepo/test_coverage)
[![npm (tag)](https://img.shields.io/npm/v/npm-upgrade-monorepo)](https://www.npmjs.com/package/npm-upgrade-monorepo)## Install
```shell
npm i -g npm-upgrade-monorepo
```## Usage
API inherits `npm-upgrade` [CLI contract](https://github.com/th0r/npm-upgrade#usage).
```shell
npm-upgrade-monorepo [...args]
```### --workspaces / -w
Additional param to override `package.json` `workspaces` field value.
```shell
npm-upgrade-monorepo -w packages/*
npm-upgrade-monorepo -w scope1/a,scope2/b
```## Alternatives
* `yarn upgrade-interactive`
* [Anifacted/lerna-update-wizard](https://github.com/Anifacted/lerna-update-wizard)
* [codsen/update-versions](https://github.com/codsen/codsen/tree/main/packages/update-versions)
* Bash script
```shell
#!/bin/bashNPM_UPGRADE="npm-upgrade"
PACKAGES=$(cat package.json | jq -r '.workspaces | join(" ")')eval $NPM_UPGRADE
for f in $PACKAGES; do
if [ -d "$f" ]; then
cd $f
eval $NPM_UPGRADE
fi
done
```
## License
[MIT](./LICENSE)