@tscircuit/cli 0.0.95 → 0.0.97
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/bun.lockb +0 -0
- package/dev-server-frontend/bun.lockb +0 -0
- package/dev-server-frontend/package.json +4 -4
- package/dist/cli.js +89 -33
- package/lib/cmd-fns/dev/start-edit-event-watcher.ts +156 -50
- package/package.json +7 -4
- package/tests/assets/example-project/examples/basic-bug.tsx +5 -6
- package/tests/assets/example-project/package-lock.json +58 -51
- package/tests/assets/example-project/package.json +3 -3
- package/tests/assets/example-project/src/MyCircuit.tsx +22 -0
- package/tests/assets/example-project/src/manual-edits.ts +3 -20
|
@@ -6,17 +6,11 @@ import fg from "fast-glob"
|
|
|
6
6
|
import fs from "fs"
|
|
7
7
|
import { Project, ts } from "ts-morph"
|
|
8
8
|
import * as Path from "path"
|
|
9
|
-
import { ManualPcbPosition } from "@tscircuit/builder"
|
|
9
|
+
import type { ManualPcbPosition } from "@tscircuit/builder"
|
|
10
10
|
import { deriveSelectorFromPcbComponentId } from "./derive-selector-from-pcb-component-id"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
edit_event_id: string
|
|
15
|
-
pcb_edit_event_type: "edit_component_location"
|
|
16
|
-
pcb_component_id: string
|
|
17
|
-
original_center: { x: number; y: number }
|
|
18
|
-
new_center: { x: number; y: number }
|
|
19
|
-
}
|
|
11
|
+
import type { EditEvent } from "@tscircuit/manual-edit-events"
|
|
12
|
+
import { getManualTraceHintFromEvent, ManualTraceHint } from "@tscircuit/layout"
|
|
13
|
+
import JSON5 from "json5"
|
|
20
14
|
|
|
21
15
|
export const startEditEventWatcher = async (
|
|
22
16
|
{
|
|
@@ -142,11 +136,34 @@ export const startEditEventWatcher = async (
|
|
|
142
136
|
const pcb_placements_ts =
|
|
143
137
|
object_literal.getPropertyOrThrow("pcb_placements")
|
|
144
138
|
|
|
139
|
+
if (object_literal.getProperty("edit_events") === undefined) {
|
|
140
|
+
object_literal.addPropertyAssignment({
|
|
141
|
+
name: "edit_events",
|
|
142
|
+
initializer: "[]",
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const edit_events_ts =
|
|
147
|
+
object_literal.getPropertyOrThrow("edit_events")
|
|
148
|
+
|
|
149
|
+
if (
|
|
150
|
+
object_literal.getProperty("manual_trace_hints") === undefined
|
|
151
|
+
) {
|
|
152
|
+
object_literal.addPropertyAssignment({
|
|
153
|
+
name: "manual_trace_hints",
|
|
154
|
+
initializer: "[]",
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
const manual_trace_hints_ts =
|
|
158
|
+
object_literal.getPropertyOrThrow("manual_trace_hints")
|
|
159
|
+
|
|
145
160
|
let pcb_placements: (ManualPcbPosition & {
|
|
146
161
|
_edit_event_id?: string
|
|
147
162
|
})[]
|
|
163
|
+
let in_file_edit_events: EditEvent[]
|
|
164
|
+
let manual_trace_hints: ManualTraceHint[]
|
|
148
165
|
try {
|
|
149
|
-
pcb_placements =
|
|
166
|
+
pcb_placements = JSON5.parse(
|
|
150
167
|
pcb_placements_ts.getText().replace(/pcb_placements:\s/, "")
|
|
151
168
|
)
|
|
152
169
|
} catch (e: any) {
|
|
@@ -157,60 +174,149 @@ export const startEditEventWatcher = async (
|
|
|
157
174
|
)
|
|
158
175
|
continue
|
|
159
176
|
}
|
|
177
|
+
try {
|
|
178
|
+
in_file_edit_events = JSON5.parse(
|
|
179
|
+
edit_events_ts.getText().replace(/edit_events:\s/, "")
|
|
180
|
+
)
|
|
181
|
+
} catch (e: any) {
|
|
182
|
+
console.log(
|
|
183
|
+
kleur.red(
|
|
184
|
+
`Error parsing edit_events from manual edits file: ${edit_events_ts.getText()} ${e.toString()}`
|
|
185
|
+
)
|
|
186
|
+
)
|
|
187
|
+
continue
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
manual_trace_hints = JSON5.parse(
|
|
191
|
+
manual_trace_hints_ts
|
|
192
|
+
.getText()
|
|
193
|
+
.replace(/manual_trace_hints:\s/, "")
|
|
194
|
+
)
|
|
195
|
+
} catch (e: any) {
|
|
196
|
+
console.log(
|
|
197
|
+
kleur.red(
|
|
198
|
+
`Error parsing manual_trace_hints from manual edits file: ${pcb_placements_ts.getText()} ${e.toString()}`
|
|
199
|
+
)
|
|
200
|
+
)
|
|
201
|
+
continue
|
|
202
|
+
}
|
|
160
203
|
|
|
161
204
|
const handled_edit_events = new Set<string>(
|
|
162
205
|
pcb_placements
|
|
163
206
|
.map((p) => (p as any)._edit_event_id)
|
|
164
|
-
.
|
|
207
|
+
.concat(in_file_edit_events.map((a) => a.edit_event_id))
|
|
165
208
|
)
|
|
166
209
|
|
|
167
210
|
// Add PCB placements from edit events
|
|
168
|
-
for (const
|
|
169
|
-
if (handled_edit_events.has(
|
|
211
|
+
for (const incoming_edit_event of edit_events) {
|
|
212
|
+
if (handled_edit_events.has(incoming_edit_event.edit_event_id))
|
|
213
|
+
continue
|
|
214
|
+
|
|
215
|
+
if (
|
|
216
|
+
incoming_edit_event.pcb_edit_event_type ===
|
|
217
|
+
"edit_component_location"
|
|
218
|
+
) {
|
|
219
|
+
// TODO Figure out a good selector for this pcb_component
|
|
220
|
+
let pcb_component_selector: string | null = null
|
|
221
|
+
if (incoming_edit_event.pcb_component_id) {
|
|
222
|
+
pcb_component_selector = deriveSelectorFromPcbComponentId({
|
|
223
|
+
soup: dev_package_example_full.tscircuit_soup,
|
|
224
|
+
pcb_component_id: incoming_edit_event.pcb_component_id,
|
|
225
|
+
})
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// TODO we'll need to work past this for edit_event_type=edit_trace
|
|
229
|
+
if (!pcb_component_selector) continue
|
|
230
|
+
|
|
231
|
+
const existing_placement_for_selector = pcb_placements.find(
|
|
232
|
+
(pp) => pp.selector === pcb_component_selector
|
|
233
|
+
)
|
|
170
234
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
235
|
+
if (!existing_placement_for_selector) {
|
|
236
|
+
console.log(
|
|
237
|
+
kleur.gray(
|
|
238
|
+
` adding PCB placement from edit event for "${pcb_component_selector}"`
|
|
239
|
+
)
|
|
240
|
+
)
|
|
176
241
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
242
|
+
pcb_placements.push({
|
|
243
|
+
_edit_event_id: incoming_edit_event.edit_event_id,
|
|
244
|
+
selector: pcb_component_selector,
|
|
245
|
+
center: incoming_edit_event.new_center,
|
|
246
|
+
relative_to: "group_center",
|
|
247
|
+
})
|
|
248
|
+
} else {
|
|
249
|
+
existing_placement_for_selector.center =
|
|
250
|
+
incoming_edit_event.new_center
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Edit the pcb placements object
|
|
254
|
+
pcb_placements_ts.replaceWithText(
|
|
255
|
+
`pcb_placements: ${JSON.stringify(
|
|
256
|
+
pcb_placements,
|
|
257
|
+
null,
|
|
258
|
+
" "
|
|
259
|
+
)}`
|
|
260
|
+
)
|
|
180
261
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
262
|
+
// Save the file
|
|
263
|
+
fs.writeFileSync(
|
|
264
|
+
Path.join(ctx.cwd, manual_edit_file),
|
|
265
|
+
ts_manual_edits_file.getFullText()
|
|
266
|
+
)
|
|
267
|
+
await devServerAxios.post("/api/dev_package_examples/update", {
|
|
268
|
+
dev_package_example_id,
|
|
269
|
+
edit_events_last_applied_at:
|
|
270
|
+
dev_package_example.edit_events_last_updated_at,
|
|
271
|
+
})
|
|
272
|
+
} else if (
|
|
273
|
+
incoming_edit_event.pcb_edit_event_type === "edit_trace_hint"
|
|
274
|
+
) {
|
|
275
|
+
const new_trace_hint = getManualTraceHintFromEvent(
|
|
276
|
+
dev_package_example_full.tscircuit_soup,
|
|
277
|
+
incoming_edit_event
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
manual_trace_hints_ts.replaceWithText(
|
|
281
|
+
`manual_trace_hints: ${JSON.stringify(
|
|
282
|
+
manual_trace_hints
|
|
283
|
+
.filter(
|
|
284
|
+
(th) =>
|
|
285
|
+
th.pcb_port_selector !==
|
|
286
|
+
new_trace_hint.pcb_port_selector
|
|
287
|
+
)
|
|
288
|
+
.concat([new_trace_hint]),
|
|
289
|
+
null,
|
|
290
|
+
" "
|
|
291
|
+
)}`
|
|
186
292
|
)
|
|
187
293
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
294
|
+
fs.writeFileSync(
|
|
295
|
+
Path.join(ctx.cwd, manual_edit_file),
|
|
296
|
+
ts_manual_edits_file.getFullText()
|
|
297
|
+
)
|
|
298
|
+
await devServerAxios.post("/api/dev_package_examples/update", {
|
|
299
|
+
dev_package_example_id,
|
|
300
|
+
edit_events_last_applied_at:
|
|
301
|
+
dev_package_example.edit_events_last_updated_at,
|
|
193
302
|
})
|
|
194
303
|
} else {
|
|
195
|
-
|
|
304
|
+
// All other events just go to the manual-edits.ts file with
|
|
305
|
+
// in the "edit_events" property
|
|
306
|
+
edit_events_ts.replaceWithText(
|
|
307
|
+
`edit_events: ${JSON.stringify(edit_events, null, " ")}`
|
|
308
|
+
)
|
|
309
|
+
console.log(edit_events_ts.getFullText())
|
|
310
|
+
fs.writeFileSync(
|
|
311
|
+
Path.join(ctx.cwd, manual_edit_file),
|
|
312
|
+
ts_manual_edits_file.getFullText()
|
|
313
|
+
)
|
|
314
|
+
await devServerAxios.post("/api/dev_package_examples/update", {
|
|
315
|
+
dev_package_example_id,
|
|
316
|
+
edit_events_last_applied_at:
|
|
317
|
+
dev_package_example.edit_events_last_updated_at,
|
|
318
|
+
})
|
|
196
319
|
}
|
|
197
|
-
|
|
198
|
-
// Edit the pcb placements object
|
|
199
|
-
pcb_placements_ts.replaceWithText(
|
|
200
|
-
`pcb_placements: ${JSON.stringify(pcb_placements, null, " ")}`
|
|
201
|
-
)
|
|
202
|
-
|
|
203
|
-
// Save the file
|
|
204
|
-
|
|
205
|
-
fs.writeFileSync(
|
|
206
|
-
Path.join(ctx.cwd, manual_edit_file),
|
|
207
|
-
ts_manual_edits_file.getFullText()
|
|
208
|
-
)
|
|
209
|
-
await devServerAxios.post("/api/dev_package_examples/update", {
|
|
210
|
-
dev_package_example_id,
|
|
211
|
-
edit_events_last_applied_at:
|
|
212
|
-
dev_package_example.edit_events_last_updated_at,
|
|
213
|
-
})
|
|
214
320
|
}
|
|
215
321
|
}
|
|
216
322
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.97",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Command line tool for developing, publishing and installing tscircuit circuits",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"build": "bun build:dev-server && npm run build:cli",
|
|
19
19
|
"dev-with-test-project": "bun cli.ts dev --cwd ./tests/assets/example-project",
|
|
20
20
|
"test:init": "bun cli.ts init --dir ./tmp/test --name test",
|
|
21
|
-
"update-deps": "
|
|
21
|
+
"update-deps": "bun add @tscircuit/builder@latest @tscircuit/react-fiber@latest && cd dev-server-frontend && bun run update-deps && cd ../tests/assets/example-project && bun add @tscircuit/builder@latest @tscircuit/react-fiber@latest @tscircuit/layout@latest"
|
|
22
22
|
},
|
|
23
23
|
"bin": {
|
|
24
24
|
"tsci": "./dist/cli.js"
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@edge-runtime/primitives": "^4.1.0",
|
|
37
37
|
"@hono/node-server": "^1.8.2",
|
|
38
|
-
"@tscircuit/builder": "^1.5.
|
|
39
|
-
"@tscircuit/
|
|
38
|
+
"@tscircuit/builder": "^1.5.118",
|
|
39
|
+
"@tscircuit/layout": "^0.0.20",
|
|
40
|
+
"@tscircuit/react-fiber": "^1.1.27",
|
|
40
41
|
"@tscircuit/soup-util": "^0.0.1",
|
|
41
42
|
"archiver": "^7.0.1",
|
|
42
43
|
"axios": "^1.6.7",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"zod": "latest"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
74
|
+
"@tscircuit/manual-edit-events": "^0.0.4",
|
|
73
75
|
"@types/archiver": "^6.0.2",
|
|
74
76
|
"@types/bun": "^1.0.8",
|
|
75
77
|
"@types/chokidar": "^2.1.3",
|
|
@@ -84,6 +86,7 @@
|
|
|
84
86
|
"@types/semver": "^7.5.8",
|
|
85
87
|
"ava": "^6.1.1",
|
|
86
88
|
"concurrently": "^8.2.2",
|
|
89
|
+
"json5": "^2.2.3",
|
|
87
90
|
"tsx": "^4.7.1",
|
|
88
91
|
"typescript": "^5.3.3"
|
|
89
92
|
}
|
|
@@ -9,13 +9,12 @@ export const BasicBug = () => (
|
|
|
9
9
|
>
|
|
10
10
|
<bug
|
|
11
11
|
name="U2"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
schPortArrangement={{
|
|
13
|
+
leftSize: 4,
|
|
14
|
+
rightSize: 4,
|
|
15
15
|
}}
|
|
16
|
-
footprint="
|
|
17
|
-
|
|
18
|
-
port_labels={{
|
|
16
|
+
footprint="ssop16"
|
|
17
|
+
pinLabels={{
|
|
19
18
|
"1": "GND",
|
|
20
19
|
"2": "VBUS",
|
|
21
20
|
"3": "D-",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"name": "example-project",
|
|
9
9
|
"version": "1.2.26",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@tscircuit/builder": "^1.5.
|
|
12
|
-
"@tscircuit/layout": "^0.0.
|
|
13
|
-
"@tscircuit/react-fiber": "^1.1.
|
|
11
|
+
"@tscircuit/builder": "^1.5.116",
|
|
12
|
+
"@tscircuit/layout": "^0.0.17",
|
|
13
|
+
"@tscircuit/react-fiber": "^1.1.27"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"node_modules/@babel/runtime": {
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"integrity": "sha512-iB+oaYyaVK1hQ0cODubnoSDg4gGYL9cp/4ad7G1b9Z0/IqehPztp5qE3KP2mV9Ns0UYmzwvtkEhTCmKUuhorbg=="
|
|
31
31
|
},
|
|
32
32
|
"node_modules/@tscircuit/builder": {
|
|
33
|
-
"version": "1.5.
|
|
34
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.
|
|
35
|
-
"integrity": "sha512-
|
|
33
|
+
"version": "1.5.116",
|
|
34
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.116.tgz",
|
|
35
|
+
"integrity": "sha512-e5PrJuLHtNfoTrbeUautXE4135F9YQK/re4iantvRGzMfAhKDJHAeolP8+0HABgHt91kkVM0PpFpy3BSYha86Q==",
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@lume/kiwi": "^0.1.0",
|
|
38
|
-
"@tscircuit/
|
|
39
|
-
"@tscircuit/layout": "^0.0.
|
|
38
|
+
"@tscircuit/footprinter": "^0.0.43",
|
|
39
|
+
"@tscircuit/layout": "^0.0.17",
|
|
40
|
+
"@tscircuit/props": "^0.0.11",
|
|
40
41
|
"@tscircuit/routing": "^1.3.1",
|
|
41
42
|
"@tscircuit/schematic-autolayout": "^0.0.5",
|
|
42
|
-
"@tscircuit/soup": "^0.0.
|
|
43
|
-
"@tscircuit/soup-util": "^0.0.
|
|
44
|
-
"@tscircuit/sparkfun-packages": "^1.2.1",
|
|
43
|
+
"@tscircuit/soup": "^0.0.32",
|
|
44
|
+
"@tscircuit/soup-util": "^0.0.11",
|
|
45
45
|
"convert-units": "^2.3.4",
|
|
46
46
|
"fast-json-stable-stringify": "^2.1.0",
|
|
47
47
|
"format-si-prefix": "^0.3.2",
|
|
@@ -51,32 +51,39 @@
|
|
|
51
51
|
"transformation-matrix": "^2.12.0"
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
"node_modules/@tscircuit/builder/node_modules/@tscircuit/
|
|
55
|
-
"version": "0.0.
|
|
56
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/
|
|
57
|
-
"integrity": "sha512-
|
|
58
|
-
"dependencies": {
|
|
59
|
-
"transformation-matrix": "^2.16.1"
|
|
60
|
-
},
|
|
54
|
+
"node_modules/@tscircuit/builder/node_modules/@tscircuit/props": {
|
|
55
|
+
"version": "0.0.11",
|
|
56
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/props/-/props-0.0.11.tgz",
|
|
57
|
+
"integrity": "sha512-7gQ9A4Oo3XytIJfOcoLXCEsvw8udaf8JWWLQRF8RBiG5otAkomL16NNg1w+WqPPkSdpHi5WP+CSjm5fOXAWBEw==",
|
|
61
58
|
"peerDependencies": {
|
|
59
|
+
"@tscircuit/layout": "*",
|
|
60
|
+
"@tscircuit/soup": "*",
|
|
61
|
+
"react": "*",
|
|
62
62
|
"zod": "*"
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
-
"node_modules/@tscircuit/
|
|
66
|
-
"version": "0.0.
|
|
67
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/
|
|
68
|
-
"integrity": "sha512-
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"@tscircuit/mm": "^0.0.4"
|
|
71
|
-
},
|
|
65
|
+
"node_modules/@tscircuit/builder/node_modules/@tscircuit/soup-util": {
|
|
66
|
+
"version": "0.0.11",
|
|
67
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/soup-util/-/soup-util-0.0.11.tgz",
|
|
68
|
+
"integrity": "sha512-fNL84qhAglj6KSdYXVafmDOByRMIHAnyzDgpRmzYrkCUbv3AvJgH1HqO8j9p3pqe/Oc+Csbm14Lhgl+SrxCgYg==",
|
|
72
69
|
"peerDependencies": {
|
|
73
|
-
"
|
|
70
|
+
"@tscircuit/soup": "*",
|
|
71
|
+
"zod": "*"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"node_modules/@tscircuit/footprinter": {
|
|
75
|
+
"version": "0.0.43",
|
|
76
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/footprinter/-/footprinter-0.0.43.tgz",
|
|
77
|
+
"integrity": "sha512-L5Z6XmvcC09iT5+SZc7rQ4rNYfLjWD5j4VB7/ymSiz0Gh17DoNx5FnWKL57BNWxRHLNe+6OPBlWnPBzlzHSEOQ==",
|
|
78
|
+
"dependencies": {
|
|
79
|
+
"@tscircuit/mm": "^0.0.7",
|
|
80
|
+
"zod": "^3.23.8"
|
|
74
81
|
}
|
|
75
82
|
},
|
|
76
83
|
"node_modules/@tscircuit/layout": {
|
|
77
|
-
"version": "0.0.
|
|
78
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/layout/-/layout-0.0.
|
|
79
|
-
"integrity": "sha512-
|
|
84
|
+
"version": "0.0.17",
|
|
85
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/layout/-/layout-0.0.17.tgz",
|
|
86
|
+
"integrity": "sha512-B3t9DC4QGSl0no/N1X1x+/6Q2a7SWaExFHUk/v0qKSZCKMhWsdNslpvccxZrCudg/3VM6ohEDIilqgo0i+Ceqw==",
|
|
80
87
|
"dependencies": {
|
|
81
88
|
"@tscircuit/soup": "^0.0.4",
|
|
82
89
|
"@tscircuit/soup-util": "^0.0.10",
|
|
@@ -96,9 +103,9 @@
|
|
|
96
103
|
}
|
|
97
104
|
},
|
|
98
105
|
"node_modules/@tscircuit/mm": {
|
|
99
|
-
"version": "0.0.
|
|
100
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/mm/-/mm-0.0.
|
|
101
|
-
"integrity": "sha512-
|
|
106
|
+
"version": "0.0.7",
|
|
107
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/mm/-/mm-0.0.7.tgz",
|
|
108
|
+
"integrity": "sha512-5lZjeOsrkQDnMd4OEuXQYC8k+zuWCbX9Ruq69JhcvLu18FUen3pPjBxmFyF2DGZYxaTrKUpUdZvoTr49TISN2g==",
|
|
102
109
|
"dependencies": {
|
|
103
110
|
"convert-units": "^2.3.4"
|
|
104
111
|
},
|
|
@@ -106,10 +113,22 @@
|
|
|
106
113
|
"typescript": "^5.0.0"
|
|
107
114
|
}
|
|
108
115
|
},
|
|
116
|
+
"node_modules/@tscircuit/props": {
|
|
117
|
+
"version": "0.0.13",
|
|
118
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/props/-/props-0.0.13.tgz",
|
|
119
|
+
"integrity": "sha512-mMEBrWkK2BFoC3OAEgQZxjf/jOEL9+67xK7sOY7rnrLEiOspF7f+ZyY/hCmBvSgOsoW5v46MWxNuxjMh4ajizw==",
|
|
120
|
+
"peer": true,
|
|
121
|
+
"peerDependencies": {
|
|
122
|
+
"@tscircuit/layout": "*",
|
|
123
|
+
"@tscircuit/soup": "*",
|
|
124
|
+
"react": "*",
|
|
125
|
+
"zod": "*"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
109
128
|
"node_modules/@tscircuit/react-fiber": {
|
|
110
|
-
"version": "1.1.
|
|
111
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/react-fiber/-/react-fiber-1.1.
|
|
112
|
-
"integrity": "sha512-
|
|
129
|
+
"version": "1.1.27",
|
|
130
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/react-fiber/-/react-fiber-1.1.27.tgz",
|
|
131
|
+
"integrity": "sha512-PVc3m/TFIfpcfcPaHoGiyyTVkiMxFdAXV21iUrU5wgvLKycSXklkvNnqDk9p/gUzX7m7r+00a9sWlZa/K0NWWw==",
|
|
113
132
|
"dependencies": {
|
|
114
133
|
"@tscircuit/soup": "^0.0.8",
|
|
115
134
|
"react-reconciler": "^0.29.0",
|
|
@@ -117,6 +136,7 @@
|
|
|
117
136
|
},
|
|
118
137
|
"peerDependencies": {
|
|
119
138
|
"@tscircuit/builder": "*",
|
|
139
|
+
"@tscircuit/props": "*",
|
|
120
140
|
"react": "*"
|
|
121
141
|
}
|
|
122
142
|
},
|
|
@@ -151,9 +171,9 @@
|
|
|
151
171
|
}
|
|
152
172
|
},
|
|
153
173
|
"node_modules/@tscircuit/soup": {
|
|
154
|
-
"version": "0.0.
|
|
155
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/soup/-/soup-0.0.
|
|
156
|
-
"integrity": "sha512-
|
|
174
|
+
"version": "0.0.32",
|
|
175
|
+
"resolved": "https://registry.npmjs.org/@tscircuit/soup/-/soup-0.0.32.tgz",
|
|
176
|
+
"integrity": "sha512-h/ZIVAGP86oQ/zRbdWgYLd3uwIUWWGFQzBU+GaoXboyla5RkD1GZDGGF8HxAyvQtMP+tlgBBP/cuQ3admJet5Q==",
|
|
157
177
|
"dependencies": {
|
|
158
178
|
"convert-units": "^2.3.4",
|
|
159
179
|
"zod": "^3.23.6"
|
|
@@ -179,24 +199,11 @@
|
|
|
179
199
|
"zod": "^3.23.6"
|
|
180
200
|
}
|
|
181
201
|
},
|
|
182
|
-
"node_modules/@tscircuit/sparkfun-packages": {
|
|
183
|
-
"version": "1.2.1",
|
|
184
|
-
"resolved": "https://registry.npmjs.org/@tscircuit/sparkfun-packages/-/sparkfun-packages-1.2.1.tgz",
|
|
185
|
-
"integrity": "sha512-2HzmmHydo5vgoKmNBAHd6RD93LaIMXRSt6t//1zx19/ZwrOA43qVOvb7cCTA82GHib1bSxoL7bqgii9sYudCHw==",
|
|
186
|
-
"dependencies": {
|
|
187
|
-
"change-case": "^5.4.3"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
202
|
"node_modules/abs-svg-path": {
|
|
191
203
|
"version": "0.1.1",
|
|
192
204
|
"resolved": "https://registry.npmjs.org/abs-svg-path/-/abs-svg-path-0.1.1.tgz",
|
|
193
205
|
"integrity": "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA=="
|
|
194
206
|
},
|
|
195
|
-
"node_modules/change-case": {
|
|
196
|
-
"version": "5.4.4",
|
|
197
|
-
"resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz",
|
|
198
|
-
"integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w=="
|
|
199
|
-
},
|
|
200
207
|
"node_modules/convert-units": {
|
|
201
208
|
"version": "2.3.4",
|
|
202
209
|
"resolved": "https://registry.npmjs.org/convert-units/-/convert-units-2.3.4.tgz",
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@tscircuit/builder": "^1.5.
|
|
8
|
-
"@tscircuit/layout": "
|
|
9
|
-
"@tscircuit/react-fiber": "^1.1.
|
|
7
|
+
"@tscircuit/builder": "^1.5.118",
|
|
8
|
+
"@tscircuit/layout": "0.0.21",
|
|
9
|
+
"@tscircuit/react-fiber": "^1.1.27"
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -13,10 +13,32 @@ export const MyCircuit = () => (
|
|
|
13
13
|
<resistor
|
|
14
14
|
name="R1"
|
|
15
15
|
resistance="20kohm"
|
|
16
|
+
pcbX={0}
|
|
17
|
+
pcbY={0}
|
|
16
18
|
footprint="0805"
|
|
17
19
|
supplierPartNumbers={{
|
|
18
20
|
jlcpcb: ["C2759650"],
|
|
19
21
|
}}
|
|
20
22
|
/>
|
|
23
|
+
<resistor
|
|
24
|
+
name="R2"
|
|
25
|
+
pcbX={5}
|
|
26
|
+
pcbY={0}
|
|
27
|
+
resistance="20kohm"
|
|
28
|
+
footprint="0805"
|
|
29
|
+
supplierPartNumbers={{
|
|
30
|
+
jlcpcb: ["C2759650"],
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
<trace from=".R1 > .right" to=".R2 > .left" />
|
|
34
|
+
{/* <tracehint
|
|
35
|
+
for=".R1 > .right"
|
|
36
|
+
offsets={[
|
|
37
|
+
{
|
|
38
|
+
x: 3,
|
|
39
|
+
y: 3,
|
|
40
|
+
},
|
|
41
|
+
]}
|
|
42
|
+
/> */}
|
|
21
43
|
</board>
|
|
22
44
|
)
|
|
@@ -14,24 +14,7 @@ export default {
|
|
|
14
14
|
manual_edit_id: "abcdef",
|
|
15
15
|
|
|
16
16
|
// Manual pcb placements, added when you drag a footprint
|
|
17
|
-
pcb_placements: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"selector": ".U2",
|
|
21
|
-
"center": {
|
|
22
|
-
"x": 13.777148607991913,
|
|
23
|
-
"y": -10.354434189987284
|
|
24
|
-
},
|
|
25
|
-
"relative_to": "group_center"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"_edit_event_id": "0.37279140805799216",
|
|
29
|
-
"selector": ".R1",
|
|
30
|
-
"center": {
|
|
31
|
-
"x": 5.433378371344073,
|
|
32
|
-
"y": -6.95083299460385
|
|
33
|
-
},
|
|
34
|
-
"relative_to": "group_center"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
17
|
+
pcb_placements: [],
|
|
18
|
+
manual_trace_hints: [],
|
|
19
|
+
edit_events: [],
|
|
37
20
|
}
|