From 8fbd1d51a985f5c8533faea2d6065666f2c0ce1d Mon Sep 17 00:00:00 2001 From: DavHau Date: Fri, 25 Feb 2022 21:38:08 +0700 Subject: [PATCH] fix output of package-lock2 translator --- src/discoverers/default.nix | 9 +++++---- .../nodejs/pure/package-lock2/default.nix | 20 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/discoverers/default.nix b/src/discoverers/default.nix index 3401df95..b2ef9af3 100644 --- a/src/discoverers/default.nix +++ b/src/discoverers/default.nix @@ -13,10 +13,11 @@ let (v: v ? discover) discoverers; - discoverProjects = source: - let - tree = dlib.prepareSourceTree { inherit source; }; - in + discoverProjects = + { + source ? null, + tree ? dlib.prepareSourceTree { inherit source; }, + }: l.flatten (l.map (discoverer: discoverer.discover { inherit tree; }) diff --git a/src/translators/nodejs/pure/package-lock2/default.nix b/src/translators/nodejs/pure/package-lock2/default.nix index 150437c9..7e4a55b7 100644 --- a/src/translators/nodejs/pure/package-lock2/default.nix +++ b/src/translators/nodejs/pure/package-lock2/default.nix @@ -38,20 +38,18 @@ let allProjectsTranslated = l.map (proj: - translateOne - { - inherit translatorName utils name noDev nodejs; - source = "${args.source}/${proj.relPath}"; - packageLock = getLock proj; - }) + proj // { + dreamLock = + translateOne { + inherit translatorName utils name noDev nodejs; + source = "${args.source}/${proj.relPath}"; + packageLock = getLock proj; + }; + }) projects; in - l.foldl' - l.recursiveUpdate - {} - # reverse the project list so the first defaultPacke persists - (lib.reverseList allProjectsTranslated); + allProjectsTranslated; translateOne =