@tscircuit/cli 0.1.1956 → 0.1.1958
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 +124 -31
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
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.
|
|
136047
|
+
var version = "0.1.1957";
|
|
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.
|
|
136108
|
+
easyeda: "^0.0.315",
|
|
136109
136109
|
"fuse.js": "^7.1.0",
|
|
136110
136110
|
"get-port": "^7.1.0",
|
|
136111
136111
|
globby: "^14.1.0",
|
|
@@ -303593,6 +303593,7 @@ var registerCheckSchematicPlacement = (program2) => {
|
|
|
303593
303593
|
// cli/check/shorts/register.ts
|
|
303594
303594
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
303595
303595
|
import path49 from "node:path";
|
|
303596
|
+
import { all_layers as all_layers2, layer_string } from "circuit-json";
|
|
303596
303597
|
|
|
303597
303598
|
// cli/check/shorts/get-check-short-layers.ts
|
|
303598
303599
|
var innerCopperLayers = [
|
|
@@ -303609,12 +303610,16 @@ var getCheckShortLayers = ({
|
|
|
303609
303610
|
circuitJson,
|
|
303610
303611
|
layerOption
|
|
303611
303612
|
}) => {
|
|
303612
|
-
if (layerOption !== "all")
|
|
303613
|
-
return [layerOption];
|
|
303614
303613
|
const pcbBoard = circuitJson.find((element) => element.type === "pcb_board");
|
|
303615
303614
|
const boardLayerCount = pcbBoard?.type === "pcb_board" ? pcbBoard.num_layers : 2;
|
|
303616
303615
|
const innerLayerCount = Math.max(0, Math.floor(boardLayerCount) - 2);
|
|
303617
|
-
|
|
303616
|
+
const availableLayers = boardLayerCount <= 1 ? ["top"] : ["top", ...innerCopperLayers.slice(0, innerLayerCount), "bottom"];
|
|
303617
|
+
if (layerOption === "all")
|
|
303618
|
+
return availableLayers;
|
|
303619
|
+
if (!availableLayers.includes(layerOption)) {
|
|
303620
|
+
throw new Error(`--layer ${layerOption} is not available on this ${boardLayerCount}-layer board; available layers: ${availableLayers.join(", ")}`);
|
|
303621
|
+
}
|
|
303622
|
+
return [layerOption];
|
|
303618
303623
|
};
|
|
303619
303624
|
|
|
303620
303625
|
// cli/check/shorts/register.ts
|
|
@@ -303652,12 +303657,16 @@ var parseMode = (mode) => {
|
|
|
303652
303657
|
return mode;
|
|
303653
303658
|
throw new Error("--mode must be either pcb or gerber");
|
|
303654
303659
|
};
|
|
303660
|
+
var checkShortsLayerNames = [...all_layers2, "all"].join(", ");
|
|
303655
303661
|
var parseLayer = (layer) => {
|
|
303656
303662
|
if (!layer)
|
|
303657
303663
|
return "all";
|
|
303658
|
-
if (layer === "
|
|
303664
|
+
if (layer === "all")
|
|
303659
303665
|
return layer;
|
|
303660
|
-
|
|
303666
|
+
const parsedLayer = layer_string.safeParse(layer);
|
|
303667
|
+
if (parsedLayer.success)
|
|
303668
|
+
return parsedLayer.data;
|
|
303669
|
+
throw new Error(`--layer must be one of: ${checkShortsLayerNames}`);
|
|
303661
303670
|
};
|
|
303662
303671
|
var formatLabels = (labels) => labels.length > 0 ? labels.join(", ") : "(unknown)";
|
|
303663
303672
|
var formatShort = (short, index) => {
|
|
@@ -303729,7 +303738,7 @@ var checkShorts = async (file, options = {}) => {
|
|
|
303729
303738
|
};
|
|
303730
303739
|
};
|
|
303731
303740
|
var registerCheckShorts = (program2) => {
|
|
303732
|
-
program2.commands.find((c3) => c3.name() === "check").command("shorts").description("Detect unintended shorts between separate PCB copper groups").argument("[file]", "Path to the entry file or prebuilt circuit JSON").option("--mode <mode>", "Bitmap source to analyze: pcb or gerber", "gerber").option("--layer <layer>",
|
|
303741
|
+
program2.commands.find((c3) => c3.name() === "check").command("shorts").description("Detect unintended shorts between separate PCB copper groups").argument("[file]", "Path to the entry file or prebuilt circuit JSON").option("--mode <mode>", "Bitmap source to analyze: pcb or gerber", "gerber").option("--layer <layer>", `Layer to analyze: ${checkShortsLayerNames}`, "all").option("--pixels-per-mm <number>", "Bitmap resolution for short detection").action(async (file, options) => {
|
|
303733
303742
|
try {
|
|
303734
303743
|
const result = await checkShorts(file, options);
|
|
303735
303744
|
console.log(result.output);
|
|
@@ -317845,7 +317854,7 @@ var __export4 = (target, all) => {
|
|
|
317845
317854
|
};
|
|
317846
317855
|
var dist_exports = {};
|
|
317847
317856
|
__export4(dist_exports, {
|
|
317848
|
-
all_layers: () =>
|
|
317857
|
+
all_layers: () => all_layers3,
|
|
317849
317858
|
any_circuit_element: () => any_circuit_element,
|
|
317850
317859
|
any_soup_element: () => any_soup_element4,
|
|
317851
317860
|
any_source_component: () => any_source_component,
|
|
@@ -317883,7 +317892,7 @@ __export4(dist_exports, {
|
|
|
317883
317892
|
kicadSymbolProperties: () => kicadSymbolProperties2,
|
|
317884
317893
|
kicadSymbolProperty: () => kicadSymbolProperty2,
|
|
317885
317894
|
layer_ref: () => layer_ref2,
|
|
317886
|
-
layer_string: () =>
|
|
317895
|
+
layer_string: () => layer_string2,
|
|
317887
317896
|
length: () => length67,
|
|
317888
317897
|
manufacturing_drc_properties: () => manufacturing_drc_properties,
|
|
317889
317898
|
ms: () => ms6,
|
|
@@ -322984,7 +322993,7 @@ var source_pcb_ground_plane = external_exports2.object({
|
|
|
322984
322993
|
subcircuit_id: external_exports2.string().optional()
|
|
322985
322994
|
}).describe("Defines a ground plane in the source domain");
|
|
322986
322995
|
expectTypesMatch2(true);
|
|
322987
|
-
var
|
|
322996
|
+
var all_layers3 = [
|
|
322988
322997
|
"top",
|
|
322989
322998
|
"bottom",
|
|
322990
322999
|
"inner1",
|
|
@@ -322994,9 +323003,9 @@ var all_layers2 = [
|
|
|
322994
323003
|
"inner5",
|
|
322995
323004
|
"inner6"
|
|
322996
323005
|
];
|
|
322997
|
-
var
|
|
322998
|
-
var layer_ref2 =
|
|
322999
|
-
name:
|
|
323006
|
+
var layer_string2 = external_exports2.enum(all_layers3);
|
|
323007
|
+
var layer_ref2 = layer_string2.or(external_exports2.object({
|
|
323008
|
+
name: layer_string2
|
|
323000
323009
|
})).transform((layer) => {
|
|
323001
323010
|
if (typeof layer === "string") {
|
|
323002
323011
|
return layer;
|
|
@@ -327218,7 +327227,7 @@ var handleSilkscreenPath = (track, index) => {
|
|
|
327218
327227
|
type: "pcb_silkscreen_path",
|
|
327219
327228
|
pcb_silkscreen_path_id: `pcb_silkscreen_path_${index + 1}`,
|
|
327220
327229
|
pcb_component_id: "pcb_component_1",
|
|
327221
|
-
layer:
|
|
327230
|
+
layer: getSideFromLayer(track.layer),
|
|
327222
327231
|
route: track.points.map((point22) => ({
|
|
327223
327232
|
x: milx10(point22.x),
|
|
327224
327233
|
y: milx10(point22.y)
|
|
@@ -327228,6 +327237,18 @@ var handleSilkscreenPath = (track, index) => {
|
|
|
327228
327237
|
};
|
|
327229
327238
|
var isCourtyardLayer = (layer) => layer === 13 || layer === 14 || layer === 15;
|
|
327230
327239
|
var isSilkscreenLayer = (layer) => layer === 3 || layer === 4;
|
|
327240
|
+
var isDocumentLayer = (layer) => layer === 12;
|
|
327241
|
+
var handleFabricationNotePath = (track, index) => pcb_fabrication_note_path.parse({
|
|
327242
|
+
type: "pcb_fabrication_note_path",
|
|
327243
|
+
pcb_fabrication_note_path_id: `pcb_fabrication_note_path_${index + 1}`,
|
|
327244
|
+
pcb_component_id: "pcb_component_1",
|
|
327245
|
+
layer: "top",
|
|
327246
|
+
route: track.points.map((point22) => ({
|
|
327247
|
+
x: mil10ToMm(point22.x),
|
|
327248
|
+
y: mil10ToMm(point22.y)
|
|
327249
|
+
})),
|
|
327250
|
+
stroke_width: mil10ToMm(track.width)
|
|
327251
|
+
});
|
|
327231
327252
|
var getSideFromLayer = (layer) => {
|
|
327232
327253
|
if (layer === 4 || layer === 14)
|
|
327233
327254
|
return "bottom";
|
|
@@ -327425,7 +327446,7 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
327425
327446
|
pcb_plated_hole_id: platedHoleId,
|
|
327426
327447
|
x: mil2mm(pad2.center.x),
|
|
327427
327448
|
y: mil2mm(pad2.center.y),
|
|
327428
|
-
layers: ["top"],
|
|
327449
|
+
layers: ["top", "bottom"],
|
|
327429
327450
|
port_hints: pcbPortHints,
|
|
327430
327451
|
pcb_component_id: "pcb_component_1",
|
|
327431
327452
|
pcb_port_id: `pcb_port_${index + 1}`
|
|
@@ -327550,8 +327571,10 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
327550
327571
|
let hasFoundDesignator = false;
|
|
327551
327572
|
easyEdaJson.packageDetail.dataStr.shape.forEach((shape, index) => {
|
|
327552
327573
|
if (shape.type === "TRACK") {
|
|
327553
|
-
if (
|
|
327574
|
+
if (isSilkscreenLayer(shape.layer)) {
|
|
327554
327575
|
circuitElements.push(handleSilkscreenPath(shape, index));
|
|
327576
|
+
} else if (isDocumentLayer(shape.layer)) {
|
|
327577
|
+
circuitElements.push(handleFabricationNotePath(shape, index));
|
|
327555
327578
|
}
|
|
327556
327579
|
} else if (shape.type === "CIRCLE") {
|
|
327557
327580
|
if (isSilkscreenLayer(shape.layer)) {
|
|
@@ -328688,6 +328711,7 @@ var generateFootprintTsx2 = (circuitJson, options = {}) => {
|
|
|
328688
328711
|
const vias = su17(circuitJson).pcb_via.list();
|
|
328689
328712
|
const silkscreenPaths = su17(circuitJson).pcb_silkscreen_path.list();
|
|
328690
328713
|
const silkscreenTexts = su17(circuitJson).pcb_silkscreen_text.list();
|
|
328714
|
+
const fabricationNotePaths = su17(circuitJson).pcb_fabrication_note_path.list();
|
|
328691
328715
|
const courtyardOutlines = su17(circuitJson).pcb_courtyard_outline.list();
|
|
328692
328716
|
const elementStrings = [];
|
|
328693
328717
|
for (const hole of holes) {
|
|
@@ -328738,6 +328762,9 @@ var generateFootprintTsx2 = (circuitJson, options = {}) => {
|
|
|
328738
328762
|
const rotationAttr = rotation23 ? ` pcbRotation="${rotation23}deg"` : "";
|
|
328739
328763
|
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)}"` : ""} />`);
|
|
328740
328764
|
}
|
|
328765
|
+
for (const fabricationNotePath of fabricationNotePaths) {
|
|
328766
|
+
elementStrings.push(`<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr2(fabricationNotePath.stroke_width)}" />`);
|
|
328767
|
+
}
|
|
328741
328768
|
for (const courtyardOutline of courtyardOutlines) {
|
|
328742
328769
|
elementStrings.push(`<courtyardoutline outline={${JSON.stringify(courtyardOutline.outline)}} />`);
|
|
328743
328770
|
}
|
|
@@ -328748,6 +328775,40 @@ var generateFootprintTsx2 = (circuitJson, options = {}) => {
|
|
|
328748
328775
|
</footprint>
|
|
328749
328776
|
`.trim();
|
|
328750
328777
|
};
|
|
328778
|
+
var POWER_PIN_LABEL = /^(?:VCC|VDD|VIN|VDDA)\d*$/;
|
|
328779
|
+
var GROUND_PIN_LABEL = /^(?:GND|VSS|PGND|AGND)\d*$/;
|
|
328780
|
+
var NO_CONNECT_PIN_LABEL = /^NC\d*$/;
|
|
328781
|
+
var getAttributeKind = (label) => {
|
|
328782
|
+
const normalizedLabel = label.trim().toUpperCase();
|
|
328783
|
+
if (POWER_PIN_LABEL.test(normalizedLabel))
|
|
328784
|
+
return "power";
|
|
328785
|
+
if (GROUND_PIN_LABEL.test(normalizedLabel))
|
|
328786
|
+
return "ground";
|
|
328787
|
+
if (NO_CONNECT_PIN_LABEL.test(normalizedLabel))
|
|
328788
|
+
return "no-connect";
|
|
328789
|
+
return;
|
|
328790
|
+
};
|
|
328791
|
+
var inferPinAttributes = (pinLabels) => {
|
|
328792
|
+
const pinAttributes = {};
|
|
328793
|
+
for (const [pinName, labels] of Object.entries(pinLabels)) {
|
|
328794
|
+
const labelList = typeof labels === "string" ? [labels] : labels;
|
|
328795
|
+
const inferredKinds = labelList.map(getAttributeKind);
|
|
328796
|
+
if (inferredKinds.some((kind) => kind === undefined))
|
|
328797
|
+
continue;
|
|
328798
|
+
const attributeKinds = new Set(inferredKinds);
|
|
328799
|
+
if (attributeKinds.size !== 1)
|
|
328800
|
+
continue;
|
|
328801
|
+
const [attributeKind] = attributeKinds;
|
|
328802
|
+
if (attributeKind === "power") {
|
|
328803
|
+
pinAttributes[pinName] = { requiresPower: true };
|
|
328804
|
+
} else if (attributeKind === "ground") {
|
|
328805
|
+
pinAttributes[pinName] = { requiresGround: true };
|
|
328806
|
+
} else if (attributeKind === "no-connect") {
|
|
328807
|
+
pinAttributes[pinName] = { doNotConnect: true };
|
|
328808
|
+
}
|
|
328809
|
+
}
|
|
328810
|
+
return pinAttributes;
|
|
328811
|
+
};
|
|
328751
328812
|
var generateTypescriptComponent = ({
|
|
328752
328813
|
pinLabels,
|
|
328753
328814
|
componentName,
|
|
@@ -328778,6 +328839,19 @@ var generateTypescriptComponent = ({
|
|
|
328778
328839
|
}));
|
|
328779
328840
|
const pinLabelsString = Object.entries(simplifiedPinLabels).map(([pin, labels]) => ` ${pin}: ${JSON.stringify(labels)}`).join(`,
|
|
328780
328841
|
`);
|
|
328842
|
+
const inferredPinAttributes = componentType === "chip" ? inferPinAttributes(simplifiedPinLabels) : {};
|
|
328843
|
+
const pinAttributesString = Object.entries(inferredPinAttributes).map(([pin, attributes2]) => {
|
|
328844
|
+
const attributesString = Object.entries(attributes2).map(([attributeName, value]) => `${attributeName}: ${JSON.stringify(value)}`).join(", ");
|
|
328845
|
+
return ` ${pin}: {${attributesString}}`;
|
|
328846
|
+
}).join(`,
|
|
328847
|
+
`);
|
|
328848
|
+
const pinAttributesBlock = pinAttributesString ? `const pinAttributes = {
|
|
328849
|
+
${pinAttributesString}
|
|
328850
|
+
} as const
|
|
328851
|
+
|
|
328852
|
+
` : "";
|
|
328853
|
+
const pinAttributesProp = pinAttributesString ? ` pinAttributes={pinAttributes}
|
|
328854
|
+
` : "";
|
|
328781
328855
|
const polarizedPinLabelsString = Object.entries(polarizedPinLabels ?? {}).map(([pin, labels]) => ` ${pin}: ${JSON.stringify(labels)}`).join(`,
|
|
328782
328856
|
`);
|
|
328783
328857
|
const polarizedPinLabelsBlock = polarizedPinLabels ? `const pinLabels = {
|
|
@@ -329033,11 +329107,11 @@ const pinLabels = {
|
|
|
329033
329107
|
${pinLabelsString}
|
|
329034
329108
|
} as const
|
|
329035
329109
|
|
|
329036
|
-
export const ${componentName} = (props: ChipProps<typeof pinLabels>) => {
|
|
329110
|
+
${pinAttributesBlock}export const ${componentName} = (props: ChipProps<typeof pinLabels>) => {
|
|
329037
329111
|
return (
|
|
329038
329112
|
<chip
|
|
329039
329113
|
pinLabels={pinLabels}
|
|
329040
|
-
${symbolProp2} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
329114
|
+
${pinAttributesProp}${symbolProp2} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
329041
329115
|
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
329042
329116
|
footprint={${footprintTsx}}
|
|
329043
329117
|
${objUrl || stepUrl ? `cadModel={{
|
|
@@ -329088,7 +329162,7 @@ var categoryValueContainsPushbutton = (value) => {
|
|
|
329088
329162
|
if (/analog\s+switch/.test(normalized) || /multiplex/.test(normalized) || /switching\s+diodes?/.test(normalized) || /\bics?\b/.test(normalized)) {
|
|
329089
329163
|
return false;
|
|
329090
329164
|
}
|
|
329091
|
-
return /push\s*buttons?/.test(normalized) || /pushbuttons?/.test(normalized) || /tact(?:ile)?\s+switch(?:es)?/.test(normalized) || /keyboard\s+(?:switch(?:es)?|shaft)/.test(normalized) || /mechanical\s+keyboard\s+shaft/.test(normalized);
|
|
329165
|
+
return /push\s*buttons?/.test(normalized) || /pushbuttons?/.test(normalized) || /tact(?:ile)?\s+switch(?:es)?/.test(normalized) || /keyboard\s+(?:switch(?:es)?|shaft)/.test(normalized) || /mechanical\s+keyboard\s+shaft/.test(normalized) || /\bkey[-_\s]+(?:th|smd)(?:\b|[_-])/.test(normalized);
|
|
329092
329166
|
}
|
|
329093
329167
|
if (Array.isArray(value)) {
|
|
329094
329168
|
return value.some(categoryValueContainsPushbutton);
|
|
@@ -329102,10 +329176,14 @@ var isPushbuttonCategoryComponent = (betterEasy) => {
|
|
|
329102
329176
|
const cPara = betterEasy.dataStr.head.c_para;
|
|
329103
329177
|
return [
|
|
329104
329178
|
betterEasy.tags,
|
|
329179
|
+
betterEasy.title,
|
|
329180
|
+
betterEasy.description,
|
|
329105
329181
|
cPara.category,
|
|
329106
329182
|
cPara.Category,
|
|
329107
329183
|
cPara["LCSC Category"],
|
|
329108
329184
|
cPara["JLCPCB Category"],
|
|
329185
|
+
cPara.package,
|
|
329186
|
+
cPara.pre,
|
|
329109
329187
|
betterEasy.category
|
|
329110
329188
|
].some(categoryValueContainsPushbutton);
|
|
329111
329189
|
};
|
|
@@ -329516,7 +329594,7 @@ var getGeneratedComponentType = (betterEasy, pinCount) => {
|
|
|
329516
329594
|
return "capacitor";
|
|
329517
329595
|
if (isResistorComponent(betterEasy) && pinCount === 2)
|
|
329518
329596
|
return "resistor";
|
|
329519
|
-
if (isInductorComponent(betterEasy))
|
|
329597
|
+
if (isInductorComponent(betterEasy) && pinCount === 2)
|
|
329520
329598
|
return "inductor";
|
|
329521
329599
|
if (isCrystalComponent(betterEasy))
|
|
329522
329600
|
return "crystal";
|
|
@@ -329589,8 +329667,9 @@ var convertBetterEasyToTsx = async ({
|
|
|
329589
329667
|
const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : undefined;
|
|
329590
329668
|
const crystalPinVariant = componentType !== "crystal" ? undefined : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : undefined;
|
|
329591
329669
|
const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
|
|
329670
|
+
const isMultiPinInductor = isInductorComponent(betterEasy) && sourcePorts.length !== 2;
|
|
329592
329671
|
const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
|
|
329593
|
-
const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx2(betterEasy, circuitJson, {
|
|
329672
|
+
const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && !isMultiPinInductor && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx2(betterEasy, circuitJson, {
|
|
329594
329673
|
alignPortsToDrawing: isPassiveWithCustomSymbol
|
|
329595
329674
|
}) : undefined;
|
|
329596
329675
|
return generateTypescriptComponent({
|
|
@@ -329951,7 +330030,7 @@ var __export5 = (target, all) => {
|
|
|
329951
330030
|
};
|
|
329952
330031
|
var dist_exports2 = {};
|
|
329953
330032
|
__export5(dist_exports2, {
|
|
329954
|
-
all_layers: () =>
|
|
330033
|
+
all_layers: () => all_layers4,
|
|
329955
330034
|
any_circuit_element: () => any_circuit_element2,
|
|
329956
330035
|
any_soup_element: () => any_soup_element5,
|
|
329957
330036
|
any_source_component: () => any_source_component2,
|
|
@@ -329989,7 +330068,7 @@ __export5(dist_exports2, {
|
|
|
329989
330068
|
kicadSymbolProperties: () => kicadSymbolProperties3,
|
|
329990
330069
|
kicadSymbolProperty: () => kicadSymbolProperty3,
|
|
329991
330070
|
layer_ref: () => layer_ref3,
|
|
329992
|
-
layer_string: () =>
|
|
330071
|
+
layer_string: () => layer_string3,
|
|
329993
330072
|
length: () => length69,
|
|
329994
330073
|
manufacturing_drc_properties: () => manufacturing_drc_properties2,
|
|
329995
330074
|
ms: () => ms7,
|
|
@@ -331168,7 +331247,7 @@ var source_pcb_ground_plane2 = z622.object({
|
|
|
331168
331247
|
subcircuit_id: z622.string().optional()
|
|
331169
331248
|
}).describe("Defines a ground plane in the source domain");
|
|
331170
331249
|
expectTypesMatch3(true);
|
|
331171
|
-
var
|
|
331250
|
+
var all_layers4 = [
|
|
331172
331251
|
"top",
|
|
331173
331252
|
"bottom",
|
|
331174
331253
|
"inner1",
|
|
@@ -331178,9 +331257,9 @@ var all_layers3 = [
|
|
|
331178
331257
|
"inner5",
|
|
331179
331258
|
"inner6"
|
|
331180
331259
|
];
|
|
331181
|
-
var
|
|
331182
|
-
var layer_ref3 =
|
|
331183
|
-
name:
|
|
331260
|
+
var layer_string3 = z632.enum(all_layers4);
|
|
331261
|
+
var layer_ref3 = layer_string3.or(z632.object({
|
|
331262
|
+
name: layer_string3
|
|
331184
331263
|
})).transform((layer) => {
|
|
331185
331264
|
if (typeof layer === "string") {
|
|
331186
331265
|
return layer;
|
|
@@ -335367,7 +335446,7 @@ var handleSilkscreenPath2 = (track, index) => {
|
|
|
335367
335446
|
type: "pcb_silkscreen_path",
|
|
335368
335447
|
pcb_silkscreen_path_id: `pcb_silkscreen_path_${index + 1}`,
|
|
335369
335448
|
pcb_component_id: "pcb_component_1",
|
|
335370
|
-
layer:
|
|
335449
|
+
layer: getSideFromLayer2(track.layer),
|
|
335371
335450
|
route: track.points.map((point22) => ({
|
|
335372
335451
|
x: milx102(point22.x),
|
|
335373
335452
|
y: milx102(point22.y)
|
|
@@ -335377,6 +335456,18 @@ var handleSilkscreenPath2 = (track, index) => {
|
|
|
335377
335456
|
};
|
|
335378
335457
|
var isCourtyardLayer2 = (layer) => layer === 13 || layer === 14 || layer === 15;
|
|
335379
335458
|
var isSilkscreenLayer2 = (layer) => layer === 3 || layer === 4;
|
|
335459
|
+
var isDocumentLayer2 = (layer) => layer === 12;
|
|
335460
|
+
var handleFabricationNotePath2 = (track, index) => pcb_fabrication_note_path2.parse({
|
|
335461
|
+
type: "pcb_fabrication_note_path",
|
|
335462
|
+
pcb_fabrication_note_path_id: `pcb_fabrication_note_path_${index + 1}`,
|
|
335463
|
+
pcb_component_id: "pcb_component_1",
|
|
335464
|
+
layer: "top",
|
|
335465
|
+
route: track.points.map((point22) => ({
|
|
335466
|
+
x: mil10ToMm2(point22.x),
|
|
335467
|
+
y: mil10ToMm2(point22.y)
|
|
335468
|
+
})),
|
|
335469
|
+
stroke_width: mil10ToMm2(track.width)
|
|
335470
|
+
});
|
|
335380
335471
|
var getSideFromLayer2 = (layer) => {
|
|
335381
335472
|
if (layer === 4 || layer === 14)
|
|
335382
335473
|
return "bottom";
|
|
@@ -335574,7 +335665,7 @@ var convertEasyEdaJsonToCircuitJson2 = (easyEdaJson, {
|
|
|
335574
335665
|
pcb_plated_hole_id: platedHoleId,
|
|
335575
335666
|
x: mil2mm2(pad2.center.x),
|
|
335576
335667
|
y: mil2mm2(pad2.center.y),
|
|
335577
|
-
layers: ["top"],
|
|
335668
|
+
layers: ["top", "bottom"],
|
|
335578
335669
|
port_hints: pcbPortHints,
|
|
335579
335670
|
pcb_component_id: "pcb_component_1",
|
|
335580
335671
|
pcb_port_id: `pcb_port_${index + 1}`
|
|
@@ -335699,8 +335790,10 @@ var convertEasyEdaJsonToCircuitJson2 = (easyEdaJson, {
|
|
|
335699
335790
|
let hasFoundDesignator = false;
|
|
335700
335791
|
easyEdaJson.packageDetail.dataStr.shape.forEach((shape, index) => {
|
|
335701
335792
|
if (shape.type === "TRACK") {
|
|
335702
|
-
if (
|
|
335793
|
+
if (isSilkscreenLayer2(shape.layer)) {
|
|
335703
335794
|
circuitElements.push(handleSilkscreenPath2(shape, index));
|
|
335795
|
+
} else if (isDocumentLayer2(shape.layer)) {
|
|
335796
|
+
circuitElements.push(handleFabricationNotePath2(shape, index));
|
|
335704
335797
|
}
|
|
335705
335798
|
} else if (shape.type === "CIRCLE") {
|
|
335706
335799
|
if (isSilkscreenLayer2(shape.layer)) {
|
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.
|
|
65760
|
+
var version = "0.1.1957";
|
|
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.
|
|
65821
|
+
easyeda: "^0.0.315",
|
|
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.
|
|
3
|
+
"version": "0.1.1958",
|
|
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.
|
|
61
|
+
"easyeda": "^0.0.315",
|
|
62
62
|
"fuse.js": "^7.1.0",
|
|
63
63
|
"get-port": "^7.1.0",
|
|
64
64
|
"globby": "^14.1.0",
|