@tscircuit/schematic-trace-solver 0.0.24 → 0.0.26

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.
Files changed (49) hide show
  1. package/.github/workflows/bun-test.yml +8 -0
  2. package/README.md +28 -0
  3. package/bunfig.toml +2 -2
  4. package/dist/index.js +24 -6137
  5. package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +0 -1
  6. package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/SingleNetLabelPlacementSolver_visualize.ts +0 -1
  7. package/lib/solvers/NetLabelPlacementSolver/SingleNetLabelPlacementSolver/geometry.ts +1 -1
  8. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver.ts +0 -2
  9. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver/SchematicTraceSingleLineSolver.ts +0 -1
  10. package/lib/solvers/TraceOverlapShiftSolver/TraceOverlapIssueSolver/TraceOverlapIssueSolver.ts +0 -2
  11. package/lib/solvers/TraceOverlapShiftSolver/TraceOverlapShiftSolver.ts +0 -1
  12. package/package.json +6 -7
  13. package/site/components/DownloadDropdown.tsx +4 -2
  14. package/site/examples/example01-basic.page.tsx +1 -1
  15. package/site/examples/example02.page.tsx +1 -1
  16. package/site/examples/example03.page.tsx +1 -1
  17. package/site/examples/example04-single-symbol.page.tsx +1 -1
  18. package/site/examples/example05.page.tsx +1 -1
  19. package/site/examples/example06.page.tsx +1 -1
  20. package/site/examples/example07.page.tsx +1 -1
  21. package/site/examples/example08.page.tsx +1 -1
  22. package/site/examples/example09.page.tsx +1 -1
  23. package/site/examples/example10.page.tsx +1 -1
  24. package/site/examples/example11.page.tsx +119 -0
  25. package/site/examples/example12.page.tsx +97 -0
  26. package/tests/__snapshots__/svg.snap.svg +3 -0
  27. package/tests/examples/__snapshots__/example01.snap.svg +157 -0
  28. package/tests/examples/__snapshots__/example02.snap.svg +262 -0
  29. package/tests/examples/__snapshots__/example03.snap.svg +282 -0
  30. package/tests/examples/__snapshots__/example04.snap.svg +87 -0
  31. package/tests/examples/__snapshots__/example05.snap.svg +190 -0
  32. package/tests/examples/__snapshots__/example06.snap.svg +94 -0
  33. package/tests/examples/__snapshots__/example07.snap.svg +204 -0
  34. package/tests/examples/__snapshots__/example08.snap.svg +136 -0
  35. package/tests/examples/__snapshots__/example09.snap.svg +484 -0
  36. package/tests/examples/__snapshots__/example10.snap.svg +135 -0
  37. package/tests/examples/example01.test.ts +12 -0
  38. package/tests/examples/example02.test.ts +12 -0
  39. package/tests/examples/example03.test.ts +12 -0
  40. package/tests/examples/example04.test.ts +12 -0
  41. package/tests/examples/example05.test.ts +12 -0
  42. package/tests/examples/example06.test.ts +12 -0
  43. package/tests/examples/example07.test.ts +12 -0
  44. package/tests/examples/example08.test.ts +12 -0
  45. package/tests/examples/example09.test.ts +12 -0
  46. package/tests/examples/example10.test.ts +12 -0
  47. package/tests/fixtures/matcher.ts +62 -0
  48. package/tests/fixtures/preload.ts +1 -0
  49. package/tests/svg.test.ts +11 -0
@@ -26,3 +26,11 @@ jobs:
26
26
 
27
27
  - name: Run tests
28
28
  run: bun test
29
+
30
+ - name: Upload test diff artifacts
31
+ if: always()
32
+ uses: actions/upload-artifact@v4
33
+ with:
34
+ name: test-diff-images
35
+ path: "**/*.diff.png"
36
+ if-no-files-found: ignore
package/README.md CHANGED
@@ -81,3 +81,31 @@ const solver = new SchematicTracePipelineSolver({
81
81
 
82
82
  solver.solve()
83
83
  ```
84
+
85
+ ## Development
86
+
87
+ ### Running locally
88
+
89
+ Every `*.page.tsx` file in the `site` directory automatically appears in the
90
+ browser when you run `bun run start`. You should add pages to help you debug
91
+ various solvers.
92
+
93
+ By clicking the solver name at the top of the page, you can download specific
94
+ inputs for each solver. This can help to reproduce bugs in the solvers that
95
+ only appear at certain iterations.
96
+
97
+ ### Downloading input problems from tscircuit
98
+
99
+ 1. Create a test in [tscircuit/core](https://github.com/tscircuit/core)
100
+ 2. Set `DEBUG=Group_doInitialSchematicTraceRender`
101
+ 3. Run the test with `bun test`
102
+ 4. The console output will show the location of the input problem
103
+ 5. Copy the input problem and [paste it into the input debugger](https://schematic-trace-solver.vercel.app/?fixture=%7B%22path%22%3A%22site%2Fexamples%2Fexample01-basic.page.tsx%22%7D)
104
+ 6. Download the `page.tsx` or `test.tsx` file and put it in the `site` or `tests` directories.
105
+
106
+ <img width="1288" height="1128" alt="image" src="https://github.com/user-attachments/assets/c067f7f9-c46c-4600-a0a4-5112440bd2f4" />
107
+
108
+ ### Updating Test Snapshots
109
+
110
+ 1. `export BUN_UPDATE_SNAPSHOTS=1`
111
+ 2. `bun test`
package/bunfig.toml CHANGED
@@ -1,5 +1,5 @@
1
- # [test]
2
- # preload = ["./tests/fixtures/preload.ts"]
1
+ [test]
2
+ preload = ["./tests/fixtures/preload.ts"]
3
3
 
4
4
  [install.lockfile]
5
5
  save = false