@tscircuit/cli 0.1.1950 → 0.1.1951

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
@@ -136044,7 +136044,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
136044
136044
  // lib/getVersion.ts
136045
136045
  import { createRequire as createRequire2 } from "node:module";
136046
136046
  // package.json
136047
- var version = "0.1.1948";
136047
+ var version = "0.1.1950";
136048
136048
  var package_default = {
136049
136049
  name: "@tscircuit/cli",
136050
136050
  version,
@@ -136105,7 +136105,7 @@ var package_default = {
136105
136105
  debug: "^4.4.0",
136106
136106
  delay: "^6.0.0",
136107
136107
  "dsn-converter": "^0.0.90",
136108
- easyeda: "^0.0.305",
136108
+ easyeda: "^0.0.307",
136109
136109
  "fuse.js": "^7.1.0",
136110
136110
  "get-port": "^7.1.0",
136111
136111
  globby: "^14.1.0",
@@ -327265,6 +327265,40 @@ var handleSilkscreenCircle = (circle2, index) => {
327265
327265
  stroke_width: mil10ToMm(circle2.width)
327266
327266
  });
327267
327267
  };
327268
+ var handleRect = (rect, index) => {
327269
+ const width = milx10(rect.width);
327270
+ const height = milx10(rect.height);
327271
+ const center2 = {
327272
+ x: milx10(rect.x) + width / 2,
327273
+ y: milx10(rect.y) + height / 2
327274
+ };
327275
+ const layer = getSideFromLayer(rect.layer);
327276
+ if (isCourtyardLayer(rect.layer)) {
327277
+ return pcb_courtyard_rect.parse({
327278
+ type: "pcb_courtyard_rect",
327279
+ pcb_courtyard_rect_id: `pcb_courtyard_rect_${index + 1}`,
327280
+ pcb_component_id: "pcb_component_1",
327281
+ center: center2,
327282
+ width,
327283
+ height,
327284
+ layer,
327285
+ ccw_rotation: rect.rotation
327286
+ });
327287
+ }
327288
+ return pcb_silkscreen_rect.parse({
327289
+ type: "pcb_silkscreen_rect",
327290
+ pcb_silkscreen_rect_id: `pcb_silkscreen_rect_${index + 1}`,
327291
+ pcb_component_id: "pcb_component_1",
327292
+ center: center2,
327293
+ width,
327294
+ height,
327295
+ layer,
327296
+ stroke_width: mil2mm(rect.lineWidth),
327297
+ is_filled: rect.fillStyle !== "none",
327298
+ has_stroke: rect.lineWidth > 0,
327299
+ ccw_rotation: rect.rotation
327300
+ });
327301
+ };
327268
327302
  var handleHole = (hole, index) => {
327269
327303
  return pcb_hole.parse({
327270
327304
  type: "pcb_hole",
@@ -327523,6 +327557,8 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
327523
327557
  if (isSilkscreenLayer(shape.layer)) {
327524
327558
  circuitElements.push(handleSilkscreenCircle(shape, index));
327525
327559
  }
327560
+ } else if (shape.type === "RECT") {
327561
+ circuitElements.push(handleRect(shape, index));
327526
327562
  } else if (shape.type === "ARC") {
327527
327563
  if (!isCourtyardLayer(shape.layer)) {
327528
327564
  circuitElements.push(handleSilkscreenArc(shape, index));
@@ -327556,6 +327592,9 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
327556
327592
  R: "bottom_right"
327557
327593
  }[shape.textAnchor ?? "L"],
327558
327594
  font_size: shape.size_mm || 1,
327595
+ ...shape.rotation !== undefined && {
327596
+ ccw_rotation: shape.rotation
327597
+ },
327559
327598
  layer: "top"
327560
327599
  }));
327561
327600
  }
@@ -327576,7 +327615,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
327576
327615
  layer: "top"
327577
327616
  }));
327578
327617
  }
327579
- const pcbElements = circuitElements.filter((e4) => e4.type === "pcb_smtpad" || e4.type === "pcb_plated_hole" || e4.type === "pcb_hole" || e4.type === "pcb_via" || e4.type === "pcb_courtyard_outline" || e4.type === "pcb_silkscreen_path" || e4.type === "pcb_silkscreen_text");
327618
+ const pcbElements = circuitElements.filter((e4) => e4.type === "pcb_smtpad" || e4.type === "pcb_plated_hole" || e4.type === "pcb_hole" || e4.type === "pcb_via" || e4.type === "pcb_courtyard_outline" || e4.type === "pcb_courtyard_rect" || e4.type === "pcb_silkscreen_path" || e4.type === "pcb_silkscreen_rect" || e4.type === "pcb_silkscreen_text");
327580
327619
  if (pcbElements.length > 0) {
327581
327620
  const bounds = findBoundsAndCenter2(pcbElements);
327582
327621
  pcb_component2.width = bounds.width;
@@ -328006,7 +328045,18 @@ var ShapeItemSchema = external_exports2.object({
328006
328045
  });
328007
328046
  }
