mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-20 13:01:44 +03:00
small fixes in translators and resolving
This commit is contained in:
parent
d8d0856c96
commit
ed9bdd2fa2
@ -428,7 +428,7 @@ let
|
||||
discoveredProjects = dlib.discoverers.discoverProjects { inherit tree; };
|
||||
|
||||
getTranslator = subsystem: translatorName:
|
||||
translators.translators."${subsystem}".all."${translatorName}";
|
||||
translators.translatorsV2."${subsystem}".all."${translatorName}";
|
||||
|
||||
isImpure = project: translatorName:
|
||||
(getTranslator project.subsystem translatorName).type == "impure";
|
||||
|
@ -21,7 +21,7 @@ let
|
||||
let
|
||||
nodes = l.readDir path;
|
||||
in
|
||||
l.optionals (nodes ? "package-lock.json") [ "package-lock2" ]
|
||||
l.optionals (nodes ? "package-lock.json") [ "package-lock" ]
|
||||
++ l.optionals (nodes ? "yarn.lock") [ "yarn-lock" ]
|
||||
++ [ "package-json" ];
|
||||
|
||||
@ -57,7 +57,9 @@ let
|
||||
makeWorkspaceProjectInfo = tree: wsRelPath: parentInfo:
|
||||
{
|
||||
inherit subsystem;
|
||||
name = (getPackageJson "${tree.fullPath}/${wsRelPath}").name or null;
|
||||
name =
|
||||
(getPackageJson "${tree.fullPath}/${wsRelPath}").name
|
||||
or "${parentInfo.name}/${wsRelPath}";
|
||||
relPath = dlib.sanitizeRelativePath "${tree.relPath}/${wsRelPath}";
|
||||
translators =
|
||||
l.unique
|
||||
@ -90,7 +92,7 @@ let
|
||||
{
|
||||
inherit subsystem;
|
||||
inherit (tree) relPath;
|
||||
name = tree.files."package.json".jsonContent.name or null;
|
||||
name = tree.files."package.json".jsonContent.name or tree.relPath;
|
||||
translators = getTranslatorNames tree.fullPath;
|
||||
subsystemInfo =
|
||||
l.optionalAttrs (workspaces != []) {
|
||||
@ -120,6 +122,7 @@ let
|
||||
(l.map (p: p.relPath) foundProjects)
|
||||
(relPath: null));
|
||||
in
|
||||
# l.trace tree.directories
|
||||
# the current directory
|
||||
foundProjects
|
||||
|
||||
|
@ -32,7 +32,8 @@ let
|
||||
(proj:
|
||||
translator.translate
|
||||
((cleanedArgs args) // {
|
||||
source = "${args.source}${proj.relPath}";
|
||||
source = "${args.source}/${proj.relPath}";
|
||||
name = proj.name;
|
||||
}))
|
||||
args.projects;
|
||||
};
|
||||
@ -50,7 +51,8 @@ let
|
||||
downgradeTranslator =
|
||||
translator // {
|
||||
translate = args:
|
||||
translator.translate (args // {
|
||||
l.head
|
||||
(translator.translate (args // {
|
||||
inherit (args) source;
|
||||
tree = dlib.prepareSourceTree { inherit (args) source; };
|
||||
projects = [{
|
||||
@ -58,7 +60,7 @@ let
|
||||
relPath = "";
|
||||
subsystem = translator.subsystem;
|
||||
}];
|
||||
});
|
||||
}));
|
||||
};
|
||||
in
|
||||
if version == 1 then
|
||||
|
Loading…
Reference in New Issue
Block a user