🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

yarn-update-monorepo

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yarn-update-monorepo

Simple utility for updating all dependencies for target namespace in all package.json files in Yarn monorepo.

latest
Source
npmnpm
Version
0.8.7
Version published
Weekly downloads
7
-79.41%
Maintainers
1
Weekly downloads
 
Created
Source

Simple utility for updating all dependencies for target namespace in all package.json files in Yarn monorepo.

Working algorithm:

  • get workspaces from yarn
  • find all package.json files in workspaces
  • get all packages from target namespace in dependencies, devDependencies and peerDependencies categories in package.json files
  • read NPM registry and get latest version for each dependency
  • write target versions in package.json files
  • (optional, if cleanYarnLockFlag set) clean yarn lock

Main command: update-monorepo

Flags:

  • -s - namespace for updating dependencies, required. For example @babel - utility will find all babel deps in current yarn workspaces and change it versions in package.json files
  • -d - dependency type, required. Can be strict (writed deps X.X.X) or minor (writed deps ^X.X.X)
  • -r - registry, optional, if utility can read registry from .npmrc, otherwise parameter is required
  • -f - fixed version, optional. If set, registry will not be used, all dependencies resolved to fixed version
  • -c - clean yarn lock flag. If set, utility will also find in yarn.lock all strict dependency records which can't be deduped later and remove they

Utility command: clean-yarnlock

Flags:

  • -s - namespace for cleaning dependency records

Examples

  • yarn update-monorepo -d strict -s @babel - find all @babel/ deps in current monorepo and bump it to latest strict versions
  • yarn update-monorepo -d minor -s @babel -r https://myRegistry - find all @babel/ deps in current monorepo and bump it to latest minor versions, working with https://myRegistry
  • yarn update-monorepo -d strict -s @babel -f 8.0.0 - find all @babel/ deps in current monorepo and change versions to 8.0.0
  • yarn clean-yarnlock -s @babel - find all dependencies for @babel/ namespace, filter only records with strict inner deps, that can't be dedupes and remove they

FAQs

Package last updated on 17 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts