easyeda 0.0.20 → 0.0.22

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/cli/main.cjs CHANGED
@@ -29176,7 +29176,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
29176
29176
  var package_default = {
29177
29177
  name: "easyeda",
29178
29178
  type: "module",
29179
- version: "0.0.19",
29179
+ version: "0.0.20",
29180
29180
  files: ["dist"],
29181
29181
  repository: {
29182
29182
  type: "git",
@@ -29595,6 +29595,16 @@ export const use${componentName} = createUseComponent(${componentName}, pinNames
29595
29595
  `.trim();
29596
29596
  };
29597
29597
 
29598
+ // lib/utils/normalize-manufacturer-part-number.ts
29599
+ function normalizeManufacturerPartNumber(partNumber) {
29600
+ let normalized = partNumber.replace(/-/g, "_");
29601
+ normalized = normalized.replace(/[^a-zA-Z0-9_$]/g, "");
29602
+ if (/^\d/.test(normalized)) {
29603
+ normalized = "A" + normalized;
29604
+ }
29605
+ return normalized;
29606
+ }
29607
+
29598
29608
  // lib/convert-to-typescript-component/index.tsx
29599
29609
  var convertRawEasyEdaToTs = (rawEasy) => {
29600
29610
  const easyeda = EasyEdaJsonSchema.parse(rawEasy);
@@ -29619,7 +29629,9 @@ var convertToTypescriptComponent = ({
29619
29629
  const hole = (0, import_soup_util2.su)(soup).pcb_hole.list();
29620
29630
  const pinLabels = {};
29621
29631
  easyEdaJson.dataStr.shape.filter((shape) => shape.type === "PIN").forEach((pin) => {
29622
- pinLabels[pin.pinNumber.toString()] = pin.label;
29632
+ const isPinLabelNumeric = /^\d+$/.test(pin.label);
29633
+ const label = isPinLabelNumeric ? `pin${pin.label}` : pin.label;
29634
+ pinLabels[pin.pinNumber.toString()] = label;
29623
29635
  });
29624
29636
  const pins = easyEdaJson.dataStr.shape.filter((shape) => shape.type === "PIN");
29625
29637
  const leftPins = pins.filter((pin) => pin.rotation === 180);
@@ -29642,14 +29654,6 @@ var convertToTypescriptComponent = ({
29642
29654
  easyEdaJson
29643
29655
  });
29644
29656
  };
29645
- function normalizeManufacturerPartNumber(partNumber) {
29646
- let normalized = partNumber.replace(/-/g, "_");
29647
- normalized = normalized.replace(/[^a-zA-Z0-9_$]/g, "");
29648
- if (/^\d/.test(normalized)) {
29649
- normalized = "A" + normalized;
29650
- }
29651
- return normalized;
29652
- }
29653
29657
 
29654
29658
  // cli/main.ts
29655
29659
  var path = __toESM(require("path"), 1);