triangulum 0.12.3 → 0.13.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 513cfa526bd9deec41fe6c5e7ddf38dd76a27f79ea446ef32734e19b5bcdb3ff
4
- data.tar.gz: c102af6a96af416c6169a1425e1090b4cd6eda7c8ee08035ed92ba40217374dd
3
+ metadata.gz: f48f709a21641318362670a528250e30d7cb9df30ea05559f162095b384a7e91
4
+ data.tar.gz: 808535f87b35cba48d38a9462a365ad8aa456b150d056b8b0a5a4047d6a1fa1b
5
5
  SHA512:
6
- metadata.gz: 87368fdbd20e34c8193fdea137540acb25b9eab427ed223f4114d94b4a26fea49326c721cc3c08bc54ef4556805414014c2c92e47cdeef9af9f054f20e25966f
7
- data.tar.gz: 4c109c339c5c3aa2e3d18bc3766edf31f3ec8027e3cf25b5bcd00c8508e9c7ad9ca7cba357be638cfbd95bb18bf10cf2672d7176376de2ad488c96b7c20f385c
6
+ metadata.gz: 46eb36f1feb52eb5177aaeee0ba048e8b15476519b00f310b0b795f46eba54255563900a30ae98c03bdd9613f4541d502dc880a0ea1847fd5e7c63eb36160bec
7
+ data.tar.gz: f29a78a1431e4e33dabaab229493c7effbe88c2711e3c893e6ffc60eab4eb9d29112a84ecbe96c9fd3b37a6e47e10d8ef46d1f1aa9b6105a6ae1d7edae5310d4
@@ -174508,7 +174508,7 @@ function E2(e6, t3, n3, r3 = false) {
174508
174508
  }), `/* @pos ${t4} ${i4} */ ${r4}`;
174509
174509
  }
174510
174510
  return a5.__typename === "LiteralValue" ? `/* @pos ${t4} ${i4} */ ${y2(a5?.value)}` : a5.__typename === "NodeFunctionIdWrapper" ? s4(a5.id, t4, i4) : r3 ? `/* @pos ${t4} ${i4} */ ({} as any)` : `/* @pos ${t4} ${i4} */ undefined`;
174511
- }).join(", "), l5 = `${`fn_${o5.functionDefinition.identifier.replace(/::/g, "_")}`}(${c5})`;
174511
+ }).join(", "), l5 = `${`/* @pos ${t4} null */ fn_${o5.functionDefinition.identifier.replace(/::/g, "_")}`}(${c5})`;
174512
174512
  return n4 !== undefined && a4 !== undefined ? `${l5}` : l5;
174513
174513
  }, c4 = (t4, l5 = "") => {
174514
174514
  if (o4.has(t4))
@@ -174549,7 +174549,7 @@ ${c4(e7.id, l5 + " ")}${l5}}` : `/* @pos ${t4} ${a4} */ ${s4(e7.id, t4, a4)}`
174549
174549
  return r3 ? `/* @pos ${t4} ${a4} */ {}` : `/* @pos ${t4} ${a4} */ undefined`;
174550
174550
  }).join(", "), _3 = `node_${T2(u5.id)}`, v3 = `fn_${u5?.functionDefinition?.identifier?.replace(/::/g, "_")}`;
174551
174551
  p5.includes("undefined");
174552
- let b3 = `${l5}${u5.functionDefinition.identifier === "std::control::return" ? "return " : `const ${_3} = `}${v3}(${p5}) ;
174552
+ let b3 = `${l5}${u5.functionDefinition.identifier === "std::control::return" ? "return " : `const ${_3} = `}/* @pos ${t4} null */ ${v3}(${p5}) ;
174553
174553
  `;
174554
174554
  return u5.nextNodeId && (b3 += c4(u5.nextNodeId, l5)), b3;
