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 +14 -10
- package/dist/cli/main.cjs.map +1 -1
- package/dist/lib/index.cjs +17 -11
- package/dist/lib/index.cjs.map +1 -1
- package/dist/lib/index.d.cts +3 -1
- package/package.json +1 -1
package/dist/lib/index.cjs
CHANGED
|
@@ -28650,7 +28650,8 @@ var lib_exports = {};
|
|
|
28650
28650
|
__export(lib_exports, {
|
|
28651
28651
|
convertEasyEdaJsonToTscircuitSoupJson: () => convertEasyEdaJsonToTscircuitSoupJson,
|
|
28652
28652
|
convertRawEasyEdaToTs: () => convertRawEasyEdaToTs,
|
|
28653
|
-
fetchEasyEDAComponent: () => fetchEasyEDAComponent
|
|
28653
|
+
fetchEasyEDAComponent: () => fetchEasyEDAComponent,
|
|
28654
|
+
normalizeManufacturerPartNumber: () => normalizeManufacturerPartNumber
|
|
28654
28655
|
});
|
|
28655
28656
|
module.exports = __toCommonJS(lib_exports);
|
|
28656
28657
|
|
|
@@ -29555,6 +29556,16 @@ export const use${componentName} = createUseComponent(${componentName}, pinNames
|
|
|
29555
29556
|
`.trim();
|
|
29556
29557
|
};
|
|
29557
29558
|
|
|
29559
|
+
// lib/utils/normalize-manufacturer-part-number.ts
|
|
29560
|
+
function normalizeManufacturerPartNumber(partNumber) {
|
|
29561
|
+
let normalized = partNumber.replace(/-/g, "_");
|
|
29562
|
+
normalized = normalized.replace(/[^a-zA-Z0-9_$]/g, "");
|
|
29563
|
+
if (/^\d/.test(normalized)) {
|
|
29564
|
+
normalized = "A" + normalized;
|
|
29565
|
+
}
|
|
29566
|
+
return normalized;
|
|
29567
|
+
}
|
|
29568
|
+
|
|
29558
29569
|
// lib/convert-to-typescript-component/index.tsx
|
|
29559
29570
|
var convertRawEasyEdaToTs = (rawEasy) => {
|
|
29560
29571
|
const easyeda = EasyEdaJsonSchema.parse(rawEasy);
|
|
@@ -29579,7 +29590,9 @@ var convertToTypescriptComponent = ({
|
|
|
29579
29590
|
const hole = (0, import_soup_util2.su)(soup).pcb_hole.list();
|
|
29580
29591
|
const pinLabels = {};
|
|
29581
29592
|
easyEdaJson.dataStr.shape.filter((shape) => shape.type === "PIN").forEach((pin) => {
|
|
29582
|
-
|
|
29593
|
+
const isPinLabelNumeric = /^\d+$/.test(pin.label);
|
|
29594
|
+
const label = isPinLabelNumeric ? `pin${pin.label}` : pin.label;
|
|
29595
|
+
pinLabels[pin.pinNumber.toString()] = label;
|
|
29583
29596
|
});
|
|
29584
29597
|
const pins = easyEdaJson.dataStr.shape.filter((shape) => shape.type === "PIN");
|
|
29585
29598
|
const leftPins = pins.filter((pin) => pin.rotation === 180);
|
|
@@ -29602,19 +29615,12 @@ var convertToTypescriptComponent = ({
|
|
|
29602
29615
|
easyEdaJson
|
|
29603
29616
|
});
|
|
29604
29617
|
};
|
|
29605
|
-
function normalizeManufacturerPartNumber(partNumber) {
|
|
29606
|
-
let normalized = partNumber.replace(/-/g, "_");
|
|
29607
|
-
normalized = normalized.replace(/[^a-zA-Z0-9_$]/g, "");
|
|
29608
|
-
if (/^\d/.test(normalized)) {
|
|
29609
|
-
normalized = "A" + normalized;
|
|
29610
|
-
}
|
|
29611
|
-
return normalized;
|
|
29612
|
-
}
|
|
29613
29618
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29614
29619
|
0 && (module.exports = {
|
|
29615
29620
|
convertEasyEdaJsonToTscircuitSoupJson,
|
|
29616
29621
|
convertRawEasyEdaToTs,
|
|
29617
|
-
fetchEasyEDAComponent
|
|
29622
|
+
fetchEasyEDAComponent,
|
|
29623
|
+
normalizeManufacturerPartNumber
|
|
29618
29624
|
});
|
|
29619
29625
|
/*! Bundled license information:
|
|
29620
29626
|
|