@tscircuit/cli 0.1.2181 → 0.1.2182
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 +60 -10
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
package/dist/cli/main.js
CHANGED
|
@@ -154298,7 +154298,7 @@ var import_perfect_cli = __toESM3(require_dist3(), 1);
|
|
|
154298
154298
|
// lib/getVersion.ts
|
|
154299
154299
|
import { createRequire as createRequire2 } from "node:module";
|
|
154300
154300
|
// package.json
|
|
154301
|
-
var version = "0.1.
|
|
154301
|
+
var version = "0.1.2181";
|
|
154302
154302
|
var package_default = {
|
|
154303
154303
|
name: "@tscircuit/cli",
|
|
154304
154304
|
version,
|
|
@@ -154348,7 +154348,7 @@ var package_default = {
|
|
|
154348
154348
|
"circuit-json-to-bom-csv": "^0.0.19",
|
|
154349
154349
|
"circuit-json-to-connectivity-map": "^0.0.25",
|
|
154350
154350
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
154351
|
-
"circuit-json-to-footprinter": "^0.0.
|
|
154351
|
+
"circuit-json-to-footprinter": "^0.0.58",
|
|
154352
154352
|
"circuit-json-to-gerber": "^0.0.105",
|
|
154353
154353
|
"circuit-json-to-kicad": "0.0.212",
|
|
154354
154354
|
"circuit-json-to-pnp-csv": "^0.0.18",
|
|
@@ -341342,7 +341342,18 @@ var getGeometryLoss = (candidate, target) => {
|
|
|
341342
341342
|
return loss / pairs.length;
|
|
341343
341343
|
};
|
|
341344
341344
|
var getGeometryScore = (candidate, target) => 1 / (1 + getGeometryLoss(candidate, target));
|
|
341345
|
+
var hasMiniMelfPackageHint = (target) => /(?:^|[^a-z0-9])(?:mini[\s-]*melf|sod[\s-]*80)(?=$|[^a-z0-9])/i.test(`${target.title} ${target.subtitle} ${target.sourceHints?.join(" ") ?? ""}`);
|
|
341346
|
+
var hasTssopPackageHint = (target, pinCount) => {
|
|
341347
|
+
const description = `${target.title} ${target.subtitle} ${target.sourceHints?.join(" ") ?? ""}`;
|
|
341348
|
+
const matches = [
|
|
341349
|
+
...description.matchAll(/(?:^|[^a-z0-9])(htssop|tssop|ssop|vssop|msop|qsop|soic|sop|sot|dfn|qfn|lqfn|lga|qfp|lqfp|tqfp|bga)(?=\d|[^a-z0-9]|$)(?:[-_ ]?(\d+))?/gi)
|
|
341350
|
+
];
|
|
341351
|
+
return matches.length > 0 && matches.every((match) => /^(?:h)?tssop$/i.test(match[1]) && (!match[2] || Number(match[2]) === pinCount));
|
|
341352
|
+
};
|
|
341345
341353
|
var getDomainScore = (target, family) => {
|
|
341354
|
+
if ((family === "minimelf" || family === "sod80") && hasMiniMelfPackageHint(target)) {
|
|
341355
|
+
return 2;
|
|
341356
|
+
}
|
|
341346
341357
|
const description = `${target.title} ${target.subtitle} ${target.sourceHints?.join(" ") ?? ""}`.toLowerCase();
|
|
341347
341358
|
const normalizedDescription = description.replace(/[^a-z0-9]+/g, "");
|
|
341348
341359
|
const aliases = {
|
|
@@ -341574,6 +341585,9 @@ var getPreferredFamilies = (target, analysis) => {
|
|
|
341574
341585
|
return /* @__PURE__ */ new Set(["jst"]);
|
|
341575
341586
|
if (isLed2835Target(target, analysis))
|
|
341576
341587
|
return /* @__PURE__ */ new Set(["led2835"]);
|
|
341588
|
+
if (analysis.twoPadSmd && hasMiniMelfPackageHint(target)) {
|
|
341589
|
+
return /* @__PURE__ */ new Set(["minimelf", "sod80"]);
|
|
341590
|
+
}
|
|
341577
341591
|
if (analysis.potentiometer)
|
|
341578
341592
|
return /* @__PURE__ */ new Set(["potentiometer"]);
|
|
341579
341593
|
if (analysis.fpc)
|
|
@@ -341800,9 +341814,16 @@ var getStaggeredSmdPinHeaderSeed = (target) => {
|
|
|
341800
341814
|
}
|
|
341801
341815
|
return;
|
|
341802
341816
|
};
|
|
341803
|
-
var
|
|
341804
|
-
const
|
|
341805
|
-
|
|
341817
|
+
var getTwoSidedSeed = (target, family, thermalPad) => {
|
|
341818
|
+
const allPads = getPadGeometries(target);
|
|
341819
|
+
const thermalEntry = thermalPad ? allPads.find(({ copper }) => {
|
|
341820
|
+
const bounds = getPadBounds3(copper);
|
|
341821
|
+
return Math.abs(bounds.width - thermalPad.width) < 0.000001 && Math.abs(bounds.height - thermalPad.height) < 0.000001;
|
|
341822
|
+
}) : undefined;
|
|
341823
|
+
if (thermalPad && !thermalEntry)
|
|
341824
|
+
return;
|
|
341825
|
+
const pads = allPads.filter((pad) => pad !== thermalEntry);
|
|
341826
|
+
if (pads.length < 4 || pads.length % 2 !== 0 || pads.some(({ copper, drill, element }) => element.type !== "pcb_smtpad" || drill || copper.shape !== "rect" && !(family === "tssop" && copper.shape === "pill"))) {
|
|
341806
341827
|
return;
|
|
341807
341828
|
}
|
|
341808
341829
|
for (const [crossAxis, alongAxis] of [
|
|
@@ -341840,8 +341861,21 @@ var getTwoSidedDfnSeed = (target) => {
|
|
|
341840
341861
|
if (pitch <= padWidth || pitches.some((candidate) => Math.abs(candidate - pitch) > tolerance)) {
|
|
341841
341862
|
continue;
|
|
341842
341863
|
}
|
|
341843
|
-
const
|
|
341844
|
-
|
|
341864
|
+
const rowDistance = Math.abs(crossCoordinates[1] - crossCoordinates[0]);
|
|
341865
|
+
const width = family === "dfn" ? rowDistance + padLength : rowDistance - padLength + (pitch <= 0.5 ? 0.15 : 0);
|
|
341866
|
+
if (width <= 0)
|
|
341867
|
+
continue;
|
|
341868
|
+
let seed = `${family}${pads.length}_p${formatPreciseLength(pitch)}_w${formatPreciseLength(width)}_pw${formatPreciseLength(padWidth)}_pl${formatPreciseLength(padLength)}`;
|
|
341869
|
+
if (family === "tssop") {
|
|
341870
|
+
const radius = median(pads.map(({ copper }) => copper.shape === "pill" ? Math.min(copper.width, copper.height) / 2 : copper.cornerRadius ?? 0));
|
|
341871
|
+
seed += `_rounded${formatPreciseLength(radius)}`;
|
|
341872
|
+
}
|
|
341873
|
+
if (thermalPad) {
|
|
341874
|
+
const width2 = crossAxis === "x" ? thermalPad.width : thermalPad.height;
|
|
341875
|
+
const height = crossAxis === "x" ? thermalPad.height : thermalPad.width;
|
|
341876
|
+
seed += `_thermalpad${formatPreciseLength(width2)}x${formatPreciseLength(height)}`;
|
|
341877
|
+
}
|
|
341878
|
+
return seed;
|
|
341845
341879
|
}
|
|
341846
341880
|
return;
|
|
341847
341881
|
};
|
|
@@ -341899,9 +341933,14 @@ var generateSeeds = (target, analysis) => {
|
|
|
341899
341933
|
const staggeredSmdPinHeaderSeed = getStaggeredSmdPinHeaderSeed(target);
|
|
341900
341934
|
if (staggeredSmdPinHeaderSeed)
|
|
341901
341935
|
seeds.add(staggeredSmdPinHeaderSeed);
|
|
341902
|
-
const twoSidedDfnSeed =
|
|
341936
|
+
const twoSidedDfnSeed = getTwoSidedSeed(target, "dfn");
|
|
341903
341937
|
if (twoSidedDfnSeed)
|
|
341904
341938
|
seeds.add(twoSidedDfnSeed);
|
|
341939
|
+
if (hasTssopPackageHint(target, analysis.perimeterPadCount)) {
|
|
341940
|
+
const tssopSeed = getTwoSidedSeed(target, "tssop", analysis.thermalPad);
|
|
341941
|
+
if (tssopSeed)
|
|
341942
|
+
seeds.add(tssopSeed);
|
|
341943
|
+
}
|
|
341905
341944
|
const twoLeadThermalQfnSeed = getTwoLeadThermalQfnSeed(target, analysis);
|
|
341906
341945
|
if (twoLeadThermalQfnSeed)
|
|
341907
341946
|
seeds.add(twoLeadThermalQfnSeed);
|
|
@@ -341923,6 +341962,16 @@ var generateSeeds = (target, analysis) => {
|
|
|
341923
341962
|
const { padHeight, pin1Offset, pin1Width, pin2Offset, pin2Width } = analysis.twoPadSmd;
|
|
341924
341963
|
const pitch = Math.abs(pin2Offset - pin1Offset);
|
|
341925
341964
|
const padWidth = median([pin1Width, pin2Width]);
|
|
341965
|
+
if (hasMiniMelfPackageHint(target)) {
|
|
341966
|
+
for (const family of ["minimelf", "sod80"]) {
|
|
341967
|
+
seeds.add([
|
|
341968
|
+
family,
|
|
341969
|
+
`p${formatPreciseLength(pitch)}`,
|
|
341970
|
+
`pl${formatPreciseLength(padWidth)}`,
|
|
341971
|
+
`pw${formatPreciseLength(padHeight)}`
|
|
341972
|
+
].join("_"));
|
|
341973
|
+
}
|
|
341974
|
+
}
|
|
341926
341975
|
for (const family of PARAMETRIC_TWO_PAD_FAMILIES) {
|
|
341927
341976
|
const parameters = [
|
|
341928
341977
|
family,
|
|
@@ -342258,7 +342307,7 @@ var generateSeeds = (target, analysis) => {
|
|
|
342258
342307
|
const familySeed = `${family}${analysis.perimeterPadCount}${quadSidePinSuffix ? `_${quadSidePinSuffix}` : ""}`;
|
|
342259
342308
|
const addThermalPadSeed = (seed) => {
|
|
342260
342309
|
seeds.add(seed);
|
|
342261
|
-
if (family !== "qfn" || !analysis.thermalViaGrid)
|
|
342310
|
+
if (family !== "qfn" && family !== "dfn" || !analysis.thermalViaGrid)
|
|
342262
342311
|
return;
|
|
342263
342312
|
const { columns, holeDiameter, outerDiameter, pitch, rows } = analysis.thermalViaGrid;
|
|
342264
342313
|
const gridOptions = /* @__PURE__ */ new Set([
|
|
@@ -342338,7 +342387,8 @@ var selectSeedsToOptimize = (candidates, analysis, target) => {
|
|
|
342338
342387
|
const selectedShapeFamilies = /* @__PURE__ */ new Set;
|
|
342339
342388
|
if (analysis.thermalPad) {
|
|
342340
342389
|
const selectedThermalPadFamilies = /* @__PURE__ */ new Set;
|
|
342341
|
-
|
|
342390
|
+
const thermalPadCandidates = analysis.thermalViaGrid ? candidates.toSorted((left, right) => Number(right.footprint.vias.length > 0) - Number(left.footprint.vias.length > 0)) : candidates;
|
|
342391
|
+
for (const candidate of thermalPadCandidates) {
|
|
342342
342392
|
const isQuarterTurn = candidate.searchRotation === 90 || candidate.searchRotation === 270;
|
|
342343
342393
|
const sourceWidth = isQuarterTurn ? analysis.thermalPad.height : analysis.thermalPad.width;
|
|
342344
342394
|
const sourceHeight = isQuarterTurn ? analysis.thermalPad.width : analysis.thermalPad.height;
|
package/dist/lib/index.js
CHANGED
|
@@ -69109,7 +69109,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
69109
69109
|
}));
|
|
69110
69110
|
};
|
|
69111
69111
|
// package.json
|
|
69112
|
-
var version = "0.1.
|
|
69112
|
+
var version = "0.1.2181";
|
|
69113
69113
|
var package_default = {
|
|
69114
69114
|
name: "@tscircuit/cli",
|
|
69115
69115
|
version,
|
|
@@ -69159,7 +69159,7 @@ var package_default = {
|
|
|
69159
69159
|
"circuit-json-to-bom-csv": "^0.0.19",
|
|
69160
69160
|
"circuit-json-to-connectivity-map": "^0.0.25",
|
|
69161
69161
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
69162
|
-
"circuit-json-to-footprinter": "^0.0.
|
|
69162
|
+
"circuit-json-to-footprinter": "^0.0.58",
|
|
69163
69163
|
"circuit-json-to-gerber": "^0.0.105",
|
|
69164
69164
|
"circuit-json-to-kicad": "0.0.212",
|
|
69165
69165
|
"circuit-json-to-pnp-csv": "^0.0.18",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2182",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tscircuit/cli"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"circuit-json-to-bom-csv": "^0.0.19",
|
|
48
48
|
"circuit-json-to-connectivity-map": "^0.0.25",
|
|
49
49
|
"circuit-json-to-fdm-component-box": "^0.0.2",
|
|
50
|
-
"circuit-json-to-footprinter": "^0.0.
|
|
50
|
+
"circuit-json-to-footprinter": "^0.0.58",
|
|
51
51
|
"circuit-json-to-gerber": "^0.0.105",
|
|
52
52
|
"circuit-json-to-kicad": "0.0.212",
|
|
53
53
|
"circuit-json-to-pnp-csv": "^0.0.18",
|