@gregoriusrippenstein/node-red-contrib-nodedev 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,64 @@ module.exports = function (RED) {
|
|
|
2
2
|
let pacote = require('pacote');
|
|
3
3
|
let tarHelpers = require('./lib/tarhelpers.js');
|
|
4
4
|
|
|
5
|
+
let dirGrpColours = (dirname) => {
|
|
6
|
+
|
|
7
|
+
dirname = (dirname.startsWith("dist/") || dirname == "dist") ? "dist" : dirname
|
|
8
|
+
dirname = (dirname.startsWith("nodes/locales/") || dirname == "nodes/locales" ) ? "nodes/locales" : dirname
|
|
9
|
+
dirname = (dirname.startsWith("locales/") || dirname == "locales") ? "nodes/locales" : dirname
|
|
10
|
+
dirname = (dirname.startsWith("samples/") || dirname == "samples") ? "examples" : dirname
|
|
11
|
+
dirname = (dirname != "." && dirname.startsWith(".")) ? ".dir" : dirname
|
|
12
|
+
|
|
13
|
+
let lookup = {
|
|
14
|
+
".dir": {
|
|
15
|
+
"stroke": "#dbcbe7",
|
|
16
|
+
"fill": "#dbcbe7",
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"stroke": "#ffefbf",
|
|
20
|
+
"fill": "#ffefbf",
|
|
21
|
+
},
|
|
22
|
+
"examples": {
|
|
23
|
+
"stroke": "#addb7b",
|
|
24
|
+
"fill": "#addb7b",
|
|
25
|
+
},
|
|
26
|
+
"nodes": {
|
|
27
|
+
"stroke": "#c8e7a7",
|
|
28
|
+
"fill": "#c8e7a7",
|
|
29
|
+
},
|
|
30
|
+
"plugins": {
|
|
31
|
+
"stroke": "#92d04f",
|
|
32
|
+
"fill": "#92d04f",
|
|
33
|
+
},
|
|
34
|
+
"nodes/lib": {
|
|
35
|
+
"stroke": "#e3f3d3",
|
|
36
|
+
"fill": "#e3f3d3",
|
|
37
|
+
},
|
|
38
|
+
"assets": {
|
|
39
|
+
"stroke": "#0070c0",
|
|
40
|
+
"fill": "#0070c0",
|
|
41
|
+
},
|
|
42
|
+
"icons": {
|
|
43
|
+
"stroke": "#3f93cf",
|
|
44
|
+
"fill": "#3f93cf",
|
|
45
|
+
},
|
|
46
|
+
"nodes/icons": {
|
|
47
|
+
"stroke": "#3f93cf",
|
|
48
|
+
"fill": "#3f93cf",
|
|
49
|
+
},
|
|
50
|
+
"dist": {
|
|
51
|
+
"stroke": "#ffbfbf",
|
|
52
|
+
"fill": "#ffbfbf"
|
|
53
|
+
},
|
|
54
|
+
"nodes/locales": {
|
|
55
|
+
"stroke": "#bfdbef",
|
|
56
|
+
"fill": "#bfdbef",
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return lookup[dirname] || {}
|
|
61
|
+
}
|
|
62
|
+
|
|
5
63
|
function ConfigNodeFactorySidebarFunctionality(config) {
|
|
6
64
|
RED.nodes.createNode(this, config)
|
|
7
65
|
}
|
|
@@ -67,14 +125,18 @@ module.exports = function (RED) {
|
|
|
67
125
|
}
|
|
68
126
|
|
|
69
127
|
function createGroupForDirectory(dirname, allIds) {
|
|
128
|
+
// no label position means that the label goes top-left.
|
|
70
129
|
return {
|
|
71
130
|
"id": RED.util.generateId(),
|
|
72
131
|
"type": "group",
|
|
73
132
|
"name": `Dir: ${dirname}`,
|
|
74
133
|
"style": {
|
|
75
134
|
"label": true,
|
|
76
|
-
"label-position": "ne",
|
|
77
|
-
"color": "#001f60"
|
|
135
|
+
// "label-position": "ne",
|
|
136
|
+
"color": "#001f60",
|
|
137
|
+
"stroke-opacity": "0.75",
|
|
138
|
+
"fill-opacity": "0.5",
|
|
139
|
+
...dirGrpColours(dirname)
|
|
78
140
|
},
|
|
79
141
|
"nodes": allIds
|
|
80
142
|
}
|
|
@@ -170,7 +232,6 @@ module.exports = function (RED) {
|
|
|
170
232
|
|
|
171
233
|
lastNode.wires[0].push(tarballNode.id)
|
|
172
234
|
|
|
173
|
-
|
|
174
235
|
/* group by dirname */
|
|
175
236
|
let groupByDirectory = {}
|
|
176
237
|
let dirGroups = []
|
|
@@ -190,9 +251,7 @@ module.exports = function (RED) {
|
|
|
190
251
|
|
|
191
252
|
allFiles = [
|
|
192
253
|
createGroup(msg.pkgname, nodeDevOp.pversion || msg.pkgversion, dirGroups.concat(nodeDevNodes))
|
|
193
|
-
|
|
194
|
-
].concat(dirGroups).concat(nodeDevNodes).concat(allFiles);
|
|
195
|
-
|
|
254
|
+
].concat(dirGroups).concat(nodeDevNodes).concat(allFiles)
|
|
196
255
|
|
|
197
256
|
RED.comms.publish(
|
|
198
257
|
"nodedev:perform-autoimport-nodes",
|