diff --git a/packages/catalog-data/package.json b/packages/catalog-data/package.json index 6681eaa..09733df 100644 --- a/packages/catalog-data/package.json +++ b/packages/catalog-data/package.json @@ -46,7 +46,7 @@ }, "dependencies": { "@toolpath/part-contracts": "workspace:*", - "@toolpath/tool-scraper": "3.0.1", + "@toolpath/tool-scraper": "3.0.2", "@toolpath/tool-support": "0.4.0" }, "devDependencies": { diff --git a/packages/catalog-data/scripts/profiles.mjs b/packages/catalog-data/scripts/profiles.mjs index 0391a26..fa8ac8f 100644 --- a/packages/catalog-data/scripts/profiles.mjs +++ b/packages/catalog-data/scripts/profiles.mjs @@ -31,6 +31,7 @@ import { existsSync, readFileSync, readdirSync, writeFileSync, mkdirSync } from 'node:fs' import { resolve } from 'node:path' +import { ScraperConfigError } from '@toolpath/tool-scraper' import { describeApi } from '@toolpath/tool-scraper/node' import { ingestProfiles } from '../dist/index.js' @@ -103,11 +104,27 @@ const stepFor = async (record) => { const OPTIONS = { tolerance: 0.05, fillBays: false, flipped: false } +/** + * PSC is ISO 26623's polygonal coupling, not a 7:24 cone or an HSK interface. + * The scraper deliberately refuses to validate its measured interface against + * either of those two families. Keep that exclusion explicit: it is a partial + * profiles document, not a reason to discard every profile that did validate. + * + * Other configuration, vendor, API, or model failures remain fatal below. + */ +const UNSUPPORTED_PROFILE_TAPERS = new Set(['PSC50', 'PSC63']) + +const isUnsupportedProfileInterface = (error) => + error instanceof ScraperConfigError && + UNSUPPORTED_PROFILE_TAPERS.has(error.subject) && + error.message.includes('is not a taper designation this package can read a size out of') + let kernelVersion = '' let measuredCount = 0 let skippedCount = 0 let alreadyMeasured = 0 const failed = [] +const unsupported = [] for (const name of families) { // Resumable, like `scrape.mjs` and `scrape-holding.mjs`: a family already @@ -155,6 +172,11 @@ for (const name of families) { }) } catch (error) { const why = error instanceof Error ? error.message : String(error) + if (isUnsupportedProfileInterface(error)) { + unsupported.push(`${name}: ${why}`) + console.log(` UNSUPPORTED: ${why}`) + continue + } failed.push(`${name}: ${why}`) console.log(` FAILED: ${why}`) continue @@ -188,6 +210,13 @@ console.log( `${merged.complete} agreeing with the vendor's published gauge length -> ${merged.path}`, ) +if (unsupported.length > 0) { + console.log(`\n${unsupported.length} family/families have an unsupported profile interface:`) + for (const note of unsupported) { + console.log(` ${note}`) + } +} + if (failed.length > 0) { console.log(`\n${failed.length} family/families failed:`) for (const note of failed) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2d02c8..fd20c55 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -278,8 +278,8 @@ importers: specifier: workspace:* version: link:../part-contracts '@toolpath/tool-scraper': - specifier: 3.0.1 - version: 3.0.1 + specifier: 3.0.2 + version: 3.0.2 '@toolpath/tool-support': specifier: 0.4.0 version: 0.4.0 @@ -1315,8 +1315,8 @@ packages: react: ^19.0.0 react-dom: ^19.0.0 - '@toolpath/tool-scraper@3.0.1': - resolution: {integrity: sha512-JuSLGX8cSXWXFP/qvoZu6CDWRljmKA5ViM6VVhOOKV8fArlERInHP33nZM7DN5Vkd1aEFL/seDWfrQC3ukJIQw==} + '@toolpath/tool-scraper@3.0.2': + resolution: {integrity: sha512-v/hW3v1fBgFydjKRbNo6veXvycyNSyCGUg7+shV4XLr10XnHeoj6s6hDYyahwbpsjxq+75tV9aVOVCC6UhYAHQ==} engines: {node: '>=20'} hasBin: true @@ -1324,6 +1324,10 @@ packages: resolution: {integrity: sha512-LVyh/qwcV8izuzKgdfbnUdgGcCPZzxnfFqYlHGF18WO6tAETb/NB7jVgi9idA+13lWM2WFZoq4O/A+apWMuvbA==} engines: {node: '>=20'} + '@toolpath/tool-support@0.5.0': + resolution: {integrity: sha512-dfZ+VUVnjxSheOBdP9BPKqSYXLjzYTD5kyzctVSCzhbfGfuRWgDM7s8x6q0yBJF+UDBfKzzv1nwQpp35fhQQZA==} + engines: {node: '>=20'} + '@toolpath/ui@1.0.0': resolution: {integrity: sha512-5SM/z0uKaA2cfeQDOUK+gVmBbVKQY06VzKP335HAXi5So0tZ0BnGQoEO+oMfPgvAebs6fwsLmdK/4nENBaX6Zg==} engines: {node: '>=20'} @@ -3982,13 +3986,15 @@ snapshots: react: 19.2.0 react-dom: 19.2.0(react@19.2.0) - '@toolpath/tool-scraper@3.0.1': + '@toolpath/tool-scraper@3.0.2': dependencies: - '@toolpath/tool-support': 0.4.0 + '@toolpath/tool-support': 0.5.0 htmlparser2: 12.0.0 '@toolpath/tool-support@0.4.0': {} + '@toolpath/tool-support@0.5.0': {} + '@toolpath/ui@1.0.0(@emotion/react@11.14.0(@types/react@19.2.18)(react@19.2.0))(@types/react@19.2.18)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)(tailwindcss@4.3.3)': dependencies: '@base-ui/react': 1.2.0(@types/react@19.2.18)(react-dom@19.2.0(react@19.2.0))(react@19.2.0)