@tscircuit/cli 0.1.2371 → 0.1.2372

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/dist/cli/main.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/cli/main.js
3
- size: 46949501 bytes
4
- sha256: 1c4a78cfcc460f7db8131969afc3e3c563f23f355eb0c489349a70591fa49651
3
+ size: 46949794 bytes
4
+ sha256: 468eebf1113937d85bb431a271613806edb8f6d86d4b81da247eb21c18eef48a
package/dist/lib/index.js CHANGED
@@ -69175,7 +69175,7 @@ var package_default = {
69175
69175
  "circuit-json-to-fdm-component-box": "^0.0.2",
69176
69176
  "circuit-json-to-footprinter": "^0.0.59",
69177
69177
  "circuit-json-to-gerber": "^0.0.112",
69178
- "circuit-json-to-kicad": "0.0.236",
69178
+ "circuit-json-to-kicad": "0.0.241",
69179
69179
  "circuit-json-to-pnp-csv": "^0.0.18",
69180
69180
  "circuit-json-to-readable-netlist": "^0.0.15",
69181
69181
  "circuit-json-to-spice": "^0.0.45",
@@ -71923,7 +71923,8 @@ import {
71923
71923
  LibSymbols,
71924
71924
  SchematicSymbol as SchematicSymbol4,
71925
71925
  SymbolPinNames,
71926
- SymbolPinNumbers
71926
+ SymbolPinNumbers,
71927
+ SymbolPower
71927
71928
  } from "kicadts";
71928
71929
  import { symbols as symbols3 } from "schematic-symbols";
71929
71930
  import { symbols } from "schematic-symbols";
@@ -73997,21 +73998,19 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
73997
73998
  }
73998
73999
  }
73999
74000
  const netLabels = db.schematic_net_label?.list?.() || [];
