@tscircuit/cli 0.0.184 → 0.0.186

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.
@@ -1,3 +1,5 @@
1
1
  export const CapacitorExample = () => (
2
- <capacitor capacitance="10uF" name="C1" footprint="0805" />
2
+ <board width="10mm" height="10mm">
3
+ <capacitor capacitance="10uF" name="C1" footprint="0805" />
4
+ </board>
3
5
  )
@@ -0,0 +1,55 @@
1
+ import { layout } from "@tscircuit/layout"
2
+ import { ArduinoProMicroBreakout } from "example-project/src/ArduinoProMicroBreakout"
3
+ import { Key } from "example-project/src/Key"
4
+ import manualEdits from "example-project/src/manual-edits"
5
+ import { SwitchShaft } from "example-project/src/SwitchShaft"
6
+
7
+ export const MacroKeypad = () => {
8
+ const keyPositions = Array.from({ length: 9 })
9
+ .map((_, i) => ({
10
+ keyNum: i + 1,
11
+ col: i % 3,
12
+ row: Math.floor(i / 3),
13
+ }))
14
+ .map((p) => ({
15
+ ...p,
16
+ x: p.col * 19.05 - 19.05,
17
+ y: p.row * 19.05 - 19.05,
18
+ }))
19
+
20
+ const rowToMicroPin = {
21
+ 0: "D2",
22
+ 1: "D3",
23
+ 2: "D4",
24
+ }
25
+ const colToMicroPin = {
26
+ 0: "D5",
27
+ 1: "D6",
28
+ 2: "D7",
29
+ }
30
+
31
+ return (
32
+ <board width="120mm" height="80mm">
33
+ {keyPositions.map(({ keyNum, x, y }) => (
34
+ <Key name={`K${keyNum}`} keyNum={keyNum} pcbX={x} pcbY={y} />
35
+ ))}
36
+ <ArduinoProMicroBreakout key="u1" name="U1" pcbX={44} />
37
+ {keyPositions.map(({ keyNum, row, col }) => (
38
+ <trace
39
+ // @ts-ignore
40
+ key={`trace-${keyNum}-col`}
41
+ from={`.SW${keyNum} .pin1`}
42
+ to={`.U1 .${colToMicroPin[col as 0 | 1 | 2]}`}
43
+ />
44
+ ))}
45
+ {keyPositions.map(({ keyNum, row, col }) => (
46
+ <trace
47
+ // @ts-ignore
48
+ key={`trace-${keyNum}-row`}
49
+ from={`.D${keyNum} .pin2`}
50
+ to={`.U1 .${rowToMicroPin[row as 0 | 1 | 2]}`}
51
+ />
52
+ ))}
53
+ </board>
54
+ )
55
+ }
@@ -0,0 +1,37 @@
1
+ export const ArduinoProMicroBreakout = (props: {
2
+ name: string
3
+ pcbX?: number
4
+ pcbY?: number
5
+ }) => (
6
+ <chip
7
+ {...props}
8
+ footprint="dip24_w0.7in_h1.3in"
9
+ pinLabels={{
10
+ pin1: "TXD",
11
+ pin2: "RXI",
12
+ pin3: "GND1",
13
+ pin4: "GND2",
14
+ pin5: "D2",
15
+ pin6: "D3",
16
+ pin7: "D4",
17
+ pin8: "D5",
18
+ pin9: "D6",
19
+ pin10: "D7",
20
+ pin11: "D8",
21
+ pin12: "D9",
22
+ // right side (from bottom)
23
+ pin13: "D10",
24
+ pin14: "D16",
25
+ pin15: "D14",
26
+ pin16: "D15",
27
+ pin17: "A0",
28
+ pin18: "A1",
29
+ pin19: "A2",
30
+ pin20: "A3",
31
+ pin21: "VCC",
32
+ pin22: "RST",
33
+ pin23: "GND3",
34
+ pin24: "RAW",
35
+ }}
36
+ />
37
+ )
@@ -0,0 +1,36 @@
1
+ import { SwitchShaft } from "./SwitchShaft"
2
+
3
+ export const Key = (props: {
4
+ name: string
5
+ keyNum: number
6
+ pcbX: number
7
+ pcbY: number
8
+ }) => {
9
+ const shaftName = `SW${props.keyNum}`
10
+ const diodeName = `D${props.keyNum}`
11
+ return (
12
+ <>
13
+ <SwitchShaft
14
+ key="shaft1"
15
+ name={shaftName}
16
+ pcbX={props.pcbX}
17
+ pcbY={props.pcbY}
18
+ />
19
+ <diode
20
+ // @ts-ignore
21
+ key="diode"
22
+ pcbRotation={-90}
23
+ name={diodeName}
24
+ footprint="0603"
25
+ pcbX={props.pcbX + 7}
26
+ pcbY={props.pcbY - 6}
27
+ />
28
+ <trace
29
+ // @ts-ignore
30
+ key="trace1"
31
+ from={`.${shaftName} .pin2`}
32
+ to={`.${diodeName} .pin1`}
33
+ />
34
+ </>
35
+ )
36
+ }
@@ -0,0 +1,48 @@
1
+ import "@tscircuit/core"
2
+
3
+ /**
4
+ * A switch shaft you can use to connect a pluggable Kailh socket.
5
+ *
6
+ * Datasheet: https://wmsc.lcsc.com/wmsc/upload/file/pdf/v2/lcsc/2211090930_Kailh-CPG151101S11-1_C5184526.pdf
7
+ */
8
+ export const SwitchShaft = (props: {
9
+ name: string
10
+ pcbX?: number
11
+ pcbY?: number
12
+ }) => (
13
+ <chip
14
+ {...props}
15
+ footprint={
16
+ <footprint>
17
+ {/* <silkscreentext text={props.name} /> */}
18
+ <smtpad
19
+ shape="rect"
20
+ width="2.55mm"
21
+ height="2.5mm"
22
+ portHints={["pin1"]}
23
+ layer="top"
24
+ />
25
+ <smtpad
26
+ shape="rect"
27
+ width="2.55mm"
28
+ height="2.5mm"
29
+ portHints={["pin2"]}
30
+ layer="top"
31
+ />
32
+ <hole name="H1" diameter="3mm" />
33
+ <hole name="H2" diameter="3mm" />
34
+ <constraint xDist="6.35mm" centerToCenter left=".H1" right=".H2" />
35
+ <constraint yDist="2.54mm" centerToCenter top=".H1" bottom=".H2" />
36
+ <constraint edgeToEdge xDist="11.3mm" left=".pin1" right=".pin2" />
37
+ <constraint sameY for={[".pin1", ".H1"]} />
38
+ <constraint sameY for={[".pin2", ".H2"]} />
39
+ <constraint
40
+ edgeToEdge
41
+ xDist={(11.3 - 6.35 - 3) / 2}
42
+ left=".pin1"
43
+ right=".H1"
44
+ />
45
+ </footprint>
46
+ }
47
+ />
48
+ )
@@ -286,13 +286,6 @@ export const HeaderMenu = () => {
286
286
  "",
287
287
  )}
