Skip to content

Commit

Permalink
moved to circuit-json
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiboSoftwareDev committed Sep 23, 2024
1 parent 5498ccd commit 6ce5453
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 36 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/pcb/convert-circuit-json-to-pcb-svg.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Point, AnyCircuitElement } from "@tscircuit/soup"
import type { Point, AnyCircuitElement } from "circuit-json"
import { type INode as SvgObject, stringify } from "svgson"
import {
type Matrix,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PCBBoard, Point } from "@tscircuit/soup"
import type { PCBBoard, Point } from "circuit-json"
import { applyToPoint, type Matrix } from "transformation-matrix"
import type { SvgObject } from "lib/svg-object"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PcbSilkscreenPath, PcbFabricationNotePath } from "@tscircuit/soup"
import type { PcbSilkscreenPath, PcbFabricationNotePath } from "circuit-json"
import { applyToPoint, type Matrix } from "transformation-matrix"
import type { SvgObject } from "lib/svg-object"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PcbFabricationNoteText } from "@tscircuit/soup"
import type { PcbFabricationNoteText } from "circuit-json"
import type { INode as SvgObject } from "svgson"
import { toString as matrixToString } from "transformation-matrix"
import {
Expand Down
2 changes: 1 addition & 1 deletion lib/pcb/svg-object-fns/create-svg-objects-from-pcb-hole.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PCBHole } from "@tscircuit/soup"
import type { PCBHole } from "circuit-json"
import { applyToPoint, type Matrix } from "transformation-matrix"
import type { SvgObject } from "lib/svg-object"
import { HOLE_COLOR } from "../colors"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PCBPlatedHole } from "@tscircuit/soup"
import type { PCBPlatedHole } from "circuit-json"
import { applyToPoint } from "transformation-matrix"
import type { SvgObject } from "lib/svg-object"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PcbSilkscreenPath } from "@tscircuit/soup"
import type { PcbSilkscreenPath } from "circuit-json"
import { applyToPoint, type Matrix } from "transformation-matrix"
import type { SvgObject } from "lib/svg-object"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PcbSilkscreenText } from "@tscircuit/soup"
import type { PcbSilkscreenText } from "circuit-json"
import type { INode as SvgObject } from "svgson"
import {
type Matrix,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PCBTrace } from "@tscircuit/soup"
import type { PCBTrace } from "circuit-json"
import { pairs } from "lib/utils/pairs"
import type { INode as SvgObject } from "svgson"
import { applyToPoint } from "transformation-matrix"
Expand Down
2 changes: 1 addition & 1 deletion lib/pcb/svg-object-fns/create-svg-objects-from-pcb-via.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PCBVia } from "@tscircuit/soup"
import type { PCBVia } from "circuit-json"
import { applyToPoint } from "transformation-matrix"

export function createSvgObjectsFromPcbVia(hole: PCBVia, transform: any): any {
Expand Down
2 changes: 1 addition & 1 deletion lib/pcb/svg-object-fns/create-svg-objects-from-smt-pads.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PCBSMTPad } from "@tscircuit/soup"
import type { PCBSMTPad } from "circuit-json"
import { applyToPoint, type Matrix } from "transformation-matrix"
import { layerNameToColor } from "../layer-name-to-color"