328008
328047
  case "TEXT": {
328009
- const [textAnchor, x4, y4, size2, layer, id2, rotation23, , font, text] = shape.data.split("~");
328048
+ const [
328049
+ textAnchor,
328050
+ x4,
328051
+ y4,
328052
+ size2,
328053
+ rotation23,
328054
+ _mirror,
328055
+ layer,
328056
+ _net,
328057
+ font,
328058
+ text
328059
+ ] = shape.data.split("~");
328010
328060
  const r4 = rotation23 ? Number(rotation23) : undefined;
328011
328061
  return TextSchema.parse({
328012
328062
  type: "TEXT",
@@ -328015,7 +328065,6 @@ var ShapeItemSchema = external_exports2.object({
328015
328065
  y: y4,
328016
328066
  size_mm: Number(size2) * 2.54,
328017
328067
  layer: layer ? Number(layer) : undefined,
328018
- id: id2,
328019
328068
  rotation: Number.isNaN(r4) ? undefined : r4,
328020
328069
  textAnchor,
328021
328070
  font: font || undefined
@@ -328685,7 +328734,9 @@ var generateFootprintTsx2 = (circuitJson, options = {}) => {
328685
328734
  for (const silkscreenText of silkscreenTexts) {
328686
328735
  const isRefDes = silkscreenText.text === "{NAME}";
328687
328736
  const textValue = isRefDes ? JSON.stringify("{NAME}") : JSON.stringify(silkscreenText.text);
328688
- elementStrings.push(`<silkscreentext text=${textValue} pcbX="${mmStr2(silkscreenText.anchor_position.x)}" pcbY="${mmStr2(silkscreenText.anchor_position.y)}" anchorAlignment="${silkscreenText.anchor_alignment}" ${silkscreenText.font_size ? `fontSize="${mmStr2(silkscreenText.font_size)}"` : ""} />`);
328737
+ const rotation23 = silkscreenText.ccw_rotation || 0;
328738
+ const rotationAttr = rotation23 ? ` pcbRotation="${rotation23}deg"` : "";
328739
+ elementStrings.push(`<silkscreentext text=${textValue} pcbX="${mmStr2(silkscreenText.anchor_position.x)}" pcbY="${mmStr2(silkscreenText.anchor_position.y)}" anchorAlignment="${silkscreenText.anchor_alignment}"${rotationAttr}${silkscreenText.font_size ? ` fontSize="${mmStr2(silkscreenText.font_size)}"` : ""} />`);
328689
328740
  }
328690
328741
  for (const courtyardOutline of courtyardOutlines) {
328691
328742
  elementStrings.push(`<courtyardoutline outline={${JSON.stringify(courtyardOutline.outline)}} />`);
@@ -335363,6 +335414,40 @@ var handleSilkscreenCircle2 = (circle2, index) => {
335363
335414
  stroke_width: mil10ToMm2(circle2.width)
335364
335415
  });
335365
335416
  };
335417
+ var handleRect2 = (rect, index) => {
335418
+ const width = milx102(rect.width);
335419
+ const height = milx102(rect.height);
335420
+ const center2 = {
335421
+ x: milx102(rect.x) + width / 2,
335422
+ y: milx102(rect.y) + height / 2
335423
+ };
335424
+ const layer = getSideFromLayer2(rect.layer);
335425
+ if (isCourtyardLayer2(rect.layer)) {
335426
+ return pcb_courtyard_rect2.parse({
335427
+ type: "pcb_courtyard_rect",
335428
+ pcb_courtyard_rect_id: `pcb_courtyard_rect_${index + 1}`,
335429
+ pcb_component_id: "pcb_component_1",
335430
+ center: center2,
335431
+ width,
335432
+ height,
335433
+ layer,
335434
+ ccw_rotation: rect.rotation
335435
+ });
335436
+ }
335437
+ return pcb_silkscreen_rect2.parse({
335438
+ type: "pcb_silkscreen_rect",
335439
+ pcb_silkscreen_rect_id: `pcb_silkscreen_rect_${index + 1}`,
335440
+ pcb_component_id: "pcb_component_1",
335441
+ center: center2,
335442
+ width,
335443
+ height,
335444
+ layer,
335445
+ stroke_width: mil2mm2(rect.lineWidth),
335446
+ is_filled: rect.fillStyle !== "none",
335447
+ has_stroke: rect.lineWidth > 0,
335448
+ ccw_rotation: rect.rotation
335449
+ });
335450
+ };
335366
335451
  var handleHole2 = (hole, index) => {
335367
335452
  return pcb_hole2.parse({
335368
335453
  type: "pcb_hole",
@@ -335621,6 +335706,8 @@ var convertEasyEdaJsonToCircuitJson2 = (easyEdaJson, {
335621
335706
  if (isSilkscreenLayer2(shape.layer)) {
335622
335707
  circuitElements.push(handleSilkscreenCircle2(shape, index));
335623
335708
  }
335709
+ } else if (shape.type === "RECT") {
335710
+ circuitElements.push(handleRect2(shape, index));
335624
335711
  } else if (shape.type === "ARC") {
335625
335712
  if (!isCourtyardLayer2(shape.layer)) {
335626
335713
  circuitElements.push(handleSilkscreenArc2(shape, index));
@@ -335654,6 +335741,9 @@ var convertEasyEdaJsonToCircuitJson2 = (easyEdaJson, {
335654
335741
  R: "bottom_right"
335655
335742
  }[shape.textAnchor ?? "L"],
335656
335743
  font_size: shape.size_mm || 1,
335744
+ ...shape.rotation !== undefined && {
335745
+ ccw_rotation: shape.rotation
335746
+ },
335657
335747
  layer: "top"
335658
335748
  }));
335659
335749
  }
@@ -335674,7 +335764,7 @@ var convertEasyEdaJsonToCircuitJson2 = (easyEdaJson, {
335674
335764
  layer: "top"
335675
335765
  }));
335676
335766
  }
335677
- const pcbElements = circuitElements.filter((e4) => e4.type === "pcb_smtpad" || e4.type === "pcb_plated_hole" || e4.type === "pcb_hole" || e4.type === "pcb_via" || e4.type === "pcb_courtyard_outline" || e4.type === "pcb_silkscreen_path" || e4.type === "pcb_silkscreen_text");
335767
+ const pcbElements = circuitElements.filter((e4) => e4.type === "pcb_smtpad" || e4.type === "pcb_plated_hole" || e4.type === "pcb_hole" || e4.type === "pcb_via" || e4.type === "pcb_courtyard_outline" || e4.type === "pcb_courtyard_rect" || e4.type === "pcb_silkscreen_path" || e4.type === "pcb_silkscreen_rect" || e4.type === "pcb_silkscreen_text");
335678
335768
  if (pcbElements.length > 0) {
335679
335769
  const bounds = findBoundsAndCenter3(pcbElements);
335680
335770
  pcb_component22.width = bounds.width;
@@ -336104,7 +336194,18 @@ var ShapeItemSchema2 = z179.object({
336104
336194
  });
336105
336195
  }
336106
336196
  case "TEXT": {
336107
- const [textAnchor, x4, y4, size22, layer, id2, rotation23, , font, text] = shape.data.split("~");
336197
+ const [
336198
+ textAnchor,
336199
+ x4,
336200
+ y4,
336201
+ size22,
336202
+ rotation23,
336203
+ _mirror,
336204
+ layer,
336205
+ _net,
336206
+ font,
336207
+ text
336208
+ ] = shape.data.split("~");
336108
336209
  const r4 = rotation23 ? Number(rotation23) : undefined;
336109
336210
  return TextSchema2.parse({
336110
336211
  type: "TEXT",
@@ -336113,7 +336214,6 @@ var ShapeItemSchema2 = z179.object({
336113
336214
  y: y4,
336114
336215
  size_mm: Number(size22) * 2.54,
336115
336216
  layer: layer ? Number(layer) : undefined,
336116
- id: id2,
336117
336217
  rotation: Number.isNaN(r4) ? undefined : r4,
336118
336218
  textAnchor,
336119
336219
  font: font || undefined
package/dist/lib/index.js CHANGED
@@ -65757,7 +65757,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
65757
65757
  }));
65758
65758
  };
65759
65759
  // package.json
65760
- var version = "0.1.1948";
65760
+ var version = "0.1.1950";
65761
65761
  var package_default = {
65762
65762
  name: "@tscircuit/cli",
65763
65763
  version,
@@ -65818,7 +65818,7 @@ var package_default = {
65818
65818
  debug: "^4.4.0",
65819
65819
  delay: "^6.0.0",
65820
65820
  "dsn-converter": "^0.0.90",
65821
- easyeda: "^0.0.305",
65821
+ easyeda: "^0.0.307",
65822
65822
  "fuse.js": "^7.1.0",
65823
65823
  "get-port": "^7.1.0",
65824
65824
  globby: "^14.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1950",
3
+ "version": "0.1.1951",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",
@@ -58,7 +58,7 @@
58
58
  "debug": "^4.4.0",
59
59
  "delay": "^6.0.0",
60
60
  "dsn-converter": "^0.0.90",
61
- "easyeda": "^0.0.305",
61
+ "easyeda": "^0.0.307",
62
62
  "fuse.js": "^7.1.0",
63
63
  "get-port": "^7.1.0",
64
64
  "globby": "^14.1.0",