circuitscript 0.5.5 → 0.5.6
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.
- package/README.md +105 -2
- package/dist/cjs/index.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,3 +1,106 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Circuitscript
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A code-based language for creating electronic schematics. Instead of clicking through GUI tools, you write Circuitscript to describe circuits — and get SVG/PDF schematics and KiCAD-compatible netlists as output.
|
|
4
|
+
|
|
5
|
+
**Homepage:** https://circuitscript.net
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Code-first design** — capture schematics using a simple scripting language
|
|
12
|
+
- **Version control friendly** — plain text files work naturally with git
|
|
13
|
+
- **SVG and PDF output** — high-quality schematic diagrams
|
|
14
|
+
- **KiCAD netlist export** — use generated netlists directly in KiCAD layout
|
|
15
|
+
- **Bill of Materials** — export BOM as CSV
|
|
16
|
+
- **Programmatic constructs** — loops, functions, conditionals, and modules for reusable circuit blocks
|
|
17
|
+
- **Standard library of components** — resistors, capacitors, inductors, LEDs, etc.
|
|
18
|
+
- **Custom components** — define components with arbitrary pin layouts and graphics
|
|
19
|
+
- **ERC** — basic electrical rules check (more to be added)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Requires Node.js 16 or later.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g circuitscript
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or install locally as a library:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install circuitscript
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
Create a file `circuit.cst`:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
from "std" import *
|
|
45
|
+
|
|
46
|
+
v5 = supply("5V")
|
|
47
|
+
gnd = dgnd()
|
|
48
|
+
|
|
49
|
+
at v5
|
|
50
|
+
wire down 100
|
|
51
|
+
add res(100k)
|
|
52
|
+
wire down 100
|
|
53
|
+
to gnd
|
|
54
|
+
|
|
55
|
+
at v5
|
|
56
|
+
wire down 100
|
|
57
|
+
add cap(100n)
|
|
58
|
+
wire down 100
|
|
59
|
+
to gnd
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Generate a schematic:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
circuitscript circuit.cst output.svg
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## CLI Usage
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
circuitscript [input path] [output path] [options]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Options
|
|
77
|
+
|
|
78
|
+
| Option | Description |
|
|
79
|
+
|--------|-------------|
|
|
80
|
+
| `-w, --watch` | Watch for file changes and regenerate |
|
|
81
|
+
| `-u, --update-source` | Update source file with reference designator annotation |
|
|
82
|
+
| `-j, --annotated-path [file]` | Save annotated source file at given path |
|
|
83
|
+
| `-n, --dump-nets` | Print net information |
|
|
84
|
+
| `-d, --dump-data` | Dump data during parsing |
|
|
85
|
+
| `-s, --stats` | Show stats during generation |
|
|
86
|
+
| `-x, --skip-output` | Skip output generation |
|
|
87
|
+
| `-e, --erc` | Enable ERC output |
|
|
88
|
+
| `-b, --bom [output-path]` | Generate Bill of Materials as CSV |
|
|
89
|
+
| `-i, --input text <text>` | Provide input text directly instead of a file |
|
|
90
|
+
| `--version` | Show version |
|
|
91
|
+
|
|
92
|
+
### Examples
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Generate SVG
|
|
96
|
+
circuitscript schematic.cst schematic.svg
|
|
97
|
+
|
|
98
|
+
# Generate PDF
|
|
99
|
+
circuitscript schematic.cst schematic.pdf
|
|
100
|
+
|
|
101
|
+
# Generate BOM
|
|
102
|
+
circuitscript schematic.cst schematic.svg --bom bom.csv
|
|
103
|
+
|
|
104
|
+
# Print to stdout
|
|
105
|
+
circuitscript schematic.cst
|
|
106
|
+
```
|
package/dist/cjs/index.js
CHANGED
|
@@ -31,6 +31,7 @@ __exportStar(require("./parser.js"), exports);
|
|
|
31
31
|
__exportStar(require("./utils.js"), exports);
|
|
32
32
|
__exportStar(require("./visitor.js"), exports);
|
|
33
33
|
__exportStar(require("./sizing.js"), exports);
|
|
34
|
+
__exportStar(require("./errors.js"), exports);
|
|
34
35
|
__exportStar(require("./objects/types.js"), exports);
|
|
35
36
|
__exportStar(require("./builtinMethods.js"), exports);
|
|
36
37
|
__exportStar(require("./validate/SymbolTable.js"), exports);
|
package/dist/esm/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './parser.js';
|
|
|
15
15
|
export * from './utils.js';
|
|
16
16
|
export * from './visitor.js';
|
|
17
17
|
export * from './sizing.js';
|
|
18
|
+
export * from './errors.js';
|
|
18
19
|
export * from './objects/types.js';
|
|
19
20
|
export * from './builtinMethods.js';
|
|
20
21
|
export * from './validate/SymbolTable.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './parser.js';
|
|
|
15
15
|
export * from './utils.js';
|
|
16
16
|
export * from './visitor.js';
|
|
17
17
|
export * from './sizing.js';
|
|
18
|
+
export * from './errors.js';
|
|
18
19
|
export * from './objects/types.js';
|
|
19
20
|
export * from './builtinMethods.js';
|
|
20
21
|
export * from './validate/SymbolTable.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "circuitscript",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Interpreter for the circuitscript language",
|
|
5
5
|
"homepage": "https://circuitscript.net",
|
|
6
6
|
"engines": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"eslint-config-prettier": "~8.8",
|
|
40
40
|
"eslint-plugin-jest": "~27.2",
|
|
41
41
|
"jest": "~29.5",
|
|
42
|
+
"license-check-and-add": "^4.0.5",
|
|
42
43
|
"prettier": "~2.8",
|
|
43
44
|
"rimraf": "~5.0",
|
|
44
45
|
"source-map-support": "^0.5.21",
|
|
@@ -76,7 +77,9 @@
|
|
|
76
77
|
"changelog": "auto-changelog --handlebars-setup ../changelog/helper.js -p",
|
|
77
78
|
"preversion": "npm run test",
|
|
78
79
|
"version": "npm run changelog && git add CHANGELOG.md",
|
|
79
|
-
"copy-assets": "mkdir -p dist/fonts && mkdir -p dist/libs && cp -r fonts dist/ && cp -r libs dist/"
|
|
80
|
+
"copy-assets": "mkdir -p dist/fonts && mkdir -p dist/libs && cp -r fonts dist/ && cp -r libs dist/",
|
|
81
|
+
"license:check": "license-check-and-add check -f licensecheck.json",
|
|
82
|
+
"license:add": "license-check-and-add add -f licensecheck.json"
|
|
80
83
|
},
|
|
81
84
|
"boilerplate_author": "Jakub Synowiec <jsynowiec@users.noreply.github.com>",
|
|
82
85
|
"license": "MIT",
|