@tscircuit/cli 0.1.1334 → 0.1.1335
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 +37 -26
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
package/dist/cli/main.js
CHANGED
|
@@ -100574,7 +100574,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
100574
100574
|
// lib/getVersion.ts
|
|
100575
100575
|
import { createRequire as createRequire2 } from "node:module";
|
|
100576
100576
|
// package.json
|
|
100577
|
-
var version = "0.1.
|
|
100577
|
+
var version = "0.1.1334";
|
|
100578
100578
|
var package_default = {
|
|
100579
100579
|
name: "@tscircuit/cli",
|
|
100580
100580
|
version,
|
|
@@ -100588,7 +100588,7 @@ var package_default = {
|
|
|
100588
100588
|
"@biomejs/biome": "^1.9.4",
|
|
100589
100589
|
"@tscircuit/circuit-json-placement-analysis": "^0.0.6",
|
|
100590
100590
|
"@tscircuit/circuit-json-routing-analysis": "^0.0.1",
|
|
100591
|
-
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#
|
|
100591
|
+
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#8e3b4dc434d342f6b9833777107fc66515d1480b",
|
|
100592
100592
|
"@tscircuit/fake-snippets": "^0.0.182",
|
|
100593
100593
|
"@tscircuit/file-server": "^0.0.32",
|
|
100594
100594
|
"@tscircuit/image-utils": "^0.0.3",
|
|
@@ -241463,7 +241463,7 @@ var generateCapacitorOrientationIssues = (componentPlacements, circuitJson) => {
|
|
|
241463
241463
|
var SCHEMATIC_BOX_TOO_WIDE_MESSAGE = "Shrink schematic box width";
|
|
241464
241464
|
var SCHEMATIC_PIN_PADDING_TO_EDGE_TOO_LARGE_MESSAGE = "Move schematic pins closer to the box edge or change the schematic box";
|
|
241465
241465
|
var PIN_HEADER_SCHEMATIC_BOX_SIZING_MAX_ALLOWED_GAP = 0.1;
|
|
241466
|
-
var
|
|
241466
|
+
var GENERIC_SCHEMATIC_BOX_SIZING_MAX_ALLOWED_GAP = 1;
|
|
241467
241467
|
var PIN_LABEL_EDGE_PADDING = 0.1;
|
|
241468
241468
|
var PIN_NAME_CHARACTER_WIDTH = 0.095;
|
|
241469
241469
|
var FALLBACK_CHARACTER_WIDTH = 0.13;
|
|
@@ -241601,16 +241601,24 @@ var getMaxAllowedPinPadding = (input) => {
|
|
|
241601
241601
|
const edgeAxisSides = isHorizontalSide(input.edgeSide) ? ["left", "right"] : ["top", "bottom"];
|
|
241602
241602
|
return (input.maxLabelLengthBySide[edgeAxisSides[0]] + input.maxLabelLengthBySide[edgeAxisSides[1]] + input.spacing) / 2;
|
|
241603
241603
|
};
|
|
241604
|
-
var createPinPaddingToEdgeIssue = (candidate) =>
|
|
241605
|
-
|
|
241606
|
-
|
|
241607
|
-
|
|
241608
|
-
|
|
241609
|
-
|
|
241610
|
-
|
|
241611
|
-
|
|
241612
|
-
|
|
241613
|
-
|
|
241604
|
+
var createPinPaddingToEdgeIssue = (candidate) => {
|
|
241605
|
+
const excessPadding = Math.max(0, candidate.measuredPadding - candidate.maxAllowedPadding);
|
|
241606
|
+
const widthReduction = excessPadding * 2;
|
|
241607
|
+
const heightReduction = excessPadding * 2;
|
|
241608
|
+
return {
|
|
241609
|
+
lineItemType: "SchematicPinPaddingToEdgeTooLarge",
|
|
241610
|
+
pinSide: candidate.pinSide,
|
|
241611
|
+
edgeSide: candidate.edgeSide,
|
|
241612
|
+
pinName: candidate.pinName,
|
|
241613
|
+
schematicBox: candidate.schematicBox,
|
|
241614
|
+
measuredPadding: candidate.measuredPadding,
|
|
241615
|
+
maxAllowedPadding: candidate.maxAllowedPadding,
|
|
241616
|
+
excessPadding,
|
|
241617
|
+
suggestedSchWidth: isHorizontalSide(candidate.pinSide) ? undefined : Math.max(0, candidate.schematicBox.width - widthReduction),
|
|
241618
|
+
suggestedSchHeight: isHorizontalSide(candidate.pinSide) ? Math.max(0, candidate.schematicBox.height - heightReduction) : undefined,
|
|
241619
|
+
message: isHorizontalSide(candidate.pinSide) ? `${SCHEMATIC_PIN_PADDING_TO_EDGE_TOO_LARGE_MESSAGE} height` : `${SCHEMATIC_PIN_PADDING_TO_EDGE_TOO_LARGE_MESSAGE} width`
|
|
241620
|
+
};
|
|
241621
|
+
};
|
|
241614
241622
|
var generateSchematicPinPaddingToEdgeCandidates = (componentPlacements, circuitJson) => {
|
|
241615
241623
|
const placementBySchematicComponentId = getPlacementBySchematicComponentId(componentPlacements);
|
|
241616
241624
|
const schematicComponentById = getSchematicComponentById(circuitJson);
|
|
@@ -241688,18 +241696,18 @@ var getInnerLabelEdge = (bounds, labelColumn) => {
|
|
|
241688
241696
|
};
|
|
241689
241697
|
var getSuggestedWidth = (input) => input.currentWidth - input.measuredInnerLabelHorizontalEmptySpace + input.maxAllowedInnerLabelHorizontalEmptySpace;
|
|
241690
241698
|
var createPinHeaderIssue = (input) => ({
|
|
241691
|
-
lineItemType: "
|
|
241699
|
+
lineItemType: "PinHeaderSchematicBoxTooWide",
|
|
241692
241700
|
schematicBox: input.schematicBox,
|
|
241693
241701
|
measuredInnerLabelHorizontalEmptySpace: input.measuredInnerLabelHorizontalEmptySpace,
|
|
241694
241702
|
maxAllowedInnerLabelHorizontalEmptySpace: PIN_HEADER_SCHEMATIC_BOX_SIZING_MAX_ALLOWED_GAP,
|
|
241695
241703
|
suggestedSchWidth: input.suggestedSchWidth,
|
|
241696
241704
|
message: SCHEMATIC_BOX_TOO_WIDE_MESSAGE
|
|
241697
241705
|
});
|
|
241698
|
-
var
|
|
241699
|
-
lineItemType: "
|
|
241706
|
+
var createGenericIssue = (input) => ({
|
|
241707
|
+
lineItemType: "GenericSchematicBoxTooWide",
|
|
241700
241708
|
schematicBox: input.schematicBox,
|
|
241701
241709
|
measuredInnerLabelHorizontalEmptySpace: input.measuredInnerLabelHorizontalEmptySpace,
|
|
241702
|
-
maxAllowedInnerLabelHorizontalEmptySpace:
|
|
241710
|
+
maxAllowedInnerLabelHorizontalEmptySpace: GENERIC_SCHEMATIC_BOX_SIZING_MAX_ALLOWED_GAP,
|
|
241703
241711
|
suggestedSchWidth: input.suggestedSchWidth,
|
|
241704
241712
|
message: SCHEMATIC_BOX_TOO_WIDE_MESSAGE
|
|
241705
241713
|
});
|
|
@@ -241745,7 +241753,7 @@ var generateSchematicBoxWidthSizingCandidates = (componentPlacements, circuitJso
|
|
|
241745
241753
|
}
|
|
241746
241754
|
return candidates;
|
|
241747
241755
|
};
|
|
241748
|
-
var
|
|
241756
|
+
var getPinHeaderSchematicBoxTooWideIssues = (candidates) => candidates.filter((candidate) => candidate.sourceComponentFtype === "simple_pin_header").filter((candidate) => exceedsMaxAllowedGap(candidate.measuredInnerLabelHorizontalEmptySpace, PIN_HEADER_SCHEMATIC_BOX_SIZING_MAX_ALLOWED_GAP)).map((candidate) => createPinHeaderIssue({
|
|
241749
241757
|
schematicBox: candidate.schematicBox,
|
|
241750
241758
|
measuredInnerLabelHorizontalEmptySpace: candidate.measuredInnerLabelHorizontalEmptySpace,
|
|
241751
241759
|
suggestedSchWidth: getSuggestedWidth({
|
|
@@ -241754,17 +241762,17 @@ var getSchematicBoxTooWideForPinHeaderIssues = (candidates) => candidates.filter
|
|
|
241754
241762
|
currentWidth: candidate.schematicBox.width
|
|
241755
241763
|
})
|
|
241756
241764
|
}));
|
|
241757
|
-
var
|
|
241765
|
+
var getGenericSchematicBoxTooWideIssues = (candidates) => candidates.filter((candidate) => candidate.sourceComponentFtype !== "simple_pin_header").filter((candidate) => exceedsMaxAllowedGap(candidate.measuredInnerLabelHorizontalEmptySpace, GENERIC_SCHEMATIC_BOX_SIZING_MAX_ALLOWED_GAP)).map((candidate) => createGenericIssue({
|
|
241758
241766
|
schematicBox: candidate.schematicBox,
|
|
241759
241767
|
measuredInnerLabelHorizontalEmptySpace: candidate.measuredInnerLabelHorizontalEmptySpace,
|
|
241760
241768
|
suggestedSchWidth: getSuggestedWidth({
|
|
241761
241769
|
measuredInnerLabelHorizontalEmptySpace: candidate.measuredInnerLabelHorizontalEmptySpace,
|
|
241762
|
-
maxAllowedInnerLabelHorizontalEmptySpace:
|
|
241770
|
+
maxAllowedInnerLabelHorizontalEmptySpace: GENERIC_SCHEMATIC_BOX_SIZING_MAX_ALLOWED_GAP,
|
|
241763
241771
|
currentWidth: candidate.schematicBox.width
|
|
241764
241772
|
})
|
|
241765
241773
|
}));
|
|
241766
|
-
var
|
|
241767
|
-
var
|
|
241774
|
+
var generatePinHeaderSchematicBoxTooWideIssues = (componentPlacements, circuitJson) => getPinHeaderSchematicBoxTooWideIssues(generateSchematicBoxWidthSizingCandidates(componentPlacements, circuitJson));
|
|
241775
|
+
var generateGenericSchematicBoxTooWideIssues = (componentPlacements, circuitJson) => getGenericSchematicBoxTooWideIssues(generateSchematicBoxWidthSizingCandidates(componentPlacements, circuitJson));
|
|
241768
241776
|
// node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/analyzers/schematic-box-overlap.ts
|
|
241769
241777
|
var getCenteredRectBounds2 = (box2) => {
|
|
241770
241778
|
const halfWidth = box2.width / 2;
|
|
@@ -242043,6 +242051,9 @@ var schematicPinPaddingToEdgeTooLargeIssueToString = (issue) => {
|
|
|
242043
242051
|
addAttr(attrs, "pinName", issue.pinName);
|
|
242044
242052
|
addAttr(attrs, "measuredPadding", issue.measuredPadding);
|
|
242045
242053
|
addAttr(attrs, "maxAllowedPadding", issue.maxAllowedPadding);
|
|
242054
|
+
addAttr(attrs, "excessPadding", issue.excessPadding);
|
|
242055
|
+
addAttr(attrs, "suggestedSchWidth", issue.suggestedSchWidth);
|
|
242056
|
+
addAttr(attrs, "suggestedSchHeight", issue.suggestedSchHeight);
|
|
242046
242057
|
return `<SchematicPinPaddingToEdgeTooLarge ${attrs.join(" ")} />`;
|
|
242047
242058
|
};
|
|
242048
242059
|
var correctionSuggestionToString = (suggestion) => {
|
|
@@ -242088,8 +242099,8 @@ class SchematicPlacementAnalysis {
|
|
|
242088
242099
|
return capacitorSymbolHorizontalIssueToString(issue);
|
|
242089
242100
|
case "VerboseSchematicNetLabel":
|
|
242090
242101
|
return verboseSchematicNetLabelIssueToString(issue);
|
|
242091
|
-
case "
|
|
242092
|
-
case "
|
|
242102
|
+
case "PinHeaderSchematicBoxTooWide":
|
|
242103
|
+
case "GenericSchematicBoxTooWide":
|
|
242093
242104
|
return schematicBoxTooWideIssueToString(issue);
|
|
242094
242105
|
case "SchematicPinPaddingToEdgeTooLarge":
|
|
242095
242106
|
return schematicPinPaddingToEdgeTooLargeIssueToString(issue);
|
|
@@ -242114,8 +242125,8 @@ var analyzeSchematicPlacement = (circuitJson) => {
|
|
|
242114
242125
|
...generateSchematicPlacementIssues(lineItems),
|
|
242115
242126
|
...generateCapacitorOrientationIssues(lineItems, circuitJson),
|
|
242116
242127
|
...generateVerboseNetLabelIssues(circuitJson),
|
|
242117
|
-
...
|
|
242118
|
-
...
|
|
242128
|
+
...generatePinHeaderSchematicBoxTooWideIssues(lineItems, circuitJson),
|
|
242129
|
+
...generateGenericSchematicBoxTooWideIssues(lineItems, circuitJson),
|
|
242119
242130
|
...generateSchematicPinPaddingToEdgeTooLargeIssues(lineItems, circuitJson)
|
|
242120
242131
|
];
|
|
242121
242132
|
return new SchematicPlacementAnalysis([
|
package/dist/lib/index.js
CHANGED
|
@@ -65661,7 +65661,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
65661
65661
|
}));
|
|
65662
65662
|
};
|
|
65663
65663
|
// package.json
|
|
65664
|
-
var version = "0.1.
|
|
65664
|
+
var version = "0.1.1334";
|
|
65665
65665
|
var package_default = {
|
|
65666
65666
|
name: "@tscircuit/cli",
|
|
65667
65667
|
version,
|
|
@@ -65675,7 +65675,7 @@ var package_default = {
|
|
|
65675
65675
|
"@biomejs/biome": "^1.9.4",
|
|
65676
65676
|
"@tscircuit/circuit-json-placement-analysis": "^0.0.6",
|
|
65677
65677
|
"@tscircuit/circuit-json-routing-analysis": "^0.0.1",
|
|
65678
|
-
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#
|
|
65678
|
+
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#8e3b4dc434d342f6b9833777107fc66515d1480b",
|
|
65679
65679
|
"@tscircuit/fake-snippets": "^0.0.182",
|
|
65680
65680
|
"@tscircuit/file-server": "^0.0.32",
|
|
65681
65681
|
"@tscircuit/image-utils": "^0.0.3",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1335",
|
|
4
4
|
"main": "dist/cli/main.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/cli/main.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@biomejs/biome": "^1.9.4",
|
|
12
12
|
"@tscircuit/circuit-json-placement-analysis": "^0.0.6",
|
|
13
13
|
"@tscircuit/circuit-json-routing-analysis": "^0.0.1",
|
|
14
|
-
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#
|
|
14
|
+
"@tscircuit/circuit-json-schematic-placement-analysis": "github:tscircuit/circuit-json-schematic-placement-analysis#8e3b4dc434d342f6b9833777107fc66515d1480b",
|
|
15
15
|
"@tscircuit/fake-snippets": "^0.0.182",
|
|
16
16
|
"@tscircuit/file-server": "^0.0.32",
|
|
17
17
|
"@tscircuit/image-utils": "^0.0.3",
|