@theotherwillembotha/node-red-plugincore 0.2.0 → 0.3.0

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.
Files changed (71) hide show
  1. package/build/GenerateNodes.js +9 -30
  2. package/build/Nodes.html +2 -4
  3. package/build/Nodes.js +2 -6
  4. package/build/Plugins.html +2 -218
  5. package/build/Plugins.js +1 -6
  6. package/build/core/NodeConstructor.d.ts +3 -0
  7. package/build/core/NodeConstructor.d.ts.map +1 -1
  8. package/build/core/NodeConstructor.js +19 -42
  9. package/build/core/NodeGenerator.d.ts +3 -1
  10. package/build/core/NodeGenerator.d.ts.map +1 -1
  11. package/build/core/NodeGenerator.js +76 -31
  12. package/build/core/logger/service/LoggerService.d.ts +2 -1
  13. package/build/core/logger/service/LoggerService.d.ts.map +1 -1
  14. package/build/core/logger/service/LoggerService.js +55 -8
  15. package/build/core/logger/template/LoggerTemplate.d.ts +1 -2
  16. package/build/core/logger/template/LoggerTemplate.d.ts.map +1 -1
  17. package/build/core/logger/template/LoggerTemplate.js +18 -5
  18. package/build/core/metrics/template/CounterMetricTemplate.d.ts +1 -2
  19. package/build/core/metrics/template/CounterMetricTemplate.d.ts.map +1 -1
  20. package/build/core/metrics/template/CounterMetricTemplate.js +16 -5
  21. package/build/core/metrics/template/GaugeMetricTemplate.d.ts +1 -2
  22. package/build/core/metrics/template/GaugeMetricTemplate.d.ts.map +1 -1
  23. package/build/core/metrics/template/GaugeMetricTemplate.js +16 -5
  24. package/build/core/metrics/template/MetricsTemplate.d.ts +1 -2
  25. package/build/core/metrics/template/MetricsTemplate.d.ts.map +1 -1
  26. package/build/core/metrics/template/MetricsTemplate.js +18 -5
  27. package/build/core/metrics/template/TimerMetricTemplate.d.ts +1 -2
  28. package/build/core/metrics/template/TimerMetricTemplate.d.ts.map +1 -1
  29. package/build/core/metrics/template/TimerMetricTemplate.js +16 -5
  30. package/build/core/other/template/BasicTemplate.d.ts +1 -2
  31. package/build/core/other/template/BasicTemplate.d.ts.map +1 -1
  32. package/build/core/other/template/BasicTemplate.js +15 -5
  33. package/build/core/other/template/SettingsTemplate.d.ts +1 -2
  34. package/build/core/other/template/SettingsTemplate.d.ts.map +1 -1
  35. package/build/core/other/template/SettingsTemplate.js +17 -5
  36. package/build/core/state/template/StateTemplate.d.ts +1 -2
  37. package/build/core/state/template/StateTemplate.d.ts.map +1 -1
  38. package/build/core/state/template/StateTemplate.js +19 -5
  39. package/build/core/tagging/TemplateDescriptionDecorator.d.ts +8 -0
  40. package/build/core/tagging/TemplateDescriptionDecorator.d.ts.map +1 -0
  41. package/build/core/tagging/TemplateDescriptionDecorator.js +10 -0
  42. package/build/core/ui/template/ScriptEditorTemplate.d.ts +1 -2
  43. package/build/core/ui/template/ScriptEditorTemplate.d.ts.map +1 -1
  44. package/build/core/ui/template/ScriptEditorTemplate.js +15 -5
  45. package/build/core/ui/template/UIHelperTemplate.d.ts +1 -2
  46. package/build/core/ui/template/UIHelperTemplate.d.ts.map +1 -1
  47. package/build/core/ui/template/UIHelperTemplate.js +15 -5
  48. package/build/core/webhook/template/WebhookTemplate.d.ts +1 -2
  49. package/build/core/webhook/template/WebhookTemplate.d.ts.map +1 -1
  50. package/build/core/webhook/template/WebhookTemplate.js +19 -6
  51. package/build/index.d.ts +1 -0
  52. package/build/index.d.ts.map +1 -1
  53. package/build/index.js +1 -0
  54. package/package.json +1 -2
  55. package/src/GenerateNodes.ts +9 -35
  56. package/src/core/NodeConstructor.ts +23 -45
  57. package/src/core/NodeGenerator.ts +87 -33
  58. package/src/core/logger/service/LoggerService.ts +23 -8
  59. package/src/core/logger/template/LoggerTemplate.ts +9 -11
  60. package/src/core/metrics/template/CounterMetricTemplate.ts +8 -11
  61. package/src/core/metrics/template/GaugeMetricTemplate.ts +8 -11
  62. package/src/core/metrics/template/MetricsTemplate.ts +9 -9
  63. package/src/core/metrics/template/TimerMetricTemplate.ts +8 -10
  64. package/src/core/other/template/BasicTemplate.ts +6 -11
  65. package/src/core/other/template/SettingsTemplate.ts +8 -13
  66. package/src/core/state/template/StateTemplate.ts +10 -9
  67. package/src/core/tagging/TemplateDescriptionDecorator.ts +19 -0
  68. package/src/core/ui/template/ScriptEditorTemplate.ts +6 -10
  69. package/src/core/ui/template/UIHelperTemplate.ts +6 -10
  70. package/src/core/webhook/template/WebhookTemplate.ts +10 -12
  71. package/src/index.ts +1 -0
@@ -1,36 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const DelegatedConfigReferenceNode_js_1 = require("./core/other/node/DelegatedConfigReferenceNode.js");
4
- const NodeTypeService_js_1 = require("./core/tagging/service/NodeTypeService.js");
5
3
  const index_js_1 = require("./index.js");
6
- const index_js_2 = require("./index.js");
7
- const index_js_3 = require("./index.js");
8
- const index_js_4 = require("./index.js");
9
- const index_js_5 = require("./index.js");
4
+ const NodeTypeService_js_1 = require("./core/tagging/service/NodeTypeService.js");
5
+ // Plugincore is a build framework — it has no leaf nodes of its own.
6
+ // Infrastructure nodes (DelegatedConfigReferenceNode, config nodes, etc.)
7
+ // are pulled in automatically via template dependencies when downstream
8
+ // packages register their nodes.
9
+ //
10
+ // NodeTypeService is the one service that must always be present because
11
+ // it powers the tag registry used by NodeManager at runtime.
10
12
  new index_js_1.NodeGenerator("./src/core/")
11
- // services.
12
- .registerService(index_js_3.LoggerService)
13
- .registerService(index_js_4.MetricsService)
14
- .registerService(index_js_1.SettingsService)
15
- .registerService(index_js_2.WebhookServerService)
16
13
  .registerService(NodeTypeService_js_1.NodeTypeService)
17
- .registerService(index_js_5.StateService)
18
- // templates.
19
- .registerTemplate(index_js_1.BasicTemplate)
20
- .registerTemplate(index_js_3.LoggerTemplate)
21
- .registerTemplate(index_js_1.SettingsTemplate)
22
- .registerTemplate(index_js_4.MetricsTemplate)
23
- .registerTemplate(index_js_4.CounterMetricTemplate)
24
- .registerTemplate(index_js_4.GaugeMetricTemplate)
25
- .registerTemplate(index_js_1.TimerMetricTemplate)
26
- .registerTemplate(index_js_2.WebhookTemplate)
27
- .registerTemplate(index_js_1.UIHelperTemplate)
28
- .registerTemplate(index_js_1.ScriptEditorTemplate)
29
- .registerTemplate(index_js_5.StateTemplate)
30
- // nodes
31
- .registerNode(DelegatedConfigReferenceNode_js_1.DelegatedConfigReferenceNode)
32
- .registerNode(index_js_2.WebhookServerConfigNode)
33
- .registerNode(index_js_5.InternalStateConfigNode)
34
- // done.
35
- .generate("./build/Nodes", "./build/Plugins");
14
+ .generate("./build/Nodes", "./build/Plugins", "@theotherwillembotha/node-red-plugincore");
36
15
  process.exit(0);
package/build/Nodes.html CHANGED
@@ -6,8 +6,6 @@
6
6
 
7
7
  You have been warned.
8
8
 
9
- Client-side node type definitions have been moved to Plugins.html to prevent
10
- duplicate type registration conflicts when multiple plugins share the same
11
- plugincore infrastructure nodes.
9
+ No owned nodes in this package. Shared nodes are registered via Plugins.html.
12
10
  -->
13
-
11
+
package/build/Nodes.js CHANGED
@@ -9,14 +9,10 @@
9
9
  */
10
10
  "use strict";
11
11
  const { NodeManager } = require("./runtime/NodeManagerRuntime");
12
- const DelegatedConfigReferenceNode = require("@theotherwillembotha/node-red-plugincore").DelegatedConfigReferenceNode;
13
- const WebhookServerConfigNode = require("@theotherwillembotha/node-red-plugincore").WebhookServerConfigNode;
14
- const InternalStateConfigNode = require("@theotherwillembotha/node-red-plugincore").InternalStateConfigNode;
12
+
15
13
  module.exports = (RED) => {
16
14
  let manager = new NodeManager(RED);
17
- manager.registerNodeType("DelegatedConfigReferenceNode", DelegatedConfigReferenceNode);
18
- manager.registerNodeType("WebhookServerConfigNode", WebhookServerConfigNode);
19
- manager.registerNodeType("InternalStateConfigNode", InternalStateConfigNode);
15
+
20
16
  }
21
17
 
22
18
 
@@ -6,222 +6,6 @@
6
6
 
7
7
  You have been warned.
8
8
 
9
+ No shared nodes in this package. All nodes are registered via Nodes.html.
9
10
  -->
10
- <!-- WebhookServerConfigNode -->
11
-
12
-
13
-
14
- <script type="text/javascript">
15
- (function() {
16
- RED.events.on('registry:node-set-added', function(ns) {
17
- if (ns.types && ns.types.indexOf('DelegatedConfigReferenceNode') !== -1) {
18
- RED.nodes.registerType('DelegatedConfigReferenceNode', {
19
- category: 'config',
20
- defaults: {},
21
- oneditprepare: function() {},
22
- oneditsave: function() {},
23
- oneditcancel: function() {},
24
- oneditdelete: function() {},
25
- });
26
- }
27
- });
28
- }());
29
-
30
- </script>
31
-
32
-
33
- <script type="text/html" data-template-name='DelegatedConfigReferenceNode'>
34
-
35
- </script>
36
-
37
- <script type="text/markdown" data-help-name='DelegatedConfigReferenceNode'>
38
-
39
- </script>
40
-
41
- <script type="text/javascript">
42
- (function() {
43
- RED.events.on('registry:node-set-added', function(ns) {
44
- if (ns.types && ns.types.indexOf('WebhookServerConfigNode') !== -1) {
45
- RED.nodes.registerType('WebhookServerConfigNode', {
46
- category: 'config',
47
- label: function() {
48
- return this.name
49
- },
50
- paletteLabel: 'Webhook',
51
- defaults: {
52
- name: {
53
- value: 'Example Test Node',
54
- required: true
55
- },
56
- port: {
57
- value: 6644,
58
- required: true
59
- },
60
- externalHost: {
61
- value: 'localhost',
62
- required: true
63
- },
64
- externalPort: {
65
- value: 6644,
66
- required: true
67
- },
68
- },
69
- oneditprepare: function() {},
70
- oneditsave: function() {},
71
- oneditcancel: function() {},
72
- oneditdelete: function() {},
73
- });
74
- }
75
- });
76
- }());
77
-
78
- </script>
79
-
80
-
81
- <script type="text/html" data-template-name='WebhookServerConfigNode'>
82
- <div id='section_WebhookServerConfigNode'>
83
- <div id="WebhookServerConfig">
84
- <div class="form-row">
85
- <label class="towb_editorlabel" for="node-config-input-name"><i class="fa fa-font"></i> Name</label>
86
- <input type="text" id="node-config-input-name" />
87
- </div>
88
-
89
- <div class="form-row">
90
- <label class="towb_editorlabel" for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
91
- <input type="number" id="node-config-input-port" />
92
- </div>
93
-
94
- <div class="form-row">
95
- <label class="towb_editorlabel" for="node-config-input-externalHost"><i class="fa fa-globe"></i> External Host</label>
96
- <input type="text" id="node-config-input-externalHost" />
97
- </div>
98
-
99
- <div class="form-row">
100
- <label class="towb_editorlabel" for="node-config-input-externalPort"><i class="fa fa-plug"></i> External Port</label>
101
- <input type="number" id="node-config-input-externalPort" />
102
- </div>
103
- <!-- add a button here to autmatically find an open port -->
104
- </div>
105
-
106
-
107
- </div>
108
- </script>
109
-
110
- <script type="text/markdown" data-help-name='WebhookServerConfigNode'>
111
- Configuration node for an Express HTTP server that webhook nodes attach to. A single server instance is shared by all webhook nodes that reference it. The server is started when the flow is first deployed and stopped when it is torn down.
112
-
113
- ### Inputs
114
- : *name* (string) : A descriptive name for this webhook server.
115
- : *port* (number) : The local port the HTTP server will listen on. Defaults to `6644`. Each server instance must use a unique port.
116
-
117
- ### Reverse Proxy
118
- When this server sits behind a reverse proxy, configure the following fields so that webhook nodes know the externally-visible address. This is used when registering endpoints with a reverse proxy service.
119
-
120
- : *external host* (string) : The public hostname or IP of the reverse proxy (e.g. `myserver.example.com`).
121
- : *external port* (number) : The public port exposed by the reverse proxy.
122
- </script>
123
-
124
- <script type="text/javascript">
125
- (function() {
126
- RED.events.on('registry:node-set-added', function(ns) {
127
- if (ns.types && ns.types.indexOf('InternalStateConfigNode') !== -1) {
128
- RED.nodes.registerType('InternalStateConfigNode', {
129
- category: 'config',
130
- label: function() {
131
- return this.name || "Internal State";
132
- },
133
- paletteLabel: 'Internal State',
134
- defaults: {
135
- name: {
136
- value: 'Internal State',
137
- required: true
138
- },
139
- survivesRedeploy: {
140
- value: false,
141
- required: false
142
- },
143
- survivesRestart: {
144
- value: false,
145
- required: false
146
- },
147
- },
148
- oneditprepare: function() {
149
- // **** InternalStateConfigNode **** //
150
- {
151
- // Auto-populate the name from the consumer node's context when this is a fresh node.
152
- let nameInput = $("#node-config-input-name");
153
- let ctx = window.__stateTemplateContext || {};
154
- if (ctx.defaultName && (!nameInput.val() || nameInput.val() === "Internal State")) {
155
- nameInput.val(ctx.defaultName);
156
- }
157
- window.__stateTemplateContext = null;
158
- // When "survives restart" is checked, "survives redeploy" must also be checked.
159
- let survivesRestart = $("#node-config-input-survivesRestart");
160
- let survivesRedeploy = $("#node-config-input-survivesRedeploy");
161
- survivesRestart.on("change", function() {
162
- if (survivesRestart.prop("checked")) {
163
- survivesRedeploy.prop("checked", true).prop("disabled", true);
164
- } else {
165
- survivesRedeploy.prop("disabled", false);
166
- }
167
- });
168
- survivesRestart.trigger("change");
169
- }
170
- },
171
- oneditsave: function() {
172
- // **** InternalStateConfigNode **** //
173
- {}
174
- },
175
- oneditcancel: function() {},
176
- oneditdelete: function() {},
177
- });
178
- }
179
- });
180
- }());
181
-
182
- </script>
183
-
184
-
185
- <script type="text/html" data-template-name='InternalStateConfigNode'>
186
- <div id='section_InternalStateConfigNode'>
187
- <div class="form-row">
188
- <span style="display:inline-block; padding: 4px 0; color:#888;">
189
- <i class="fa fa-database" style="margin-right:6px;"></i>Internal State Provider
190
- </span>
191
- </div>
192
-
193
- <!-- Name is stored but not shown - auto-set from the consumer node's name + suffix. -->
194
- <input type="hidden" id="node-config-input-name" />
195
-
196
- <div class="form-row editorsectionheading" style="margin-top:8px;">
197
- <i class="w-16 fa fa-database"></i> <span>Persistence</span>
198
- </div>
199
- <div class="editorgroupborder">
200
- <div class="form-row nomargin">
201
- <input type="checkbox" id="node-config-input-survivesRedeploy" style="margin: 8px 0 10px 130px; width:20px;" />
202
- <label style="width:auto;" for="node-config-input-survivesRedeploy">Survives redeploy</label>
203
- </div>
204
- <div class="form-row nomargin">
205
- <input type="checkbox" id="node-config-input-survivesRestart" style="margin: 8px 0 10px 130px; width:20px;" />
206
- <label style="width:auto;" for="node-config-input-survivesRestart">Survives restart <span style="color:#aaa; font-size:0.85em;">(also writes to disk)</span></label>
207
- </div>
208
- </div>
209
-
210
- </div>
211
- </script>
212
-
213
- <script type="text/markdown" data-help-name='InternalStateConfigNode'>
214
- Stores a named state value in memory, optionally persisted across redeployments or process restarts.
215
-
216
- ### Properties
217
-
218
- : *survives redeploy* (boolean) : When checked, the current state value is preserved across Node-RED flow redeployments. When unchecked (default), state resets on each deploy.
219
- : *survives restart* (boolean) : When checked, the current state is written to disk and restored after a process restart. Automatically implies "survives redeploy".
220
-
221
- ### Details
222
-
223
- The initial (default) state value is provided by the node that owns this config - for example, a Circuit Breaker Config Node sets the state to its configured **Default State** if no value has been stored yet.
224
-
225
- When **Survives Restart** is enabled, state is persisted to `<userDir>/internalstate/<nodeId>.json` and automatically restored on the next startup.
226
- </script>
227
-
11
+
package/build/Plugins.js CHANGED
@@ -9,17 +9,12 @@
9
9
  */
10
10
  "use strict";
11
11
  const runtime = require("node-red").runtime;
12
- const LoggerService = require("@theotherwillembotha/node-red-plugincore").LoggerService;
13
- const MetricsService = require("@theotherwillembotha/node-red-plugincore").MetricsService;
14
- const SettingsService = require("@theotherwillembotha/node-red-plugincore").SettingsService;
15
- const WebhookServerService = require("@theotherwillembotha/node-red-plugincore").WebhookServerService;
16
12
  const NodeTypeService = require("@theotherwillembotha/node-red-plugincore").NodeTypeService;
17
- const StateService = require("@theotherwillembotha/node-red-plugincore").StateService;
18
13
 
19
14
  module.exports = function (RED) {
20
15
 
21
16
  // 1. make a list of all the plugins that need to be installed.
22
- let pluginList = [LoggerService, MetricsService, SettingsService, WebhookServerService, NodeTypeService, StateService]
17
+ let pluginList = [NodeTypeService]
23
18
  .map(service => service.getServiceDescriptor())
24
19
  .filter(plugin => !RED.plugins.get(plugin.id()));
25
20
 
@@ -168,7 +168,10 @@ export declare class NodeBuilder {
168
168
  source: string;
169
169
  html: string;
170
170
  }[];
171
+ private applyShaddowDefaults;
172
+ private buildRegisterTypeBody;
171
173
  buildDeferredType(): string;
174
+ buildStandardType(): string;
172
175
  private serializeProperty;
173
176
  private serializeHTML;
174
177
  private serializeJavaScript;
@@ -1 +1 @@
1
- {"version":3,"file":"NodeConstructor.d.ts","sourceRoot":"","sources":["../../src/core/NodeConstructor.ts"],"names":[],"mappings":"AAAA,OAA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(entry.source, entry.script)
419
419
  }));
