diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-21 12:50:15 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-21 12:50:15 +0900 |
| commit | 96f94253d66eb9302855d7a6ae4534e12d818d58 (patch) | |
| tree | 24340724112f439ca49c48c1cfcb138b01b623f4 /crates/mozart/src/package.rs | |
| parent | 70881be20ebedad2834566065444f76a67e7cc8c (diff) | |
| download | php-mozart-96f94253d66eb9302855d7a6ae4534e12d818d58.tar.gz php-mozart-96f94253d66eb9302855d7a6ae4534e12d818d58.tar.zst php-mozart-96f94253d66eb9302855d7a6ae4534e12d818d58.zip | |
feat(update): implement update command with resolver-based dependency updates
Add full update command supporting --lock (content-hash refresh only),
--dry-run, --no-install, --no-dev, --prefer-stable, --prefer-lowest,
and partial updates (named packages). Extract install_from_lock() from
install.rs for shared use. Add Stability::parse() to package.rs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/package.rs')
| -rw-r--r-- | crates/mozart/src/package.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/mozart/src/package.rs b/crates/mozart/src/package.rs index e0e8c6c..e439ac5 100644 --- a/crates/mozart/src/package.rs +++ b/crates/mozart/src/package.rs @@ -17,6 +17,22 @@ pub enum Stability { Dev = 20, } +impl Stability { + /// Parse a stability string (case-insensitive) into a `Stability` value. + /// + /// Recognizes: "stable", "RC", "beta", "alpha", "dev". + /// Defaults to `Stability::Stable` for unrecognized values. + pub fn parse(s: &str) -> Self { + match s.to_lowercase().as_str() { + "dev" => Stability::Dev, + "alpha" => Stability::Alpha, + "beta" => Stability::Beta, + "rc" => Stability::RC, + _ => Stability::Stable, + } + } +} + /// A versioned relationship between two packages. /// Corresponds to `Composer\Package\Link`. #[derive(Debug, Clone)] |
