@tscircuit/core 0.0.1926 → 0.0.1927

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as circuit_json from 'circuit-json';
2
- import { PcbGroup, PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, PcbVia as PcbVia$1, LayerRef, AnyCircuitElement, Size, PcbTrace as PcbTrace$1, PcbTraceRoutePoint, AnySourceComponent, PcbComponent, SchematicPort, SchematicComponent, SimulationVoltageSource, SimulationCurrentSource, PcbSilkscreenGraphic, RouteHintPoint, PcbBoard, SchematicSheet as SchematicSheet$1, SchematicGraphic as SchematicGraphic$1, SimulationExperiment, SimulationParameterSweep, CircuitJson } from 'circuit-json';
2
+ import { PcbGroup, PcbTraceError, PcbPlacementError, PcbManualEditConflictWarning, PcbViaClearanceError, PcbVia as PcbVia$1, LayerRef, AnyCircuitElement, Size, PcbTrace as PcbTrace$1, PcbTraceRoutePoint, AnySourceComponent, PcbComponent, SchematicPort, SchematicComponent, SimulationVoltageSource, SimulationCurrentSource, PcbSilkscreenGraphic, SourceBus, RouteHintPoint, PcbBoard, SchematicSheet as SchematicSheet$1, SchematicGraphic as SchematicGraphic$1, SimulationExperiment, SimulationParameterSweep, CircuitJson } from 'circuit-json';
3
3
  import * as _tscircuit_props from '@tscircuit/props';
4
4
  import { PlatformConfig, traceProps, netProps, AutoroutingPhaseProps, AutorouterProp, subcircuitGroupProps, AutorouterConfig, PcbSx, portProps, PinAttributeMap, SupplierPartNumbers, CadModelProp, SchematicPortArrangement, groupProps, platedHoleProps, BoardOutlinePoint, boardProps, subcircuitProps, subpanelProps, capacitorProps, antennaProps, chipProps, pinoutProps, diodeProps, fuseProps, jumperProps, interconnectProps, solderjumperProps, ledProps, powerSourceProps, voltageSourceProps, currentSourceProps, ammeterProps, resistorProps, constraintProps, drcCheckProps, autoroutingPhaseProps, fabricationNoteRectProps, fabricationNotePathProps, fabricationNoteTextProps, fabricationNoteDimensionProps, pcbNoteLineProps, pcbNoteRectProps, pcbNoteTextProps, pcbNotePathProps, pcbNoteDimensionProps, footprintProps, breakoutProps, breakoutPointProps, holeProps, pcbKeepoutProps, netLabelProps, cadmodelProps, cadassemblyProps, courtyardCircleProps, courtyardOutlineProps, courtyardRectProps, silkscreenCircleProps, silkscreenPathProps, silkscreenRectProps, silkscreenTextProps, silkscreenLineProps, silkscreenGraphicProps, smtPadProps, fiducialProps, busProps, differentialPairProps, traceHintProps, viaProps, copperPourProps, copperTextProps, cutoutProps, assemblyDeviceProps, enclosureCutoutApertureProps, enclosureFdmBoxProps, batteryProps, pinHeaderProps, resonatorProps, inductorProps, potentiometerProps, pushButtonProps, crystalProps, CrystalPinLabels, transistorProps, mosfetProps, opampProps, OpAmpPinLabels, switchProps, SwitchProps, testpointProps, schematicTextProps, schematicLineProps, schematicRectProps, schematicArcProps, schematicCircleProps, schematicPathProps, schematicBoxProps, schematicSymbolProps, schematicSectionProps, schematicSheetProps, schematicGraphicProps, schematicTableProps, schematicRowProps, schematicCellProps, symbolProps, analogSimulationProps, analogTransientSimulationProps, analogDcOperatingPointSimulationProps, analogDcSweepSimulationProps, analogAcSweepSimulationProps, analogSweepParameterProps, voltageProbeProps, spicemodelProps, AnalogTransientSimulationProps, AnalogDcSweepSimulationProps, AnalogAcSweepSimulationProps, AnalogSweepParameterProps, AssemblyDevicePropsInput, EnclosureCutoutApertureProps, EnclosureFdmBoxProps, CapacitorProps, ChipProps, DiodeProps, ResistorProps, ManualEditEvent, ManualEditsFile, ChipConnections, manual_edits_file } from '@tscircuit/props';
5
5
  export { FanoutTracePath, fanoutTracePath, kicadFootprintStrings } from '@tscircuit/props';
