fix: specify subsystems in discoverers

This commit is contained in:
Yusuf Bera Ertan 2022-09-27 23:18:03 +03:00
parent 13fd0fa908
commit 73e575078e
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA
5 changed files with 7 additions and 15 deletions

View File

@ -42,12 +42,7 @@ modules:
import_ = collectedModules:
lib.mapAttrs
(name: description:
(
import description.path {
inherit dlib lib;
inherit (description) name subsystem;
}
)
(import description.path {inherit dlib lib;})
// {inherit (description) name subsystem;})
(
lib.foldl'

View File

@ -1,7 +1,6 @@
{
dlib,
lib,
subsystem,
...
}: let
l = lib // builtins;
@ -119,10 +118,10 @@
makeWorkspaceProjectInfo = tree: wsRelPath: parentInfo:
dlib.construct.discoveredProject {
inherit subsystem;
name =
(getPackageJson "${tree.fullPath}/${wsRelPath}").name
or "${parentInfo.name}/${wsRelPath}";
subsystem = "nodejs";
relPath = dlib.sanitizeRelativePath "${tree.relPath}/${wsRelPath}";
translators =
l.unique
@ -162,9 +161,9 @@
else let
# project info of current directory
currentProjectInfo = dlib.construct.discoveredProject {
inherit subsystem;
inherit (tree) relPath;
name = tree.files."package.json".jsonContent.name or tree.relPath;
subsystem = "nodejs";
translators = getTranslatorNames tree;
subsystemInfo = l.optionalAttrs (workspaces != []) {
workspaces =

View File

@ -1,7 +1,6 @@
{
dlib,
lib,
subsystem,
...
}: let
l = lib // builtins;
@ -14,7 +13,6 @@
# discover php projects
discover = {tree}: let
currentProjectInfo = dlib.construct.discoveredProject {
inherit subsystem;
inherit (tree) relPath;
name =
tree.files."composer.json".jsonContent.name
@ -23,6 +21,7 @@
then tree.relPath
else "unknown"
);
subsystem = "php";
translators = getTranslators tree;
subsystemInfo = {};
};

View File

@ -1,7 +1,6 @@
{
dlib,
lib,
subsystem,
...
}: let
l = lib // builtins;
@ -24,7 +23,6 @@
then
[
(dlib.construct.discoveredProject {
inherit subsystem;
relPath = tree.relPath;
name =
if topLevel
@ -33,6 +31,7 @@
l.unsafeDiscardStringContext
(l.last
(l.splitString "/" (l.removeSuffix "/" "${tree.fullPath}")));
subsystem = "python";
translators = ["pip"];
subsystemInfo.pythonAttr = "python3";
})

View File

@ -1,7 +1,6 @@
{
dlib,
lib,
subsystem,
...
}: let
l = lib // builtins;
@ -95,7 +94,8 @@
then
[
(dlib.construct.discoveredProject {
inherit subsystem translators;
inherit translators;
subsystem = "rust";
relPath = tree.relPath;
name = cargoToml.package.name or tree.relPath;
subsystemInfo = {inherit crates workspaceMembers;};