ephemeris_release/adapters/
npm.rs1mod publisher;
4mod registry;
5
6use std::io;
7
8pub(crate) use self::publisher::NpmPublisher;
9pub use self::registry::NpmRegistry;
10use crate::error::PackageFailure;
11
12#[derive(Debug, thiserror::Error)]
14pub(crate) enum NpmError {
15 #[error("npm unit {unit:?} publishes but no npm registry is configured")]
17 MissingRegistry {
18 unit: String,
20 },
21 #[error("npm release unit {0:?} has no package name")]
23 MissingPackage(String),
24 #[error("npm registry URL {url:?} has no host")]
26 RegistryWithoutHost {
27 url: String,
29 },
30 #[error("no credential was given to publish npm packages")]
32 MissingToken,
33 #[error("cannot write the temporary npm configuration")]
35 Npmrc(#[source] io::Error),
36 #[error("cannot run npm {arguments:?}")]
38 Spawn {
39 arguments: Vec<String>,
41 #[source]
43 source: io::Error,
44 },
45 #[error("npm {arguments:?} exited unsuccessfully: {stderr}")]
47 Failed {
48 arguments: Vec<String>,
50 stderr: String,
52 },
53 #[error("npm registry lookup failed")]
55 Registry(#[from] PackageFailure),
56}