174555
174555
  }, l4 = w2(n3), u4 = `declare function flow${e6?.signature ?? "(): void"}`, d4 = t3?.map((e7) => `declare function fn_${e7.identifier?.replace(/::/g, "_")}${e7.signature}`).join(`
@@ -174564,30 +174564,54 @@ ${c4(e7.id, l5 + " ")}${l5}}` : `/* @pos ${t4} ${a4} */ ${s4(e7.id, t4, a4)}`
174564
174564
  ${d4}
174565
174565
 
174566
174566
  (() =>
174567
- ${e6 ? `const flow_${T2(e6.id ?? "")} = flow(${e6.settings?.nodes?.map((e7, t4) => `/* @pos undefined ${t4} */ ${y2(e7?.value)}`).join(", ") ?? ""});` : ""}
174567
+ ${e6 ? `const flow_${T2(e6.id ?? "")} = /* @pos null null */ flow(${e6.settings?.nodes?.map((e7, t4) => `/* @pos null ${t4} */ ${y2(e7?.value)}`).join(", ") ?? ""});` : ""}
174568
174568
  ${i3.filter((e7) => e7?.id && !f4.has(e7.id) && !p4.has(e7.id)).map((e7) => c4(e7.id)).join(`
174569
174569
  `)}
174570
174570
  )();
174571
174571
  `;
174572
174572
  }
174573
174573
  var I2 = (e6, n3, r3) => {
174574
+ if (!e6?.startingNodeId)
174575
+ return {
174576
+ isValid: false,
174577
+ returnType: "void",
174578
+ diagnostics: [{
174579
+ nodeId: null,
174580
+ parameterIndex: null,
174581
+ code: 0,
174582
+ message: "You need to provide a starting node to be able to execute this flow.",
174583
+ severity: "error"
174584
+ }]
174585
+ };
174586
+ if (!e6.nodes?.nodes?.find((t3) => t3?.id == e6.startingNodeId))
174587
+ return {
174588
+ isValid: false,
174589
+ returnType: "void",
174590
+ diagnostics: [{
174591
+ nodeId: null,
174592
+ parameterIndex: null,
174593
+ code: 0,
174594
+ message: "The starting node is not linked within the flow. Please make sure the starting node is connected to the rest of the flow.",
174595
+ severity: "error"
174596
+ }]
174597
+ };
174574
174598
  let i3 = E2(e6, n3, r3), a3 = "index.ts", o4 = S2(a3, i3), s4 = o4.getSourceFile(a3), c4 = o4.languageService.getProgram().getSemanticDiagnostics(s4).map((e7) => {
174575
174599
  let n4 = import_typescript.flattenDiagnosticMessageText(e7.messageText, `
174576
- `), r4, i4;
174600
+ `), r4, i4 = null;
174577
174601
  if (e7.start !== undefined) {
174578
- let t3 = s4.getFullText(), n5 = Math.max(0, e7.start - 300), a4 = Math.min(t3.length, e7.start), o5 = t3.substring(n5, a4), c5 = /\/\* @pos ([^ ]+) (\d+) \*\//g, l4, u4 = null, d4 = -1;
174602
+ let t3 = s4.getFullText(), n5 = Math.max(0, e7.start - 300), a4 = Math.min(t3.length, e7.start), o5 = t3.substring(n5, a4), c5 = /\/\* @pos ([^ ]+) (\d+|null) \*\//g, l4, u4 = null, d4 = -1;
174579
174603
  for (;(l4 = c5.exec(o5)) !== null; ) {
174580
174604
  let t4 = n5 + l4.index + l4[0].length;
174581
174605
  t4 <= e7.start && t4 > d4 && (d4 = t4, u4 = l4);
174582
174606
  }
174583
- u4 && (r4 = u4[1] === "undefined" ? undefined : u4[1], i4 = parseInt(u4[2], 10));
174607
+ u4 && (r4 = u4[1] === "null" ? null : u4[1], i4 = parseInt(u4[2], 10));
174584
174608
  }
174585
174609
  return {
174586
174610
  message: n4,
174587
174611
  code: e7.code,
174588
174612
  severity: "error",
174589
174613
  nodeId: r4,
174590
- parameterIndex: i4
174614
+ parameterIndex: typeof i4 == "number" && Number.isSafeInteger(i4) ? i4 : null
174591
174615
  };
174592
174616
  }).filter((e7) => e7 !== null);
174593
174617
  return {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Triangulum
4
- VERSION = '0.12.3'
4
+ VERSION = '0.13.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: triangulum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niklas van Schrick