Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0sec labs 0 pnpm lock yaml

From Leeroopedia
Knowledge Sources
Domains Tooling, Dependency_Management, Reproducibility
Last Updated 2026-10-30 00:00 GMT

Overview

Concrete tool for locking the entire monorepo's dependency graph to exact resolved versions for reproducible installs, provided by the pnpm package manager.

Description

The pnpm-lock.yaml file is the lockfile for the 0sec_labs_0 monorepo. It pins every direct and transitive dependency across all workspace packages (root, docs, and the @0/* packages) to exact resolved versions, integrity hashes, and peer-dependency resolutions. The file uses lockfile version 9.0 and includes an overrides block that forces security-patched versions of transitive deps (e.g., nanoid ≥ 3.3.18, dompurify ≥ 3.4.17, zod = 4.6.6) regardless of what upstream packages request. It is the source of truth consumed by pnpm install --frozen-lockfile in CI to guarantee identical dependency trees across developers and pipelines.

Usage

Reference this file when you need to:

  • Audit or update the locked dependency graph (pnpm update regenerates it).
  • Reproduce an exact dependency tree in CI or a fresh checkout (pnpm install --frozen-lockfile).
  • Investigate a security advisory against a transitive dependency (check the overrides and packages sections).
  • Understand which version of a transitive dependency is actually resolved after overrides are applied.

Code Reference

Source Location

Signature

lockfileVersion: '9.0'

settings:
  autoInstallPeers: true
  excludeLinksFromLockfile: false

overrides:
  <package>: <forced-version>      # security/compat overrides applied across the tree

importers:

  .:                                # root workspace
    dependencies: { ... }           # direct deps + resolved versions
    devDependencies: { ... }

  docs:                             # docs workspace
    dependencies: { ... }

  packages/<name>:                  # each @0/* package
    dependencies: { ... }

packages:
  <name>@<version>:                 # exact resolved transitive dep entries
    resolution: { integrity: sha512-... }
    dependencies: { ... }
    peerDependencies: { ... }

Import

# Consumed by pnpm; no code import. Use the CLI:
pnpm install --frozen-lockfile     # CI: fail if lockfile out of sync
pnpm install                       # dev: regenerate if needed

I/O Contract

Inputs

Name Type Required Description
package.json files JSON Yes Workspace manifest files declaring desired specifiers
pnpm-workspace.yaml YAML Yes Defines which directories are workspace packages
overrides block YAML mapping No Forced versions for transitive deps (security patches)
lockfileVersion string Yes Lockfile format version ('9.0')

Outputs

Name Type Description
node_modules tree Directory Reproducible installed dependency graph matching the lockfile
integrity hashes sha512 strings Per-package integrity for tamper detection
resolved versions mapping Exact version selected for every direct + transitive dep
exit code int Non-zero from --frozen-lockfile when lockfile is out of sync

Usage Examples

CI Frozen Install

# In CI: install exactly what the lockfile says, fail if it drifts
pnpm install --frozen-lockfile

# Verify the lockfile is up to date with manifests
pnpm install --frozen-lockfile --frozen-lockfile

Auditing a Transitive Dependency

# Find the exact resolved version of a transitive dep after overrides
pnpm why dompurify

# Or grep the lockfile directly for the override + resolved version
grep -A2 'dompurify' pnpm-lock.yaml

Updating the Lockfile

# Update a single package and regenerate the lockfile
pnpm update dompurify

# Add a new direct dependency (updates lockfile)
pnpm add zod

# Commit the regenerated pnpm-lock.yaml alongside package.json changes

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment