node-red-contrib-typescript 1.0.11 → 1.0.13

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.
package/helper.js CHANGED
@@ -212,6 +212,7 @@ function createSandbox(RED, node) {
212
212
  return sandbox;
213
213
  }
214
214
 
215
+ global.WebSocket = require("ws");
215
216
  function createScript(node, iniOpt, code) {
216
217
  //console.log(ts.transpile(code));
217
218
  var iniText = `
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "node-red-contrib-typescript",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "",
5
5
  "author": "kezziny",
6
6
  "license": "ISC",
7
- "node-red" : {
7
+ "node-red": {
8
8
  "nodes": {
9
9
  "instance": "src/instance/instance.js"
10
10
  }
11
- }
11
+ },
12
+ "dependencies": {
13
+ "ws": "^8.19.0"
14
+ }
12
15
  }
@@ -267,7 +267,9 @@
267
267
  <div class="form-row">
268
268
  <label for="node-input-outputs"><i class="fa fa-random"></i> <span data-i18n="function.label.outputs"></span></label>
269
269
  <input id="node-input-outputs" style="width: 60px;" value="1">
270
- <label for="node-input-filename"><i class="fa fa-random"></i> Override filename</label>
270
+ </div>
271
+ <div class="form-row">
272
+ <label for="node-input-filename"><i class="fa fa-tag"></i> Override filename <i>(prefix, if ends with '/')</i></label>
271
273
  <input id="node-input-filename" style="width: 60px;" value="">
272
274
  </div>
273
275
 
@@ -12,6 +12,14 @@ module.exports = function(RED) {
12
12
  node.modules = config.modules;
13
13
  node.code = config.code;
14
14
 
15
+ if (node.config.filename) {
16
+ if (node.config.filename.endsWith("/")) {
17
+ node.config.name = node.config.filename + node.config.name;
18
+ } else {
19
+ node.config.name = node.config.filename;
20
+ }
21
+ }
22
+
15
23
  var sandbox = helper.createSandbox(RED, node);
16
24
  let moduleErrors = false;
17
25