Expand Down
2 changes: 1 addition & 1 deletion lib/sch/convert-circuit-json-to-schematic-svg.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AnyCircuitElement } from "@tscircuit/soup"
import type { AnyCircuitElement } from "circuit-json"
import { getSvg, symbols } from "schematic-symbols"
import { parseSync, stringify } from "svgson"

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
"vite-tsconfig-paths": "^5.0.1"
},
"peerDependencies": {
"@tscircuit/soup": "*"
"circuit-json": "*"
},
"dependencies": {
"@tscircuit/footprinter": "^0.0.57",
"@tscircuit/routing": "^1.3.5",
"@tscircuit/soup": "*",
"circuit-json": "*",
"@tscircuit/soup-util": "^0.0.28",
"@types/node": "^22.5.5",
"schematic-symbols": "^0.0.17",
Expand Down
4 changes: 2 additions & 2 deletions stories/net-label-not-overlap.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react"
import { circuitJsonToSchematicSvg, circuitJsonToPcbSvg } from "../lib/index.js"
import { circuitJsonToSchematicSvg, convertCircuitJsonToPcbSvg } from "../lib/index.js"

const soup: any = [
{
Expand Down Expand Up @@ -1130,7 +1130,7 @@ const soup: any = [
]

export const NetLabelNotOverlap = () => {
const result = circuitJsonToPcbSvg(soup)
const result = convertCircuitJsonToPcbSvg(soup)

return <div dangerouslySetInnerHTML={{ __html: result }} />
}
Expand Down
6 changes: 3 additions & 3 deletions stories/pcb-silkscreen-text.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react"
import { circuitJsonToPcbSvg } from "../lib/index.js"
import type { AnyCircuitElement } from "@tscircuit/soup"
import { convertCircuitJsonToPcbSvg } from "../lib/index.js"
import type { AnyCircuitElement } from "circuit-json"

export const PcbSilkScreenText = () => {
const result = circuitJsonToPcbSvg(pcbSoup)
const result = convertCircuitJsonToPcbSvg(pcbSoup)

// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
return <div dangerouslySetInnerHTML={{ __html: result }} />
Expand Down
6 changes: 3 additions & 3 deletions stories/pcb-via.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AnyCircuitElement } from "@tscircuit/soup"
import { circuitJsonToPcbSvg } from "../lib/index.js"
import type { AnyCircuitElement } from "circuit-json"
import { convertCircuitJsonToPcbSvg } from "../lib/index.js"

export const PcbViaInNullTraceHit = () => {
const result = circuitJsonToPcbSvg(pcbSoup)
const result = convertCircuitJsonToPcbSvg(pcbSoup)

// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
return <div dangerouslySetInnerHTML={{ __html: result }} />
Expand Down
4 changes: 2 additions & 2 deletions stories/silkscreen-with-hole-and-trace.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import { circuitJsonToPcbSvg } from "../lib/index.js"
import { convertCircuitJsonToPcbSvg } from "../lib/index.js"

export const SilkScreenPcbPlatedHole = () => {
const result = circuitJsonToPcbSvg(pcbSoup as any)
const result = convertCircuitJsonToPcbSvg(pcbSoup as any)

// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
return <div dangerouslySetInnerHTML={{ __html: result }} />
Expand Down
4 changes: 2 additions & 2 deletions tests/pcb/bottom-smtpads-in-blue.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { test, expect } from "bun:test"
import { circuitJsonToPcbSvg } from "lib"
import { convertCircuitJsonToPcbSvg } from "lib"

test("bottom trace is blue", () => {
expect(
circuitJsonToPcbSvg([
convertCircuitJsonToPcbSvg([
{
type: "pcb_smtpad",
x: 0,
Expand Down
4 changes: 2 additions & 2 deletions tests/pcb/bottom-trace-in-blue.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from "bun:test"
import { circuitJsonToPcbSvg } from "lib"
import { convertCircuitJsonToPcbSvg } from "lib"

const soup: any = [
{
Expand Down Expand Up @@ -331,5 +331,5 @@ const soup: any = [
]

test("bottom trace is blue", () => {
expect(circuitJsonToPcbSvg(soup)).toMatchSvgSnapshot(import.meta.path)
expect(convertCircuitJsonToPcbSvg(soup)).toMatchSvgSnapshot(import.meta.path)
})
4 changes: 2 additions & 2 deletions tests/pcb/colored-fabnotes.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from "bun:test"
import { circuitJsonToPcbSvg } from "lib"
import { convertCircuitJsonToPcbSvg } from "lib"
import { Circuit } from "@tscircuit/core"

test("fabrication note path and fabrication note text", () => {
Expand Down Expand Up @@ -32,7 +32,7 @@ test("fabrication note path and fabrication note text", () => {

const circuitJson = circuit.getCircuitJson()

const svg = circuitJsonToPcbSvg(circuitJson as any)
const svg = convertCircuitJsonToPcbSvg(circuitJson as any)

expect(svg).toMatchSvgSnapshot(import.meta.path)
})
4 changes: 2 additions & 2 deletions tests/pcb/fabnotes.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from "bun:test"
import { circuitJsonToPcbSvg } from "lib"
import { convertCircuitJsonToPcbSvg } from "lib"
import { Circuit } from "@tscircuit/core"

test("fabrication note path and fabrication note text", () => {
Expand Down Expand Up @@ -27,7 +27,7 @@ test("fabrication note path and fabrication note text", () => {

const circuitJson = circuit.getCircuitJson()

const svg = circuitJsonToPcbSvg(circuitJson as any)
const svg = convertCircuitJsonToPcbSvg(circuitJson as any)

expect(svg).toMatchSvgSnapshot(import.meta.path)
})
4 changes: 2 additions & 2 deletions tests/pcb/hole.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from "bun:test"
import { circuitJsonToPcbSvg, convertCircuitJsonToPcbSvg } from "lib"
import { convertCircuitJsonToPcbSvg, convertconvertCircuitJsonToPcbSvg } from "lib"
import { Circuit } from "@tscircuit/core"

test("should render a hole", () => {
Expand Down Expand Up @@ -28,7 +28,7 @@ test("should render a hole", () => {

const circuitJson = circuit.getCircuitJson()

const svg = convertCircuitJsonToPcbSvg(circuitJson as any)
const svg = convertconvertCircuitJsonToPcbSvg(circuitJson as any)

expect(svg).toMatchSvgSnapshot(import.meta.path)
})
4 changes: 2 additions & 2 deletions tests/pcb/silkscreen-with-hole-and-trace.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from "bun:test"
import { circuitJsonToPcbSvg } from "lib"
import { convertCircuitJsonToPcbSvg } from "lib"

const pcbSoup: any[] = [
{
Expand Down Expand Up @@ -1075,5 +1075,5 @@ const pcbSoup: any[] = [
]

test("Silkscreen with PCB Plated Hole", () => {
expect(circuitJsonToPcbSvg(pcbSoup)).toMatchSvgSnapshot(import.meta.path)
expect(convertCircuitJsonToPcbSvg(pcbSoup)).toMatchSvgSnapshot(import.meta.path)
})

0 comments on commit 6ce5453

Please sign in to comment.