Files
pnpm/pnpr/crates/error/Cargo.toml
573c4d1e8e fix(pnpr): gate server-only error variants behind server feature (#16972)
pnpr-error depended on axum, bcrypt, object_store, reqwest, rusqlite,
serde_json, tokio and tracing on every non-wasm target. pnpm-config depends
on pnpr-registry for Ecosystem and PackagePattern, and pnpr-registry and
pnpr-package-name both depend on pnpr-error, so every consumer of pnpm-config
compiled and linked the registry server's HTTP, storage and auth crates.

- pnpr-error: those dependencies are optional and enabled by a new `server`
  feature. The response module (IntoResponse, public_message, log_kind) and
  the Upstream, Bcrypt, Sqlite, JoinError, ObjectStore and Json variants are
  gated on it, replacing the cfg(not(target_family = "wasm")) gate.
- The pnpr crates that use those variants or the response rendering (auth,
  osv, pipeline-runs, pnpr, search, shared-artifacts, storage, upstream)
  enable `server`. pnpr-config only builds InvalidConfig and does not.
- pnpr-registry drops its unused pnpr-error dependency.
- pnpr-package-name tests compare Display output instead of
  public_message(), so they pass without the server feature.
- Three workflow_run workflows carry their zizmor ignore directive on the
  trigger line. zizmor did not apply the standalone comment, which failed the
  zizmor job on fork PRs.

Closes pnpm/tasks#134.

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 14:45:10 +02:00

47 lines
1.2 KiB
TOML

[package]
name = "pnpr-error"
version = "0.0.1"
description = "The error type every pnpr layer returns, and how it renders as an HTTP response"
publish = false
authors.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license-file = "../../LICENSE.md"
repository.workspace = true
[features]
server = [
"dep:axum",
"dep:bcrypt",
"dep:object_store",
"dep:reqwest",
"dep:rusqlite",
"dep:serde_json",
"dep:tokio",
"dep:tracing",
]
backend-libsql = ["dep:libsql"]
backend-mysql = ["dep:sqlx", "sqlx/mysql"]
backend-postgres = ["dep:sqlx", "sqlx/postgres"]
[dependencies]
axum = { workspace = true, optional = true }
bcrypt = { workspace = true, optional = true }
derive_more = { workspace = true }
libsql = { workspace = true, optional = true }
object_store = { workspace = true, optional = true }
reqwest = { workspace = true, optional = true }
rusqlite = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
sqlx = { workspace = true, optional = true }
tokio = { workspace = true, features = ["net", "signal"], optional = true }
tracing = { workspace = true, optional = true }
url = { workspace = true }
[dev-dependencies]
tokio = { workspace = true }
[lints]
workspace = true