From dfc15e9183dc4a34d9d7e0c75c3e8364517c91bd Mon Sep 17 00:00:00 2001 From: Martin Toman Date: Thu, 25 Aug 2022 17:04:58 -0700 Subject: [PATCH] fix: php: require-dev only for top-level packages --- .../php/translators/composer-lock/default.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/subsystems/php/translators/composer-lock/default.nix b/src/subsystems/php/translators/composer-lock/default.nix index b75be48c..29576e10 100644 --- a/src/subsystems/php/translators/composer-lock/default.nix +++ b/src/subsystems/php/translators/composer-lock/default.nix @@ -203,14 +203,8 @@ in { in map (l.strings.removePrefix "ext-") (l.lists.unique extensions); - # get require (and require-dev) - getDependencies = pkg: - ( - if noDev - then [] - else (pkg.require-dev or {}) - ) - // (pkg.require or {}); + # get dependencies + getDependencies = pkg: (pkg.require or {}); # resolve semvers into exact versions pinPackages = pkgs: let @@ -230,7 +224,6 @@ in { pkg // { require = l.mapAttrs doPin (clean pkg.require); - require-dev = l.mapAttrs doPin (clean pkg.require-dev); }; in map doPins pkgs; @@ -279,7 +272,13 @@ in { type = "path"; path = projectSource; }; - inherit (composerJson) require require-dev; + require = + ( + if noDev + then {} + else composerJson.require-dev + ) + // composerJson.require; } ] ++ resolvedPackages