Blog
What does "react": "catalog:" in package.json mean?

What does "react": "catalog:" in package.json mean?

In this article, we will review what does “react”:“catalog:” in package.json mean. We will look at:

  1. What is catalog?

  2. catalog in package.json

  3. pnpm-workspace.yaml

What is catalog?

0.email codebase is a monorepo and it uses pnpm workspace to manage it.

“Catalogs” are a workspace feature for defining dependency version ranges as reusable constants. Constants defined in catalogs can later be referenced in package.json files.

The Catalog Protocol (catalog:)

Once a catalog is defined in pnpm-workspace.yaml,

packages:
  - packages/*

# Define a catalog of version ranges.
catalog:
  react: ^18.3.1
  redux: ^5.0.1

The above code snippet is picked from the documentation.

The catalog: protocol can be used instead of the version range itself.

{
  "name": "@example/app",
  "dependencies": {
    "react": "catalog:",
    "redux": "catalog:"
  }
}

This is equivalent to writing a version range (e.g. ^18.3.1) directly.

{
  "name": "@example/app",
  "dependencies": {
    "react": "^18.3.1",
    "redux": "^5.0.1"
  }
}

Learn more about catalogs

catalog in package.json

In zero/apps/main/package.json at line 81, you will find this catalog mentioned as a value for the “react” key.

 "react": "catalog:",

pnpm-workspace.yaml

You will find the following code in zero/pnpm-workspace.yaml

packages:
  - apps/*
  - packages/*
  - scripts/*
catalog:
  zod: ^3.25.42
  better-auth: ^1.2.9
  autumn-js: ^0.0.48
  superjson: ^2.2.2
  '@trpc/server': ^11.1.4
  '@trpc/client': ^11.1.4
  '@trpc/tanstack-react-query': ^11.1.4
  wrangler: ^4.18.0
  typescript: ^5.8.3
  drizzle-orm: ^0.43.1
  drizzle-kit: ^0.31.1
  '@types/node': ^22.15.21
  'react': ^19.1.0
  'react-dom': ^19.1.0
onlyBuiltDependencies:
  - core-js
  - core-js-pure
  - esbuild
  - sharp
  - unrs-resolver
  - workerd
patchedDependencies:
  novel: patches/novel.patch

Based on the example picked in catalog in package.json section above, the react version is as shown below:

'react': ^19.1.0

About me

Hey, my name is Ramu Narasinga. I study codebase architecture in large open-source projects.

Email: ramu.narasinga@gmail.com

Build Shadcn CLI from scratch.

References:

  1. https://github.com/Mail-0/Zero/blob/staging/apps/mail/package.json#L89

  2. https://github.com/Mail-0/Zero/blob/staging/pnpm-workspace.yaml

  3. https://pnpm.io/catalogs