@tscircuit/fanout-solver 0.0.54 → 0.0.55

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.
@@ -1,6 +1,5 @@
1
1
  import type { SimpleRouteJson } from "@tscircuit/capacity-autorouter"
2
2
  import { BaseSolver } from "@tscircuit/solver-utils"
3
- import { shortenBusPlans } from "./shorten-bus-plans"
4
3
  import { type GraphicsObject, mergeGraphics } from "graphics-debug"
5
4
  import { addViaLayerMetadataToSrj } from "./add-via-layer-metadata"
6
5
  import { getCornerBandSide, getExitEdgeForDirection } from "./boundary-exit"
@@ -34,6 +33,8 @@ import {
34
33
  } from "./route-bus"
35
34
  import { routeSingleLayerWithAdaptiveExitsSteps } from "./route-single-layer-adaptive-exits"
36
35
  import { routeSingleLayerWithPushAndShove } from "./route-single-layer-push-shove"
36
+ import { getRuntimeProcess } from "./runtime-process"
37
+ import { shortenBusPlans } from "./shorten-bus-plans"
37
38
  import type {
38
39
  AssignmentAttempt,
39
40
  Bounds,
@@ -49,6 +50,11 @@ import type {
49
50
  import { validateFanoutSolution } from "./validate-fanout-solution"
50
51
  import { visualizeSimpleRouteJson } from "./visualize-simple-route-json"
51
52
 
53
+ // Browser Web Workers do not expose Node's `process` global. Keep a local,
54
+ // browser-safe adapter so the optional debug environment flags still work in
55
+ // Node and Bun without crashing browser-based routing.
56
+ const process = getRuntimeProcess(globalThis)
57
+
52
58
  interface ResolvedFanoutConfig {
53
59
  traceWidth: number
54
60
  viaDiameter: number
@@ -0,0 +1,10 @@
1
+ export interface RuntimeProcess {
2
+ env: Record<string, string | undefined>
3
+ }
4
+
5
+ interface RuntimeGlobal {
6
+ process?: RuntimeProcess
7
+ }
8
+
9
+ export const getRuntimeProcess = (runtime: RuntimeGlobal): RuntimeProcess =>
10
+ runtime.process ?? { env: {} }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/fanout-solver",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "BGA fanout solver with coordinated bus-layer escapes for SimpleRouteJson",
5
5
  "module": "lib/index.ts",
6
6
  "type": "module",