circuit-json-to-tscircuit 0.0.30 → 0.0.31
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.
|
@@ -5,6 +5,10 @@ import { su } from "@tscircuit/soup-util";
|
|
|
5
5
|
import { mmStr } from "@tscircuit/mm";
|
|
6
6
|
var escapeJsxText = (value) => String(value ?? "").replace(/"/g, '\\"');
|
|
7
7
|
var formatMm = (value) => mmStr(value ?? 0);
|
|
8
|
+
var formatOptionalMmAttr = (attrName, value) => {
|
|
9
|
+
if (value === void 0) return "";
|
|
10
|
+
return ` ${attrName}="${mmStr(value)}"`;
|
|
11
|
+
};
|
|
8
12
|
var formatPcbRotationAttr = (rotation, attrName = "pcbRotation") => {
|
|
9
13
|
if (rotation === void 0) return "";
|
|
10
14
|
const formatted = typeof rotation === "number" ? `${rotation}deg` : rotation;
|
|
@@ -371,10 +375,6 @@ var convertNotes = (circuitJson) => {
|
|
|
371
375
|
// lib/generate-footprint-tsx/convert-plated-holes.ts
|
|
372
376
|
import { su as su8 } from "@tscircuit/soup-util";
|
|
373
377
|
import { mmStr as mmStr3 } from "@tscircuit/mm";
|
|
374
|
-
var formatOptionalMmAttr = (attrName, value) => {
|
|
375
|
-
if (value === void 0) return "";
|
|
376
|
-
return ` ${attrName}="${mmStr3(value)}"`;
|
|
377
|
-
};
|
|
378
378
|
var convertPlatedHoles = (circuitJson) => {
|
|
379
379
|
const platedHoles = su8(circuitJson).pcb_plated_hole.list();
|
|
380
380
|
const elementStrings = [];
|
package/dist/cli/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
convertCircuitJsonToTscircuit
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-JVWZSO65.js";
|
|
5
5
|
|
|
6
6
|
// cli/main.ts
|
|
7
7
|
import { Command } from "commander";
|
|
@@ -16,7 +16,7 @@ var package_default = {
|
|
|
16
16
|
"./cli": "./dist/cli/main.js"
|
|
17
17
|
},
|
|
18
18
|
type: "module",
|
|
19
|
-
version: "0.0.
|
|
19
|
+
version: "0.0.30",
|
|
20
20
|
scripts: {
|
|
21
21
|
build: "tsup-node lib/index.ts cli/main.ts --format esm --dts",
|
|
22
22
|
test: "bun test",
|
package/dist/lib/index.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { su } from "@tscircuit/soup-util"
|
|
2
2
|
import { mmStr } from "@tscircuit/mm"
|
|
3
3
|
import type { FootprintElementConverter } from "./converter-types"
|
|
4
|
-
import { formatPcbRotationAttr } from "./helpers"
|
|
5
|
-
|
|
6
|
-
const formatOptionalMmAttr = (
|
|
7
|
-
attrName: string,
|
|
8
|
-
value: number | undefined,
|
|
9
|
-
): string => {
|
|
10
|
-
if (value === undefined) return ""
|
|
11
|
-
return ` ${attrName}="${mmStr(value)}"`
|
|
12
|
-
}
|
|
4
|
+
import { formatOptionalMmAttr, formatPcbRotationAttr } from "./helpers"
|
|
13
5
|
|
|
14
6
|
export const convertPlatedHoles: FootprintElementConverter = (circuitJson) => {
|
|
15
7
|
const platedHoles = su(circuitJson).pcb_plated_hole.list()
|
|
@@ -5,6 +5,14 @@ export const escapeJsxText = (value: unknown): string =>
|
|
|
5
5
|
|
|
6
6
|
export const formatMm = (value: number | undefined): string => mmStr(value ?? 0)
|
|
7
7
|
|
|
8
|
+
export const formatOptionalMmAttr = (
|
|
9
|
+
attrName: string,
|
|
10
|
+
value: number | undefined,
|
|
11
|
+
): string => {
|
|
12
|
+
if (value === undefined) return ""
|
|
13
|
+
return ` ${attrName}="${mmStr(value)}"`
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
export const formatPcbRotationAttr = (
|
|
9
17
|
rotation: string | number | undefined,
|
|
10
18
|
attrName = "pcbRotation",
|