easyeda 0.0.275 → 0.0.277

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/main.cjs CHANGED
@@ -3441,7 +3441,14 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber, {
3441
3441
  body: searchData
3442
3442
  });
3443
3443
  if (!searchResponse.ok) {
3444
- throw new Error("Failed to search for the component");
3444
+ if (searchResponse.status === 403) {
3445
+ throw new Error(
3446
+ `EasyEDA API rate limit exceeded while searching for "${jlcpcbPartNumber}" (HTTP 403). EasyEDA rate-limits by IP \u2014 the part number is likely fine. Wait ~2 minutes and try again.`
3447
+ );
3448
+ }
3449
+ throw new Error(
3450
+ `Failed to search for the component (HTTP ${searchResponse.status})`
3451
+ );
3445
3452
  }
3446
3453
  const searchResult = await searchResponse.json();
3447
3454
  if (!searchResult.success || !searchResult.result.lists.lcsc.length) {
@@ -3459,7 +3466,14 @@ async function fetchEasyEDAComponent(jlcpcbPartNumber, {
3459
3466
  }
3460
3467
  });
3461
3468
  if (!componentResponse.ok) {
3462
- throw new Error("Failed to fetch the component details");
3469
+ if (componentResponse.status === 403) {
3470
+ throw new Error(
3471
+ `EasyEDA API rate limit exceeded while fetching "${jlcpcbPartNumber}" (HTTP 403). EasyEDA rate-limits by IP \u2014 the part number is likely fine. Wait ~2 minutes and try again.`
3472
+ );
3473
+ }
3474
+ throw new Error(
3475
+ `Failed to fetch the component details (HTTP ${componentResponse.status})`
3476
+ );
3463
3477
  }
3464
3478
  const componentResult = await componentResponse.json();
3465
3479
  const result = componentResult.result;
@@ -3499,7 +3513,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
3499
3513
  var package_default = {
3500
3514
  name: "easyeda",
3501
3515
  type: "module",
3502
- version: "0.0.274",
3516
+ version: "0.0.276",
3503
3517
  files: [
3504
3518
  "dist"
3505
3519
  ],
@@ -3518,10 +3532,10 @@ var package_default = {
3518
3532
  "@tscircuit/props": "^0.0.567",
3519
3533
  "@types/bun": "latest",
3520
3534
  "bun-match-svg": "^0.0.13",
3535
+ "circuit-json-to-3d-png": "^0.0.7",
3521
3536
  "circuit-json-to-gltf": "^0.0.106",
3522
3537
  "circuit-to-svg": "^0.0.392",
3523
3538
  "looks-same": "^9.0.1",
3524
- poppygl: "^0.0.24",
3525
3539
  "transformation-matrix": "^2.16.1",
3526
3540
  tscircuit: "^0.0.2002",
3527
3541
  tsup: "^8.5.0"