@tscircuit/core 0.0.454 → 0.0.456

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.d.ts CHANGED
@@ -207,9 +207,16 @@ declare class RootCircuit {
207
207
  */
208
208
  name?: string;
209
209
  platform?: PlatformConfig;
210
+ /**
211
+ * Optional URL pointing to where this project is hosted or documented.
212
+ * When provided it is stored in the source_project_metadata.project_url field
213
+ * of the generated Circuit JSON.
214
+ */
215
+ projectUrl?: string;
210
216
  _hasRenderedAtleastOnce: boolean;
211
- constructor({ platform }?: {
217
+ constructor({ platform, projectUrl, }?: {
212
218
  platform?: PlatformConfig;
219
+ projectUrl?: string;
213
220
  });
214
221
  add(componentOrElm: PrimitiveComponent | ReactElement): void;
215
222
  /**
package/dist/index.js CHANGED
@@ -1155,6 +1155,7 @@ var ErrorPlaceholderComponent = class extends PrimitiveComponent2 {
1155
1155
  const schematicPosition = this._getGlobalSchematicPositionBeforeLayout();
1156
1156
  this.root.db.source_failed_to_create_component_error.insert({
1157
1157
  component_name: this._parsedProps.component_name,
1158
+ error_type: "source_failed_to_create_component_error",
1158
1159
  message: this._parsedProps.error?.formattedError?._errors?.join("; ") || this._parsedProps.message,
1159
1160
  pcb_center: pcbPosition,
1160
1161
  schematic_center: schematicPosition
@@ -6578,6 +6579,7 @@ import {
6578
6579
  convertCircuitJsonToInputNetlist,
6579
6580
  getRefKey as getRefKey2
6580
6581
  } from "@tscircuit/schematic-match-adapt";
6582
+ import { circuitBuilderFromLayoutJson } from "@tscircuit/schematic-match-adapt";
6581
6583
 
6582
6584
  // lib/utils/schematic/deriveSourceTraceIdFromMatchAdaptPath.ts
6583
6585
  import {
@@ -6657,8 +6659,14 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
6657
6659
  let subtreeCircuitJson = structuredClone(db.toArray());
6658
6660
  subtreeCircuitJson = reorderChipPinsToCcw(subtreeCircuitJson);
6659
6661
  const inputNetlist = convertCircuitJsonToInputNetlist(subtreeCircuitJson);
6662
+ const templateFns = group._parsedProps.matchAdaptTemplate ? [
6663
+ () => circuitBuilderFromLayoutJson(
6664
+ group._parsedProps.matchAdaptTemplate
6665
+ )
6666
+ ] : void 0;
6660
6667
  const solver = new SchematicLayoutPipelineSolver({
6661
- inputNetlist
6668
+ inputNetlist,
6669
+ templateFns
6662
6670
  });
6663
6671
  let solvedLayout = null;
6664
6672
  try {
@@ -6667,6 +6675,7 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
6667
6675
  } catch (e) {
6668
6676
  db.schematic_layout_error.insert({
6669
6677
  message: `Match-adapt layout failed: ${e.toString()}`,
6678
+ error_type: "schematic_layout_error",
6670
6679
  source_group_id: group.source_group_id,
6671
6680
  schematic_group_id: group.schematic_group_id
6672
6681
  });
@@ -7304,6 +7313,7 @@ var Group = class extends NormalComponent {
7304
7313
  if (job.has_error) {
7305
7314
  db.pcb_autorouting_error.insert({
7306
7315
  pcb_error_id: autorouting_job.autorouting_job_id,
7316
+ error_type: "pcb_autorouting_error",
7307
7317
  message: job.error?.message ?? JSON.stringify(job.error)
7308
7318
  });
7309
7319
  throw new Error(`Autorouting job failed: ${JSON.stringify(job.error)}`);
@@ -7372,6 +7382,7 @@ var Group = class extends NormalComponent {
7372
7382
  const { db: db2 } = this.root;
7373
7383
  db2.pcb_autorouting_error.insert({
7374
7384
  pcb_error_id: `pcb_autorouter_error_subcircuit_${this.subcircuit_id}`,
7385
+ error_type: "pcb_autorouting_error",
7375
7386
  message: error instanceof Error ? error.message : String(error)
7376
7387
  });
7377
7388
  this.root?.emit("autorouting:error", {
@@ -9500,7 +9511,7 @@ import { identity as identity4 } from "transformation-matrix";
9500
9511
  var package_default = {
9501
9512
  name: "@tscircuit/core",
9502
9513
  type: "module",
9503
- version: "0.0.453",
9514
+ version: "0.0.455",
9504
9515
  types: "dist/index.d.ts",
9505
9516
  main: "dist/index.js",
9506
9517
  module: "dist/index.js",
@@ -9534,7 +9545,7 @@ var package_default = {
9534
9545
  "@tscircuit/math-utils": "^0.0.18",
9535
9546
  "@tscircuit/props": "^0.0.211",
9536
9547
  "@tscircuit/schematic-autolayout": "^0.0.6",
9537
- "@tscircuit/schematic-match-adapt": "^0.0.9",
9548
+ "@tscircuit/schematic-match-adapt": "^0.0.16",
9538
9549
  "@tscircuit/simple-3d-svg": "^0.0.6",
9539
9550
  "@types/bun": "latest",
9540
9551
  "@types/debug": "^4.1.12",
@@ -9543,7 +9554,7 @@ var package_default = {
9543
9554
  "@types/react-reconciler": "^0.28.9",
9544
9555
  "bun-match-svg": "0.0.8",
9545
9556
  "chokidar-cli": "^3.0.0",
9546
- "circuit-json": "^0.0.199",
9557
+ "circuit-json": "^0.0.201",
9547
9558
  "circuit-json-to-connectivity-map": "^0.0.22",
9548
9559
  "circuit-json-to-simple-3d": "^0.0.2",
9549
9560
  "circuit-to-svg": "^0.0.151",
@@ -9605,12 +9616,22 @@ var RootCircuit = class {
9605
9616
  */
9606
9617
  name;
9607
9618
  platform;
9619
+ /**
9620
+ * Optional URL pointing to where this project is hosted or documented.
9621
+ * When provided it is stored in the source_project_metadata.project_url field
9622
+ * of the generated Circuit JSON.
9623
+ */
9624
+ projectUrl;
9608
9625
  _hasRenderedAtleastOnce = false;
9609
- constructor({ platform } = {}) {
9626
+ constructor({
9627
+ platform,
9628
+ projectUrl
9629
+ } = {}) {
9610
9630
  this.children = [];
9611
9631
  this.db = su5([]);
9612
9632
  this.root = this;
9613
9633
  this.platform = platform;
9634
+ this.projectUrl = projectUrl;
9614
9635
  }
9615
9636
  add(componentOrElm) {
9616
9637
  let component;
@@ -9662,9 +9683,11 @@ var RootCircuit = class {
9662
9683
  this._hasRenderedAtleastOnce = true;
9663
9684
  }
9664
9685
  async renderUntilSettled() {
9665
- if (!this.db.source_project_metadata.list()?.[0]) {
9686
+ const existing = this.db.source_project_metadata.list()?.[0];
9687
+ if (!existing) {
9666
9688
  this.db.source_project_metadata.insert({
9667
- software_used_string: `@tscircuit/core@${this.getCoreVersion()}`
9689
+ software_used_string: `@tscircuit/core@${this.getCoreVersion()}`,
9690
+ ...this.projectUrl ? { project_url: this.projectUrl } : {}
9668
9691
  });
9669
9692
  }
9670
9693
  this.render();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.454",
4
+ "version": "0.0.456",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "@tscircuit/math-utils": "^0.0.18",
36
36
  "@tscircuit/props": "^0.0.211",
37
37
  "@tscircuit/schematic-autolayout": "^0.0.6",
38
- "@tscircuit/schematic-match-adapt": "^0.0.9",
38
+ "@tscircuit/schematic-match-adapt": "^0.0.16",
39
39
  "@tscircuit/simple-3d-svg": "^0.0.6",
40
40
  "@types/bun": "latest",
41
41
  "@types/debug": "^4.1.12",
@@ -44,7 +44,7 @@
44
44
  "@types/react-reconciler": "^0.28.9",
45
45
  "bun-match-svg": "0.0.8",
46
46
  "chokidar-cli": "^3.0.0",
47
- "circuit-json": "^0.0.199",
47
+ "circuit-json": "^0.0.201",
48
48
  "circuit-json-to-connectivity-map": "^0.0.22",
49
49
  "circuit-json-to-simple-3d": "^0.0.2",
50
50
  "circuit-to-svg": "^0.0.151",