@tscircuit/core 0.0.11 → 0.0.12

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/dist/index.js CHANGED
@@ -1081,6 +1081,9 @@ var Board = class extends NormalComponent {
1081
1081
  doInitialPcbComponentRender() {
1082
1082
  const { db } = this.project;
1083
1083
  const { _parsedProps: props } = this;
1084
+ if (!props.width || !props.height) {
1085
+ throw new Error("Board width and height or an outline are required");
1086
+ }
1084
1087
  const pcb_board = db.pcb_board.insert({
1085
1088
  center: { x: props.pcbX, y: props.pcbY },
1086
1089
  width: props.width,
@@ -1157,7 +1160,7 @@ var stringProxy = new Proxy(
1157
1160
  var FTYPE = stringProxy;
1158
1161
 
1159
1162
  // lib/components/normal-components/Capacitor.ts
1160
- var Capacitor = class extends PrimitiveComponent {
1163
+ var Capacitor = class extends NormalComponent {
1161
1164
  get config() {
1162
1165
  return {
1163
1166
  // schematicSymbolName: BASE_SYMBOLS.capacitor,
@@ -16,13 +16,18 @@ export class Board extends NormalComponent<typeof boardProps> {
16
16
  const { db } = this.project!
17
17
  const { _parsedProps: props } = this
18
18
 
19
+ if (!props.width || !props.height) {
20
+ throw new Error("Board width and height or an outline are required")
21
+ }
22
+
19
23
  const pcb_board = db.pcb_board.insert({
20
24
  center: { x: props.pcbX, y: props.pcbY },
25
+
21
26
  width: props.width,
22
27
  height: props.height,
23
28
  })
24
29
 
25
- this.pcb_board_id = pcb_board.pcb_board_id
30
+ this.pcb_board_id = pcb_board.pcb_board_id!
26
31
  }
27
32
 
28
33
  removePcbComponentRender(): void {
@@ -1,6 +1,7 @@
1
1
  import { ledProps } from "@tscircuit/props"
2
2
  import { PrimitiveComponent } from "../base-components/PrimitiveComponent"
3
3
  import { FTYPE, SYMBOL } from "lib/utils/constants"
4
+ import { NormalComponent } from "../base-components/NormalComponent"
4
5
 
5
6
  type PortNames =
6
7
  | "1"
@@ -12,7 +13,7 @@ type PortNames =
12
13
  | "anode"
13
14
  | "cathode"
14
15
 
15
- export class Capacitor extends PrimitiveComponent<typeof ledProps, PortNames> {
16
+ export class Capacitor extends NormalComponent<typeof ledProps, PortNames> {
16
17
  get config() {
17
18
  return {
18
19
  // schematicSymbolName: BASE_SYMBOLS.capacitor,
@@ -52,8 +52,8 @@ export class TraceHint extends PrimitiveComponent<typeof traceHintProps> {
52
52
  (offset): RouteHintPoint => ({
53
53
  ...applyToPoint(globalTransform, offset),
54
54
  via: offset.via,
55
- to_layer: offset.to_layer,
56
- trace_width: offset.trace_width,
55
+ to_layer: (offset as any).to_layer,
56
+ trace_width: (offset as any).trace_width,
57
57
  }),
58
58
  )
59
59
  }
package/package.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "name": "@tscircuit/core",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "types": "index.ts",
6
- "version": "0.0.11",
5
+ "version": "0.0.12",
6
+ "types": "dist/index.d.ts",
7
7
  "main": "dist/index.js",
8
8
  "files": [
9
9
  "index.ts",
@@ -11,7 +11,7 @@
11
11
  "dist"
12
12
  ],
13
13
  "scripts": {
14
- "build": "tsup-node index.ts --format esm"
14
+ "build": "tsup-node index.ts --format esm --dts"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@biomejs/biome": "^1.8.3",