288
288
  </MenubarItem>
289
- <MenubarItem disabled>
290
- @tscircuit/react-fiber v
291
- {cliPackageJson.dependencies["@tscircuit/react-fiber"].replace(
292
- /\^/g,
293
- "",
294
- )}
295
- </MenubarItem>
296
289
  <MenubarItem disabled>
297
290
  @tscircuit/schematic-viewer v
298
291
  {cliPackageJson.devDependencies[
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.0.184",
3
+ "version": "0.0.186",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command line tool for developing, publishing and installing tscircuit circuits",
@@ -8,8 +8,9 @@
8
8
  "scripts": {
9
9
  "start": "bun cli/cli.ts",
10
10
  "dev": "bun run build:dev-server && concurrently 'bun run dev:frontend' 'bun run dev:test-project'",
11
+ "dev:fast": "concurrently 'bun run dev:frontend' 'bun run dev:test-project'",
11
12
  "dev:frontend": "vite dev --config frontend/vite.config.ts",
12
- "dev:test-project": "bun --hot cli/cli.ts dev --no-cleanup --core --cwd ./example-project",
13
+ "dev:test-project": "bun --hot cli/cli.ts dev --no-cleanup --cwd ./example-project",
13
14
  "start:dev-server": "bun build:dev-server && bun cli/cli.ts dev -y --cwd ./example-project",
14
15
  "build": "bun build:dev-server && npm run build:cli",
15
16
  "build:cli": "bun scripts/build-cli.ts",
@@ -36,9 +37,8 @@
36
37
  "@edge-runtime/primitives": "^4.1.0",
37
38
  "@hono/node-server": "^1.8.2",
38
39
  "@tscircuit/builder": "*",
40
+ "@tscircuit/core": "0.0.41",
39
41
  "@tscircuit/props": "^0.0.62",
40
- "@tscircuit/core": "0.0.35",
41
- "@tscircuit/react-fiber": "*",
42
42
  "archiver": "^7.0.1",
43
43
  "axios": "^1.6.7",
44
44
  "chokidar": "^3.6.0",
@@ -76,7 +76,6 @@
76
76
  "@tscircuit/builder": "*",
77
77
  "@tscircuit/layout": "*",
78
78
  "@tscircuit/manual-edit-events": "*",
79
- "@tscircuit/react-fiber": "*",
80
79
  "@tscircuit/soup-util": "*"
81
80
  },
82
81
  "devDependencies": {