0.0.342 • Published 9 months ago

tscircuit v0.0.342

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

⏣ tscircuit - React for Circuits

Docs · Website · Twitter · discord · Quickstart · Online Playground

NPM Version npm.io

Make electronics using Typescript, React and AI.

npm install -g tscircuit

tscircuit is a library complemented by a registry, package manager, command line tool and AI electronic design suite that makes it easy to create, share, export and manufacture electronic circuits. It uses React Fiber to render circuits into web pages.

const Circuit = () => (
  <board width="50mm" height="50mm" center_x={0} center_y={0}>
    <MySubcomponent name="U1" center={[0, 0]} footprint="sot236" />
    <resistor
      x={2}
      y={-0.5}
      name="R1"
      resistance="10ohm"
      footprint="0805"
      pcb_x="4mm"
      pcb_y="-1mm"
    />
    <ground x={3} y={1} name="GND" />
    <trace path={[".U1 > .D0", ".R1 > .left"]} />
    <trace path={[".R1 > .right", ".GND > .gnd"]} />
  </board>
)

Example Circuit Rendering

https://github.com/tscircuit/tscircuit/assets/1910070/63610730-41e6-4a00-9748-e4c3691e5ca9

Getting Started

You can do everything you need to do with tscircuit using the tsci command line tool.

npm install -g tscircuit

tsci dev

Open your browser to http://localhost:3020!

tsci Server Preview

More Features!

  • Preview PCBs & Schematics in your browser
  • Use normal Typescript/React tooling
  • Export Gerbers, Pick'n'Place and BOM for manufacturing
  • Add registry packages with tsci add
  • Publish subpackages to the registry with tsci publish
  • Simplified, extensible auto-routing for schematics and PCBs
  • Generate footprints from text using AI

FAQ

Is tscircuit free?

tscircuit is completely free and MIT-licensed open-source

How does this work?

