pub struct Config {
pub scope: Option<String>,
pub license: Option<String>,
pub launcher: Option<Launcher>,
pub include: Vec<String>,
pub extra: Map<String, Value>,
pub manifests: Vec<ManifestSpec>,
pub targets: Vec<TargetSpec>,
}Expand description
Deserialized npmgen metadata table. Every field is optional so a project
publishing a plain cross-platform binary needs no configuration at all.
Fields§
§scope: Option<String>npm scope (@owner); defaults to the repository owner.
license: Option<String>SPDX license override; defaults to the crate’s license.
launcher: Option<Launcher>Launcher file bundled into the meta package, optionally wired as bin.
include: Vec<String>Non-manifest files/dirs copied verbatim into the meta package.
extra: Map<String, Value>Extra fields merged into the meta package.json.
manifests: Vec<ManifestSpec>Foreign manifests rendered by ${var} identity substitution.
targets: Vec<TargetSpec>Highest-precedence platform target list; empty means inherit from cargo or default.
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_metadata(value: &Value) -> Result<Self, ConfigError>
pub fn from_metadata(value: &Value) -> Result<Self, ConfigError>
Build from the npmgen sub-value of a metadata table. A Null value
(table absent) yields the all-defaults config.
Sourcepub fn inherit(self, base: &Config) -> Config
pub fn inherit(self, base: &Config) -> Config
Resolve this package-level config against the workspace-level base,
mirroring cargo’s [workspace.package] inheritance: a field set here
wins, an unset one is inherited. Scalars inherit when None; lists
inherit when empty; extra maps merge key by key with this package’s
entries taking precedence.