@tscircuit/core 0.0.755 → 0.0.757

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
@@ -163,6 +163,10 @@ interface SimpleRouteJson {
163
163
  minY: number;
164
164
  maxY: number;
165
165
  };
166
+ outline?: Array<{
167
+ x: number;
168
+ y: number;
169
+ }>;
166
170
  traces?: SimplifiedPcbTrace[];
167
171
  }
168
172
 
package/dist/index.js CHANGED
@@ -6946,6 +6946,23 @@ var getFileExtension = (filename) => {
6946
6946
  return cleanFilename.split(".").pop();
6947
6947
  };
6948
6948
 
6949
+ // lib/utils/constructAssetUrl.ts
6950
+ var constructAssetUrl = (targetUrl, baseUrl) => {
6951
+ if (!baseUrl) {
6952
+ return targetUrl;
6953
+ }
6954
+ if (!targetUrl.startsWith("/")) {
6955
+ return targetUrl;
6956
+ }
6957
+ try {
6958
+ const base = new URL(baseUrl);
6959
+ const resolved = new URL(targetUrl, base.origin);
6960
+ return resolved.toString();
6961
+ } catch (error) {
6962
+ return targetUrl;
6963
+ }
6964
+ };
6965
+
6949
6966
  // lib/components/base-components/NormalComponent/NormalComponent_doInitialPcbFootprintStringRender.ts
6950
6967
  function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsyncEffect) {
6951
6968
  let { footprint } = component.props;
@@ -6957,10 +6974,13 @@ function NormalComponent_doInitialPcbFootprintStringRender(component, queueAsync
6957
6974
  if (typeof footprint === "string" && isFootprintUrl(footprint) && footprintParser) {
6958
6975
  if (component._hasStartedFootprintUrlLoad) return;
6959
6976
  component._hasStartedFootprintUrlLoad = true;
6960
- const url = footprint;
6977
+ const baseUrl = component.root?.platform?.projectBaseUrl;
6978
+ const url = constructAssetUrl(footprint, baseUrl);
6961
6979
  queueAsyncEffect("load-footprint-from-platform-file-parser", async () => {
6962
6980
  try {
6963
- const result = await footprintParser.loadFromUrl(url);
6981
+ const result = await footprintParser.loadFromUrl(footprint).catch(() => {
6982
+ return footprintParser.loadFromUrl(url);
6983
+ });
6964
6984
  const fpComponents = createComponentsFromCircuitJson(
6965
6985
  {
6966
6986
  componentName: component.name,
@@ -8761,9 +8781,9 @@ var getSimpleRouteJsonFromCircuitJson = ({
8761
8781
  x: o.center.x + o.width / 2,
8762
8782
  y: o.center.y + o.height / 2
8763
8783
  }
8764
- ]);
8784
+ ]).concat(board?.outline ?? []);
8765
8785
  let bounds;
8766
- if (board) {
8786
+ if (board && !board.outline) {
8767
8787
  bounds = {
8768
8788
  minX: board.center.x - board.width / 2,
8769
8789
  maxX: board.center.x + board.width / 2,
@@ -8965,7 +8985,8 @@ var getSimpleRouteJsonFromCircuitJson = ({
8965
8985
  // TODO add traces so that we don't run into things routed by another
8966
8986
  // subcircuit
8967
8987
  layerCount: board?.num_layers ?? 2,
8968
- minTraceWidth
8988
+ minTraceWidth,
8989
+ outline: board?.outline?.map((point) => ({ ...point }))
8969
8990
  },
8970
8991
  connMap
8971
8992
  };
@@ -12143,6 +12164,13 @@ var Group6 = class extends NormalComponent3 {
12143
12164
  minTraceWidth: this.props.autorouter?.minTraceWidth ?? 0.15,
12144
12165
  subcircuit_id: this.subcircuit_id
12145
12166
  });
12167
+ if (debug10.enabled) {
12168
+ ;
12169
+ global.debugOutputArray?.push({
12170
+ name: `simpleroutejson-${this.props.name}.json`,
12171
+ obj: simpleRouteJson
12172
+ });
12173
+ }
12146
12174
  if (debug10.enabled) {
12147
12175
  const graphicsObject = convertSrjToGraphicsObject(
12148
12176
  simpleRouteJson
@@ -15783,7 +15811,7 @@ import { identity as identity6 } from "transformation-matrix";
15783
15811
  var package_default = {
15784
15812
  name: "@tscircuit/core",
15785
15813
  type: "module",
15786
- version: "0.0.754",
15814
+ version: "0.0.756",
15787
15815
  types: "dist/index.d.ts",
15788
15816
  main: "dist/index.js",
15789
15817
  module: "dist/index.js",
@@ -15812,7 +15840,7 @@ var package_default = {
15812
15840
  },
15813
15841
  devDependencies: {
15814
15842
  "@biomejs/biome": "^1.8.3",
15815
- "@tscircuit/capacity-autorouter": "^0.0.107",
15843
+ "@tscircuit/capacity-autorouter": "^0.0.123",
15816
15844
  "@tscircuit/checks": "^0.0.75",
15817
15845
  "@tscircuit/circuit-json-util": "^0.0.67",
15818
15846
  "@tscircuit/footprinter": "^0.0.236",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.755",
4
+ "version": "0.0.757",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@biomejs/biome": "^1.8.3",
33
- "@tscircuit/capacity-autorouter": "^0.0.107",
33
+ "@tscircuit/capacity-autorouter": "^0.0.123",
34
34
  "@tscircuit/checks": "^0.0.75",
35
35
  "@tscircuit/circuit-json-util": "^0.0.67",
36
36
  "@tscircuit/footprinter": "^0.0.236",