tscircuit uses the same thing that React Native and react-three-fiber use to render to mobile or 3d to render PCBs and schematics (it's called React Fiber!)

You can render schematics or PCBs in any React project like this:

import { Schematic } from "@tscircuit/schematic-viewer"

export const MyApp = () => (
  <div>Regular web react here!</div>
  <Schematic>
   <resistor name="R1" resistance="10k" />
  </Schematic>
)

tscircuit has a bunch of extra tools and exports in the command line, so it's a bit easier to use tsci dev to develop circuits (you can always publish and import them later)

Is this ready for production?

No! Although I've ordered a fully assembled circuit (source code), this project is still very very early!

How does the registry work?

The tscircuit registry fully implements the npm registry. When you run tsci init a .npmrc file is created in your project so that any npm add or npm install for a package starting with @tsci/* will go to the tscircuit registry instead of the npm registry.

# Example .npmrc
# This line says "any package from the org @tsci should use the tscircuit registry server
@tsci:registry=https://registry-api.tscircuit.com/npm

Can I use a different registry?

Yes! You can use the same trick and modify the .npmrc file for your project. You can run your own npm registry with verdaccio

Why are some things upside down?

If you see something upside down, it's because mid-April the Y Axis was flipped so that "up" would mean the Y value would increase for both schematics and PCBs. In web development, the Y axis is negative as you go up, but this probably isn't a good choice an engineering tool so now the Y Axis is positive and some things are upside down until they're fixed.

Can I test this in my browser?

Yes! There is a playground tool!

Do I have to specify the position of every component?

I'm working on autolayout functionality where you will hopefully only need to tweak things like the spacing. The goal of anything auto

Is the auto-routing good?

The auto-routing is very basic. You can adjust the paths by adding pcb_route_hints to a <trace />. Over time, we'll get good, fast auto-routing algorithms and also ways to "bake & cache" a route over a longer time period.

Can I export into other tools for routing?

This isn't currently possible but a major current objective. If you're interested in writing a module that can convert tscircuit soup JSON into another editor's format, reach out on our campfire!!

I found a bug or have an idea for a feature, what should I do?

Please create an issue!

How can I follow along?

Does this use AI?

No, but AI is pretty good at generating circuits! Try it with copilot!

What big features are coming?

  • Type-safe traces
  • Autolayout and autorouter improvements
  • Layout and route "baking" for more complex routes/layouts
  • Lots and lots of static analysis
  • SPICE output!
  • Export to other EDA tools
  • Less bugs! A lot less bugs!

Development Sub-Projects / Organization

tscircuit includes a lot of different independently-runnable sub-projects. Here's a quick guide to navigating all of the sub-projects:

Core Libraries

ProjectDescription
tscircuitThe main package, packages up everything into a single version
@tscircuit/builderA typescript-native library for building circuits (no React). Converts typescript into "the soup format"
@tscircuit/cliThe tscircuit command line tool tsci and development environment
@tscircuit/schematic-viewerThe Schematic renderer
@tscircuit/pcb-viewerThe PCB renderer
@tscircuit/react-fiberBindings from builder to React, React types
@tscircuit/routingRouting algorithms for schematic and PCB traces
@tscircuit/autolayoutLayout algorithms for schematics
@tscircuit/footprinterDSL for creating footprints
kicad-mod-converterConvert kicad_mod files to and from JSON
@tscircuit/kicad-viewerView the KiCad official footprints online

Other Links

  • tscircuit.com - The official tscircuit website
  • Registry - The official tscircuit registry that hosts re-usable tscircuit components
  • discord
  • @seveibar - Twitter for author of tscircuit with dev sessions and upcoming features
0.0.315

10 months ago

0.0.314

10 months ago

0.0.313

10 months ago

0.0.312

10 months ago

0.0.319

10 months ago

0.0.318

10 months ago

0.0.317

10 months ago

0.0.316

10 months ago

0.0.311

10 months ago

0.0.310

10 months ago

0.0.309

10 months ago

0.0.326

10 months ago

0.0.325

10 months ago

0.0.324

10 months ago

0.0.323

10 months ago

0.0.329

10 months ago

0.0.328

10 months ago

0.0.327

10 months ago

0.0.322

10 months ago

0.0.321

10 months ago

0.0.320

10 months ago

0.0.337

10 months ago

0.0.336

10 months ago

0.0.335

10 months ago

0.0.334

10 months ago

0.0.339

10 months ago

0.0.338

10 months ago

0.0.333

10 months ago

0.0.332

10 months ago

0.0.331

10 months ago

0.0.330

10 months ago

0.0.340

10 months ago

0.0.342

9 months ago

0.0.341

9 months ago

0.0.304

10 months ago

0.0.303

10 months ago

0.0.302

10 months ago

0.0.301

11 months ago

0.0.308

10 months ago

0.0.307

10 months ago

0.0.306

10 months ago

0.0.305

10 months ago

0.0.300

11 months ago

0.0.296

11 months ago

0.0.295

11 months ago

0.0.294

11 months ago

0.0.293

11 months ago

0.0.299

11 months ago

0.0.298

11 months ago

0.0.297

11 months ago

0.0.205

1 year ago

0.0.204

1 year ago

0.0.203

1 year ago

0.0.202

1 year ago

0.0.209

1 year ago

0.0.208

1 year ago

0.0.207

1 year ago

0.0.206

1 year ago

0.0.201

1 year ago

0.0.200

1 year ago

0.0.216

1 year ago

0.0.215

1 year ago

0.0.214

1 year ago

0.0.213

1 year ago

0.0.219

12 months ago

0.0.218

12 months ago

0.0.217

1 year ago

0.0.212

1 year ago

0.0.211

1 year ago

0.0.210

1 year ago

0.0.227

12 months ago

0.0.226

12 months ago

0.0.225

12 months ago

0.0.224

12 months ago

0.0.229

12 months ago

0.0.228

12 months ago

0.0.223

12 months ago

0.0.222

12 months ago

0.0.221

12 months ago

0.0.220

12 months ago

0.0.197

1 year ago

0.0.196

1 year ago

0.0.195

1 year ago

0.0.194

1 year ago

0.0.199

1 year ago

0.0.198

1 year ago

0.0.193

1 year ago

0.0.192

1 year ago

0.0.191

1 year ago

0.0.190

1 year ago

0.0.159

1 year ago

0.0.279

11 months ago

0.0.158

1 year ago

0.0.274

11 months ago

0.0.153

1 year ago

0.0.273

11 months ago

0.0.152

1 year ago

0.0.272

11 months ago

0.0.151

1 year ago

0.0.271

11 months ago

0.0.150

1 year ago

0.0.278

11 months ago

0.0.157

1 year ago

0.0.277

11 months ago

0.0.156

1 year ago

0.0.276

11 months ago

0.0.155

1 year ago

0.0.275

11 months ago

0.0.154

1 year ago

0.0.270

11 months ago

0.0.169

1 year ago

0.0.285

11 months ago

0.0.164

1 year ago

0.0.284

11 months ago

0.0.163

1 year ago

0.0.283

11 months ago

0.0.162

1 year ago

0.0.282

11 months ago

0.0.161

1 year ago

0.0.289

11 months ago

0.0.168

1 year ago

0.0.288

11 months ago

0.0.167

1 year ago

0.0.287

11 months ago

0.0.166

1 year ago

0.0.286

11 months ago

0.0.165

1 year ago

0.0.281

11 months ago

0.0.160

1 year ago

0.0.280

11 months ago

0.0.175

1 year ago

0.0.174

1 year ago

0.0.173

1 year ago

0.0.172

1 year ago

0.0.179

1 year ago

0.0.178

1 year ago

0.0.177

1 year ago

0.0.176

1 year ago

0.0.292

11 months ago

0.0.171

1 year ago

0.0.291

11 months ago

0.0.170

1 year ago

0.0.290

11 months ago

0.0.186

1 year ago

0.0.185

1 year ago

0.0.184

1 year ago

0.0.183

1 year ago

0.0.189

1 year ago

0.0.188

1 year ago

0.0.187

1 year ago

0.0.182

1 year ago

0.0.181

1 year ago

0.0.180

1 year ago

0.0.238

12 months ago

0.0.237

12 months ago

0.0.236

12 months ago

0.0.235

12 months ago

0.0.239

12 months ago

0.0.230

12 months ago

0.0.234

12 months ago

0.0.233

12 months ago

0.0.232

12 months ago

0.0.231

12 months ago

0.0.249

12 months ago

0.0.248

12 months ago

0.0.247

12 months ago

0.0.246

12 months ago

0.0.241

12 months ago

0.0.240

12 months ago

0.0.245

12 months ago

0.0.244

12 months ago

0.0.243

12 months ago

0.0.242

12 months ago

0.0.259

11 months ago

0.0.258

11 months ago

0.0.257

11 months ago

0.0.252

11 months ago

0.0.251

11 months ago

0.0.250

12 months ago

0.0.256

11 months ago

0.0.255

11 months ago

0.0.254

11 months ago

0.0.253

11 months ago

0.0.149

1 year ago

0.0.269

11 months ago

0.0.148

1 year ago

0.0.268

11 months ago

0.0.147

1 year ago

0.0.263

11 months ago

0.0.142

1 year ago

0.0.262

11 months ago

0.0.141

1 year ago

0.0.261

11 months ago

0.0.140

1 year ago

0.0.260

11 months ago

0.0.267

11 months ago

0.0.146

1 year ago

0.0.266

11 months ago

0.0.145

1 year ago

0.0.265

11 months ago

0.0.144

1 year ago

0.0.264

11 months ago

0.0.143

1 year ago

0.0.139

1 year ago

0.0.138

1 year ago

0.0.137

1 year ago

0.0.128

1 year ago

0.0.129

1 year ago

0.0.136

1 year ago

0.0.131

1 year ago

0.0.130

1 year ago

0.0.135

1 year ago

0.0.134

1 year ago

0.0.133

1 year ago

0.0.132

1 year ago

0.0.127

1 year ago

0.0.126

1 year ago

0.0.125

1 year ago

0.0.124

1 year ago

0.0.123

1 year ago

0.0.119

1 year ago

0.0.120

1 year ago

0.0.122

1 year ago

0.0.121

1 year ago

0.0.117

1 year ago

0.0.116

1 year ago

0.0.115

1 year ago

0.0.118

1 year ago

0.0.114

1 year ago

0.0.109

1 year ago

0.0.108

1 year ago

0.0.107

1 year ago

0.0.113

1 year ago

0.0.112

1 year ago

0.0.111

1 year ago

0.0.110

1 year ago

0.0.106

1 year ago

0.0.105

1 year ago

0.0.104

1 year ago

0.0.103

1 year ago

0.0.102

1 year ago

0.0.101

1 year ago

0.0.100

1 year ago

0.0.99

1 year ago

0.0.98

1 year ago

0.0.97

1 year ago

0.0.84

1 year ago

0.0.85

1 year ago

0.0.86

1 year ago

0.0.87

1 year ago

0.0.88

1 year ago

0.0.89

1 year ago

0.0.81

1 year ago

0.0.82

1 year ago

0.0.83

1 year ago

0.0.95

1 year ago

0.0.96

1 year ago

0.0.90

1 year ago

0.0.91

1 year ago

0.0.92

1 year ago

0.0.93

1 year ago

0.0.94

1 year ago

0.0.80

1 year ago

0.0.77

1 year ago

0.0.78

1 year ago

0.0.79

1 year ago

0.0.73

1 year ago

0.0.74

1 year ago

0.0.75

1 year ago

0.0.76

1 year ago

0.0.72

1 year ago

0.0.71

1 year ago

0.0.70

1 year ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.64

1 year ago

0.0.65

1 year ago

0.0.66

1 year ago

0.0.67

1 year ago

0.0.68

1 year ago

0.0.69

1 year ago

0.0.60

1 year ago

0.0.61

1 year ago

0.0.59

1 year ago

0.0.55

1 year ago

0.0.56

1 year ago

0.0.57

1 year ago

0.0.58

1 year ago

0.0.54

1 year ago

0.0.53

1 year ago

0.0.51

1 year ago

0.0.52

1 year ago

0.0.50

1 year ago

0.0.47

1 year ago

0.0.48

1 year ago

0.0.49

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.39

1 year ago

0.0.38

1 year ago

0.0.37

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago