Skip to content
This documentation is for v14, the docs for v13 are archived.

Dependency Types

Dependency types refer to the different locations in package.json files where dependencies can be defined.

Default Values

The default dependency types in syncpack are the ones defined by npm, pnpm, and yarn:

NameSourceProperty
devpackage.jsondevDependencies
localpackage.jsonversion
overridespackage.jsonoverrides
peerpackage.jsonpeerDependencies
pnpmOverridespnpm-workspace.yamloverrides
prodpackage.jsondependencies
resolutionspackage.jsonresolutions

Catalog Names

Catalog dependency types are added automatically when syncpack detects pnpm catalogs in pnpm-workspace.yaml or Bun catalogs in the root package.json.

NameSourceWhen
pnpmCatalogpnpm-workspace.yaml catalogthe pnpm default catalog has entries
pnpmCatalog:<name>pnpm-workspace.yaml catalogs.<name>one per named pnpm catalog
bunCatalogroot package.json catalogthe Bun default catalog is present
bunCatalog:<name>root package.json catalogs.<name>one per named Bun catalog

Bun also recognises workspaces.catalog and workspaces.catalogs.<name>. These names work everywhere a dependency type is accepted.

syncpack lint --dependency-types pnpmCatalog
syncpack list --dependency-types 'pnpmCatalog:react18'

Custom Values

You can extend the above list by defining your own custom types, such as:

  • Engine versions (engines)
  • Package manager versions (packageManager)
  • Any other nested property in package.json
  • Properties in pnpm-workspace.yaml (via source: "PnpmWorkspace")

Using Dependency Types

Dependency types can be specified in these contexts:

Command Line Filtering

Use the --dependency-types option to target specific types in commands:

# Only check production dependencies
syncpack lint --dependency-types prod
# Check both production and development dependencies
syncpack lint --dependency-types prod,dev
# Check everything except peer dependencies
syncpack lint --dependency-types '!peer'

Configuration

Dependency types can be used to target and filter:

  1. Version Groups - Carve out specific version policies
  2. Semver Groups - Define which semver ranges to use with specific dependencies
  3. Dependency Groups - Merge and alias families of dependencies as one