pub struct PackageInfo {
pub name: String,
pub private: bool,
pub package_json_path: String,
pub package_path: String,
pub package_relative_path: String,
pub pkg_json: Value,
pub root: bool,
pub version: String,
pub url: String,
pub repository_info: Option<PackageRepositoryInfo>,
pub changed_files: Vec<String>,
pub dependencies: Vec<DependencyInfo>,
}
Expand description
A struct that represents a package in the monorepo.
Fields§
§name: String
§private: bool
§package_json_path: String
§package_path: String
§package_relative_path: String
§pkg_json: Value
§root: bool
§version: String
§url: String
§repository_info: Option<PackageRepositoryInfo>
§changed_files: Vec<String>
§dependencies: Vec<DependencyInfo>
Implementations§
Source§impl PackageInfo
impl PackageInfo
Sourcepub fn push_changed_file(&mut self, file: String)
pub fn push_changed_file(&mut self, file: String)
Pushes a changed file to the list of changed files.
Sourcepub fn get_changed_files(&self) -> Vec<String>
pub fn get_changed_files(&self) -> Vec<String>
Returns the list of changed files.
Sourcepub fn extend_changed_files(&mut self, files: Vec<String>)
pub fn extend_changed_files(&mut self, files: Vec<String>)
Extends the list of changed files with the provided list.
pub fn push_dependency(&mut self, dependency: DependencyInfo)
Sourcepub fn update_version(&mut self, version: String)
pub fn update_version(&mut self, version: String)
Updates the version of the package.
Sourcepub fn update_dependency_version(&mut self, dependency: String, version: String)
pub fn update_dependency_version(&mut self, dependency: String, version: String)
Updates a dependency version in the package.json file.
Sourcepub fn update_dev_dependency_version(
&mut self,
dependency: String,
version: String,
)
pub fn update_dev_dependency_version( &mut self, dependency: String, version: String, )
Updates a dev dependency version in the package.json file.
Sourcepub fn write_package_json(&self)
pub fn write_package_json(&self)
Write package.json file with the updated version.
Trait Implementations§
Source§impl Clone for PackageInfo
impl Clone for PackageInfo
Source§fn clone(&self) -> PackageInfo
fn clone(&self) -> PackageInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PackageInfo
impl Debug for PackageInfo
Source§impl<'de> Deserialize<'de> for PackageInfo
impl<'de> Deserialize<'de> for PackageInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for PackageInfo
impl Hash for PackageInfo
Source§impl Node for PackageInfo
impl Node for PackageInfo
Source§type DependencyType = DependencyInfo
type DependencyType = DependencyInfo
Encodes a dependency relationship. In a Package Manager dependency graph for intance, this might be a (package name, version) tuple.
It might also just be the exact same type as the one that implements the Node trait, in which case
Node::matches
can be implemented through simple equality.Source§fn dependencies(&self) -> &[Self::DependencyType]
fn dependencies(&self) -> &[Self::DependencyType]
Returns a slice of dependencies for this Node
Source§fn matches(&self, dependency: &Self::DependencyType) -> bool
fn matches(&self, dependency: &Self::DependencyType) -> bool
Returns true if the
dependency
can be met by us.Source§impl PartialEq for PackageInfo
impl PartialEq for PackageInfo
Source§impl Serialize for PackageInfo
impl Serialize for PackageInfo
impl Eq for PackageInfo
impl StructuralPartialEq for PackageInfo
Auto Trait Implementations§
impl Freeze for PackageInfo
impl RefUnwindSafe for PackageInfo
impl Send for PackageInfo
impl Sync for PackageInfo
impl Unpin for PackageInfo
impl UnwindSafe for PackageInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more