@tscircuit/cli 0.1.1907 → 0.1.1908
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 +166 -30
- package/dist/lib/index.js +1 -1
- package/package.json +2 -2
package/dist/cli/main.js
CHANGED
|
@@ -135502,7 +135502,7 @@ var package_default = {
|
|
|
135502
135502
|
debug: "^4.4.0",
|
|
135503
135503
|
delay: "^6.0.0",
|
|
135504
135504
|
"dsn-converter": "^0.0.90",
|
|
135505
|
-
easyeda: "^0.0.
|
|
135505
|
+
easyeda: "^0.0.292",
|
|
135506
135506
|
"fuse.js": "^7.1.0",
|
|
135507
135507
|
"get-port": "^7.1.0",
|
|
135508
135508
|
globby: "^14.1.0",
|
|
@@ -322819,6 +322819,8 @@ var isDiodeCategoryComponent = (betterEasy) => {
|
|
|
322819
322819
|
};
|
|
322820
322820
|
var categoryValueContainsLed = (value) => {
|
|
322821
322821
|
if (typeof value === "string") {
|
|
322822
|
+
if (/(^|[^a-z])leds?\s+drivers?([^a-z]|$)/i.test(value))
|
|
322823
|
+
return false;
|
|
322822
322824
|
return /(^|[^a-z])leds?([^a-z]|$)/i.test(value) || /light[-\s]?emitting\s+diodes?/i.test(value);
|
|
322823
322825
|
}
|
|
322824
322826
|
if (Array.isArray(value)) {
|
|
@@ -323264,7 +323266,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
323264
323266
|
if (pad2.shape === "RECT") {
|
|
323265
323267
|
soupShape = "rect";
|
|
323266
323268
|
} else if (pad2.shape === "ELLIPSE") {
|
|
323267
|
-
soupShape = "
|
|
323269
|
+
soupShape = "circle";
|
|
323268
323270
|
} else if (pad2.shape === "OVAL") {
|
|
323269
323271
|
soupShape = "pill";
|
|
323270
323272
|
} else if (pad2.shape === "POLYGON") {
|
|
@@ -324032,8 +324034,13 @@ var parsePath = (str) => {
|
|
|
324032
324034
|
};
|
|
324033
324035
|
var PathShapeSchema = external_exports2.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
|
|
324034
324036
|
var optionalEasyEdaTextField = (fieldSchema) => external_exports2.preprocess((textField) => {
|
|
324035
|
-
if (textField == null
|
|
324037
|
+
if (textField == null)
|
|
324036
324038
|
return;
|
|
324039
|
+
if (typeof textField === "string") {
|
|
324040
|
+
const trimmedTextField = textField.trim();
|
|
324041
|
+
if (trimmedTextField === "" || trimmedTextField === "undefined") {
|
|
324042
|
+
return;
|
|
324043
|
+
}
|
|
324037
324044
|
}
|
|
324038
324045
|
return textField;
|
|
324039
324046
|
}, fieldSchema);
|
|
@@ -324476,6 +324483,9 @@ var generateTypescriptComponent = ({
|
|
|
324476
324483
|
supplierPartNumbers,
|
|
324477
324484
|
manufacturerPartNumber,
|
|
324478
324485
|
componentType = "chip",
|
|
324486
|
+
inductance: inductance22,
|
|
324487
|
+
crystalFrequency,
|
|
324488
|
+
crystalPinVariant,
|
|
324479
324489
|
symbolTsx
|
|
324480
324490
|
}) => {
|
|
324481
324491
|
const safePinLabels = pinLabels ?? {};
|
|
@@ -324610,6 +324620,82 @@ ${cadModelLines}
|
|
|
324610
324620
|
/>
|
|
324611
324621
|
)
|
|
324612
324622
|
}
|
|
324623
|
+
`.trim();
|
|
324624
|
+
}
|
|
324625
|
+
if (componentType === "inductor") {
|
|
324626
|
+
if (!inductance22) {
|
|
324627
|
+
throw new Error("Inductance is required for inductor components");
|
|
324628
|
+
}
|
|
324629
|
+
return `
|
|
324630
|
+
import type { InductorProps } from "@tscircuit/props"
|
|
324631
|
+
|
|
324632
|
+
export const ${componentName} = (props: Omit<InductorProps, "inductance">) => {
|
|
324633
|
+
return (
|
|
324634
|
+
<inductor
|
|
324635
|
+
inductance=${JSON.stringify(inductance22)}
|
|
324636
|
+
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
324637
|
+
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
324638
|
+
footprint={${footprintTsx}}
|
|
324639
|
+
${objUrl || stepUrl ? `cadModel={{
|
|
324640
|
+
${cadModelLines}
|
|
324641
|
+
}}` : ""}
|
|
324642
|
+
{...props}
|
|
324643
|
+
/>
|
|
324644
|
+
)
|
|
324645
|
+
}
|
|
324646
|
+
`.trim();
|
|
324647
|
+
}
|
|
324648
|
+
if (componentType === "crystal") {
|
|
324649
|
+
if (!crystalFrequency || !crystalPinVariant) {
|
|
324650
|
+
throw new Error("Crystal frequency and pin variant are required");
|
|
324651
|
+
}
|
|
324652
|
+
return `
|
|
324653
|
+
import type { CrystalProps } from "@tscircuit/props"
|
|
324654
|
+
|
|
324655
|
+
type ImportedCrystalProps = Omit<CrystalProps, "frequency" | "pinVariant">
|
|
324656
|
+
|
|
324657
|
+
export const ${componentName} = (props: ImportedCrystalProps) => {
|
|
324658
|
+
const { name = "X1", ...restProps } = props
|
|
324659
|
+
|
|
324660
|
+
return (
|
|
324661
|
+
<crystal
|
|
324662
|
+
name={name}
|
|
324663
|
+
frequency=${JSON.stringify(crystalFrequency)}
|
|
324664
|
+
pinVariant=${JSON.stringify(crystalPinVariant)}
|
|
324665
|
+
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
324666
|
+
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
324667
|
+
footprint={${footprintTsx}}
|
|
324668
|
+
${objUrl || stepUrl ? `cadModel={{
|
|
324669
|
+
${cadModelLines}
|
|
324670
|
+
}}` : ""}
|
|
324671
|
+
{...restProps}
|
|
324672
|
+
/>
|
|
324673
|
+
)
|
|
324674
|
+
}
|
|
324675
|
+
`.trim();
|
|
324676
|
+
}
|
|
324677
|
+
if (componentType === "connector") {
|
|
324678
|
+
return `
|
|
324679
|
+
import type { ConnectorProps } from "@tscircuit/props"
|
|
324680
|
+
|
|
324681
|
+
const pinLabels = {
|
|
324682
|
+
${pinLabelsString}
|
|
324683
|
+
} as const
|
|
324684
|
+
|
|
324685
|
+
export const ${componentName} = (props: ConnectorProps) => {
|
|
324686
|
+
return (
|
|
324687
|
+
<connector
|
|
324688
|
+
pinLabels={pinLabels}
|
|
324689
|
+
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
324690
|
+
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
324691
|
+
footprint={${footprintTsx}}
|
|
324692
|
+
${objUrl || stepUrl ? `cadModel={{
|
|
324693
|
+
${cadModelLines}
|
|
324694
|
+
}}` : ""}
|
|
324695
|
+
{...props}
|
|
324696
|
+
/>
|
|
324697
|
+
)
|
|
324698
|
+
}
|
|
324613
324699
|
`.trim();
|
|
324614
324700
|
}
|
|
324615
324701
|
return `
|
|
@@ -324635,6 +324721,24 @@ ${cadModelLines}
|
|
|
324635
324721
|
}
|
|
324636
324722
|
`.trim();
|
|
324637
324723
|
};
|
|
324724
|
+
var frequencyPattern = /^\d+(?:\.\d+)?\s*(?:Hz|kHz|MHz|GHz)$/i;
|
|
324725
|
+
var isCrystalComponent = (betterEasy) => {
|
|
324726
|
+
const componentParameters = betterEasy.dataStr.head.c_para;
|
|
324727
|
+
const packageName = componentParameters.package;
|
|
324728
|
+
const value = componentParameters.Value;
|
|
324729
|
+
return componentParameters.pre === "X?" && packageName?.toUpperCase().startsWith("CRYSTAL-") === true && typeof value === "string" && frequencyPattern.test(value.trim());
|
|
324730
|
+
};
|
|
324731
|
+
var inductancePattern = /^\d+(?:\.\d+)?\s*(?:pH|nH|uH|µH|mH|H)$/i;
|
|
324732
|
+
var isInductorComponent = (betterEasy) => {
|
|
324733
|
+
const componentParameters = betterEasy.dataStr.head.c_para;
|
|
324734
|
+
const packageName = componentParameters.package;
|
|
324735
|
+
const value = componentParameters.Value;
|
|
324736
|
+
return packageName?.toUpperCase().startsWith("IND-") === true && typeof value === "string" && inductancePattern.test(value.trim());
|
|
324737
|
+
};
|
|
324738
|
+
var isMicroUsbConnectorComponent = (betterEasy) => {
|
|
324739
|
+
const componentParameters = betterEasy.dataStr.head.c_para;
|
|
324740
|
+
return componentParameters.pre === "USB?" && componentParameters.package?.toUpperCase().startsWith("MICRO-USB-") === true;
|
|
324741
|
+
};
|
|
324638
324742
|
var categoryValueContainsPushbutton = (value) => {
|
|
324639
324743
|
if (typeof value === "string") {
|
|
324640
324744
|
const normalized = value.toLowerCase();
|
|
@@ -324690,10 +324794,11 @@ var isSwitchCategoryComponent = (betterEasy) => {
|
|
|
324690
324794
|
].some(categoryValueContainsSwitch);
|
|
324691
324795
|
};
|
|
324692
324796
|
var round = (value) => Number(value.toFixed(6));
|
|
324693
|
-
var
|
|
324797
|
+
var EASYEDA_SCHEMATIC_UNIT_TO_TSCIRCUIT_UNIT = 0.02;
|
|
324798
|
+
var toSchematicUnits = (value) => round(value * EASYEDA_SCHEMATIC_UNIT_TO_TSCIRCUIT_UNIT);
|
|
324694
324799
|
var getPointTransformer = (origin) => (point22) => ({
|
|
324695
|
-
x:
|
|
324696
|
-
y:
|
|
324800
|
+
x: toSchematicUnits(point22.x - origin.x),
|
|
324801
|
+
y: toSchematicUnits(origin.y - point22.y)
|
|
324697
324802
|
});
|
|
324698
324803
|
var formatNumber5 = (value) => String(round(value));
|
|
324699
324804
|
var SVG_PATH_COMMAND_PARAMETER_COUNTS = {
|
|
@@ -324785,8 +324890,8 @@ var transformSvgPath = (pathData, origin) => {
|
|
|
324785
324890
|
const transformedEndpoint = transformPoint2(endpoint);
|
|
324786
324891
|
output.push([
|
|
324787
324892
|
"A",
|
|
324788
|
-
formatNumber5(
|
|
324789
|
-
formatNumber5(
|
|
324893
|
+
formatNumber5(toSchematicUnits(Math.abs(values[0]))),
|
|
324894
|
+
formatNumber5(toSchematicUnits(Math.abs(values[1]))),
|
|
324790
324895
|
formatNumber5(-values[2]),
|
|
324791
324896
|
String(values[3]),
|
|
324792
324897
|
String(values[4] === 0 ? 1 : 0),
|
|
@@ -324813,16 +324918,13 @@ var getPinStemLength = (path72) => {
|
|
|
324813
324918
|
const segment2 = path72.match(/[hHvV]\s*(-?(?:\d*\.\d+|\d+\.?))/);
|
|
324814
324919
|
if (!segment2)
|
|
324815
324920
|
return;
|
|
324816
|
-
return
|
|
324921
|
+
return toSchematicUnits(Math.abs(Number(segment2[1])));
|
|
324817
324922
|
};
|
|
324818
|
-
var
|
|
324923
|
+
var getTextFontSize = (fontSize) => {
|
|
324819
324924
|
const numericFontSize = Number.parseFloat(fontSize);
|
|
324820
324925
|
if (!Number.isFinite(numericFontSize))
|
|
324821
|
-
return
|
|
324822
|
-
|
|
324823
|
-
return round(numericFontSize * 25.4 / 72);
|
|
324824
|
-
}
|
|
324825
|
-
return toMillimeters(numericFontSize);
|
|
324926
|
+
return 0.2;
|
|
324927
|
+
return toSchematicUnits(numericFontSize);
|
|
324826
324928
|
};
|
|
324827
324929
|
var getTextAnchor = (alignment) => {
|
|
324828
324930
|
if (alignment === "L")
|
|
@@ -324862,11 +324964,12 @@ var getPortMetadataByShapeId = (easyEdaJson, circuitJson) => {
|
|
|
324862
324964
|
const numericPinNumber = Number(pin.pinNumber);
|
|
324863
324965
|
if (!portName && Number.isInteger(numericPinNumber)) {
|
|
324864
324966
|
const numericPortName = `pin${numericPinNumber}`;
|
|
324865
|
-
if (sourcePorts.some((port) => port.name === numericPortName)) {
|
|
324967
|
+
if (!usedPortNames.has(numericPortName) && sourcePorts.some((port) => port.name === numericPortName)) {
|
|
324866
324968
|
portName = numericPortName;
|
|
324867
324969
|
}
|
|
324868
324970
|
}
|
|
324869
|
-
portName ??= sourcePorts
|
|
324971
|
+
portName ??= sourcePorts.find((port) => !usedPortNames.has(port.name))?.name;
|
|
324972
|
+
portName ??= `pin${pinIndex + 1}`;
|
|
324870
324973
|
usedPortNames.add(portName);
|
|
324871
324974
|
const sourcePort = sourcePorts.find((port) => port.name === portName);
|
|
324872
324975
|
metadataByShapeId.set(pin.id, {
|
|
@@ -324891,36 +324994,36 @@ var generateShapeTsx = ({
|
|
|
324891
324994
|
x: shape.position.x + shape.width / 2,
|
|
324892
324995
|
y: shape.position.y + shape.height / 2
|
|
324893
324996
|
});
|
|
324894
|
-
return `<schematicrect schX={${center2.x}} schY={${center2.y}} width={${
|
|
324997
|
+
return `<schematicrect schX={${center2.x}} schY={${center2.y}} width={${toSchematicUnits(shape.width)}} height={${toSchematicUnits(shape.height)}} color=${JSON.stringify(shape.color)}${shape.fillColor && shape.fillColor !== "none" ? ` isFilled fillColor=${JSON.stringify(shape.fillColor)}` : ""} />`;
|
|
324895
324998
|
}
|
|
324896
324999
|
if (shape.type === "ELLIPSE") {
|
|
324897
325000
|
const center2 = transformPoint2(shape.center);
|
|
324898
|
-
return `<schematiccircle center={{ x: ${center2.x}, y: ${center2.y} }} radius={${
|
|
325001
|
+
return `<schematiccircle center={{ x: ${center2.x}, y: ${center2.y} }} radius={${toSchematicUnits(Math.max(shape.radiusX, shape.radiusY))}} color=${JSON.stringify(shape.color)}${shape.fillColor && shape.fillColor !== "none" ? ` isFilled fillColor=${JSON.stringify(shape.fillColor)}` : ""} />`;
|
|
324899
325002
|
}
|
|
324900
325003
|
if (shape.type === "POLYLINE" || shape.type === "POLYGON") {
|
|
324901
325004
|
const isPolygon = shape.type === "POLYGON";
|
|
324902
325005
|
const points = shape.points.map(transformPoint2);
|
|
324903
325006
|
if (isPolygon && points.length > 0)
|
|
324904
325007
|
points.push(points[0]);
|
|
324905
|
-
return `<schematicpath points={${JSON.stringify(points)}}
|
|
325008
|
+
return `<schematicpath points={${JSON.stringify(points)}} strokeColor=${JSON.stringify(isPolygon ? shape.lineColor : shape.color)}${isPolygon && shape.fillColor !== "none" ? ` isFilled fillColor=${JSON.stringify(shape.fillColor)}` : ""} />`;
|
|
324906
325009
|
}
|
|
324907
325010
|
if (shape.type === "PATH") {
|
|
324908
325011
|
const transformedPath = transformSvgPath(shape.pathData, origin);
|
|
324909
325012
|
if (!transformedPath)
|
|
324910
325013
|
return;
|
|
324911
|
-
return `<schematicpath svgPath=${JSON.stringify(transformedPath)}
|
|
325014
|
+
return `<schematicpath svgPath=${JSON.stringify(transformedPath)} strokeColor=${JSON.stringify(shape.strokeColor)}${shape.fillColor !== "none" ? ` isFilled fillColor=${JSON.stringify(shape.fillColor)}` : ""} />`;
|
|
324912
325015
|
}
|
|
324913
325016
|
if (shape.type === "ARC") {
|
|
324914
325017
|
const transformedPath = transformSvgPath(shape.pathData, origin);
|
|
324915
325018
|
if (!transformedPath)
|
|
324916
325019
|
return;
|
|
324917
|
-
return `<schematicpath svgPath=${JSON.stringify(transformedPath)}
|
|
325020
|
+
return `<schematicpath svgPath=${JSON.stringify(transformedPath)} strokeColor=${JSON.stringify(shape.color)} />`;
|
|
324918
325021
|
}
|
|
324919
325022
|
if (shape.type === "TEXT") {
|
|
324920
325023
|
if (shape.visibility !== "1")
|
|
324921
325024
|
return;
|
|
324922
325025
|
const position2 = transformPoint2({ x: shape.x, y: shape.y });
|
|
324923
|
-
return `<schematictext schX={${position2.x}} schY={${position2.y}} text=${JSON.stringify(shape.content)} fontSize={${
|
|
325026
|
+
return `<schematictext schX={${position2.x}} schY={${position2.y}} text=${JSON.stringify(shape.content)} fontSize={${getTextFontSize(shape.fontSize)}} anchor=${JSON.stringify(getTextAnchor(shape.alignment))} color=${JSON.stringify(shape.fontColor)} schRotation={${round(-shape.rotation)}} />`;
|
|
324924
325027
|
}
|
|
324925
325028
|
if (shape.type === "PIN" && portMetadata) {
|
|
324926
325029
|
const position2 = transformPoint2({ x: shape.x, y: shape.y });
|
|
@@ -324976,6 +325079,12 @@ var getGeneratedComponentType = (betterEasy) => {
|
|
|
324976
325079
|
return "pushbutton";
|
|
324977
325080
|
if (isSwitchCategoryComponent(betterEasy))
|
|
324978
325081
|
return "switch";
|
|
325082
|
+
if (isInductorComponent(betterEasy))
|
|
325083
|
+
return "inductor";
|
|
325084
|
+
if (isCrystalComponent(betterEasy))
|
|
325085
|
+
return "crystal";
|
|
325086
|
+
if (isMicroUsbConnectorComponent(betterEasy))
|
|
325087
|
+
return "connector";
|
|
324979
325088
|
return "chip";
|
|
324980
325089
|
};
|
|
324981
325090
|
var convertRawEasyToTsx = async ({ rawEasy }) => {
|
|
@@ -325003,8 +325112,11 @@ var convertBetterEasyToTsx = async ({
|
|
|
325003
325112
|
cadComponent.position.x = 0;
|
|
325004
325113
|
cadComponent.position.y = 0;
|
|
325005
325114
|
}
|
|
325006
|
-
const
|
|
325007
|
-
|
|
325115
|
+
const manufacturerPartNumber = betterEasy.dataStr.head.c_para["Manufacturer Part"];
|
|
325116
|
+
if (!manufacturerPartNumber) {
|
|
325117
|
+
throw new Error(`Missing manufacturer part number for ${betterEasy.lcsc.number}`);
|
|
325118
|
+
}
|
|
325119
|
+
const componentName = normalizeManufacturerPartNumber(manufacturerPartNumber);
|
|
325008
325120
|
const sourcePorts = su17(circuitJson).source_port.list();
|
|
325009
325121
|
const pinLabels = {};
|
|
325010
325122
|
const sortedPorts = sourcePorts.sort((a2, b3) => {
|
|
@@ -325034,16 +325146,22 @@ var convertBetterEasyToTsx = async ({
|
|
|
325034
325146
|
jlcpcb: [betterEasy.lcsc.number]
|
|
325035
325147
|
};
|
|
325036
325148
|
const componentType = getGeneratedComponentType(betterEasy);
|
|
325149
|
+
const inductance22 = componentType === "inductor" ? betterEasy.dataStr.head.c_para.Value?.trim() : undefined;
|
|
325150
|
+
const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : undefined;
|
|
325151
|
+
const crystalPinVariant = componentType !== "crystal" ? undefined : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : undefined;
|
|
325037
325152
|
const symbolTsx = componentType === "chip" && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx2(betterEasy, circuitJson) : undefined;
|
|
325038
325153
|
return generateTypescriptComponent({
|
|
325039
|
-
componentName
|
|
325040
|
-
manufacturerPartNumber
|
|
325154
|
+
componentName,
|
|
325155
|
+
manufacturerPartNumber,
|
|
325041
325156
|
pinLabels,
|
|
325042
325157
|
objUrl: modelObjUrl,
|
|
325043
325158
|
stepUrl: modelStepUrl,
|
|
325044
325159
|
circuitJson,
|
|
325045
325160
|
supplierPartNumbers,
|
|
325046
325161
|
componentType,
|
|
325162
|
+
inductance: inductance22,
|
|
325163
|
+
crystalFrequency,
|
|
325164
|
+
crystalPinVariant,
|
|
325047
325165
|
symbolTsx
|
|
325048
325166
|
});
|
|
325049
325167
|
};
|
|
@@ -325146,7 +325264,18 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber, {
|
|
|
325146
325264
|
if (!searchResult.success || !searchResult.result.lists.lcsc.length) {
|
|
325147
325265
|
throw new Error("Component not found");
|
|
325148
325266
|
}
|
|
325149
|
-
const
|
|
325267
|
+
const requestedPartNumber = jlcpcbPartNumber.trim().toUpperCase();
|
|
325268
|
+
const bestMatchComponent = searchResult.result.lists.lcsc.find((component) => {
|
|
325269
|
+
const candidatePartNumbers = [
|
|
325270
|
+
component.dataStr?.head?.c_para?.["Supplier Part"],
|
|
325271
|
+
component.lcsc?.number,
|
|
325272
|
+
component.szlcsc?.number
|
|
325273
|
+
];
|
|
325274
|
+
return candidatePartNumbers.some((partNumber) => typeof partNumber === "string" && partNumber.trim().toUpperCase() === requestedPartNumber);
|
|
325275
|
+
});
|
|
325276
|
+
if (!bestMatchComponent) {
|
|
325277
|
+
throw new Error(`No exact EasyEDA component match for "${jlcpcbPartNumber}"`);
|
|
325278
|
+
}
|
|
325150
325279
|
const componentUUID = bestMatchComponent.uuid;
|
|
325151
325280
|
const componentResponse = await fetch22(componentUrl(componentUUID), {
|
|
325152
325281
|
method: "GET",
|
|
@@ -330595,6 +330724,8 @@ var isDiodeCategoryComponent2 = (betterEasy) => {
|
|
|
330595
330724
|
};
|
|
330596
330725
|
var categoryValueContainsLed2 = (value) => {
|
|
330597
330726
|
if (typeof value === "string") {
|
|
330727
|
+
if (/(^|[^a-z])leds?\s+drivers?([^a-z]|$)/i.test(value))
|
|
330728
|
+
return false;
|
|
330598
330729
|
return /(^|[^a-z])leds?([^a-z]|$)/i.test(value) || /light[-\s]?emitting\s+diodes?/i.test(value);
|
|
330599
330730
|
}
|
|
330600
330731
|
if (Array.isArray(value)) {
|
|
@@ -331026,7 +331157,7 @@ var convertEasyEdaJsonToCircuitJson2 = (easyEdaJson, {
|
|
|
331026
331157
|
if (pad2.shape === "RECT") {
|
|
331027
331158
|
soupShape = "rect";
|
|
331028
331159
|
} else if (pad2.shape === "ELLIPSE") {
|
|
331029
|
-
soupShape = "
|
|
331160
|
+
soupShape = "circle";
|
|
331030
331161
|
} else if (pad2.shape === "OVAL") {
|
|
331031
331162
|
soupShape = "pill";
|
|
331032
331163
|
} else if (pad2.shape === "POLYGON") {
|
|
@@ -331794,8 +331925,13 @@ var parsePath2 = (str) => {
|
|
|
331794
331925
|
};
|
|
331795
331926
|
var PathShapeSchema2 = z180.string().startsWith("PT~").transform(parsePath2).pipe(PathShapeOutputSchema2);
|
|
331796
331927
|
var optionalEasyEdaTextField2 = (fieldSchema) => z180.preprocess((textField) => {
|
|
331797
|
-
if (textField == null
|
|
331928
|
+
if (textField == null)
|
|
331798
331929
|
return;
|
|
331930
|
+
if (typeof textField === "string") {
|
|
331931
|
+
const trimmedTextField = textField.trim();
|
|
331932
|
+
if (trimmedTextField === "" || trimmedTextField === "undefined") {
|
|
331933
|
+
return;
|
|
331934
|
+
}
|
|
331799
331935
|
}
|
|
331800
331936
|
return textField;
|
|
331801
331937
|
}, fieldSchema);
|
package/dist/lib/index.js
CHANGED
|
@@ -65817,7 +65817,7 @@ var package_default = {
|
|
|
65817
65817
|
debug: "^4.4.0",
|
|
65818
65818
|
delay: "^6.0.0",
|
|
65819
65819
|
"dsn-converter": "^0.0.90",
|
|
65820
|
-
easyeda: "^0.0.
|
|
65820
|
+
easyeda: "^0.0.292",
|
|
65821
65821
|
"fuse.js": "^7.1.0",
|
|
65822
65822
|
"get-port": "^7.1.0",
|
|
65823
65823
|
globby: "^14.1.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1908",
|
|
4
4
|
"main": "dist/cli/main.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/cli/main.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"debug": "^4.4.0",
|
|
58
58
|
"delay": "^6.0.0",
|
|
59
59
|
"dsn-converter": "^0.0.90",
|
|
60
|
-
"easyeda": "^0.0.
|
|
60
|
+
"easyeda": "^0.0.292",
|
|
61
61
|
"fuse.js": "^7.1.0",
|
|
62
62
|
"get-port": "^7.1.0",
|
|
63
63
|
"globby": "^14.1.0",
|