@tscircuit/cli 0.1.2003 → 0.1.2004

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
@@ -136144,7 +136144,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
136144
136144
  // lib/getVersion.ts
136145
136145
  import { createRequire as createRequire2 } from "node:module";
136146
136146
  // package.json
136147
- var version = "0.1.2002";
136147
+ var version = "0.1.2003";
136148
136148
  var package_default = {
136149
136149
  name: "@tscircuit/cli",
136150
136150
  version,
@@ -136209,7 +136209,7 @@ var package_default = {
136209
136209
  debug: "^4.4.0",
136210
136210
  delay: "^6.0.0",
136211
136211
  "dsn-converter": "^0.0.90",
136212
- easyeda: "^0.0.331",
136212
+ easyeda: "^0.0.337",
136213
136213
  "fuse.js": "^7.1.0",
136214
136214
  "get-port": "^7.1.0",
136215
136215
  globby: "^14.1.0",
@@ -333132,7 +333132,7 @@ var handleRect = (rect, index) => {
333132
333132
  width,
333133
333133
  height,
333134
333134
  layer,
333135
- stroke_width: mil2mm(rect.lineWidth),
333135
+ stroke_width: mil10ToMm(rect.lineWidth),
333136
333136
  is_filled: rect.fillStyle !== "none",
333137
333137
  has_stroke: rect.lineWidth > 0,
333138
333138
  ccw_rotation: rect.rotation
@@ -333897,7 +333897,7 @@ var ShapeItemSchema = external_exports2.object({
333897
333897
  return SVGNodeSchema.parse({ type: "SVGNODE", svgData });
333898
333898
  }
333899
333899
  case "RECT": {
333900
- const [x4, y4, width, height, lineWidth, id2, rotation23, layer, fillStyle] = shape.data.split("~");
333900
+ const [x4, y4, width, height, layer, id2, rotation23, lineWidth, fillStyle] = shape.data.split("~");
333901
333901
  const r4 = rotation23 ? Number(rotation23) : undefined;
333902
333902
  return RectSchema.parse({
333903
333903
  type: "RECT",
@@ -335086,6 +335086,11 @@ ${polarizedPinLabelsString}
335086
335086
 
335087
335087
  ` : "";
335088
335088
  const polarizedPinLabelsProp = polarizedPinLabels ? ` pinLabels={pinLabels}
335089
+ ` : "";
335090
+ const isPolarizedCapacitor = componentType === "capacitor" && circuitJson.filter((item) => item.type === "source_port").length === 2 && polarizedPinMetadata !== undefined;
335091
+ const capacitorPolarizedPinLabelsBlock = isPolarizedCapacitor ? polarizedPinLabelsBlock : "";
335092
+ const capacitorPolarizedPinLabelsProp = isPolarizedCapacitor ? polarizedPinLabelsProp : "";
335093
+ const polarizedProp = isPolarizedCapacitor ? ` polarized
335089
335094
  ` : "";
335090
335095
  const symbolProp2 = symbolTsx ? ` symbol={
335091
335096
  ${symbolTsx.split(`
@@ -335207,14 +335212,14 @@ ${cadModelLines}
335207
335212
  return `
335208
335213
  import type { CapacitorProps } from "@tscircuit/props"
335209
335214
 
335210
- export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) => {
335215
+ ${capacitorPolarizedPinLabelsBlock}export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) => {
335211
335216
  const { name = "C1", ...restProps } = props
335212
335217
 
335213
335218
  return (
335214
335219
  <capacitor
335215
335220
  name={name}
335216
335221
  capacitance=${JSON.stringify(capacitance22)}
335217
- ${symbolProp2} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
335222
+ ${capacitorPolarizedPinLabelsProp}${polarizedProp}${symbolProp2} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
335218
335223
  manufacturerPartNumber="${manufacturerPartNumber}"
335219
335224
  footprint={${footprintTsx}}
335220
335225
  ${objUrl || stepUrl ? `cadModel={{
@@ -335590,7 +335595,7 @@ var convertBetterEasyToTsx = async ({
335590
335595
  const crystalPinVariant = componentType !== "crystal" ? undefined : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : undefined;
335591
335596
  const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
335592
335597
  const isMultiPinInductor = isInductorComponent(betterEasy) && sourcePorts.length !== 2;
335593
- const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
335598
+ const isPassiveWithCustomSymbol = componentType === "capacitor" && sourcePorts.length !== 2;
335594
335599
  const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && !isMultiPinInductor && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx2(betterEasy, circuitJson, {
335595
335600
  alignPortsToDrawing: isPassiveWithCustomSymbol
335596
335601
  }) : undefined;
@@ -341838,7 +341843,7 @@ var handleRect2 = (rect, index) => {
341838
341843
  width,
341839
341844
  height,
341840
341845
  layer,
341841
- stroke_width: mil2mm2(rect.lineWidth),
341846
+ stroke_width: mil10ToMm2(rect.lineWidth),
341842
341847
  is_filled: rect.fillStyle !== "none",
341843
341848
  has_stroke: rect.lineWidth > 0,
341844
341849
  ccw_rotation: rect.rotation
@@ -342603,7 +342608,7 @@ var ShapeItemSchema2 = z1932.object({
342603
342608
  return SVGNodeSchema2.parse({ type: "SVGNODE", svgData });
342604
342609
  }
342605
342610
  case "RECT": {
342606
- const [x4, y4, width, height, lineWidth, id2, rotation23, layer, fillStyle] = shape.data.split("~");
342611
+ const [x4, y4, width, height, layer, id2, rotation23, lineWidth, fillStyle] = shape.data.split("~");
342607
342612
  const r4 = rotation23 ? Number(rotation23) : undefined;
342608
342613
  return RectSchema2.parse({
342609
342614
  type: "RECT",
package/dist/lib/index.js CHANGED
@@ -65759,7 +65759,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
65759
65759
  }));
65760
65760
  };
65761
65761
  // package.json
65762
- var version = "0.1.2002";
65762
+ var version = "0.1.2003";
65763
65763
  var package_default = {
65764
65764
  name: "@tscircuit/cli",
65765
65765
  version,
@@ -65824,7 +65824,7 @@ var package_default = {
65824
65824
  debug: "^4.4.0",
65825
65825
  delay: "^6.0.0",
65826
65826
  "dsn-converter": "^0.0.90",
65827
- easyeda: "^0.0.331",
65827
+ easyeda: "^0.0.337",
65828
65828
  "fuse.js": "^7.1.0",
65829
65829
  "get-port": "^7.1.0",
65830
65830
  globby: "^14.1.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.2003",
3
+ "version": "0.1.2004",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/tscircuit/cli"
@@ -62,7 +62,7 @@
62
62
  "debug": "^4.4.0",
63
63
  "delay": "^6.0.0",
64
64
  "dsn-converter": "^0.0.90",
65
- "easyeda": "^0.0.331",
65
+ "easyeda": "^0.0.337",
66
66
  "fuse.js": "^7.1.0",
67
67
  "get-port": "^7.1.0",
68
68
  "globby": "^14.1.0",