mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-26 09:46:04 +03:00
chore(v1): get rid of dreamLockUtils.nix
This commit is contained in:
parent
4663912a1c
commit
69560f5128
@ -6,14 +6,13 @@
|
||||
l = lib // builtins;
|
||||
cfg = config.nodejs-package-lock;
|
||||
|
||||
dreamLockUtils = import ../../../lib/internal/dreamLockUtils.nix {inherit lib;};
|
||||
nodejsUtils = import ../../../lib/internal/nodejsUtils.nix {inherit lib parseSpdxId;};
|
||||
parseSpdxId = import ../../../lib/internal/parseSpdxId.nix {inherit lib;};
|
||||
prepareSourceTree = import ../../../lib/internal/prepareSourceTree.nix {inherit lib;};
|
||||
simpleTranslate = import ../../../lib/internal/simpleTranslate.nix {inherit lib;};
|
||||
|
||||
translate = import ./translate.nix {
|
||||
inherit lib dreamLockUtils nodejsUtils parseSpdxId simpleTranslate;
|
||||
inherit lib nodejsUtils parseSpdxId simpleTranslate;
|
||||
};
|
||||
|
||||
dreamLock = translate {
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
nodejsUtils,
|
||||
dreamLockUtils,
|
||||
simpleTranslate,
|
||||
...
|
||||
}: let
|
||||
@ -224,7 +223,7 @@
|
||||
|
||||
http = dependencyObject:
|
||||
if lib.hasPrefix "https://" dependencyObject.version
|
||||
then rec {
|
||||
then {
|
||||
version = getVersion dependencyObject;
|
||||
url = dependencyObject.version;
|
||||
hash = dependencyObject.integrity;
|
||||
@ -237,7 +236,7 @@
|
||||
// {
|
||||
hash = dependencyObject.integrity;
|
||||
}
|
||||
else rec {
|
||||
else {
|
||||
url = dependencyObject.resolved;
|
||||
hash = dependencyObject.integrity;
|
||||
};
|
||||
@ -245,21 +244,21 @@
|
||||
path = dependencyObject:
|
||||
# in case of an entry with missing resolved field
|
||||
if ! lib.hasPrefix "file:" dependencyObject.version
|
||||
then
|
||||
dreamLockUtils.mkPathSource {
|
||||
path = let
|
||||
module = l.elemAt (l.splitString "/" dependencyObject.pname) 0;
|
||||
in "node_modules/${module}";
|
||||
rootName = projectName;
|
||||
rootVersion = packageVersion;
|
||||
}
|
||||
then {
|
||||
type = "path";
|
||||
path = let
|
||||
module = l.elemAt (l.splitString "/" dependencyObject.pname) 0;
|
||||
in "node_modules/${module}";
|
||||
rootName = projectName;
|
||||
rootVersion = packageVersion;
|
||||
}
|
||||
# in case of a "file:" entry
|
||||
else
|
||||
dreamLockUtils.mkPathSource {
|
||||
path = getPath dependencyObject;
|
||||
rootName = projectName;
|
||||
rootVersion = packageVersion;
|
||||
};
|
||||
else {
|
||||
type = "path";
|
||||
path = getPath dependencyObject;
|
||||
rootName = projectName;
|
||||
rootVersion = packageVersion;
|
||||
};
|
||||
};
|
||||
|
||||
getDependencies = dependencyObject:
|
||||
|
Loading…
Reference in New Issue
Block a user