dsh-plugin-lcsc 0.3.1 → 0.3.2
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/README.md +1 -1
- package/data.js +7 -1
- package/index.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/data.js
CHANGED
|
@@ -582,6 +582,11 @@ export function parseBomCsvDetailed(text) {
|
|
|
582
582
|
const rest = row.filter((cell) => !/^C\d{4,11}$/i.test(cell.trim()))
|
|
583
583
|
let qty = 1
|
|
584
584
|
let designators
|
|
585
|
+
let place
|
|
586
|
+
// Headerless rows may be `code,qty,place` — recognise the placement token so
|
|
587
|
+
// it is not mistaken for a designator (and DNP/hand rows stay separate).
|
|
588
|
+
const placeCell = rest.find((cell) => /^(smt|hand|dnp|不贴|手焊|手工|贴片|机贴|mount)$/i.test(cell.trim()))
|
|
589
|
+
if (placeCell !== undefined) place = placeCell.trim()
|
|
585
590
|
for (const cell of rest) {
|
|
586
591
|
const integer = Number(cell)
|
|
587
592
|
if (Number.isInteger(integer) && integer > 0 && cell.trim() !== '') {
|
|
@@ -590,12 +595,13 @@ export function parseBomCsvDetailed(text) {
|
|
|
590
595
|
}
|
|
591
596
|
}
|
|
592
597
|
for (const cell of rest) {
|
|
598
|
+
if (cell === placeCell) continue
|
|
593
599
|
if (cell.trim() !== '' && !Number.isFinite(Number(cell)) && !/C\d{4,11}/i.test(cell)) {
|
|
594
600
|
designators = cell.trim()
|
|
595
601
|
break
|
|
596
602
|
}
|
|
597
603
|
}
|
|
598
|
-
rows.push(clean({ line: index + 1, code, qty, designators }))
|
|
604
|
+
rows.push(clean({ line: index + 1, code, qty, designators, place }))
|
|
599
605
|
}
|
|
600
606
|
return { rows, skipped }
|
|
601
607
|
}
|
package/index.js
CHANGED
|
@@ -1817,9 +1817,10 @@ export async function auditBom(service, args, options = {}) {
|
|
|
1817
1817
|
verified: auditRows.filter((row) => row.status === 'verified').length,
|
|
1818
1818
|
no_stock: auditRows.filter((row) => row.status === 'NO-STOCK').length,
|
|
1819
1819
|
not_found: auditRows.filter((row) => row.status === 'NOT-FOUND').length,
|
|
1820
|
-
base_parts:
|
|
1821
|
-
expand_parts:
|
|
1822
|
-
|
|
1820
|
+
base_parts: costRows.filter((row) => row.library === 'base').length,
|
|
1821
|
+
expand_parts: new Set(costRows.filter((row) => row.library === 'expand').map((row) => row.lcsc)).size,
|
|
1822
|
+
expanded_fee_parts: extendedUnique.size,
|
|
1823
|
+
library_unknown: costRows.filter((row) => row.library === undefined).length,
|
|
1823
1824
|
extended_fee_per_order_usd: money(extendedFee),
|
|
1824
1825
|
setup_fee_usd: money(setupFeeUsd),
|
|
1825
1826
|
stencil_fee_usd: money(stencilFeeUsd),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-lcsc",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Requirement-driven LCSC/JLC part finder and BOM cost auditor for DeepSeek Harness agents: real CNY+USD dual pricing, basic-vs-extended library fees, DNP/hand placement, net-saving alternatives",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh-plugin",
|