@tscircuit/props 0.0.645 → 0.0.646

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.
@@ -30,6 +30,8 @@ export interface AutoroutingPhaseProps extends RoutingTolerances, FanoutProps {
30
30
  }
31
31
  connection?: string
32
32
  connections?: string[]
33
+ // Reroutes traces selected by region or connection. The simplify autorouter
34
+ // may omit a selector to simplify every existing trace in the phase.
33
35
  reroute?: boolean
34
36
  }
35
37
 
@@ -55,8 +57,20 @@ export const autoroutingPhaseProps = z
55
57
  ...fanoutProps.shape,
56
58
  })
57
59
  .superRefine((value, ctx) => {
60
+ const isSimplifyAutorouter =
61
+ value.autorouter === "simplify" ||
62
+ (typeof value.autorouter === "object" &&
63
+ value.autorouter?.preset === "simplify")
64
+
65
+ if (isSimplifyAutorouter && value.reroute !== true) {
66
+ console.warn(
67
+ 'The "simplify" autorouter preset should only be used with reroute=true',
68
+ )
69
+ }
70
+
58
71
  if (
59
72
  value.reroute !== undefined &&
73
+ !(isSimplifyAutorouter && value.reroute === true) &&
60
74
  value.region === undefined &&
61
75
  value.connection === undefined &&
62
76
  value.connections === undefined
@@ -356,6 +356,7 @@ export interface AutorouterConfig {
356
356
  | "tscircuit_beta"
357
357
  | "krt"
358
358
  | "freerouting"
359
+ | "simplify"
359
360
  | "laser_prefab" // Prefabricated PCB with laser copper ablation
360
361
  | "single_layer_fanout"
361
362
  | "fanout"
@@ -376,6 +377,7 @@ export type AutorouterPreset =
376
377
  | "tscircuit_beta"
377
378
  | "krt"
378
379
  | "freerouting"
380
+ | "simplify"
379
381
  | "laser_prefab"
380
382
  | "single_layer_fanout"
381
383
  | "fanout"
@@ -443,6 +445,7 @@ export const autorouterConfig = z.object({
443
445
  "tscircuit_beta",
444
446
  "krt",
445
447
  "freerouting",
448
+ "simplify",
446
449
  "laser_prefab",
447
450
  "single_layer_fanout",
448
451
  "fanout",
@@ -466,6 +469,7 @@ export const autorouterPreset = z.union([
466
469
  z.literal("tscircuit_beta"),
467
470
  z.literal("krt"),
468
471
  z.literal("freerouting"),
472
+ z.literal("simplify"),
469
473
  z.literal("laser_prefab"), // Prefabricated PCB with laser copper ablation
470
474
  z.literal("single_layer_fanout"),
471
475
  z.literal("fanout"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.645",
3
+ "version": "0.0.646",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",