From 52539c8c4f6f188d174a2306792f926e289966f1 Mon Sep 17 00:00:00 2001 From: seveibar Date: Mon, 10 Jun 2024 20:30:17 -0700 Subject: [PATCH] update kicad mod converter --- package-lock.json | 64 ++++++++++++++++++++++++++++++----------------- package.json | 2 +- renovate.json | 6 ++--- src/App.tsx | 16 ++++++------ 4 files changed, 52 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index 50e0f17..d61944a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,8 @@ "name": "kicad-viewer", "version": "0.0.0", "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", @@ -1566,28 +1566,6 @@ "zod": "^3.23.8" } }, - "node_modules/@tscircuit/kicad-mod-converter": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@tscircuit/kicad-mod-converter/-/kicad-mod-converter-0.0.11.tgz", - "integrity": "sha512-0SgHIRRbz+dkuRWhKCLMtgA+eURvKu0jpxFXcLuOplrnA/UKsgMeFMrP4lotWQ7/TOggSu1EDz/ciE6hjSgeeg==", - "dependencies": { - "@tscircuit/builder": "^1.5.109", - "@tscircuit/props": "^0.0.6", - "s-expression": "^3.1.1", - "zod": "^3.23.8" - } - }, - "node_modules/@tscircuit/kicad-mod-converter/node_modules/@tscircuit/props": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@tscircuit/props/-/props-0.0.6.tgz", - "integrity": "sha512-P1GkfL4n68Y116lfjahnk9AbD2E6N5tqBApVNgIZSvbFWVv3mpq/+z1FVTdSm3gljZfLU4G1yQsIufVKcHbX3Q==", - "peerDependencies": { - "@tscircuit/layout": "*", - "@tscircuit/soup": "*", - "react": "*", - "zod": "*" - } - }, "node_modules/@tscircuit/layout": { "version": "0.0.17", "resolved": "https://registry.npmjs.org/@tscircuit/layout/-/layout-0.0.17.tgz", @@ -3480,6 +3458,32 @@ "json-buffer": "3.0.1" } }, + "node_modules/kicad-mod-converter": { + "version": "0.0.21", + "resolved": "https://registry.npmjs.org/kicad-mod-converter/-/kicad-mod-converter-0.0.21.tgz", + "integrity": "sha512-qhv3nxKCmRzMz3hth5+NOVTvwUMpN39EKmL2JfZXhRPYnHPZGhrj2TTv2NEPAccRW5B7+rrlyD/gjsVXCPMcDw==", + "dependencies": { + "@tscircuit/builder": "^1.5.109", + "@tscircuit/props": "^0.0.6", + "prettier": "^3.3.1", + "s-expression": "^3.1.1", + "zod": "^3.23.8" + }, + "bin": { + "kicad-mod-converter": "dist/cli.cjs" + } + }, + "node_modules/kicad-mod-converter/node_modules/@tscircuit/props": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@tscircuit/props/-/props-0.0.6.tgz", + "integrity": "sha512-P1GkfL4n68Y116lfjahnk9AbD2E6N5tqBApVNgIZSvbFWVv3mpq/+z1FVTdSm3gljZfLU4G1yQsIufVKcHbX3Q==", + "peerDependencies": { + "@tscircuit/layout": "*", + "@tscircuit/soup": "*", + "react": "*", + "zod": "*" + } + }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -4247,6 +4251,20 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", diff --git a/package.json b/package.json index e27ca97..abfcbb7 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/renovate.json b/renovate.json index c55753e..9b947e2 100644 --- a/renovate.json +++ b/renovate.json @@ -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 }, { diff --git a/src/App.tsx b/src/App.tsx index 95a7e16..4299f0c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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 { @@ -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") @@ -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(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") @@ -59,7 +59,7 @@ function App() { cacheTime: 60_000 * 60, staleTime: 60_000 * 60, refetchOnWindowFocus: false, - } + }, ) const { data: soup, error: soupError } = useQuery( @@ -70,7 +70,7 @@ function App() { cacheTime: 60_000 * 60, staleTime: 60_000 * 60, refetchOnWindowFocus: false, - } + }, ) const handleSearchChange = (e: React.ChangeEvent) => { @@ -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[] } = {}