@tscircuit/core 0.0.1375 → 0.0.1377

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 (2) hide show
  1. package/dist/index.js +11 -34
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -16044,24 +16044,8 @@ var getSimpleRouteJsonFromCircuitJson = ({
16044
16044
  }).filter((c) => c !== null);
16045
16045
  const source_nets = db.source_net.list().filter((e) => !subcircuit_id || e.subcircuit_id === subcircuit_id);
16046
16046
  const connectionsFromNets = [];
16047
- const connectionFromNetId = /* @__PURE__ */ new Map();
16048
- const handledNetConnectivityKeys = /* @__PURE__ */ new Set();
16049
- const sourceTraces = db.source_trace.list();
16050
- const getSourceConnectivityKey = (id) => id ? connMap.getNetConnectedToId(id) ?? id : null;
16051
16047
  for (const net of source_nets) {
16052
- const netConnectivityKey = getSourceConnectivityKey(net.source_net_id);
16053
- if (!netConnectivityKey || handledNetConnectivityKeys.has(netConnectivityKey)) {
16054
- continue;
16055
- }
16056
- handledNetConnectivityKeys.add(netConnectivityKey);
16057
- const connectedSourceNetIds = source_nets.filter(
16058
- (sourceNet) => getSourceConnectivityKey(sourceNet.source_net_id) === netConnectivityKey
16059
- ).map((sourceNet) => sourceNet.source_net_id);
16060
- const connectedSourceTraces = sourceTraces.filter(
16061
- (st) => [st.source_trace_id, ...st.connected_source_net_ids ?? []].some(
16062
- (id) => getSourceConnectivityKey(id) === netConnectivityKey
16063
- )
16064
- );
16048
+ const connectedSourceTraces = db.source_trace.list().filter((st) => st.connected_source_net_ids?.includes(net.source_net_id));
16065
16049
  let nominalTraceWidthFromConnectedTraces;
16066
16050
  for (const sourceTrace of connectedSourceTraces) {
16067
16051
  if (sourceTrace.min_trace_thickness === void 0) continue;
@@ -16086,16 +16070,12 @@ var getSimpleRouteJsonFromCircuitJson = ({
16086
16070
  });
16087
16071
  }
16088
16072
  }
16089
- const connection = {
16073
+ connectionsFromNets.push({
16090
16074
  name: net.source_net_id ?? connMap.getNetConnectedToId(net.source_net_id),
16091
16075
  nominalTraceWidth: nominalTraceWidthFromConnectedTraces,
16092
16076
  width: nominalTraceWidthFromConnectedTraces,
16093
16077
  pointsToConnect
16094
- };
16095
- connectionsFromNets.push(connection);
16096
- for (const sourceNetId of connectedSourceNetIds) {
16097
- connectionFromNetId.set(sourceNetId, connection);
16098
- }
16078
+ });
16099
16079
  }
16100
16080
  const connectionsFromBreakoutPoints = [];
16101
16081
  for (const bp of breakoutPoints) {
@@ -16130,7 +16110,7 @@ var getSimpleRouteJsonFromCircuitJson = ({
16130
16110
  continue;
16131
16111
  }
16132
16112
  if (bp.source_net_id) {
16133
- const conn = connectionFromNetId.get(bp.source_net_id);
16113
+ const conn = connectionsFromNets.find((c) => c.name === bp.source_net_id);
16134
16114
  if (conn) {
16135
16115
  conn.pointsToConnect.push(pt);
16136
16116
  } else {
@@ -23610,7 +23590,6 @@ var Group5 = class extends NormalComponent3 {
23610
23590
  const subcircuitComponentsByName = /* @__PURE__ */ new Map();
23611
23591
  for (const child of this.children) {
23612
23592
  if (child.isSubcircuit) continue;
23613
- if (child instanceof Trace3) continue;
23614
23593
  if (child._parsedProps.name) {
23615
23594
  const components = subcircuitComponentsByName.get(child._parsedProps.name) || [];
23616
23595
  components.push(child);
@@ -24743,7 +24722,7 @@ import { identity as identity5 } from "transformation-matrix";
24743
24722
  var package_default = {
24744
24723
  name: "@tscircuit/core",
24745
24724
  type: "module",
24746
- version: "0.0.1374",
24725
+ version: "0.0.1376",
24747
24726
  types: "dist/index.d.ts",
24748
24727
  main: "dist/index.js",
24749
24728
  module: "dist/index.js",
@@ -24811,7 +24790,7 @@ var package_default = {
24811
24790
  "circuit-json-to-connectivity-map": "^0.0.23",
24812
24791
  "circuit-json-to-gltf": "^0.0.105",
24813
24792
  "circuit-json-to-spice": "^0.0.40",
24814
- "circuit-to-svg": "^0.0.367",
24793
+ "circuit-to-svg": "^0.0.369",
24815
24794
  concurrently: "^9.1.2",
24816
24795
  "connectivity-map": "^1.0.0",
24817
24796
  debug: "^4.3.6",
@@ -25850,17 +25829,15 @@ var Subcircuit = class extends Group5 {
25850
25829
  const parentNetSelector = `> net.${netName}`;
25851
25830
  const childNetSelector = `.${this.name} > net.${netName}`;
25852
25831
  const traceName = `exposed_net.${netName}`;
25853
- const parentNet = parentSubcircuit.children.find(
25832
+ const parentHasDirectNet = parentSubcircuit.children.some(
25854
25833
  (child) => child instanceof Net && child._parsedProps.name === netName
25855
25834
  );
25856
- if (!parentNet) {
25835
+ if (!parentHasDirectNet) {
25857
25836
  parentSubcircuit.add(new Net({ name: netName }));
25858
25837
  }
25859
- const existingTrace = parentSubcircuit.children.find((child) => {
25860
- if (!(child instanceof Trace3)) return false;
25861
- const childProps = child._parsedProps;
25862
- return childProps.name === traceName && childProps.from === childNetSelector && childProps.to === parentNetSelector;
25863
- });
25838
+ const existingTrace = parentSubcircuit.children.find(
25839
+ (child) => child instanceof Trace3 && child._parsedProps.name === traceName
25840
+ );
25864
25841
  if (existingTrace) continue;
25865
25842
  parentSubcircuit.add(
25866
25843
  new Trace3({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1375",
4
+ "version": "0.0.1377",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -69,7 +69,7 @@
69
69
  "circuit-json-to-connectivity-map": "^0.0.23",
70
70
  "circuit-json-to-gltf": "^0.0.105",
71
71
  "circuit-json-to-spice": "^0.0.40",
72
- "circuit-to-svg": "^0.0.367",
72
+ "circuit-to-svg": "^0.0.369",
73
73
  "concurrently": "^9.1.2",
74
74
  "connectivity-map": "^1.0.0",
75
75
  "debug": "^4.3.6",