circuit-json-to-tscircuit 0.0.71 → 0.0.72

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.
@@ -728,7 +728,7 @@ var convertNetLabels = (circuitJson) => su4(circuitJson).schematic_net_label.lis
728
728
  anchorPosition.x,
729
729
  anchorPosition.y
730
730
  ),
731
- reference: "",
731
+ reference: schematicNetLabel.text,
732
732
  displayText: schematicNetLabel.text
733
733
  });
734
734
  }
package/dist/cli/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  convertCircuitJsonToTscircuit
4
- } from "../chunk-3CHC36FN.js";
4
+ } from "../chunk-2BNMFKVO.js";
5
5
 
6
6
  // cli/main.ts
7
7
  import { Command } from "commander";
@@ -16,7 +16,7 @@ var package_default = {
16
16
  "./cli": "./dist/cli/main.js"
17
17
  },
18
18
  type: "module",
19
- version: "0.0.70",
19
+ version: "0.0.71",
20
20
  repository: {
21
21
  type: "git",
22
22
  url: "https://github.com/tscircuit/circuit-json-to-tscircuit.git"
package/dist/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  convertCircuitJsonToTscircuit
3
- } from "../chunk-3CHC36FN.js";
3
+ } from "../chunk-2BNMFKVO.js";
4
4
  export {
5
5
  convertCircuitJsonToTscircuit
6
6
  };
@@ -22,7 +22,7 @@ export const convertNetLabels: SchematicElementConverter = (circuitJson) =>
22
22
  anchorPosition.x,
23
23
  anchorPosition.y,
24
24
  ),
25
- reference: "",
25
+ reference: schematicNetLabel.text,
26
26
  displayText: schematicNetLabel.text,
27
27
  })
28
28
  }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "./cli": "./dist/cli/main.js"
7
7
  },
8
8
  "type": "module",
9
- "version": "0.0.71",
9
+ "version": "0.0.72",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "https://github.com/tscircuit/circuit-json-to-tscircuit.git"
@@ -0,0 +1,47 @@
1
+ import { expect, test } from "bun:test"
2
+ import type { CircuitJson } from "circuit-json"
3
+ import { convertCircuitJsonToTscircuit } from "lib"
4
+ import { runTscircuitCode } from "tscircuit"
5
+
6
+ test("preserves text for imported symbolic net labels", async () => {
7
+ const circuitJson: CircuitJson = [
8
+ {
9
+ type: "pcb_board",
10
+ pcb_board_id: "board",
11
+ center: { x: 0, y: 0 },
12
+ width: 10,
13
+ height: 10,
14
+ num_layers: 2,
15
+ thickness: 1.6,
16
+ material: "fr4",
17
+ },
18
+ {
19
+ type: "source_net",
20
+ source_net_id: "power_good_net",
21
+ name: "PGOOD",
22
+ member_source_group_ids: [],
23
+ },
24
+ {
25
+ type: "schematic_net_label",
26
+ schematic_net_label_id: "power_good_label",
27
+ source_net_id: "power_good_net",
28
+ text: "PGOOD",
29
+ center: { x: 1, y: 2 },
30
+ anchor_position: { x: 1, y: 2 },
31
+ anchor_side: "left",
32
+ symbol_name: "vcc_right",
33
+ },
34
+ ]
35
+ const renderedCircuitJson = await runTscircuitCode(
36
+ convertCircuitJsonToTscircuit(circuitJson, {
37
+ componentName: "NetLabelBoard",
38
+ }),
39
+ )
40
+
41
+ expect(
42
+ renderedCircuitJson.some(
43
+ (element) =>
44
+ element.type === "schematic_text" && element.text === "PGOOD",
45
+ ),
46
+ ).toBe(true)
47
+ })