@tscircuit/eval 0.0.324 → 0.0.326
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/.github/workflows/auto-merge-tscircuitbot.yml +60 -0
- package/.github/workflows/bun-test.yml +3 -3
- package/.github/workflows/update-tscircuit-core.yml +3 -0
- package/dist/blob-url.js +1 -1
- package/dist/eval/index.d.ts +152 -4
- package/dist/eval/index.js +10 -2
- package/dist/lib/index.d.ts +152 -4
- package/dist/lib/index.js +13 -2
- package/dist/webworker/entrypoint.js +308 -308
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +4 -1
- package/lib/runner/CircuitRunner.ts +7 -0
- package/lib/shared/types.ts +2 -0
- package/lib/worker.ts +3 -0
- package/package.json +5 -5
- package/tests/features/project-config.test.tsx +25 -0
- package/webworker/entrypoint.ts +7 -0
- package/webworker/execution-context.ts +7 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface CircuitRunnerConfiguration {
|
|
|
8
8
|
cjsRegistryUrl: string;
|
|
9
9
|
verbose?: boolean;
|
|
10
10
|
platform?: PlatformConfig;
|
|
11
|
+
projectConfig?: Partial<PlatformConfig>;
|
|
11
12
|
}
|
|
12
13
|
interface WebWorkerConfiguration extends CircuitRunnerConfiguration {
|
|
13
14
|
evalVersion?: string;
|
|
@@ -42,6 +43,7 @@ interface CircuitRunnerApi {
|
|
|
42
43
|
getCircuitJson: () => Promise<AnyCircuitElement[]>;
|
|
43
44
|
setSnippetsApiBaseUrl: (baseUrl: string) => Promise<void>;
|
|
44
45
|
setPlatformConfig: (platform: PlatformConfig) => Promise<void>;
|
|
46
|
+
setProjectConfig: (project: Partial<PlatformConfig>) => Promise<void>;
|
|
45
47
|
enableDebug: (namespace: string) => Promise<void>;
|
|
46
48
|
on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void;
|
|
47
49
|
clearEventListeners: () => void;
|
|
@@ -73,6 +75,7 @@ interface ExecutionContext extends WebWorkerConfiguration {
|
|
|
73
75
|
declare function createExecutionContext(webWorkerConfiguration: WebWorkerConfiguration, opts?: {
|
|
74
76
|
name?: string;
|
|
75
77
|
platform?: PlatformConfig;
|
|
78
|
+
projectConfig?: Partial<PlatformConfig>;
|
|
76
79
|
debugNamespace?: string;
|
|
77
80
|
}): ExecutionContext;
|
|
78
81
|
|
|
@@ -104,6 +107,7 @@ declare class CircuitRunner implements CircuitRunnerApi {
|
|
|
104
107
|
kill(): Promise<void>;
|
|
105
108
|
setSnippetsApiBaseUrl(baseUrl: string): Promise<void>;
|
|
106
109
|
setPlatformConfig(platform: PlatformConfig): Promise<void>;
|
|
110
|
+
setProjectConfig(project: Partial<PlatformConfig>): Promise<void>;
|
|
107
111
|
enableDebug(namespace: string): Promise<void>;
|
|
108
112
|
private _bindEventListeners;
|
|
109
113
|
}
|
|
@@ -709,14 +713,14 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
709
713
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
710
714
|
} | {
|
|
711
715
|
type: "source_pcb_ground_plane";
|
|
712
|
-
source_group_id: string;
|
|
713
716
|
source_net_id: string;
|
|
717
|
+
source_group_id: string;
|
|
714
718
|
source_pcb_ground_plane_id: string;
|
|
715
719
|
subcircuit_id?: string | undefined;
|
|
716
720
|
} | {
|
|
717
721
|
type: "source_manually_placed_via";
|
|
718
|
-
source_group_id: string;
|
|
719
722
|
source_net_id: string;
|
|
723
|
+
source_group_id: string;
|
|
720
724
|
source_manually_placed_via_id: string;
|
|
721
725
|
subcircuit_id?: string | undefined;
|
|
722
726
|
source_trace_id?: string | undefined;
|
|
@@ -795,6 +799,16 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
795
799
|
subcircuit_id?: string | undefined;
|
|
796
800
|
pcb_group_id?: string | undefined;
|
|
797
801
|
footprinter_string?: string | undefined;
|
|
802
|
+
} | {
|
|
803
|
+
message: string;
|
|
804
|
+
type: "circuit_json_footprint_load_error";
|
|
805
|
+
pcb_component_id: string;
|
|
806
|
+
source_component_id: string;
|
|
807
|
+
error_type: "circuit_json_footprint_load_error";
|
|
808
|
+
circuit_json_footprint_load_error_id: string;
|
|
809
|
+
subcircuit_id?: string | undefined;
|
|
810
|
+
pcb_group_id?: string | undefined;
|
|
811
|
+
circuit_json?: any[] | undefined;
|
|
798
812
|
} | {
|
|
799
813
|
message: string;
|
|
800
814
|
type: "pcb_manual_edit_conflict_warning";
|
|
@@ -868,6 +882,8 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
868
882
|
pad_shape: "rect";
|
|
869
883
|
rect_pad_width: number;
|
|
870
884
|
rect_pad_height: number;
|
|
885
|
+
hole_offset_x: number;
|
|
886
|
+
hole_offset_y: number;
|
|
871
887
|
pcb_component_id?: string | undefined;
|
|
872
888
|
subcircuit_id?: string | undefined;
|
|
873
889
|
pcb_group_id?: string | undefined;
|
|
@@ -887,6 +903,8 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
887
903
|
pad_shape: "rect";
|
|
888
904
|
rect_pad_width: number;
|
|
889
905
|
rect_pad_height: number;
|
|
906
|
+
hole_offset_x: number;
|
|
907
|
+
hole_offset_y: number;
|
|
890
908
|
hole_ccw_rotation: number;
|
|
891
909
|
rect_ccw_rotation: number;
|
|
892
910
|
pcb_component_id?: string | undefined;
|
|
@@ -933,6 +951,11 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
933
951
|
subcircuit_id?: string | undefined;
|
|
934
952
|
pcb_group_id?: string | undefined;
|
|
935
953
|
is_board_pinout?: boolean | undefined;
|
|
954
|
+
} | {
|
|
955
|
+
type: "pcb_net";
|
|
956
|
+
pcb_net_id: string;
|
|
957
|
+
rats_nest_color?: string | undefined;
|
|
958
|
+
source_net_id?: string | undefined;
|
|
936
959
|
} | {
|
|
937
960
|
type: "pcb_text";
|
|
938
961
|
width: number;
|
|
@@ -976,6 +999,7 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
976
999
|
route_order_index?: number | undefined;
|
|
977
1000
|
should_round_corners?: boolean | undefined;
|
|
978
1001
|
trace_length?: number | undefined;
|
|
1002
|
+
rats_nest_color?: string | undefined;
|
|
979
1003
|
} | {
|
|
980
1004
|
x: number;
|
|
981
1005
|
y: number;
|
|
@@ -1555,8 +1579,60 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1555
1579
|
y1: number;
|
|
1556
1580
|
x2: number;
|
|
1557
1581
|
y2: number;
|
|
1582
|
+
color: string;
|
|
1583
|
+
schematic_component_id: string;
|
|
1584
|
+
is_dashed: boolean;
|
|
1585
|
+
schematic_line_id: string;
|
|
1586
|
+
subcircuit_id?: string | undefined;
|
|
1587
|
+
stroke_width?: number | null | undefined;
|
|
1588
|
+
} | {
|
|
1589
|
+
type: "schematic_rect";
|
|
1590
|
+
width: number;
|
|
1591
|
+
height: number;
|
|
1592
|
+
center: {
|
|
1593
|
+
x: number;
|
|
1594
|
+
y: number;
|
|
1595
|
+
};
|
|
1596
|
+
rotation: number;
|
|
1597
|
+
is_filled: boolean;
|
|
1598
|
+
color: string;
|
|
1558
1599
|
schematic_component_id: string;
|
|
1600
|
+
is_dashed: boolean;
|
|
1601
|
+
schematic_rect_id: string;
|
|
1602
|
+
subcircuit_id?: string | undefined;
|
|
1603
|
+
stroke_width?: number | null | undefined;
|
|
1604
|
+
fill_color?: string | undefined;
|
|
1605
|
+
} | {
|
|
1606
|
+
type: "schematic_circle";
|
|
1607
|
+
center: {
|
|
1608
|
+
x: number;
|
|
1609
|
+
y: number;
|
|
1610
|
+
};
|
|
1611
|
+
radius: number;
|
|
1612
|
+
is_filled: boolean;
|
|
1613
|
+
color: string;
|
|
1614
|
+
schematic_component_id: string;
|
|
1615
|
+
is_dashed: boolean;
|
|
1616
|
+
schematic_circle_id: string;
|
|
1617
|
+
subcircuit_id?: string | undefined;
|
|
1618
|
+
stroke_width?: number | null | undefined;
|
|
1619
|
+
fill_color?: string | undefined;
|
|
1620
|
+
} | {
|
|
1621
|
+
type: "schematic_arc";
|
|
1622
|
+
center: {
|
|
1623
|
+
x: number;
|
|
1624
|
+
y: number;
|
|
1625
|
+
};
|
|
1626
|
+
radius: number;
|
|
1627
|
+
color: string;
|
|
1628
|
+
schematic_component_id: string;
|
|
1629
|
+
is_dashed: boolean;
|
|
1630
|
+
direction: "clockwise" | "counterclockwise";
|
|
1631
|
+
schematic_arc_id: string;
|
|
1632
|
+
start_angle_degrees: number;
|
|
1633
|
+
end_angle_degrees: number;
|
|
1559
1634
|
subcircuit_id?: string | undefined;
|
|
1635
|
+
stroke_width?: number | null | undefined;
|
|
1560
1636
|
} | {
|
|
1561
1637
|
type: "schematic_component";
|
|
1562
1638
|
center: {
|
|
@@ -2456,14 +2532,14 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2456
2532
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
2457
2533
|
} | {
|
|
2458
2534
|
type: "source_pcb_ground_plane";
|
|
2459
|
-
source_group_id: string;
|
|
2460
2535
|
source_net_id: string;
|
|
2536
|
+
source_group_id: string;
|
|
2461
2537
|
source_pcb_ground_plane_id: string;
|
|
2462
2538
|
subcircuit_id?: string | undefined;
|
|
2463
2539
|
} | {
|
|
2464
2540
|
type: "source_manually_placed_via";
|
|
2465
|
-
source_group_id: string;
|
|
2466
2541
|
source_net_id: string;
|
|
2542
|
+
source_group_id: string;
|
|
2467
2543
|
source_manually_placed_via_id: string;
|
|
2468
2544
|
subcircuit_id?: string | undefined;
|
|
2469
2545
|
source_trace_id?: string | undefined;
|
|
@@ -2542,6 +2618,16 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2542
2618
|
subcircuit_id?: string | undefined;
|
|
2543
2619
|
pcb_group_id?: string | undefined;
|
|
2544
2620
|
footprinter_string?: string | undefined;
|
|
2621
|
+
} | {
|
|
2622
|
+
message: string;
|
|
2623
|
+
type: "circuit_json_footprint_load_error";
|
|
2624
|
+
pcb_component_id: string;
|
|
2625
|
+
source_component_id: string;
|
|
2626
|
+
error_type: "circuit_json_footprint_load_error";
|
|
2627
|
+
circuit_json_footprint_load_error_id: string;
|
|
2628
|
+
subcircuit_id?: string | undefined;
|
|
2629
|
+
pcb_group_id?: string | undefined;
|
|
2630
|
+
circuit_json?: any[] | undefined;
|
|
2545
2631
|
} | {
|
|
2546
2632
|
message: string;
|
|
2547
2633
|
type: "pcb_manual_edit_conflict_warning";
|
|
@@ -2615,6 +2701,8 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2615
2701
|
pad_shape: "rect";
|
|
2616
2702
|
rect_pad_width: number;
|
|
2617
2703
|
rect_pad_height: number;
|
|
2704
|
+
hole_offset_x: number;
|
|
2705
|
+
hole_offset_y: number;
|
|
2618
2706
|
pcb_component_id?: string | undefined;
|
|
2619
2707
|
subcircuit_id?: string | undefined;
|
|
2620
2708
|
pcb_group_id?: string | undefined;
|
|
@@ -2634,6 +2722,8 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2634
2722
|
pad_shape: "rect";
|
|
2635
2723
|
rect_pad_width: number;
|
|
2636
2724
|
rect_pad_height: number;
|
|
2725
|
+
hole_offset_x: number;
|
|
2726
|
+
hole_offset_y: number;
|
|
2637
2727
|
hole_ccw_rotation: number;
|
|
2638
2728
|
rect_ccw_rotation: number;
|
|
2639
2729
|
pcb_component_id?: string | undefined;
|
|
@@ -2680,6 +2770,11 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2680
2770
|
subcircuit_id?: string | undefined;
|
|
2681
2771
|
pcb_group_id?: string | undefined;
|
|
2682
2772
|
is_board_pinout?: boolean | undefined;
|
|
2773
|
+
} | {
|
|
2774
|
+
type: "pcb_net";
|
|
2775
|
+
pcb_net_id: string;
|
|
2776
|
+
rats_nest_color?: string | undefined;
|
|
2777
|
+
source_net_id?: string | undefined;
|
|
2683
2778
|
} | {
|
|
2684
2779
|
type: "pcb_text";
|
|
2685
2780
|
width: number;
|
|
@@ -2723,6 +2818,7 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2723
2818
|
route_order_index?: number | undefined;
|
|
2724
2819
|
should_round_corners?: boolean | undefined;
|
|
2725
2820
|
trace_length?: number | undefined;
|
|
2821
|
+
rats_nest_color?: string | undefined;
|
|
2726
2822
|
} | {
|
|
2727
2823
|
x: number;
|
|
2728
2824
|
y: number;
|
|
@@ -3302,8 +3398,60 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
3302
3398
|
y1: number;
|
|
3303
3399
|
x2: number;
|
|
3304
3400
|
y2: number;
|
|
3401
|
+
color: string;
|
|
3402
|
+
schematic_component_id: string;
|
|
3403
|
+
is_dashed: boolean;
|
|
3404
|
+
schematic_line_id: string;
|
|
3405
|
+
subcircuit_id?: string | undefined;
|
|
3406
|
+
stroke_width?: number | null | undefined;
|
|
3407
|
+
} | {
|
|
3408
|
+
type: "schematic_rect";
|
|
3409
|
+
width: number;
|
|
3410
|
+
height: number;
|
|
3411
|
+
center: {
|
|
3412
|
+
x: number;
|
|
3413
|
+
y: number;
|
|
3414
|
+
};
|
|
3415
|
+
rotation: number;
|
|
3416
|
+
is_filled: boolean;
|
|
3417
|
+
color: string;
|
|
3305
3418
|
schematic_component_id: string;
|
|
3419
|
+
is_dashed: boolean;
|
|
3420
|
+
schematic_rect_id: string;
|
|
3421
|
+
subcircuit_id?: string | undefined;
|
|
3422
|
+
stroke_width?: number | null | undefined;
|
|
3423
|
+
fill_color?: string | undefined;
|
|
3424
|
+
} | {
|
|
3425
|
+
type: "schematic_circle";
|
|
3426
|
+
center: {
|
|
3427
|
+
x: number;
|
|
3428
|
+
y: number;
|
|
3429
|
+
};
|
|
3430
|
+
radius: number;
|
|
3431
|
+
is_filled: boolean;
|
|
3432
|
+
color: string;
|
|
3433
|
+
schematic_component_id: string;
|
|
3434
|
+
is_dashed: boolean;
|
|
3435
|
+
schematic_circle_id: string;
|
|
3436
|
+
subcircuit_id?: string | undefined;
|
|
3437
|
+
stroke_width?: number | null | undefined;
|
|
3438
|
+
fill_color?: string | undefined;
|
|
3439
|
+
} | {
|
|
3440
|
+
type: "schematic_arc";
|
|
3441
|
+
center: {
|
|
3442
|
+
x: number;
|
|
3443
|
+
y: number;
|
|
3444
|
+
};
|
|
3445
|
+
radius: number;
|
|
3446
|
+
color: string;
|
|
3447
|
+
schematic_component_id: string;
|
|
3448
|
+
is_dashed: boolean;
|
|
3449
|
+
direction: "clockwise" | "counterclockwise";
|
|
3450
|
+
schematic_arc_id: string;
|
|
3451
|
+
start_angle_degrees: number;
|
|
3452
|
+
end_angle_degrees: number;
|
|
3306
3453
|
subcircuit_id?: string | undefined;
|
|
3454
|
+
stroke_width?: number | null | undefined;
|
|
3307
3455
|
} | {
|
|
3308
3456
|
type: "schematic_component";
|
|
3309
3457
|
center: {
|