Subject: [bug#77231] [PATCH 1/6] import: npm-binary: Fix import.

From: Nicolas Graves <[email-masked]>
Date: Mon, 24 Mar 2025 08:29:12 +0100

This is a follow-up to b65f5b731c538227b51645d6d81b0cbb731bb6e4.

* guix/import/npm-binary.scm (npm-package->package-sexp): Use modify-json.
* tests/npm-binary.scm (npm-binary->guix-package test): Use modify-json.
---
 guix/import/npm-binary.scm | 3 ++-
 tests/npm-binary.scm       | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/import/npm-binary.scm b/guix/import/npm-binary.scm
index 92ac7d338e..c43b84f3d5 100644
--- a/guix/import/npm-binary.scm
+++ b/guix/import/npm-binary.scm
@@ -228,7 +228,8 @@ (define resolve-spec
                   ((dev-names ...)
                    `((add-after 'patch-dependencies 'delete-dev-dependencies
                        (lambda _
-                         (delete-dependencies '(,@(reverse dev-names))))))))))
+                         (modify-json
+                          (delete-dependencies '(,@(reverse dev-names)))))))))))
           (values
            `(package
               (name ,name)
diff --git a/tests/npm-binary.scm b/tests/npm-binary.scm
index cf85e572b3..0cc2864546 100755
--- a/tests/npm-binary.scm
+++ b/tests/npm-binary.scm
@@ -133,7 +133,8 @@ (define have-guile-semver?
                              (delete 'build)
                              (add-after 'patch-dependencies 'delete-dev-dependencies
                                (lambda _
-                                 (delete-dependencies '("node-megabuilder"))))))))
+                                 (modify-json
+                                  (delete-dependencies '("node-megabuilder")))))))))
               (inputs (list node-bar-0.1.2))
               (home-page "https://github.com/quartz/foo")
               (synopsis "General purpose utilities to foo your bars")
-- 
2.48.1