Skip to content

Commit

Permalink
update kicad mod converter
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Jun 11, 2024
1 parent 1ae69bb commit 52539c8
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 36 deletions.
64 changes: 41 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"aider": "aider --no-auto-commits --no-auto-lint"
},
"dependencies": {
"@tscircuit/kicad-mod-converter": "^0.0.11",
"@tscircuit/pcb-viewer": "^1.3.10",
"kicad-mod-converter": "^0.0.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
Expand Down
6 changes: 2 additions & 4 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"extends": ["config:base"],
"packageRules": [
{
"packagePatterns": ["*"],
"excludePackagePatterns": ["@tscircuit/*"],
"excludePackagePatterns": ["@tscircuit/*", "kicad-mod-converter"],
"enabled": false
},
{
Expand Down
16 changes: 8 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { MdSubdirectoryArrowRight } from "react-icons/md"
import { FaTimes } from "react-icons/fa"
import { PCBViewer } from "@tscircuit/pcb-viewer"
import { parseKicadModToTscircuitSoup } from "@tscircuit/kicad-mod-converter"
import { parseKicadModToTscircuitSoup } from "kicad-mod-converter"

function App() {
const {
Expand All @@ -22,7 +22,7 @@ function App() {
"kicadFiles",
async () => {
const response = await fetch(
"https://kicad-mod-cache.tscircuit.com/kicad_files.json"
"https://kicad-mod-cache.tscircuit.com/kicad_files.json",
)
if (!response.ok) {
throw new Error("Network response was not ok")
Expand All @@ -35,19 +35,19 @@ function App() {
cacheTime: 60_000 * 60,
staleTime: 60_000 * 60,
refetchOnWindowFocus: false,
}
},
)

const [searchTerm, setSearchTerm] = useState("")
const [expandedDirs, setExpandedDirs] = useState<{ [key: string]: boolean }>(
{}
{},
)
const [selectedFile, setSelectedFile] = useState<string | null>(null)
const { data: fileContent, error: fileError } = useQuery(
["fileContent", selectedFile],
async () => {
const response = await fetch(
`https://kicad-mod-cache.tscircuit.com/${selectedFile}`
`https://kicad-mod-cache.tscircuit.com/${selectedFile}`,
)
if (!response.ok) {
throw new Error("Network response was not ok")
Expand All @@ -59,7 +59,7 @@ function App() {
cacheTime: 60_000 * 60,
staleTime: 60_000 * 60,
refetchOnWindowFocus: false,
}
},
)

const { data: soup, error: soupError } = useQuery(
Expand All @@ -70,7 +70,7 @@ function App() {
cacheTime: 60_000 * 60,
staleTime: 60_000 * 60,
refetchOnWindowFocus: false,
}
},
)

const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {
Expand Down Expand Up @@ -107,7 +107,7 @@ function App() {
}, [kicadFiles])

const filteredData = kicadFiles?.filter((filePath: string) =>
filePath.toLowerCase().includes(searchTerm.toLowerCase())
filePath.toLowerCase().includes(searchTerm.toLowerCase()),
)

const dirStructure: { [key: string]: string[] } = {}
Expand Down

0 comments on commit 52539c8

Please sign in to comment.