@tscircuit/cli 0.0.220 → 0.0.222

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.
@@ -8,8 +8,8 @@ export const BasicChip = () => (
8
8
  <chip
9
9
  name="U2"
10
10
  schPortArrangement={{
11
- leftSize: 4,
12
- rightSize: 4,
11
+ leftSize: 8,
12
+ rightSize: 8,
13
13
  }}
14
14
  footprint="ssop16"
15
15
  pinLabels={{
@@ -2,7 +2,7 @@ import { layout } from "@tscircuit/layout"
2
2
  import { ArduinoProMicroBreakout } from "example-project/src/ArduinoProMicroBreakout"
3
3
  import { Key } from "example-project/src/Key"
4
4
  import manualEdits from "example-project/src/manual-edits"
5
- import { SwitchShaft } from "example-project/src/SwitchShaft"
5
+ import { KeyswitchSocket } from "example-project/src/KeyswitchSocket"
6
6
 
7
7
  export const MacroKeypad = () => {
8
8
  const keyPositions = Array.from({ length: 9 })
@@ -1,4 +1,5 @@
1
- import { SwitchShaft } from "./SwitchShaft"
1
+ import { Keyswitch } from "./Keyswitch"
2
+ import { KeyswitchSocket } from "./KeyswitchSocket"
2
3
 
3
4
  export const Key = (props: {
4
5
  name: string
@@ -6,29 +7,38 @@ export const Key = (props: {
6
7
  pcbX: number
7
8
  pcbY: number
8
9
  }) => {
9
- const shaftName = `SW${props.keyNum}`
10
+ const socketName = `SW${props.keyNum}`
11
+ const switchHoleName = `HO${props.keyNum}`
10
12
  const diodeName = `D${props.keyNum}`
11
13
  return (
12
14
  <>
13
- <SwitchShaft
15
+ <KeyswitchSocket
14
16
  key="shaft1"
15
- name={shaftName}
17
+ layer="bottom"
18
+ name={socketName}
16
19
  pcbX={props.pcbX}
17
20
  pcbY={props.pcbY}
18
21
  />
22
+ <Keyswitch
23
+ key="switch"
24
+ name={switchHoleName}
25
+ pcbX={props.pcbX + 0.55}
26
+ pcbY={props.pcbY + -3.81}
27
+ />
19
28
  <diode
20
29
  // @ts-ignore
21
30
  key="diode"
22
31
  pcbRotation={-90}
23
32
  name={diodeName}
24
33
  footprint="0603"
34
+ layer="bottom"
25
35
  pcbX={props.pcbX + 7}
26
36
  pcbY={props.pcbY - 6}
27
37
  />
28
38
  <trace
29
39
  // @ts-ignore
30
40
  key="trace1"
31
- from={`.${shaftName} .pin2`}
41
+ from={`.${socketName} .pin2`}
32
42
  to={`.${diodeName} .pin1`}
33
43
  />
34
44
  </>
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Keyswitch (Brown)
3
+ *
4
+ * https://www.lcsc.com/datasheet/lcsc_datasheet_1912111437_Kailh-CPG1511F01S03_C400227.pdf
5
+ */
6
+ export const Keyswitch = (props: {
7
+ name: string
8
+ pcbX?: number
9
+ pcbY?: number
10
+ }) => {
11
+ return (
12
+ <chip
13
+ {...props}
14
+ cadModel={{
15
+ objUrl:
16
+ "https://modelcdn.tscircuit.com/easyeda_models/download?pn=C400227",
17
+ rotationOffset: { x: 180, y: 0, z: -90 },
18
+ }}
19
+ footprint={
20
+ <footprint>
21
+ <smtpad
22
+ shape="rect"
23
+ width="0.1mm"
24
+ height="0.1mm"
25
+ portHints={["pin1"]}
26
+ layer="top"
27
+ />
28
+ <hole diameter={2.5} pcbX={0} pcbY={0} />
29
+ </footprint>
30
+ }
31
+ />
32
+ )
33
+ }
@@ -5,13 +5,18 @@ import "@tscircuit/core"
5
5
  *
6
6
  * Datasheet: https://wmsc.lcsc.com/wmsc/upload/file/pdf/v2/lcsc/2211090930_Kailh-CPG151101S11-1_C5184526.pdf
7
7
  */
8
- export const SwitchShaft = (props: {
8
+ export const KeyswitchSocket = (props: {
9
9
  name: string
10
10
  pcbX?: number
11
11
  pcbY?: number
12
+ layer?: "top" | "bottom"
12
13
  }) => (
13
14
  <chip
14
15
  {...props}
16
+ pcbRotation={0}
17
+ cadModel={{
18
+ objUrl: `https://modelcdn.tscircuit.com/easyeda_models/download?pn=C5184526`,
19
+ }}
15
20
  footprint={
16
21
  <footprint>
17
22
  {/* <silkscreentext text={props.name} /> */}
@@ -52,6 +52,22 @@ export default {
52
52
  relative_to: "group_center",
53
53
  },
54
54
  ],
55
- manual_trace_hints: [],
55
+ manual_trace_hints: [
56
+ {
57
+ pcb_port_selector: ".D4 > .pin2",
58
+ offsets: [
59
+ {
60
+ x: -12.12299453118936,
61
+ y: -8.872955772271606,
62
+ via: true,
63
+ },
64
+ {
65
+ x: 43.833615026953254,
66
+ y: -17.47530225275473,
67
+ via: true,
68
+ },
69
+ ],
70
+ },
71
+ ],
56
72
  edit_events: [],
57
73
  }
@@ -10,6 +10,7 @@ import "react-data-grid/lib/styles.css"
10
10
  import { useEffect, useRef, useState } from "react"
11
11
  import type { EditEvent } from "@tscircuit/pcb-viewer"
12
12
  import { CadViewer } from "@tscircuit/3d-viewer"
13
+ import type { PcbHole, PcbSmtPad, PcbCircuitElement } from "circuit-json"
13
14
 
14
15
  export const MainContentView = () => {
15
16
  const devExamplePackageId = useGlobalStore(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.0.220",
3
+ "version": "0.0.222",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command line tool for developing, publishing and installing tscircuit circuits",
@@ -10,7 +10,7 @@
10
10
  "start": "bun run dev",
11
11
  "dev": "bun run build:dev-server && concurrently 'bun run dev:frontend' 'bun run dev:test-project'",
12
12
  "dev:fast": "concurrently 'bun run dev:frontend' 'bun run dev:test-project'",
13
- "dev:frontend": "vite dev --config frontend/vite.config.ts",
13
+ "dev:frontend": "vite dev --force --config frontend/vite.config.ts",
14
14
  "dev:test-project": "bun --hot cli/cli.ts dev --no-cleanup --cwd ./example-project",
15
15
  "start:dev-server": "bun build:dev-server && bun cli/cli.ts dev -y --cwd ./example-project",
16
16
  "build": "bun build:dev-server && npm run build:cli",
@@ -35,12 +35,13 @@
35
35
  "dependencies": {
36
36
  "@edge-runtime/primitives": "^4.1.0",
37
37
  "@hono/node-server": "^1.8.2",
38
- "@tscircuit/core": "^0.0.72",
38
+ "@tscircuit/core": "^0.0.84",
39
39
  "@tscircuit/props": "^0.0.66",
40
40
  "@tscircuit/soup": "^0.0.73",
41
41
  "archiver": "^7.0.1",
42
42
  "axios": "^1.6.7",
43
43
  "chokidar": "^3.6.0",
44
+ "circuit-json": "^0.0.77",
44
45
  "circuit-json-to-bom-csv": "^0.0.4",
45
46
  "circuit-json-to-connectivity-map": "^0.0.16",
46
47
  "circuit-json-to-gerber": "^0.0.4",
@@ -59,7 +60,7 @@
59
60
  "hono": "^4.1.0",
60
61
  "ignore": "^5.3.1",
61
62
  "json5": "^2.2.3",
62
- "kicad-converter": "^0.0.7",
63
+ "kicad-converter": "^0.0.12",
63
64
  "kleur": "^4.1.5",
64
65
  "lodash": "^4.17.21",
65
66
  "memory-level": "^1.0.0",
@@ -100,10 +101,10 @@
100
101
  "@radix-ui/react-toggle": "^1.0.3",
101
102
  "@radix-ui/react-toggle-group": "^1.0.4",
102
103
  "@radix-ui/react-tooltip": "^1.0.7",
103
- "@tscircuit/3d-viewer": "^0.0.26",
104
+ "@tscircuit/3d-viewer": "^0.0.28",
104
105
  "@tscircuit/layout": "^0.0.28",
105
106
  "@tscircuit/manual-edit-events": "^0.0.4",
106
- "@tscircuit/pcb-viewer": "^1.10.2",
107
+ "@tscircuit/pcb-viewer": "^1.10.4",
107
108
  "@tscircuit/schematic-viewer": "^1.2.14",
108
109
  "@tscircuit/soup-util": "^0.0.31",
109
110
  "@tscircuit/table-viewer": "0.0.8",