From 9c2396134465613d3c650e881219572aecc777a5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 8 May 2026 21:45:02 +0900 Subject: fix(bump): align with Composer's BumpCommand pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splits execute() into execute → do_bump → update_file_cleanly mirroring Composer's structure, switches state loading to Composer::require, adds the no-lock fallback to vendor/composer/installed.json, routes warnings and errors through stderr, and matches Composer's wording verbatim. JsonManipulator is deferred — update_file_cleanly always falls back to a full structured rewrite for now, documented in known-incompatibilities. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/known-incompatibilities.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs') diff --git a/docs/known-incompatibilities.md b/docs/known-incompatibilities.md index 5a46e0a..45f0c17 100644 --- a/docs/known-incompatibilities.md +++ b/docs/known-incompatibilities.md @@ -15,3 +15,12 @@ In typical environments this does not matter; both Composer and Mozart trust the - PHP-only ini overrides: `openssl.cafile` / `openssl.capath` configured via `php.ini` affect Composer but have no effect on Mozart. If you rely on a private CA, set `config.cafile` and `config.capath` in `composer.json` (or the global `$COMPOSER_HOME/config.json`). It works in Mozart too. + + +## `bump` rewrites composer.json without preserving comments / key order + +Composer's `bump` command edits `composer.json` through `JsonManipulator`, which keeps unrelated whitespace, comments, and key ordering intact — only the bumped constraint values change in place. + +Mozart does not yet have a `JsonManipulator` port. `bump` therefore falls back to a full structured rewrite of `composer.json` (the same path Composer uses when `JsonManipulator` cannot handle the input). User-authored comments and idiosyncratic key orderings are lost on every run; the resulting file is functionally equivalent but reformatted. + +This will be addressed by porting `JsonManipulator`, which is also needed by `require`, `remove`, `config`, `init`, and `create-project`. -- cgit v1.3.1