@tscircuit/cli 0.1.1947 → 0.1.1949
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 +179 -38
- 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.1948";
|
|
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.305",
|
|
136109
136109
|
"fuse.js": "^7.1.0",
|
|
136110
136110
|
"get-port": "^7.1.0",
|
|
136111
136111
|
globby: "^14.1.0",
|
|
@@ -326886,8 +326886,17 @@ var getPolarizedPinMetadata = (pinLabels) => {
|
|
|
326886
326886
|
pinLabels: Object.fromEntries(polarizedPinEntries)
|
|
326887
326887
|
};
|
|
326888
326888
|
};
|
|
326889
|
+
var normalizeActiveLowPinLabel = (label) => {
|
|
326890
|
+
if (!label.startsWith("#"))
|
|
326891
|
+
return label;
|
|
326892
|
+
const activeLowLabel = label.slice(1);
|
|
326893
|
+
if (activeLowLabel.length === 0)
|
|
326894
|
+
return label;
|
|
326895
|
+
return `N_${activeLowLabel}`;
|
|
326896
|
+
};
|
|
326889
326897
|
var normalizePinLabels = (inputPinLabels) => {
|
|
326890
|
-
const
|
|
326898
|
+
const normalizedInputPinLabels = inputPinLabels.map((labels) => labels.map(normalizeActiveLowPinLabel));
|
|
326899
|
+
const uniqueInputPinLabels = normalizedInputPinLabels.map((labels) => [
|
|
326891
326900
|
...new Set(labels)
|
|
326892
326901
|
]);
|
|
326893
326902
|
const result = uniqueInputPinLabels.map(() => []);
|
|
@@ -327012,6 +327021,23 @@ var isLedCategoryComponent = (betterEasy) => {
|
|
|
327012
327021
|
betterEasy.category
|
|
327013
327022
|
].some(categoryValueContainsLed);
|
|
327014
327023
|
};
|
|
327024
|
+
function distance211(p12, p22) {
|
|
327025
|
+
const dx3 = p12.x - p22.x;
|
|
327026
|
+
const dy3 = p12.y - p22.y;
|
|
327027
|
+
return Math.sqrt(dx3 * dx3 + dy3 * dy3);
|
|
327028
|
+
}
|
|
327029
|
+
var getUnitVectorFromDirection2 = (direction2) => {
|
|
327030
|
+
switch (direction2) {
|
|
327031
|
+
case "up":
|
|
327032
|
+
return { x: 0, y: 1 };
|
|
327033
|
+
case "down":
|
|
327034
|
+
return { x: 0, y: -1 };
|
|
327035
|
+
case "left":
|
|
327036
|
+
return { x: -1, y: 0 };
|
|
327037
|
+
case "right":
|
|
327038
|
+
return { x: 1, y: 0 };
|
|
327039
|
+
}
|
|
327040
|
+
};
|
|
327015
327041
|
var getBoundsCenter3 = (bounds) => ({
|
|
327016
327042
|
x: (bounds.minX + bounds.maxX) / 2,
|
|
327017
327043
|
y: (bounds.minY + bounds.maxY) / 2
|
|
@@ -327213,7 +327239,7 @@ var handleSilkscreenArc = (arc2, index) => {
|
|
|
327213
327239
|
type: "pcb_silkscreen_path",
|
|
327214
327240
|
pcb_silkscreen_path_id: `pcb_silkscreen_arc_${index + 1}`,
|
|
327215
327241
|
pcb_component_id: "pcb_component_1",
|
|
327216
|
-
layer:
|
|
327242
|
+
layer: getSideFromLayer(arc2.layer),
|
|
327217
327243
|
route: arcPath.map((p3) => ({
|
|
327218
327244
|
x: milx10(p3.x),
|
|
327219
327245
|
y: milx10(p3.y)
|
|
@@ -327766,7 +327792,7 @@ var SolidRegionSchema = BaseShapeSchema.extend({
|
|
|
327766
327792
|
type: external_exports2.literal("SOLIDREGION"),
|
|
327767
327793
|
layermask: external_exports2.number(),
|
|
327768
327794
|
points: external_exports2.array(PointSchema),
|
|
327769
|
-
fillStyle: external_exports2.string()
|
|
327795
|
+
fillStyle: external_exports2.string().default("none")
|
|
327770
327796
|
});
|
|
327771
327797
|
var SVGNodeSchema = BaseShapeSchema.extend({
|
|
327772
327798
|
type: external_exports2.literal("SVGNODE"),
|
|
@@ -327797,7 +327823,7 @@ var RectSchema = BaseShapeSchema.extend({
|
|
|
327797
327823
|
width: tenthmil,
|
|
327798
327824
|
height: tenthmil,
|
|
327799
327825
|
lineWidth: external_exports2.number(),
|
|
327800
|
-
fillStyle: external_exports2.string(),
|
|
327826
|
+
fillStyle: external_exports2.string().default("none"),
|
|
327801
327827
|
rotation: external_exports2.number().optional()
|
|
327802
327828
|
});
|
|
327803
327829
|
var TextSchema = BaseShapeSchema.extend({
|
|
@@ -327955,7 +327981,7 @@ var ShapeItemSchema = external_exports2.object({
|
|
|
327955
327981
|
type: "SOLIDREGION",
|
|
327956
327982
|
layermask: Number(layermask),
|
|
327957
327983
|
points,
|
|
327958
|
-
fillStyle,
|
|
327984
|
+
fillStyle: fillStyle || undefined,
|
|
327959
327985
|
id: id2
|
|
327960
327986
|
});
|
|
327961
327987
|
}
|
|
@@ -328203,6 +328229,17 @@ var parsePath = (str) => {
|
|
|
328203
328229
|
};
|
|
328204
328230
|
};
|
|
328205
328231
|
var PathShapeSchema = external_exports2.string().startsWith("PT~").transform(parsePath).pipe(PathShapeOutputSchema);
|
|
328232
|
+
var IgnoredShapeOutputSchema = external_exports2.object({
|
|
328233
|
+
type: external_exports2.literal("IGNORED"),
|
|
328234
|
+
sourceType: external_exports2.enum(["AR", "I"])
|
|
328235
|
+
});
|
|
328236
|
+
var IgnoredShapeSchema = external_exports2.string().transform((shape) => {
|
|
328237
|
+
const sourceType = shape.startsWith("AR~") ? "AR" : shape.startsWith("I~") ? "I" : undefined;
|
|
328238
|
+
if (!sourceType) {
|
|
328239
|
+
throw new Error(`Invalid ignored shape: ${shape}`);
|
|
328240
|
+
}
|
|
328241
|
+
return { type: "IGNORED", sourceType };
|
|
328242
|
+
}).pipe(IgnoredShapeOutputSchema);
|
|
328206
328243
|
var optionalEasyEdaTextField = (fieldSchema) => external_exports2.preprocess((textField) => {
|
|
328207
328244
|
if (textField == null)
|
|
328208
328245
|
return;
|
|
@@ -328253,7 +328290,7 @@ var parseText = (str) => {
|
|
|
328253
328290
|
] = str.split("~");
|
|
328254
328291
|
return {
|
|
328255
328292
|
type: "TEXT",
|
|
328256
|
-
alignment,
|
|
328293
|
+
alignment: alignment === "P" ? "L" : alignment,
|
|
328257
328294
|
x: Number(x4),
|
|
328258
328295
|
y: Number(y4),
|
|
328259
328296
|
rotation: Number(rotation23),
|
|
@@ -328286,6 +328323,9 @@ var SingleLetterShapeSchema = external_exports2.string().transform((x4) => {
|
|
|
328286
328323
|
return PathShapeSchema.parse(x4);
|
|
328287
328324
|
if (x4.startsWith("T~"))
|
|
328288
328325
|
return TextShapeSchema.parse(x4);
|
|
328326
|
+
if (x4.startsWith("AR~") || x4.startsWith("I~")) {
|
|
328327
|
+
return IgnoredShapeSchema.parse(x4);
|
|
328328
|
+
}
|
|
328289
328329
|
if (x4.startsWith("A~"))
|
|
328290
328330
|
return ArcShapeSchema.parse(x4);
|
|
328291
328331
|
throw new Error(`Invalid shape type: ${x4}`);
|
|
@@ -328297,15 +328337,28 @@ var SingleLetterShapeSchema = external_exports2.string().transform((x4) => {
|
|
|
328297
328337
|
PolygonShapeOutputSchema,
|
|
328298
328338
|
PathShapeOutputSchema,
|
|
328299
328339
|
TextShapeOutputSchema,
|
|
328340
|
+
IgnoredShapeOutputSchema,
|
|
328300
328341
|
ArcShapeOutputSchema
|
|
328301
328342
|
]));
|
|
328302
328343
|
var maybeNumber = external_exports2.any().transform((k4) => k4 === "nan" || Number.isNaN(k4) ? null : k4).pipe(external_exports2.number().nullable().optional());
|
|
328344
|
+
var optionalNumberWithNumericString = external_exports2.preprocess((value) => {
|
|
328345
|
+
if (typeof value !== "string")
|
|
328346
|
+
return value;
|
|
328347
|
+
if (value.trim() === "")
|
|
328348
|
+
return;
|
|
328349
|
+
return Number(value);
|
|
328350
|
+
}, external_exports2.number().optional());
|
|
328303
328351
|
var SzlcscSchema = external_exports2.object({
|
|
328304
|
-
id: external_exports2.
|
|
328352
|
+
id: external_exports2.preprocess((value) => {
|
|
328353
|
+
if (typeof value === "string" && /^\d+$/.test(value)) {
|
|
328354
|
+
return Number(value);
|
|
328355
|
+
}
|
|
328356
|
+
return value;
|
|
328357
|
+
}, external_exports2.number()),
|
|
328305
328358
|
number: external_exports2.string(),
|
|
328306
328359
|
step: external_exports2.number().optional(),
|
|
328307
328360
|
min: external_exports2.number().optional(),
|
|
328308
|
-
price:
|
|
328361
|
+
price: optionalNumberWithNumericString,
|
|
328309
328362
|
stock: external_exports2.number().optional(),
|
|
328310
328363
|
url: external_exports2.string().url().optional(),
|
|
328311
328364
|
image: external_exports2.string().optional().optional()
|
|
@@ -328315,7 +328368,7 @@ var LcscSchema = external_exports2.object({
|
|
|
328315
328368
|
number: external_exports2.string(),
|
|
328316
328369
|
step: external_exports2.number().optional(),
|
|
328317
328370
|
min: external_exports2.number().optional(),
|
|
328318
|
-
price:
|
|
328371
|
+
price: optionalNumberWithNumericString,
|
|
328319
328372
|
stock: external_exports2.number().optional(),
|
|
328320
328373
|
url: external_exports2.string().url().optional()
|
|
328321
328374
|
});
|
|
@@ -328334,12 +328387,12 @@ var HeadSchema = external_exports2.object({
|
|
|
328334
328387
|
puuid: external_exports2.string().optional(),
|
|
328335
328388
|
uuid: external_exports2.string(),
|
|
328336
328389
|
utime: external_exports2.preprocess((val) => {
|
|
328337
|
-
if (val === "")
|
|
328338
|
-
return
|
|
328390
|
+
if (val == null || val === "")
|
|
328391
|
+
return;
|
|
328339
328392
|
if (typeof val === "string")
|
|
328340
328393
|
return Number(val);
|
|
328341
328394
|
return val;
|
|
328342
|
-
}, external_exports2.number()),
|
|
328395
|
+
}, external_exports2.number().optional()),
|
|
328343
328396
|
importFlag: external_exports2.number().optional(),
|
|
328344
328397
|
c_spiceCmd: external_exports2.any().optional(),
|
|
328345
328398
|
hasIdFlag: external_exports2.boolean().default(false)
|
|
@@ -328592,7 +328645,7 @@ var generateFootprintTsx2 = (circuitJson, options = {}) => {
|
|
|
328592
328645
|
if (hole.hole_shape === "circle") {
|
|
328593
328646
|
elementStrings.push(`<hole pcbX="${mmStr2(hole.x)}" pcbY="${mmStr2(hole.y)}" diameter="${mmStr2(hole.hole_diameter)}" />`);
|
|
328594
328647
|
} else if (hole.hole_shape === "oval") {
|
|
328595
|
-
|
|
328648
|
+
elementStrings.push(`<hole pcbX="${mmStr2(hole.x)}" pcbY="${mmStr2(hole.y)}" width="${mmStr2(hole.hole_width)}" height="${mmStr2(hole.hole_height)}" shape="oval" />`);
|
|
328596
328649
|
}
|
|
328597
328650
|
}
|
|
328598
328651
|
for (const platedHole of platedHoles) {
|
|
@@ -328808,7 +328861,7 @@ export const ${componentName} = (props: Omit<CapacitorProps, "capacitance">) =>
|
|
|
328808
328861
|
<capacitor
|
|
328809
328862
|
name={name}
|
|
328810
328863
|
capacitance=${JSON.stringify(capacitance22)}
|
|
328811
|
-
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
328864
|
+
${symbolProp2} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
328812
328865
|
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
328813
328866
|
footprint={${footprintTsx}}
|
|
328814
328867
|
${objUrl || stepUrl ? `cadModel={{
|
|
@@ -328834,7 +328887,7 @@ export const ${componentName} = (props: Omit<ResistorProps, "resistance">) => {
|
|
|
328834
328887
|
<resistor
|
|
328835
328888
|
name={name}
|
|
328836
328889
|
resistance=${JSON.stringify(resistance22)}
|
|
328837
|
-
supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
328890
|
+
${symbolProp2} supplierPartNumbers={${JSON.stringify(supplierPartNumbers, null, " ")}}
|
|
328838
328891
|
manufacturerPartNumber="${manufacturerPartNumber}"
|
|
328839
328892
|
footprint={${footprintTsx}}
|
|
328840
328893
|
${objUrl || stepUrl ? `cadModel={{
|
|
@@ -329200,6 +329253,40 @@ var getPinStemLength = (path72) => {
|
|
|
329200
329253
|
return;
|
|
329201
329254
|
return toSchematicUnits(Math.abs(Number(segment2[1])));
|
|
329202
329255
|
};
|
|
329256
|
+
var getOpenPolylineEndpoints = (shapes, transformPoint2) => shapes.flatMap((shape) => {
|
|
329257
|
+
if (shape.type !== "POLYLINE" || shape.points.length < 2)
|
|
329258
|
+
return [];
|
|
329259
|
+
const first = shape.points[0];
|
|
329260
|
+
const last = shape.points[shape.points.length - 1];
|
|
329261
|
+
if (first.x === last.x && first.y === last.y)
|
|
329262
|
+
return [];
|
|
329263
|
+
return [transformPoint2(first), transformPoint2(last)];
|
|
329264
|
+
});
|
|
329265
|
+
var alignPortToDrawing = ({
|
|
329266
|
+
position: position2,
|
|
329267
|
+
direction: direction2,
|
|
329268
|
+
stemLength,
|
|
329269
|
+
drawingEndpoints
|
|
329270
|
+
}) => {
|
|
329271
|
+
if (stemLength === undefined)
|
|
329272
|
+
return position2;
|
|
329273
|
+
const outwardDirection = getUnitVectorFromDirection2(direction2);
|
|
329274
|
+
const expectedBodyConnection = {
|
|
329275
|
+
x: position2.x - outwardDirection.x * stemLength,
|
|
329276
|
+
y: position2.y - outwardDirection.y * stemLength
|
|
329277
|
+
};
|
|
329278
|
+
const alignmentTolerance = Math.max(0.02, stemLength * 0.25);
|
|
329279
|
+
const nearestEndpoint = drawingEndpoints.map((endpoint) => ({
|
|
329280
|
+
endpoint,
|
|
329281
|
+
distance: distance211(endpoint, expectedBodyConnection)
|
|
329282
|
+
})).filter((candidate) => candidate.distance <= alignmentTolerance).sort((a2, b3) => a2.distance - b3.distance)[0]?.endpoint;
|
|
329283
|
+
if (!nearestEndpoint)
|
|
329284
|
+
return position2;
|
|
329285
|
+
return {
|
|
329286
|
+
x: round(nearestEndpoint.x + outwardDirection.x * stemLength),
|
|
329287
|
+
y: round(nearestEndpoint.y + outwardDirection.y * stemLength)
|
|
329288
|
+
};
|
|
329289
|
+
};
|
|
329203
329290
|
var getTextFontSize = (fontSize) => {
|
|
329204
329291
|
const numericFontSize = Number.parseFloat(fontSize);
|
|
329205
329292
|
if (!Number.isFinite(numericFontSize))
|
|
@@ -329266,7 +329353,8 @@ var getPortMetadataByShapeId = (easyEdaJson, circuitJson) => {
|
|
|
329266
329353
|
var generateShapeTsx = ({
|
|
329267
329354
|
shape,
|
|
329268
329355
|
origin,
|
|
329269
|
-
portMetadata
|
|
329356
|
+
portMetadata,
|
|
329357
|
+
drawingEndpoints = []
|
|
329270
329358
|
}) => {
|
|
329271
329359
|
const transformPoint2 = getPointTransformer(origin);
|
|
329272
329360
|
if (shape.type === "RECTANGLE") {
|
|
@@ -329306,16 +329394,27 @@ var generateShapeTsx = ({
|
|
|
329306
329394
|
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)}} />`;
|
|
329307
329395
|
}
|
|
329308
329396
|
if (shape.type === "PIN" && portMetadata) {
|
|
329309
|
-
const
|
|
329397
|
+
const direction2 = getPinDirection3(shape.rotation);
|
|
329398
|
+
const stemLength = getPinStemLength(shape.path);
|
|
329399
|
+
const position2 = alignPortToDrawing({
|
|
329400
|
+
position: transformPoint2({ x: shape.x, y: shape.y }),
|
|
329401
|
+
direction: direction2,
|
|
329402
|
+
stemLength,
|
|
329403
|
+
drawingEndpoints
|
|
329404
|
+
});
|
|
329310
329405
|
const pinNumberProp = portMetadata.pinNumber === undefined ? "" : ` pinNumber={${portMetadata.pinNumber}}`;
|
|
329311
329406
|
const aliasesProp = portMetadata.aliases.length === 0 ? "" : ` aliases={${JSON.stringify(portMetadata.aliases)}}`;
|
|
329312
|
-
const stemLength = getPinStemLength(shape.path);
|
|
329313
329407
|
const stemLengthProp = stemLength === undefined ? "" : ` schStemLength={${stemLength}}`;
|
|
329314
|
-
return `<port name=${JSON.stringify(portMetadata.name)}${pinNumberProp}${aliasesProp} direction=${JSON.stringify(
|
|
329408
|
+
return `<port name=${JSON.stringify(portMetadata.name)}${pinNumberProp}${aliasesProp} direction=${JSON.stringify(direction2)} schX={${position2.x}} schY={${position2.y}}${stemLengthProp} />`;
|
|
329315
329409
|
}
|
|
329410
|
+
if (shape.type === "IGNORED")
|
|
329411
|
+
return;
|
|
329316
329412
|
return;
|
|
329317
329413
|
};
|
|
329318
|
-
var generateSymbolTsx2 = (easyEdaJson, circuitJson
|
|
329414
|
+
var generateSymbolTsx2 = (easyEdaJson, circuitJson, {
|
|
329415
|
+
includePorts = true,
|
|
329416
|
+
alignPortsToDrawing = false
|
|
329417
|
+
} = {}) => {
|
|
329319
329418
|
const shapes = easyEdaJson.dataStr.shape;
|
|
329320
329419
|
if (shapes.length === 0)
|
|
329321
329420
|
return;
|
|
@@ -329330,10 +329429,13 @@ var generateSymbolTsx2 = (easyEdaJson, circuitJson) => {
|
|
|
329330
329429
|
y: bounds.y + bounds.height / 2
|
|
329331
329430
|
};
|
|
329332
329431
|
const portMetadataByShapeId = getPortMetadataByShapeId(easyEdaJson, circuitJson);
|
|
329333
|
-
const
|
|
329432
|
+
const transformPoint2 = getPointTransformer(origin);
|
|
329433
|
+
const drawingEndpoints = alignPortsToDrawing ? getOpenPolylineEndpoints(shapes, transformPoint2) : [];
|
|
329434
|
+
const shapeTsx = shapes.filter((shape) => includePorts || shape.type !== "PIN").map((shape) => generateShapeTsx({
|
|
329334
329435
|
shape,
|
|
329335
329436
|
origin,
|
|
329336
|
-
portMetadata: shape.type === "PIN" ? portMetadataByShapeId.get(shape.id) : undefined
|
|
329437
|
+
portMetadata: shape.type === "PIN" ? portMetadataByShapeId.get(shape.id) : undefined,
|
|
329438
|
+
drawingEndpoints
|
|
329337
329439
|
})).filter((tsx) => Boolean(tsx));
|
|
329338
329440
|
if (shapeTsx.length === 0)
|
|
329339
329441
|
return;
|
|
@@ -329343,7 +329445,7 @@ ${shapeTsx.map((tsx) => ` ${tsx}`).join(`
|
|
|
329343
329445
|
</symbol>`;
|
|
329344
329446
|
};
|
|
329345
329447
|
var hasNonBoxSchematicSymbol = (easyEdaJson) => {
|
|
329346
|
-
const drawableShapes = easyEdaJson.dataStr.shape.filter((shape) => shape.type !== "PIN" && shape.type !== "TEXT");
|
|
329448
|
+
const drawableShapes = easyEdaJson.dataStr.shape.filter((shape) => shape.type !== "PIN" && shape.type !== "TEXT" && shape.type !== "IGNORED");
|
|
329347
329449
|
if (drawableShapes.length === 0)
|
|
329348
329450
|
return false;
|
|
329349
329451
|
const rectangles = drawableShapes.filter((shape) => shape.type === "RECTANGLE");
|
|
@@ -329436,7 +329538,10 @@ var convertBetterEasyToTsx = async ({
|
|
|
329436
329538
|
const crystalFrequency = componentType === "crystal" ? betterEasy.dataStr.head.c_para.Value?.trim() : undefined;
|
|
329437
329539
|
const crystalPinVariant = componentType !== "crystal" ? undefined : sourcePorts.length === 4 ? "four_pin" : sourcePorts.length === 2 ? "two_pin" : undefined;
|
|
329438
329540
|
const isMultiPinDiode = isDiodeCategoryComponent(betterEasy) && sourcePorts.length !== 2;
|
|
329439
|
-
const
|
|
329541
|
+
const isPassiveWithCustomSymbol = componentType === "capacitor" || componentType === "resistor";
|
|
329542
|
+
const symbolTsx = isPassiveWithCustomSymbol || componentType === "chip" && !isMultiPinDiode && hasNonBoxSchematicSymbol(betterEasy) ? generateSymbolTsx2(betterEasy, circuitJson, {
|
|
329543
|
+
alignPortsToDrawing: isPassiveWithCustomSymbol
|
|
329544
|
+
}) : undefined;
|
|
329440
329545
|
return generateTypescriptComponent({
|
|
329441
329546
|
componentName,
|
|
329442
329547
|
manufacturerPartNumber,
|
|
@@ -334910,8 +335015,17 @@ var getPolarizedPinMetadata2 = (pinLabels) => {
|
|
|
334910
335015
|
pinLabels: Object.fromEntries(polarizedPinEntries)
|
|
334911
335016
|
};
|
|
334912
335017
|
};
|
|
335018
|
+
var normalizeActiveLowPinLabel2 = (label) => {
|
|
335019
|
+
if (!label.startsWith("#"))
|
|
335020
|
+
return label;
|
|
335021
|
+
const activeLowLabel = label.slice(1);
|
|
335022
|
+
if (activeLowLabel.length === 0)
|
|
335023
|
+
return label;
|
|
335024
|
+
return `N_${activeLowLabel}`;
|
|
335025
|
+
};
|
|
334913
335026
|
var normalizePinLabels2 = (inputPinLabels) => {
|
|
334914
|
-
const
|
|
335027
|
+
const normalizedInputPinLabels = inputPinLabels.map((labels) => labels.map(normalizeActiveLowPinLabel2));
|
|
335028
|
+
const uniqueInputPinLabels = normalizedInputPinLabels.map((labels) => [
|
|
334915
335029
|
...new Set(labels)
|
|
334916
335030
|
]);
|
|
334917
335031
|
const result = uniqueInputPinLabels.map(() => []);
|
|
@@ -335223,7 +335337,7 @@ var handleSilkscreenArc2 = (arc2, index) => {
|
|
|
335223
335337
|
type: "pcb_silkscreen_path",
|
|
335224
335338
|
pcb_silkscreen_path_id: `pcb_silkscreen_arc_${index + 1}`,
|
|
335225
335339
|
pcb_component_id: "pcb_component_1",
|
|
335226
|
-
layer:
|
|
335340
|
+
layer: getSideFromLayer2(arc2.layer),
|
|
335227
335341
|
route: arcPath.map((p3) => ({
|
|
335228
335342
|
x: milx102(p3.x),
|
|
335229
335343
|
y: milx102(p3.y)
|
|
@@ -335776,7 +335890,7 @@ var SolidRegionSchema2 = BaseShapeSchema2.extend({
|
|
|
335776
335890
|
type: z179.literal("SOLIDREGION"),
|
|
335777
335891
|
layermask: z179.number(),
|
|
335778
335892
|
points: z179.array(PointSchema3),
|
|
335779
|
-
fillStyle: z179.string()
|
|
335893
|
+
fillStyle: z179.string().default("none")
|
|
335780
335894
|
});
|
|
335781
335895
|
var SVGNodeSchema2 = BaseShapeSchema2.extend({
|
|
335782
335896
|
type: z179.literal("SVGNODE"),
|
|
@@ -335807,7 +335921,7 @@ var RectSchema2 = BaseShapeSchema2.extend({
|
|
|
335807
335921
|
width: tenthmil2,
|
|
335808
335922
|
height: tenthmil2,
|
|
335809
335923
|
lineWidth: z179.number(),
|
|
335810
|
-
fillStyle: z179.string(),
|
|
335924
|
+
fillStyle: z179.string().default("none"),
|
|
335811
335925
|
rotation: z179.number().optional()
|
|
335812
335926
|
});
|
|
335813
335927
|
var TextSchema2 = BaseShapeSchema2.extend({
|
|
@@ -335965,7 +336079,7 @@ var ShapeItemSchema2 = z179.object({
|
|
|
335965
336079
|
type: "SOLIDREGION",
|
|
335966
336080
|
layermask: Number(layermask),
|
|
335967
336081
|
points,
|
|
335968
|
-
fillStyle,
|
|
336082
|
+
fillStyle: fillStyle || undefined,
|
|
335969
336083
|
id: id2
|
|
335970
336084
|
});
|
|
335971
336085
|
}
|
|
@@ -336213,6 +336327,17 @@ var parsePath2 = (str) => {
|
|
|
336213
336327
|
};
|
|
336214
336328
|
};
|
|
336215
336329
|
var PathShapeSchema2 = z180.string().startsWith("PT~").transform(parsePath2).pipe(PathShapeOutputSchema2);
|
|
336330
|
+
var IgnoredShapeOutputSchema2 = z180.object({
|
|
336331
|
+
type: z180.literal("IGNORED"),
|
|
336332
|
+
sourceType: z180.enum(["AR", "I"])
|
|
336333
|
+
});
|
|
336334
|
+
var IgnoredShapeSchema2 = z180.string().transform((shape) => {
|
|
336335
|
+
const sourceType = shape.startsWith("AR~") ? "AR" : shape.startsWith("I~") ? "I" : undefined;
|
|
336336
|
+
if (!sourceType) {
|
|
336337
|
+
throw new Error(`Invalid ignored shape: ${shape}`);
|
|
336338
|
+
}
|
|
336339
|
+
return { type: "IGNORED", sourceType };
|
|
336340
|
+
}).pipe(IgnoredShapeOutputSchema2);
|
|
336216
336341
|
var optionalEasyEdaTextField2 = (fieldSchema) => z180.preprocess((textField) => {
|
|
336217
336342
|
if (textField == null)
|
|
336218
336343
|
return;
|
|
@@ -336263,7 +336388,7 @@ var parseText2 = (str) => {
|
|
|
336263
336388
|
] = str.split("~");
|
|
336264
336389
|
return {
|
|
336265
336390
|
type: "TEXT",
|
|
336266
|
-
alignment,
|
|
336391
|
+
alignment: alignment === "P" ? "L" : alignment,
|
|
336267
336392
|
x: Number(x4),
|
|
336268
336393
|
y: Number(y4),
|
|
336269
336394
|
rotation: Number(rotation23),
|
|
@@ -336296,6 +336421,9 @@ var SingleLetterShapeSchema2 = z180.string().transform((x4) => {
|
|
|
336296
336421
|
return PathShapeSchema2.parse(x4);
|
|
336297
336422
|
if (x4.startsWith("T~"))
|
|
336298
336423
|
return TextShapeSchema2.parse(x4);
|
|
336424
|
+
if (x4.startsWith("AR~") || x4.startsWith("I~")) {
|
|
336425
|
+
return IgnoredShapeSchema2.parse(x4);
|
|
336426
|
+
}
|
|
336299
336427
|
if (x4.startsWith("A~"))
|
|
336300
336428
|
return ArcShapeSchema2.parse(x4);
|
|
336301
336429
|
throw new Error(`Invalid shape type: ${x4}`);
|
|
@@ -336307,15 +336435,28 @@ var SingleLetterShapeSchema2 = z180.string().transform((x4) => {
|
|
|
336307
336435
|
PolygonShapeOutputSchema2,
|
|
336308
336436
|
PathShapeOutputSchema2,
|
|
336309
336437
|
TextShapeOutputSchema2,
|
|
336438
|
+
IgnoredShapeOutputSchema2,
|
|
336310
336439
|
ArcShapeOutputSchema2
|
|
336311
336440
|
]));
|
|
336312
336441
|
var maybeNumber2 = z181.any().transform((k4) => k4 === "nan" || Number.isNaN(k4) ? null : k4).pipe(z181.number().nullable().optional());
|
|
336442
|
+
var optionalNumberWithNumericString2 = z181.preprocess((value) => {
|
|
336443
|
+
if (typeof value !== "string")
|
|
336444
|
+
return value;
|
|
336445
|
+
if (value.trim() === "")
|
|
336446
|
+
return;
|
|
336447
|
+
return Number(value);
|
|
336448
|
+
}, z181.number().optional());
|
|
336313
336449
|
var SzlcscSchema2 = z181.object({
|
|
336314
|
-
id: z181.
|
|
336450
|
+
id: z181.preprocess((value) => {
|
|
336451
|
+
if (typeof value === "string" && /^\d+$/.test(value)) {
|
|
336452
|
+
return Number(value);
|
|
336453
|
+
}
|
|
336454
|
+
return value;
|
|
336455
|
+
}, z181.number()),
|
|
336315
336456
|
number: z181.string(),
|
|
336316
336457
|
step: z181.number().optional(),
|
|
336317
336458
|
min: z181.number().optional(),
|
|
336318
|
-
price:
|
|
336459
|
+
price: optionalNumberWithNumericString2,
|
|
336319
336460
|
stock: z181.number().optional(),
|
|
336320
336461
|
url: z181.string().url().optional(),
|
|
336321
336462
|
image: z181.string().optional().optional()
|
|
@@ -336325,7 +336466,7 @@ var LcscSchema2 = z181.object({
|
|
|
336325
336466
|
number: z181.string(),
|
|
336326
336467
|
step: z181.number().optional(),
|
|
336327
336468
|
min: z181.number().optional(),
|
|
336328
|
-
price:
|
|
336469
|
+
price: optionalNumberWithNumericString2,
|
|
336329
336470
|
stock: z181.number().optional(),
|
|
336330
336471
|
url: z181.string().url().optional()
|
|
336331
336472
|
});
|
|
@@ -336344,12 +336485,12 @@ var HeadSchema2 = z181.object({
|
|
|
336344
336485
|
puuid: z181.string().optional(),
|
|
336345
336486
|
uuid: z181.string(),
|
|
336346
336487
|
utime: z181.preprocess((val) => {
|
|
336347
|
-
if (val === "")
|
|
336348
|
-
return
|
|
336488
|
+
if (val == null || val === "")
|
|
336489
|
+
return;
|
|
336349
336490
|
if (typeof val === "string")
|
|
336350
336491
|
return Number(val);
|
|
336351
336492
|
return val;
|
|
336352
|
-
}, z181.number()),
|
|
336493
|
+
}, z181.number().optional()),
|
|
336353
336494
|
importFlag: z181.number().optional(),
|
|
336354
336495
|
c_spiceCmd: z181.any().optional(),
|
|
336355
336496
|
hasIdFlag: z181.boolean().default(false)
|
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.1948";
|
|
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.305",
|
|
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.1949",
|
|
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.305",
|
|
62
62
|
"fuse.js": "^7.1.0",
|
|
63
63
|
"get-port": "^7.1.0",
|
|
64
64
|
"globby": "^14.1.0",
|