1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Get node-red core nodes back to the top of the list

This commit is contained in:
Nick O'Leary 2021-02-17 15:16:02 +00:00
parent e6ec59092c
commit f96ce2fd83
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -305,13 +305,15 @@ function getNodeFiles(disableNodePathScan) {
}
}
var nodeList = {};
var coreNodeEntry = {
name: "node-red",
version: settings.version,
nodes: {},
icons: iconList
}
var nodeList = {
"node-red": coreNodeEntry
};
nodeFiles.forEach(function(node) {
coreNodeEntry.nodes[node.name] = node;
});
@ -370,11 +372,10 @@ function getNodeFiles(disableNodePathScan) {
}
return true;
});
nodeList = convertModuleFileListToObject(moduleFiles);
nodeList = convertModuleFileListToObject(moduleFiles, nodeList);
} else {
// console.log("node path scan disabled");
}
nodeList["node-red"] = coreNodeEntry;
return nodeList;
}
@ -392,8 +393,8 @@ function getModuleFiles(module) {
return convertModuleFileListToObject(moduleFiles);
}
function convertModuleFileListToObject(moduleFiles) {
const nodeList = {};
function convertModuleFileListToObject(moduleFiles,seedObject) {
const nodeList = seedObject || {};
moduleFiles.forEach(function(moduleFile) {
var nodeModuleFiles = getModuleNodeFiles(moduleFile);