@@ -107591,7 +107591,9 @@ declare class Fiducial extends PrimitiveComponent<typeof fiducialProps> {
107591
107591
  * Declares a group of connections that an autorouter should keep together.
107592
107592
  */
107593
107593
  declare class Bus extends PrimitiveComponent<typeof busProps> {
107594
+ source_bus_id?: SourceBus["source_bus_id"];
107594
107595
  get config(): BaseComponentConfig;
107596
+ doInitialSourceAddConnectivityMapKey(): void;
107595
107597
  }
107596
107598
 
107597
107599
  /**
@@ -107651,6 +107653,8 @@ declare const pcbTraceProps: z.ZodObject<{
107651
107653
  is_inside_copper_pour: z.ZodOptional<z.ZodBoolean>;
107652
107654
  hole_diameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
107653
107655
  outer_diameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
107656
+ tented_on_top: z.ZodOptional<z.ZodBoolean>;
107657
+ tented_on_bottom: z.ZodOptional<z.ZodBoolean>;
107654
107658
  from_layer: z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6", "inner7", "inner8"]>, z.ZodObject<{
107655
107659
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6", "inner7", "inner8"]>;
107656
107660
  }, "strip", z.ZodTypeAny, {
@@ -107679,6 +107683,8 @@ declare const pcbTraceProps: z.ZodObject<{
107679
107683
  outer_diameter?: number | undefined;
107680
107684
  copper_pour_id?: string | undefined;
107681
107685
  is_inside_copper_pour?: boolean | undefined;
107686
+ tented_on_top?: boolean | undefined;
107687
+ tented_on_bottom?: boolean | undefined;
107682
107688
  }, {
107683
107689
  x: string | number;
107684
107690
  y: string | number;
@@ -107693,6 +107699,8 @@ declare const pcbTraceProps: z.ZodObject<{
107693
107699
  outer_diameter?: string | number | undefined;
107694
107700
  copper_pour_id?: string | undefined;
107695
107701
  is_inside_copper_pour?: boolean | undefined;
107702
+ tented_on_top?: boolean | undefined;
107703
+ tented_on_bottom?: boolean | undefined;
107696
107704
  }>, z.ZodObject<{
107697
107705
  route_type: z.ZodLiteral<"through_pad">;
107698
107706
  start: z.ZodObject<{
@@ -107793,6 +107801,8 @@ declare const pcbTraceProps: z.ZodObject<{
107793
107801
  outer_diameter?: number | undefined;
107794
107802
  copper_pour_id?: string | undefined;
107795
107803
  is_inside_copper_pour?: boolean | undefined;
107804
+ tented_on_top?: boolean | undefined;
107805
+ tented_on_bottom?: boolean | undefined;
107796
107806
  } | {
107797
107807
  width: number;
107798
107808
  start: {
@@ -107837,6 +107847,8 @@ declare const pcbTraceProps: z.ZodObject<{
107837
107847
  outer_diameter?: string | number | undefined;
107838
107848
  copper_pour_id?: string | undefined;
107839
107849
  is_inside_copper_pour?: boolean | undefined;
107850
+ tented_on_top?: boolean | undefined;
107851
+ tented_on_bottom?: boolean | undefined;
107840
107852
  } | {
107841
107853
  width: string | number;
107842
107854
  start: {
@@ -107913,6 +107925,8 @@ declare class PcbTrace extends PrimitiveComponent<typeof pcbTraceProps> {
107913
107925
  is_inside_copper_pour: z.ZodOptional<z.ZodBoolean>;
107914
107926
  hole_diameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
107915
107927
  outer_diameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
107928
+ tented_on_top: z.ZodOptional<z.ZodBoolean>;
107929
+ tented_on_bottom: z.ZodOptional<z.ZodBoolean>;
107916
107930
  from_layer: z.ZodEffects<z.ZodUnion<[z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6", "inner7", "inner8"]>, z.ZodObject<{
107917
107931
  name: z.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6", "inner7", "inner8"]>;
107918
107932
  }, "strip", z.ZodTypeAny, {
@@ -107941,6 +107955,8 @@ declare class PcbTrace extends PrimitiveComponent<typeof pcbTraceProps> {
107941
107955
  outer_diameter?: number | undefined;
107942
107956
  copper_pour_id?: string | undefined;
107943
107957
  is_inside_copper_pour?: boolean | undefined;
107958
+ tented_on_top?: boolean | undefined;
107959
+ tented_on_bottom?: boolean | undefined;
107944
107960
  }, {
107945
107961
  x: string | number;
107946
107962
  y: string | number;
@@ -107955,6 +107971,8 @@ declare class PcbTrace extends PrimitiveComponent<typeof pcbTraceProps> {
107955
107971
  outer_diameter?: string | number | undefined;
107956
107972
  copper_pour_id?: string | undefined;
107957
107973
  is_inside_copper_pour?: boolean | undefined;
107974
+ tented_on_top?: boolean | undefined;
107975
+ tented_on_bottom?: boolean | undefined;
107958
107976
  }>, z.ZodObject<{
107959
107977
  route_type: z.ZodLiteral<"through_pad">;
107960
107978
  start: z.ZodObject<{
@@ -108055,6 +108073,8 @@ declare class PcbTrace extends PrimitiveComponent<typeof pcbTraceProps> {
108055
108073
  outer_diameter?: number | undefined;
108056
108074
  copper_pour_id?: string | undefined;
108057
108075
  is_inside_copper_pour?: boolean | undefined;
108076
+ tented_on_top?: boolean | undefined;
108077
+ tented_on_bottom?: boolean | undefined;
108058
108078
  } | {
108059
108079
  width: number;
108060
108080
  start: {
@@ -108099,6 +108119,8 @@ declare class PcbTrace extends PrimitiveComponent<typeof pcbTraceProps> {
108099
108119
  outer_diameter?: string | number | undefined;
108100
108120
  copper_pour_id?: string | undefined;
108101
108121
  is_inside_copper_pour?: boolean | undefined;
108122
+ tented_on_top?: boolean | undefined;
108123
+ tented_on_bottom?: boolean | undefined;
108102
108124
  } | {
108103
108125
  width: string | number;
108104
108126
  start: {
package/dist/index.js CHANGED
@@ -53464,15 +53464,72 @@ import {
53464
53464
  getFullConnectivityMapFromCircuitJson as getFullConnectivityMapFromCircuitJson4
53465
53465
  } from "circuit-json-to-connectivity-map";
53466
53466
 
53467
+ // lib/utils/autorouting/getBusSourceTraceIdOrThrow.ts
53468
+ var getBusSourceTraceIdOrThrow = ({
53469
+ bus,
53470
+ busSourceTraces,
53471
+ traceNameOrPortSelector
53472
+ }) => {
53473
+ const sourceTracesWithMatchingName = busSourceTraces.filter(
53474
+ (sourceTrace2) => sourceTrace2.name === traceNameOrPortSelector
53475
+ );
53476
+ const selectedPort = sourceTracesWithMatchingName.length === 0 ? bus.getSubcircuit().selectOne(traceNameOrPortSelector, {
53477
+ type: "port"
53478
+ }) : null;
53479
+ const selectedSourcePortId = selectedPort?.source_port_id ?? void 0;
53480
+ const matchingSourceTraces = selectedSourcePortId ? busSourceTraces.filter(
53481
+ (sourceTrace2) => sourceTrace2.connected_source_port_ids.includes(selectedSourcePortId)
53482
+ ) : sourceTracesWithMatchingName;
53483
+ if (matchingSourceTraces.length === 0) {
53484
+ throw new Error(
53485
+ `Could not find source trace for trace name or port selector "${traceNameOrPortSelector}" in bus "${bus.name}"`
53486
+ );
53487
+ }
53488
+ if (matchingSourceTraces.length > 1) {
53489
+ throw new Error(
53490
+ `Trace name or port selector "${traceNameOrPortSelector}" matches multiple source traces in bus "${bus.name}"`
53491
+ );
53492
+ }
53493
+ const sourceTrace = matchingSourceTraces[0];
53494
+ return sourceTrace.source_trace_id;
53495
+ };
53496
+
53467
53497
  // lib/components/primitive-components/Bus.ts
53468
53498
  import { busProps } from "@tscircuit/props";
53469
53499
  var Bus = class extends PrimitiveComponent2 {
53500
+ source_bus_id;
53470
53501
  get config() {
53471
53502
  return {
53472
53503
  componentName: "Bus",
53473
53504
  zodProps: busProps
53474
53505
  };
53475
53506
  }
53507
+ // This phase follows SourceTraceRender for every component, including traces
53508
+ // declared after the bus. It also runs when PCB routing is disabled.
53509
+ doInitialSourceAddConnectivityMapKey() {
53510
+ const { db } = this.root;
53511
+ const subcircuit_id = this.getSubcircuit().subcircuit_id;
53512
+ const busSourceTraces = db.source_trace.list().filter((sourceTrace) => sourceTrace.subcircuit_id === subcircuit_id);
53513
+ const source_trace_ids = this._parsedProps.connections.map(
53514
+ (traceNameOrPortSelector) => getBusSourceTraceIdOrThrow({
53515
+ bus: this,
53516
+ busSourceTraces,
53517
+ traceNameOrPortSelector
53518
+ })
53519
+ );
53520
+ if (new Set(source_trace_ids).size !== source_trace_ids.length) {
53521
+ throw new Error(
53522
+ `Bus "${this.name}" resolves multiple entries to one trace`
53523
+ );
53524
+ }
53525
+ const sourceBus = db.source_bus.insert({
53526
+ name: this._parsedProps.name,
53527
+ source_trace_ids,
53528
+ max_length_skew: this._parsedProps.maxLengthSkew,
53529
+ subcircuit_id
53530
+ });
53531
+ this.source_bus_id = sourceBus.source_bus_id;
53532
+ }
53476
53533
  };
53477
53534
 
53478
53535
  // lib/components/primitive-components/DifferentialPair.ts
@@ -53625,34 +53682,6 @@ var expandSrjBoundsToIncludeConnectionPoints = (input) => {
53625
53682
  };
53626
53683
 
53627
53684
  // lib/utils/autorouting/getBusesForSimpleRouteJson.ts
53628
- var getBusSourceTraceIdOrThrow = ({
53629
- bus,
53630
- busSourceTraces,
53631
- traceNameOrPortSelector
53632
- }) => {
53633
- const sourceTracesWithMatchingName = busSourceTraces.filter(
53634
- (sourceTrace2) => sourceTrace2.name === traceNameOrPortSelector
53635
- );
53636
- const selectedPort = sourceTracesWithMatchingName.length === 0 ? bus.getSubcircuit().selectOne(traceNameOrPortSelector, {
53637
- type: "port"
53638
- }) : null;
53639
- const selectedSourcePortId = selectedPort?.source_port_id ?? void 0;
53640
- const matchingSourceTraces = selectedSourcePortId ? busSourceTraces.filter(
53641
- (sourceTrace2) => sourceTrace2.connected_source_port_ids.includes(selectedSourcePortId)
53642
- ) : sourceTracesWithMatchingName;
53643
- if (matchingSourceTraces.length === 0) {
53644
- throw new Error(
53645
- `Could not find source trace for trace name or port selector "${traceNameOrPortSelector}" in bus "${bus.name}"`
53646
- );
53647
- }
53648
- if (matchingSourceTraces.length > 1) {
53649
- throw new Error(
53650
- `Trace name or port selector "${traceNameOrPortSelector}" matches multiple source traces in bus "${bus.name}"`
53651
- );
53652
- }
53653
- const sourceTrace = matchingSourceTraces[0];
53654
- return sourceTrace.source_trace_id;
53655
- };
53656
53685
  var getBusSrjConnectionNamesOrThrow = ({
53657
53686
  srjConnections,
53658
53687
  bus,
@@ -63353,7 +63382,7 @@ var package_default = {
63353
63382
  "bun-match-svg": "0.0.12",
63354
63383
  "calculate-elbow": "^0.0.12",
63355
63384
  "chokidar-cli": "^3.0.0",
63356
- "circuit-json": "^0.0.489",
63385
+ "circuit-json": "^0.0.492",
63357
63386
  "circuit-json-to-bpc": "^0.0.13",
63358
63387
  "circuit-json-to-connectivity-map": "^0.0.30",
63359
63388
  "circuit-json-to-gltf": "^0.0.128",
@@ -63417,7 +63446,7 @@ var package_default = {
63417
63446
  overrides: {
63418
63447
  "@tscircuit/circuit-json-util": "^0.0.114",
63419
63448
  "@tscircuit/props": "^0.0.660",
63420
- "circuit-json": "^0.0.489"
63449
+ "circuit-json": "^0.0.492"
63421
63450
  }
63422
63451
  };
63423
63452
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1926",
4
+ "version": "0.0.1927",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -71,7 +71,7 @@
71
71
  "bun-match-svg": "0.0.12",
72
72
  "calculate-elbow": "^0.0.12",
73
73
  "chokidar-cli": "^3.0.0",
74
- "circuit-json": "^0.0.489",
74
+ "circuit-json": "^0.0.492",
75
75
  "circuit-json-to-bpc": "^0.0.13",
76
76
  "circuit-json-to-connectivity-map": "^0.0.30",
77
77
  "circuit-json-to-gltf": "^0.0.128",
@@ -135,6 +135,6 @@
135
135
  "overrides": {
136
136
  "@tscircuit/circuit-json-util": "^0.0.114",
137
137
  "@tscircuit/props": "^0.0.660",
138
- "circuit-json": "^0.0.489"
138
+ "circuit-json": "^0.0.492"
139
139
  }
140
140
  }