CodeVetter · Repo Unpack · System map
pnpm/pnpm
The repository has two CLI implementations and a sibling registry server, with shared Rust crates rather than one uniform runtime. The Rust CLI separates startup, command routing, application state, and the installation engine. pnpr builds an Axum server around configuration, identity, routing, storage, and optional protocol surfaces. Root manifests coordinate builds and tests across both language stacks.
- The root Cargo workspace includes pnpm crates, pnpm task binaries, and pnpr crates; its shared package metadata selects Rust edition 2024.
- The Rust executable's main delegates to pnpm_cli::main, which installs diagnostics and runs CLI startup on a separate thread; normal commands use a Tokio runtime with 32 MiB stack headroom.
- The TypeScript entrypoint dynamically loads main and the worker API, routes errors through errorHandler, and drains workers in finally; its package ships bin launchers and dist output and requires Node >=22.13.
- CLI State owns manifest data, a lazy wanted lockfile, resolved-package state, and shared HTTP/tarball caches; configuration is borrowed as a process-lifetime Config.
- pnpr exposes library router/serve APIs and a Tokio binary; serve validates enabled surfaces and registry routing, loads OSV and authentication, builds the router, then binds and serves with graceful shutdown.
- pnpr separates durable hosted storage from its disposable local proxy cache. HostedBackend supports local or S3-compatible implementations, while authentication supports local htpasswd/SQLite and selectable shared SQL backends.
- Root scripts provide Rust build, affected tests, smoke tests, checks, and linting, alongside TypeScript compilation and package testing; pnpm-workspace.yaml wraps CI scripts in named pipelines and assigns task concurrency groups.
- The Rust CLI's npm wrapper is named pacquet in-repo but publishes as pnpm and exposes pnpm/pn/pnpx/pnx. A separate workflow builds the pnpm container image for amd64 and arm64 with provenance and SBOM output.