Consistent dependency versions in large JavaScript Monorepos.
Consistent dependency versions in large JavaScript Monorepos.
Consistent dependency versions in large JavaScript Monorepos.
https://syncpack.dev
Syncpack is used by AWS, Cloudflare, DataDog, Electron, GoDaddy, Lottie, Microsoft, PostHog, Qwik, Raycast, Salesforce, TopTal, Vercel, VoltAgent, WooCommerce and others.
Some of the things it can do are:
npm install --save-dev syncpackAll command line options can be combined to target packages and dependencies in multiple ways.
Ensure that multiple packages requiring the same dependency define the same version, so that every package requires eg. [email protected], instead of a combination of [email protected], [email protected], and [email protected].
…Fix every autofixable issue found by syncpack lint.
# Only fix issues in dependencies and devDependencies
syncpack fix --dependency-types prod,dev
# Only fix inconsistencies with exact versions (eg "1.2.3")
syncpack fix --specifier-types exact
# Only fix issues in "react" specifically
syncpack fix --dependencies react
# See more examples
syncpack fix --help
# See a short summary of options
syncpack fix -hUpdate packages to the latest versions from the npm registry, wherever they are in your monorepo, including pnpm catalog entries in pnpm-workspace.yaml.
Semver range preferences are preserved when updating.
…Organise package.json files according to a conventional format, where fields appear in a predictable order and nested fields are ordered alphabetically. Shorthand properties are used where available, such as the "repository" and "bugs" fields.
# Fix every formatting issue in the monorepo
syncpack format
# List all formatting issues in the monorepo
syncpack format --check
# Check the formatting of one package
syncpack format --check --source 'packages/pingu/package.json'
# See more examples
syncpack format --help
# See a short summary of options
syncpack format -hQuery and inspect all dependencies in your project, both valid and invalid.
…Output the state of every instance of every dependency as a JSON object, one per line. This command is best used with tools like jq for filtering and processing.
# Output all dependencies as JSON
syncpack json
# Output only AWS SDK dependencies
syncpack json --dependencies '@aws-sdk/**'
# Count dependencies by type
syncpack json | jq -r '.dependencyType' | sort | uniq -c
# See more examples
syncpack json --help
# See a short summary of options
syncpack json -hNo open issues yet, or sync has not completed.