pub struct Project {
pub identity: Identity,
pub version: String,
pub description: String,
pub author: Author,
pub license: String,
pub repository: String,
pub bin: String,
pub package: Option<String>,
pub config: Config,
pub workspace_root: PathBuf,
pub target_directory: PathBuf,
}Expand description
Everything the pipeline needs to ship one binary as an npm package.
Fields§
§identity: Identity§version: String§description: String§license: String§repository: String§bin: StringCargo bin name to build and ship; also the npm package name.
package: Option<String>Owning cargo package, passed as --package to the build.
config: Config§workspace_root: PathBuf§target_directory: PathBufImplementations§
Source§impl Project
impl Project
Sourcepub fn builder(
scope: impl Into<String>,
name: impl Into<String>,
version: impl Into<String>,
) -> ProjectBuilder
pub fn builder( scope: impl Into<String>, name: impl Into<String>, version: impl Into<String>, ) -> ProjectBuilder
Construct a project programmatically, with no Cargo.toml, cargo metadata, or TOML parsing. The scope, name and version are required.
Sourcepub fn discover(
manifest_path: &Path,
overrides: &Overrides,
) -> Result<Vec<Self>, ProjectError>
pub fn discover( manifest_path: &Path, overrides: &Overrides, ) -> Result<Vec<Self>, ProjectError>
Resolve every publishable binary at manifest_path into a project.
Selection mirrors cargo build: by default the workspace’s
default-members (or all members), each member’s binaries, skipping
libraries and publish = false crates. --package/--workspace/
--exclude/--bin narrow the set exactly as cargo’s flags do. Each
binary becomes one npm package named after the binary.
Sourcepub fn load(
manifest_path: &Path,
overrides: &Overrides,
) -> Result<Self, ProjectError>
pub fn load( manifest_path: &Path, overrides: &Overrides, ) -> Result<Self, ProjectError>
Resolve a single binary at manifest_path. A convenience over
discover for the common one-binary case; errors with
ProjectError::NotSingle when the selection matches more than one.
Sourcepub fn package_name(&self) -> String
pub fn package_name(&self) -> String
@scope/name meta package name.