@tscircuit/cli 0.0.206 → 0.0.207

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.
@@ -123,6 +123,16 @@ export default {
123
123
  },
124
124
  ],
125
125
  },
126
+ {
127
+ pcb_port_selector: ".SW6 > .pin1",
128
+ offsets: [
129
+ {
130
+ x: 14.242563958561936,
131
+ y: -0.4071654915144425,
132
+ via: false,
133
+ },
134
+ ],
135
+ },
126
136
  ],
127
137
  edit_events: [],
128
138
  }
@@ -11,11 +11,13 @@ export const useGenericExportDialog = ({
11
11
  dialogTitle,
12
12
  dialogDescription,
13
13
  exportParameters,
14
+ fileExtension = "",
14
15
  }: {
15
16
  exportFileName: string
16
17
  dialogTitle: string
17
18
  dialogDescription: string
18
19
  exportParameters: ExportParametersInput
20
+ fileExtension?: string
19
21
  }) => {
20
22
  const [open, setIsOpen] = useState(false)
21
23
  const activeDevExamplePackage = useActiveDevPackageExampleLite()
@@ -40,7 +42,7 @@ export const useGenericExportDialog = ({
40
42
  activeDevExamplePackage
41
43
  const outputName = `${
42
44
  inputFilePath.split("/").pop()?.split(".")[0]
43
- }-${exampleExportName}-${exportFileName}`
45
+ }-${exampleExportName}-${exportFileName}${fileExtension}`
44
46
 
45
47
  return {
46
48
  openDialog,
@@ -77,6 +77,17 @@ export const HeaderMenu = () => {
77
77
  },
78
78
  })
79
79
 
80
+ const kicadPcbExportDialog = useGenericExportDialog({
81
+ dialogTitle: "Export KiCad PCB",
82
+ dialogDescription:
83
+ "Export the circuit as a KiCad PCB file. This can be opened and edited in KiCad.",
84
+ exportFileName: "kicad_pcb",
85
+ fileExtension: ".kicad_pcb",
86
+ exportParameters: {
87
+ should_export_kicad_pcb: true,
88
+ },
89
+ })
90
+
80
91
  const handleDebugClick = async () => {
81
92
  const soupData = await axios
82
93
  .post("/api/dev_package_examples/get", {
@@ -156,6 +167,9 @@ export const HeaderMenu = () => {
156
167
  <MenubarItem onSelect={() => soupExportDialog.openDialog()}>
157
168
  Circuit JSON
158
169
  </MenubarItem>
170
+ <MenubarItem onSelect={() => kicadPcbExportDialog.openDialog()}>
171
+ KiCad PCB
172
+ </MenubarItem>
159
173
  </MenubarSubContent>
160
174
  </MenubarSub>
161
175
  </MenubarContent>
@@ -306,6 +320,7 @@ export const HeaderMenu = () => {
306
320
  <pnpExportDialog.Component />
307
321
  <bomExportDialog.Component />
308
322
  <soupExportDialog.Component />
323
+ <kicadPcbExportDialog.Component />
309
324
  </>
310
325
  )
311
326
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.0.206",
3
+ "version": "0.0.207",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command line tool for developing, publishing and installing tscircuit circuits",
@@ -58,6 +58,7 @@
58
58
  "hono": "^4.1.0",
59
59
  "ignore": "^5.3.1",
60
60
  "json5": "^2.2.3",
61
+ "kicad-converter": "^0.0.4",
61
62
  "kleur": "^4.1.5",
62
63
  "lodash": "^4.17.21",
63
64
  "memory-level": "^1.0.0",