74001
+ const railLibraryIds = /* @__PURE__ */ new Set;
74000
74002
  for (const netLabel of netLabels) {
74001
- if (netLabel.symbol_name) {
74002
- const isPower = netLabel.source_net_id ? db.source_net.get(netLabel.source_net_id)?.is_power : false;
74003
- const isGround = netLabel.source_net_id ? db.source_net.get(netLabel.source_net_id)?.is_ground : false;
74004
- const isPowerOrGround = isPower || isGround;
74005
- if (isPowerOrGround) {
74006
- const libSymbol = this.createLibrarySymbolForNetLabel({
74007
- netLabel,
74008
- isPower: isPower ?? false,
74009
- isGround: isGround ?? false
74010
- });
74011
- if (libSymbol) {
74012
- librarySymbols.push(libSymbol);
74013
- }
74014
- }
74003
+ if (!netLabel.symbol_name || railLibraryIds.has(netLabel.symbol_name))
74004
+ continue;
74005
+ const sourceNet = netLabel.source_net_id ? db.source_net.get(netLabel.source_net_id) : undefined;
74006
+ const libSymbol = this.createLibrarySymbolForNetLabel({
74007
+ netLabel,
74008
+ isPower: sourceNet?.is_power ?? false,
74009
+ isGround: sourceNet?.is_ground ?? false
74010
+ });
74011
+ if (libSymbol) {
74012
+ librarySymbols.push(libSymbol);
74013
+ railLibraryIds.add(netLabel.symbol_name);
74015
74014
  }
74016
74015
  }
74017
74016
  libSymbols.symbols = librarySymbols;
@@ -74168,7 +74167,7 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
74168
74167
  if (!symbolData)
74169
74168
  return null;
74170
74169
  const libId = `Custom:${symbolName}`;
74171
- return this.createLibrarySymbol({
74170
+ const symbol = this.createLibrarySymbol({
74172
74171
  libId,
74173
74172
  symbolData,
74174
74173
  isChip: false,
@@ -74176,9 +74175,17 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
74176
74175
  description: isPower ? "Power net label" : isGround ? "Ground net label" : "Net symbol",
74177
74176
  keywords: isPower ? "power net" : isGround ? "ground net" : "net",
74178
74177
  fpFilters: "",
74179
- referencePrefix: libId.split(":")[1]?.[0] || "U",
74178
+ referencePrefix: "#PWR",
74180
74179
  symbolScale: this.ctx.kicadSchematicScaleFactor
74181
74180
  });
74181
+ symbol._sxPower = new SymbolPower("global");
74182
+ symbol.inBom = false;
74183
+ symbol.onBoard = false;
74184
+ for (const unit of symbol.subSymbols) {
74185
+ for (const pin of unit.pins)
74186
+ pin.pinElectricalType = "power_in";
74187
+ }
74188
+ return symbol;
74182
74189
  }
74183
74190
  getSymbolData(symbolName, schematicComponent) {
74184
74191
  if (symbolName.startsWith("generic_chip_")) {
@@ -74560,13 +74567,14 @@ var AddSchematicNetLabelsStage = class extends ConverterStage {
74560
74567
  x -= pinPosition.x;
74561
74568
  y += pinPosition.y;
74562
74569
  }
74570
+ const reference = `#PWR${netLabel.schematic_net_label_id}`;
74563
74571
  const uuid = crypto.randomUUID();
74564
74572
  const symbol = new SchematicSymbol5({
74565
74573
  at: [x, y, 0],
74566
74574
  unit: 1,
74567
74575
  excludeFromSim: false,
74568
- inBom: true,
74569
- onBoard: true,
74576
+ inBom: false,
74577
+ onBoard: false,
74570
74578
  dnp: false,
74571
74579
  uuid,
74572
74580
  fieldsAutoplaced: false
@@ -74576,20 +74584,19 @@ var AddSchematicNetLabelsStage = class extends ConverterStage {
74576
74584
  symbol._sxLibId = symLibId;
74577
74585
  const isUpSymbol = symbolName.includes("_up") || symbolName.toLowerCase().includes("vcc");
74578
74586
  const referenceOffset = isUpSymbol ? -4 : 4;
74579
- const valueOffset = isUpSymbol ? -6 : 6;
74580
74587
  const referenceProperty = new SymbolProperty2({
74581
74588
  key: "Reference",
74582
- value: labelText,
74589
+ value: reference,
74583
74590
  id: 0,
74584
74591
  at: [x, y + referenceOffset, 0],
74585
- effects: this.createTextEffects(1.27, false)
74592
+ effects: this.createTextEffects(1.27, true)
74586
74593
  });
74587
74594
  const valueProperty = new SymbolProperty2({
74588
74595
  key: "Value",
74589
74596
  value: labelText,
74590
74597
  id: 1,
74591
- at: [x, y + valueOffset, 0],
74592
- effects: this.createTextEffects(1.27, true)
74598
+ at: [x, y + referenceOffset, 0],
74599
+ effects: this.createTextEffects(1.27, false)
74593
74600
  });
74594
74601
  const footprintProperty = new SymbolProperty2({
74595
74602
  key: "Footprint",
@@ -74622,7 +74629,7 @@ var AddSchematicNetLabelsStage = class extends ConverterStage {
74622
74629
  const project = new SymbolInstancesProject("");
74623
74630
  const instancePathPrefix = this.ctx.symbolInstancePathPrefix ?? `/${kicadSch?.uuid?.value || ""}`;
74624
74631
  const path = new SymbolInstancePath(instancePathPrefix);
74625
- path.reference = labelText;
74632
+ path.reference = reference;
74626
74633
  path.unit = 1;
74627
74634
  project.paths.push(path);
74628
74635
  instances.projects.push(project);
@@ -77549,6 +77556,7 @@ var AddTracesStage = class extends ConverterStage {
77549
77556
  constructor(input, ctx) {
77550
77557
  super(input, ctx);
77551
77558
  this.pcbTraces = this.ctx.db.pcb_trace.list();
77559
+ this.MAX_ITERATIONS = Math.max(this.MAX_ITERATIONS, this.pcbTraces.length + 1);
77552
77560
  }
77553
77561
  getRoutePointPosition(point, pointRoleInSegment) {
77554
77562
  if ("x" in point && "y" in point) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.2371",
3
+ "version": "0.1.2372",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/tscircuit/cli"
@@ -51,7 +51,7 @@
51
51
  "circuit-json-to-fdm-component-box": "^0.0.2",
52
52
  "circuit-json-to-footprinter": "^0.0.59",
53
53
  "circuit-json-to-gerber": "^0.0.112",
54
- "circuit-json-to-kicad": "0.0.236",
54
+ "circuit-json-to-kicad": "0.0.241",
55
55
  "circuit-json-to-pnp-csv": "^0.0.18",
56
56
  "circuit-json-to-readable-netlist": "^0.0.15",
57
57
  "circuit-json-to-spice": "^0.0.45",