420
420
  }
421
- buildDeferredType() {
422
- // Apply shadow defaults (same side-effect as buildType)
421
+ applyShaddowDefaults() {
423
422
  let shaddowDefaults = Object.entries(this._defaults).filter(([name, template]) => template.type && template.type.endsWith("[]"));
424
423
  if (shaddowDefaults.length > 0) {
425
424
  this.addIncludeEditSave(this._name + "_shaddowDefaults", `{ let node = this; ` +
@@ -431,7 +430,9 @@ class NodeBuilder {
431
430
  .join("\n\n") +
432
431
  `}`);
433
432
  }
434
- const registerTypeBody = `{
433
+ }
434
+ buildRegisterTypeBody() {
435
+ return `{
435
436
  category: '${this._category}',
436
437
  ${(this._category !== "config" && this._icon) ? `icon: '${this._icon}',` : ""}
437
438
  ${(this._category !== "config" && this._color) ? `color: '${this._color}',` : ""}
@@ -458,6 +459,10 @@ class NodeBuilder {
458
459
  ${this._onIncludeEditDelete.map(entry => this.serializeJavaScript(entry.source, entry.script)).join("")}
459
460
  },
460
461
  }`;
462
+ }
463
+ buildDeferredType() {
464
+ this.applyShaddowDefaults();
465
+ const registerTypeBody = this.buildRegisterTypeBody();
461
466
  return getBeautify().html_beautify(`
462
467
  <script type="text/javascript">
463
468
  (function () {
@@ -469,6 +474,14 @@ class NodeBuilder {
469
474
  }());
470
475
  </script>`, beautifyOptions);
471
476
  }
477
+ buildStandardType() {
478
+ this.applyShaddowDefaults();
479
+ const registerTypeBody = this.buildRegisterTypeBody();
480
+ return getBeautify().html_beautify(`
481
+ <script type="text/javascript">
482
+ RED.nodes.registerType('${this._name}', ${registerTypeBody});
483
+ </script>`, beautifyOptions);
484
+ }
472
485
  serializeProperty(value) {
473
486
  switch (typeof value) {
474
487
  case "boolean": {
@@ -533,48 +546,12 @@ class NodeBuilder {
533
546
  return script;
534
547
  }
535
548
  buildType() {
536
- // compose the shaddow defaults if need be.
537
- let shaddowDefaults = Object.entries(this._defaults).filter(([name, template]) => template.type && template.type.endsWith("[]"));
538
- if (shaddowDefaults.length > 0) {
539
- this.addIncludeEditSave(this._name + "_shaddowDefaults", `{ let node = this; ` +
540
- shaddowDefaults
541
- .map(([name, template]) => `
542
- for(let i = 0; i < ${template.maxInstances}; i++){
543
- node["_${name}_" + i] = (node.${name}[i] || {}).proxy || "";
544
- }`)
545
- .join("\n\n") +
546
- `}`);
547
- }
549
+ this.applyShaddowDefaults();
550
+ const registerTypeBody = this.buildRegisterTypeBody();
548
551
  return getBeautify().html_beautify(`
549
552
  ${this._onIncludeOnce.map(entry => this.serializeHTML(entry.source, entry.script)).join("")}
550
553
  <script type="text/javascript">
551
- RED.nodes.registerType('${this._name}',{
552
- category: '${this._category}',
553
- ${(this._category !== "config" && this._icon) ? `icon: '${this._icon}',` : ""}
554
- ${(this._category !== "config" && this._color) ? `color: '${this._color}',` : ""}
555
- ${(this._category !== "config" && this._labelStyle) ? `labelStyle: '${this._labelStyle}',` : ""}
556
- ${(this._label) ? `label: ${this._label},` : ""}
557
- ${this._paletteLabel ? `paletteLabel: '${this._paletteLabel}',` : ""}
558
- ${(this._category !== "config") ? `inputs:${this._inputs ? "1" : "0"},` : ""}
559
- ${(this._category !== "config") ? `inputLabels:(i) => '${this._inputs}',` : ""}
560
- ${(this._category !== "config") ? `outputs:${this._outputs.length},` : ""}
561
- ${(this._category !== "config") ? `outputLabels:(i) => ${this.serializeProperty(this._outputs)}[i],` : ""}
562
- defaults: {
563
- ${Object.entries(this._defaults).map(([key, value]) => this.serializeDefault(key, value)).join("\n")}
564
- },
565
- oneditprepare: function() {
566
- ${this._onIncludeEditPrepare.map(entry => this.serializeJavaScript(entry.source, entry.script)).join("")}
567
- },
568
- oneditsave: function() {
569
- ${this._onIncludeEditSave.map(entry => this.serializeJavaScript(entry.source, entry.script)).join("")}
570
- },
571
- oneditcancel: function() {
572
- ${this._onIncludeEditCancel.map(entry => this.serializeJavaScript(entry.source, entry.script)).join("")}
573
- },
574
- oneditdelete: function() {
575
- ${this._onIncludeEditDelete.map(entry => this.serializeJavaScript(entry.source, entry.script)).join("")}
576
- },
577
- });
554
+ RED.nodes.registerType('${this._name}', ${registerTypeBody});
578
555
  </script>`, beautifyOptions);
579
556
  }
580
557
  ;
@@ -21,7 +21,9 @@ declare class NodeGenerator {
21
21
  registerTemplate(template: ITemplateClass): NodeGenerator;
22
22
  registerNode(node: INodeClass): NodeGenerator;
23
23
  registerService(service: IServiceClass): NodeGenerator;
24
- generate(nodesOutputFile: string, pluginsOutputFile: string): void;
24
+ generate(nodesOutputFile: string, pluginsOutputFile: string, packageName: string): void;
25
+ private generateNodesHtml;
26
+ private generatePluginsHtml;
25
27
  private static generateHeader;
26
28
  }
27
29
  export { NodeGenerator };
@@ -1 +1 @@
1
- {"version":3,"file":"NodeGenerator.d.ts","sourceRoot":"","sources":["../../src/core/NodeGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,EAA+B,QAAQ,EAAE,cAAc,EAAe,iBAAiB,EAA4B,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAIvK,MAAM,WAAW,cAAc;IAC3B,QAAQ,QAAQ,CAAC;IACjB,qBAAqB,IAAI,kBAAkB,CAAC;CAC/C;AAED,MAAM,WAAW,UAAU;IACvB,iBAAiB,IAAG,cAAc,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC1B,oBAAoB,IAAG,iBAAiB,CAAC;CAC5C;AAED,cAAM,aAAa;IAEf,OAAO,CAAC,MAAM,CAAC,WAAW,CAAM;IAChC,OAAO,CAAC,MAAM,CAAC,OAAO,CAKpB;IAEF,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,MAAM,CAA4E;IAC1F,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,UAAU,CAA2B;IAE7C,YAAmB,UAAU,EAAC,MAAM,EAEnC;IAED,OAAO,CAAC,aAAa;IAmBd,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,aAAa,CAe/D;IAEM,YAAY,CAAC,IAAI,EAAC,UAAU,GAAE,aAAa,CAejD;IAEM,eAAe,CAAC,OAAO,E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GAAE,aAAa,CAejD;IAEM,eAAe,CAAC,OAAO,EAAE,aAAa,GAAE,aAAa,CAY3D;IAEM,QAAQ,CAAC,eAAe,EAAC,MAAM,EAAE,iBAAiB,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,QA8JnF;IAED,OAAO,CAAC,iBAAiB;IA4CzB,OAAO,CAAC,mBAAmB;IA4C3B,OAAO,CAAC,MAAM,CAAC,cAAc;CAQhC;AAID,OAAO,EACH,aAAa,EAChB,CAAA;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAC,MAAM,CAAC;CACf;AAmCD,qBAAa,aAAa;IAEtB,OAAc,aAAa,CAAC,SAAS,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,GAAE,MAAM,CA0BtE;CACJ;AAED,MAAM,MAAM,OAAO,GAAG;IAClB,CAAC,GAAG,EAAC,MAAM,GAAE,GAAG,CAAC;CACpB,CAAA"}
@@ -69,12 +69,10 @@ class NodeGenerator {
69
69
  }
70
70
  registerTemplate(template) {
71
71
  try {
72
- // verify that we dont already have this template.
73
72
  let descriptor = template.getTemplateDescriptor();
74
73
  if (!this._templates.map(t => t.name()).includes(descriptor.name())) {
75
74
  this._templates.push(descriptor);
76
- // FIXME: skip recursive dependency resolution for now.
77
- // descriptor.dependencies().forEach(dependency => this.addDependency(dependency));
75
+ descriptor.dependencies().forEach(dependency => this.addDependency(dependency));
78
76
  }
79
77
  }
80
78
  catch (error) {
@@ -84,12 +82,13 @@ class NodeGenerator {
84
82
  }
85
83
  registerNode(node) {
86
84
  try {
87
- // verify that we have dont already have this node.
88
85
  let descriptor = node.getNodeDescriptor();
89
86
  if (!this._nodes[descriptor.id()]) {
90
87
  this._nodes[descriptor.id()] = { nodeClass: node, descriptor: descriptor };
91
- // skip the recursive dependencies for now.
92
- //descriptor.dependencies().forEach(dependency => this.addDependency(dependency));
88
+ // resolve templates declared in @NodeDescription
89
+ descriptor.templates().forEach(t => this.registerTemplate(t.template));
90
+ // resolve explicit dependencies (services, nodes, templates)
91
+ descriptor.dependencies().forEach(dependency => this.addDependency(dependency));
93
92
  }
94
93
  }
95
94
  catch (error) {
@@ -102,8 +101,7 @@ class NodeGenerator {
102
101
  let descriptor = service.getServiceDescriptor();
103
102
  if (!this._services.map(s => s.name()).includes(descriptor.name())) {
104
103
  this._services.push(descriptor);
105
- // FIXME: skip recursive dependency resolution for now.
106
- //descriptor.dependencies().forEach(dependency => this.addDependency(dependency));
104
+ descriptor.dependencies().forEach(dependency => this.addDependency(dependency));
107
105
  }
108
106
  }
109
107
  catch (error) {
@@ -111,19 +109,20 @@ class NodeGenerator {
111
109
  }
112
110
  return this;
113
111
  }
114
- generate(nodesOutputFile, pluginsOutputFile) {
115
- // STEP 1. Write an empty Nodes.html.
116
- // Client-side node type definitions live in Plugins.html (generated below)
117
- // to prevent HTML-scanning conflicts when multiple plugins bundle the same
118
- // plugincore infrastructure nodes.
119
- fs.writeFileSync(nodesOutputFile + ".html", `
120
- <!--
121
- ${NodeGenerator.warning}
122
- Client-side node type definitions have been moved to Plugins.html to prevent
123
- duplicate type registration conflicts when multiple plugins share the same
124
- plugincore infrastructure nodes.
125
- -->
126
- `);
112
+ generate(nodesOutputFile, pluginsOutputFile, packageName) {
113
+ // Partition nodes into owned (belongs to this package) vs shared (from dependencies).
114
+ // Owned nodes get standard registerType + data-template-name in Nodes.html so that
115
+ // Node-RED's registry maps them to this module (enabling palette icons, flow library
116
+ // detection, etc.). Shared nodes keep the deferred pattern in Plugins.html to avoid
117
+ // HTML-scanning conflicts when multiple plugins bundle the same infrastructure nodes.
118
+ const allNodes = Object.values(this._nodes);
119
+ const ownedNodes = allNodes.filter(node => node.descriptor.package() === packageName);
120
+ const sharedNodes = allNodes.filter(node => node.descriptor.package() !== packageName);
121
+ console.log(`\nPackage: ${packageName}`);
122
+ console.log(` Owned nodes (→ Nodes.html): ${ownedNodes.map(n => n.descriptor.id()).join(', ') || '(none)'}`);
123
+ console.log(` Shared nodes (→ Plugins.html): ${sharedNodes.map(n => n.descriptor.id()).join(', ') || '(none)'}\n`);
124
+ // STEP 1. Generate Nodes.html with standard client-side definitions for owned nodes.
125
+ this.generateNodesHtml(nodesOutputFile + ".html", ownedNodes);
127
126
  // Step 3. compose the JS structure for each of the nodes.
128
127
  // 1. get a list of the files to import.
129
128
  let importList = [
@@ -254,16 +253,62 @@ module.exports = function (RED) {
254
253
  `;
255
254
  fs.writeFileSync(pluginsOutputFile + ".js", output);
256
255
  console.log(`Done building ${this._services.length} services\n${this._services.map(service => " - " + service.name() + "\n").join("")}\n`);
257
- // STEP 4. Generate Plugins.html with deferred client-side node definitions.
258
- // All nodes are registered via registry:node-set-added so that:
259
- // a) registerType is only called after typeToId/nodeSets are populated, and
260
- // b) data-template-name declarations are absent from Nodes.html, avoiding
261
- // the HTML-scanning conflict that causes Node-RED to reject an entire
262
- // plugin when a second package declares the same node type.
256
+ // STEP 4. Generate Plugins.html with deferred client-side definitions for shared nodes.
257
+ this.generatePluginsHtml(pluginsOutputFile + ".html", sharedNodes);
258
+ }
259
+ generateNodesHtml(filePath, nodes) {
260
+ if (nodes.length === 0) {
261
+ fs.writeFileSync(filePath, `
262
+ <!--
263
+ ${NodeGenerator.warning}
264
+ No owned nodes in this package. Shared nodes are registered via Plugins.html.
265
+ -->
266
+ `);
267
+ console.log(`Nodes.html: no owned nodes\n`);
268
+ return;
269
+ }
270
+ const seenOnce = new Set();
271
+ const onceHtmlParts = [];
272
+ const nodeParts = [];
273
+ nodes.forEach(node => {
274
+ console.log(`Building Nodes.html for: ${node.descriptor.id()}`);
275
+ const nb = (0, NodeConstructor_1.buildNodeBuilder)(node.nodeClass);
276
+ nb.buildOnceHtml().forEach(({ source, html }) => {
277
+ if (!seenOnce.has(source)) {
278
+ seenOnce.add(source);
279
+ onceHtmlParts.push(html);
280
+ }
281
+ });
282
+ nodeParts.push([
283
+ nb.buildStandardType(),
284
+ nb.buildHtml(),
285
+ nb.buildDocumentation()
286
+ ].join('\n\n'));
287
+ });
288
+ fs.writeFileSync(filePath, `
289
+ <!--
290
+ ${NodeGenerator.warning}
291
+ -->
292
+ ${onceHtmlParts.join('\n')}
293
+ ${nodeParts.join('\n\n')}
294
+ `);
295
+ console.log(`Done building Nodes.html (${nodes.length} owned nodes)\n`);
296
+ }
297
+ generatePluginsHtml(filePath, nodes) {
298
+ if (nodes.length === 0) {
299
+ fs.writeFileSync(filePath, `
300
+ <!--
301
+ ${NodeGenerator.warning}
302
+ No shared nodes in this package. All nodes are registered via Nodes.html.
303
+ -->
304
+ `);
305
+ console.log(`Plugins.html: no shared nodes\n`);
306
+ return;
307
+ }
263
308
  const seenOnce = new Set();
264
309
  const onceHtmlParts = [];
265
310
  const nodePluginParts = [];
266
- Object.values(this._nodes).forEach(node => {
311
+ nodes.forEach(node => {
267
312
  console.log(`Building Plugins.html for: ${node.descriptor.id()}`);
268
313
  const nb = (0, NodeConstructor_1.buildNodeBuilder)(node.nodeClass);
269
314
  nb.buildOnceHtml().forEach(({ source, html }) => {
@@ -278,14 +323,14 @@ module.exports = function (RED) {
278
323
  nb.buildDocumentation()
279
324
  ].join('\n\n'));
280
325
  });
281
- fs.writeFileSync(pluginsOutputFile + ".html", `
326
+ fs.writeFileSync(filePath, `
282
327
  <!--
283
328
  ${NodeGenerator.warning}
284
329
  -->
285
330
  ${onceHtmlParts.join('\n')}
286
331
  ${nodePluginParts.join('\n\n')}
287
332
  `);
288
- console.log(`Done building Plugins.html\n`);
333
+ console.log(`Done building Plugins.html (${nodes.length} shared nodes)\n`);
289
334
  }
290
335
  static generateHeader(node) {
291
336
  let padding = ' '.repeat(Math.max(0, Math.floor(NodeGenerator.headerWidth - node.id().length) / 2));
@@ -300,7 +345,7 @@ exports.NodeGenerator = NodeGenerator;
300
345
  class TypeUtility {
301
346
  constructor() { }
302
347
  static getPrototypes(t) {
303
- if (!t.name) {
348
+ if (!t || !t.name) {
304
349
  return [];
305
350
  }
306
351
  else {