Skip to main content

npmgen_core/
lib.rs

1//! Generate the npm publish tree that ships a prebuilt Rust binary.
2//!
3//! The tree follows the "platform packages" pattern: a meta package whose
4//! `optionalDependencies` point at one `@scope/name-<os>-<cpu>` package per
5//! platform, each carrying the binary and filtered by npm `os`/`cpu`. Package
6//! identity is read from the target crate via `cargo metadata`; targets, payload
7//! and foreign manifests are declared under `[package.metadata.npmgen]` (or
8//! `[workspace.metadata.npmgen]`).
9//!
10//! Obtain a [`Project`] with [`Project::builder`] (in-memory) or [`Project::load`]
11//! (from a manifest), then run [`Generator::new`].
12
13mod error;
14mod pipeline;
15
16pub mod compile;
17pub mod config;
18pub mod npm;
19pub mod project;
20pub mod target;
21
22pub use compile::{BuildDriver, CargoDriver, CompileError};
23pub use config::{Config, ConfigError, Launcher, ManifestSpec, TargetSpec};
24pub use error::{Error, Result};
25pub use npm::NpmError;
26pub use pipeline::{DEFAULT_DRIVER, DEFAULT_OUT, Generator};
27pub use project::{
28    Author, DEFAULT_MANIFEST_PATH, Identity, Overrides, Project, ProjectBuilder, ProjectError,
29    Workspace,
30};
31pub use target::{Target, TargetError};