diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-10 00:32:08 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-10 00:32:08 +0900 |
| commit | 8cc1ba8a02c0318b65658f1634de378c780392b9 (patch) | |
| tree | fdd5cb61e488018891a486b25991b87c84220bb8 /crates/mozart/src/commands/bump.rs | |
| parent | 72b2e877c01e67ba7edd37e34ac2eadb7a1c62c4 (diff) | |
| download | php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.tar.gz php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.tar.zst php-mozart-8cc1ba8a02c0318b65658f1634de378c780392b9.zip | |
refactor(workspace): consolidate crates into mozart-core
Merged mozart-archiver, mozart-autoload, mozart-registry,
mozart-sat-resolver, and mozart-vcs into mozart-core to align
the source layout with Composer's structure.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/bump.rs')
| -rw-r--r-- | crates/mozart/src/commands/bump.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crates/mozart/src/commands/bump.rs b/crates/mozart/src/commands/bump.rs index 4722fe2..ee611d1 100644 --- a/crates/mozart/src/commands/bump.rs +++ b/crates/mozart/src/commands/bump.rs @@ -109,13 +109,13 @@ pub async fn do_bump( // to an empty map (`getLockedRepository` would throw in PHP — Mozart degrades // gracefully because `bump` has nothing to bump in that case anyway). if composer.locker().is_locked() { - let lock = mozart_registry::lockfile::LockFile::read_from_file(lock_path)?; + let lock = mozart_core::repository::lockfile::LockFile::read_from_file(lock_path)?; build_locked_versions_from_lock(&lock) } else { IndexMap::new() } } else if composer.locker().is_locked() { - let lock = mozart_registry::lockfile::LockFile::read_from_file(lock_path)?; + let lock = mozart_core::repository::lockfile::LockFile::read_from_file(lock_path)?; if !lock.is_fresh(&contents) { console_writeln_error!( io, @@ -282,9 +282,10 @@ fn update_file_cleanly( /// successful in-place edit so the lockfile stays "fresh" for the next install. fn update_lock_hash(lock_path: &Path, composer_json_path: &Path) -> anyhow::Result<()> { let new_composer_json_content = std::fs::read_to_string(composer_json_path)?; - let new_hash = - mozart_registry::lockfile::LockFile::compute_content_hash(&new_composer_json_content)?; - let mut lock = mozart_registry::lockfile::LockFile::read_from_file(lock_path)?; + let new_hash = mozart_core::repository::lockfile::LockFile::compute_content_hash( + &new_composer_json_content, + )?; + let mut lock = mozart_core::repository::lockfile::LockFile::read_from_file(lock_path)?; lock.content_hash = new_hash; lock.write_to_file(lock_path)?; Ok(()) @@ -304,7 +305,7 @@ fn is_writable(path: &Path) -> bool { /// Build a map of lowercase package names to (pretty_version, version_normalized) /// from a parsed `composer.lock`. fn build_locked_versions_from_lock( - lock: &mozart_registry::lockfile::LockFile, + lock: &mozart_core::repository::lockfile::LockFile, ) -> IndexMap<String, (String, Option<String>)> { let mut map: IndexMap<String, (String, Option<String>)> = IndexMap::new(); let all_packages = lock @@ -352,7 +353,7 @@ fn strip_inline_constraint(arg: &str) -> &str { #[cfg(test)] mod tests { use super::*; - use mozart_registry::lockfile::{LockFile, LockedPackage}; + use mozart_core::repository::lockfile::{LockFile, LockedPackage}; use tempfile::tempdir; fn minimal_lock(packages: Vec<LockedPackage>, packages_dev: Vec<LockedPackage>) -> LockFile { |
