@tscircuit/cli 0.1.965 → 0.1.966

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 CHANGED
@@ -74389,7 +74389,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
74389
74389
  import { execSync as execSync2 } from "node:child_process";
74390
74390
  var import_semver2 = __toESM2(require_semver2(), 1);
74391
74391
  // package.json
74392
- var version = "0.1.964";
74392
+ var version = "0.1.965";
74393
74393
  var package_default = {
74394
74394
  name: "@tscircuit/cli",
74395
74395
  main: "dist/cli/main.js",
@@ -74418,7 +74418,7 @@ var package_default = {
74418
74418
  "@types/semver": "^7.5.8",
74419
74419
  "bun-match-svg": "^0.0.12",
74420
74420
  chokidar: "4.0.1",
74421
- "circuit-json-to-kicad": "^0.0.76",
74421
+ "circuit-json-to-kicad": "^0.0.78",
74422
74422
  "circuit-json-to-readable-netlist": "^0.0.13",
74423
74423
  "circuit-json-to-spice": "^0.0.10",
74424
74424
  "circuit-json-to-tscircuit": "^0.0.9",
@@ -76638,7 +76638,14 @@ function buildSymbolDataFromSchematicPrimitives(params2) {
76638
76638
  const texts = circuitJson.filter((el) => el.type === "schematic_text" && el.schematic_symbol_id === schematicSymbolId);
76639
76639
  let ports = circuitJson.filter((el) => el.type === "schematic_port" && ("schematic_symbol_id" in el) && el.schematic_symbol_id === schematicSymbolId);
76640
76640
  if (ports.length === 0 && schematicComponentId) {
76641
- ports = circuitJson.filter((el) => el.type === "schematic_port" && el.schematic_component_id === schematicComponentId && el.display_pin_label !== undefined);
76641
+ const labeledPorts = circuitJson.filter((el) => el.type === "schematic_port" && el.schematic_component_id === schematicComponentId && el.display_pin_label !== undefined);
76642
+ const labelMap = /* @__PURE__ */ new Map;
76643
+ for (const port of labeledPorts) {
76644
+ if (port.display_pin_label) {
76645
+ labelMap.set(port.display_pin_label, port);
76646
+ }
76647
+ }
76648
+ ports = labelMap.size > 0 ? Array.from(labelMap.values()) : labeledPorts;
76642
76649
  if (ports.length === 0) {
76643
76650
  const allPorts = circuitJson.filter((el) => el.type === "schematic_port" && el.schematic_component_id === schematicComponentId);
76644
76651
  const seenPinNumbers = /* @__PURE__ */ new Set;
@@ -76774,8 +76781,7 @@ function createDrawingSubsymbol({
76774
76781
  const drawingSymbol = new SchematicSymbol({
76775
76782
  libraryId: `${libId.split(":")[1]}_0_1`
76776
76783
  });
76777
- const GRID_ALIGNED_SCALE = 15.24;
76778
- const symbolScale = isChip ? c2kMatSchScale : GRID_ALIGNED_SCALE;
76784
+ const symbolScale = c2kMatSchScale;
76779
76785
  const cx = symbolData.center?.x ?? 0;
76780
76786
  const cy = symbolData.center?.y ?? 0;
76781
76787
  const transform = compose(createScaleMatrix(symbolScale, symbolScale), translate(-cx, -cy));
@@ -76922,8 +76928,7 @@ function calculatePinPosition({
76922
76928
  schematicPorts,
76923
76929
  c2kMatSchScale
76924
76930
  }) {
76925
- const GRID_ALIGNED_SCALE = 15.24;
76926
- const symbolScale = isChip ? c2kMatSchScale : GRID_ALIGNED_SCALE;
76931
+ const symbolScale = c2kMatSchScale;
76927
76932
  let portX = port.x ?? 0;
76928
76933
  let portY = port.y ?? 0;
76929
76934
  let usingCircuitJsonPort = false;
@@ -77157,7 +77162,8 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
77157
77162
  keywords: this.getKeywords(sourceComp),
77158
77163
  fpFilters: this.getFpFilters(sourceComp, schematicSymbol.name),
77159
77164
  footprintRef: footprintName ? `tscircuit:${footprintName}` : "",
77160
- referencePrefix: getReferencePrefixForComponent(sourceComp)
77165
+ referencePrefix: getReferencePrefixForComponent(sourceComp),
77166
+ symbolScale: 1
77161
77167
  });
77162
77168
  }
77163
77169
  createLibrarySymbolForNetLabel({
@@ -77198,8 +77204,11 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
77198
77204
  keywords,
77199
77205
  fpFilters,
77200
77206
  footprintRef = "",
77201
- referencePrefix
77207
+ referencePrefix,
77208
+ symbolScale
77202
77209
  }) {
77210
+ const CIRCUIT_JSON_SCALE_FACTOR = 15;
77211
+ const c2kMatSchScale = symbolScale ?? this.ctx.c2kMatSch?.a ?? CIRCUIT_JSON_SCALE_FACTOR;
77203
77212
  const symbol = new SchematicSymbol4({
77204
77213
  libraryId: libId,
77205
77214
  excludeFromSim: false,
@@ -77225,7 +77234,7 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
77225
77234
  libId,
77226
77235
  symbolData,
77227
77236
  isChip,
77228
- c2kMatSchScale: this.ctx.c2kMatSch?.a ?? 15
77237
+ c2kMatSchScale
77229
77238
  });
77230
77239
  symbol.subSymbols.push(drawingSymbol);
77231
77240
  const pinSymbol = createPinSubsymbol({
@@ -77234,7 +77243,7 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
77234
77243
  isChip,
77235
77244
  schematicComponent,
77236
77245
  schematicPorts: this.ctx.db.schematic_port.list(),
77237
- c2kMatSchScale: this.ctx.c2kMatSch?.a ?? 15
77246
+ c2kMatSchScale
77238
77247
  });
77239
77248
  symbol.subSymbols.push(pinSymbol);
77240
77249
  symbol._sxEmbeddedFonts = new EmbeddedFonts(false);
package/dist/lib/index.js CHANGED
@@ -60414,7 +60414,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
60414
60414
  }));
60415
60415
  };
60416
60416
  // package.json
60417
- var version = "0.1.964";
60417
+ var version = "0.1.965";
60418
60418
  var package_default = {
60419
60419
  name: "@tscircuit/cli",
60420
60420
  main: "dist/cli/main.js",
@@ -60443,7 +60443,7 @@ var package_default = {
60443
60443
  "@types/semver": "^7.5.8",
60444
60444
  "bun-match-svg": "^0.0.12",
60445
60445
  chokidar: "4.0.1",
60446
- "circuit-json-to-kicad": "^0.0.76",
60446
+ "circuit-json-to-kicad": "^0.0.78",
60447
60447
  "circuit-json-to-readable-netlist": "^0.0.13",
60448
60448
  "circuit-json-to-spice": "^0.0.10",
60449
60449
  "circuit-json-to-tscircuit": "^0.0.9",
@@ -63347,7 +63347,14 @@ function buildSymbolDataFromSchematicPrimitives(params2) {
63347
63347
  const texts = circuitJson.filter((el) => el.type === "schematic_text" && el.schematic_symbol_id === schematicSymbolId);
63348
63348
  let ports = circuitJson.filter((el) => el.type === "schematic_port" && ("schematic_symbol_id" in el) && el.schematic_symbol_id === schematicSymbolId);
63349
63349
  if (ports.length === 0 && schematicComponentId) {
63350
- ports = circuitJson.filter((el) => el.type === "schematic_port" && el.schematic_component_id === schematicComponentId && el.display_pin_label !== undefined);
63350
+ const labeledPorts = circuitJson.filter((el) => el.type === "schematic_port" && el.schematic_component_id === schematicComponentId && el.display_pin_label !== undefined);
63351
+ const labelMap = /* @__PURE__ */ new Map;
63352
+ for (const port of labeledPorts) {
63353
+ if (port.display_pin_label) {
63354
+ labelMap.set(port.display_pin_label, port);
63355
+ }
63356
+ }
63357
+ ports = labelMap.size > 0 ? Array.from(labelMap.values()) : labeledPorts;
63351
63358
  if (ports.length === 0) {
63352
63359
  const allPorts = circuitJson.filter((el) => el.type === "schematic_port" && el.schematic_component_id === schematicComponentId);
63353
63360
  const seenPinNumbers = /* @__PURE__ */ new Set;
@@ -63483,8 +63490,7 @@ function createDrawingSubsymbol({
63483
63490
  const drawingSymbol = new SchematicSymbol({
63484
63491
  libraryId: `${libId.split(":")[1]}_0_1`
63485
63492
  });
63486
- const GRID_ALIGNED_SCALE = 15.24;
63487
- const symbolScale = isChip ? c2kMatSchScale : GRID_ALIGNED_SCALE;
63493
+ const symbolScale = c2kMatSchScale;
63488
63494
  const cx = symbolData.center?.x ?? 0;
63489
63495
  const cy = symbolData.center?.y ?? 0;
63490
63496
  const transform = compose(createScaleMatrix(symbolScale, symbolScale), translate(-cx, -cy));
@@ -63631,8 +63637,7 @@ function calculatePinPosition({
63631
63637
  schematicPorts,
63632
63638
  c2kMatSchScale
63633
63639
  }) {
63634
- const GRID_ALIGNED_SCALE = 15.24;
63635
- const symbolScale = isChip ? c2kMatSchScale : GRID_ALIGNED_SCALE;
63640
+ const symbolScale = c2kMatSchScale;
63636
63641
  let portX = port.x ?? 0;
63637
63642
  let portY = port.y ?? 0;
63638
63643
  let usingCircuitJsonPort = false;
@@ -63866,7 +63871,8 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
63866
63871
  keywords: this.getKeywords(sourceComp),
63867
63872
  fpFilters: this.getFpFilters(sourceComp, schematicSymbol.name),
63868
63873
  footprintRef: footprintName ? `tscircuit:${footprintName}` : "",
63869
- referencePrefix: getReferencePrefixForComponent(sourceComp)
63874
+ referencePrefix: getReferencePrefixForComponent(sourceComp),
63875
+ symbolScale: 1
63870
63876
  });
63871
63877
  }
63872
63878
  createLibrarySymbolForNetLabel({
@@ -63907,8 +63913,11 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
63907
63913
  keywords,
63908
63914
  fpFilters,
63909
63915
  footprintRef = "",
63910
- referencePrefix
63916
+ referencePrefix,
63917
+ symbolScale
63911
63918
  }) {
63919
+ const CIRCUIT_JSON_SCALE_FACTOR = 15;
63920
+ const c2kMatSchScale = symbolScale ?? this.ctx.c2kMatSch?.a ?? CIRCUIT_JSON_SCALE_FACTOR;
63912
63921
  const symbol = new SchematicSymbol4({
63913
63922
  libraryId: libId,
63914
63923
  excludeFromSim: false,
@@ -63934,7 +63943,7 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
63934
63943
  libId,
63935
63944
  symbolData,
63936
63945
  isChip,
63937
- c2kMatSchScale: this.ctx.c2kMatSch?.a ?? 15
63946
+ c2kMatSchScale
63938
63947
  });
63939
63948
  symbol.subSymbols.push(drawingSymbol);
63940
63949
  const pinSymbol = createPinSubsymbol({
@@ -63943,7 +63952,7 @@ var AddLibrarySymbolsStage = class extends ConverterStage {
63943
63952
  isChip,
63944
63953
  schematicComponent,
63945
63954
  schematicPorts: this.ctx.db.schematic_port.list(),
63946
- c2kMatSchScale: this.ctx.c2kMatSch?.a ?? 15
63955
+ c2kMatSchScale
63947
63956
  });
63948
63957
  symbol.subSymbols.push(pinSymbol);
63949
63958
  symbol._sxEmbeddedFonts = new EmbeddedFonts(false);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ".": "./dist/cli/main.js",
6
6
  "./lib": "./dist/lib/index.js"
7
7
  },
8
- "version": "0.1.965",
8
+ "version": "0.1.966",
9
9
  "devDependencies": {
10
10
  "@babel/standalone": "^7.26.9",
11
11
  "@biomejs/biome": "^1.9.4",
@@ -26,7 +26,7 @@
26
26
  "@types/semver": "^7.5.8",
27
27
  "bun-match-svg": "^0.0.12",
28
28
  "chokidar": "4.0.1",
29
- "circuit-json-to-kicad": "^0.0.76",
29
+ "circuit-json-to-kicad": "^0.0.78",
30
30
  "circuit-json-to-readable-netlist": "^0.0.13",
31
31
  "circuit-json-to-spice": "^0.0.10",
32
32
  "circuit-json-to-tscircuit": "^0.0.9",