// 校验 react-icons/lu 里要用的图标名是否存在 import { readdirSync, readFileSync } from 'node:fs' const pnpm = new URL('../node_modules/.pnpm/', import.meta.url) const dir = readdirSync(pnpm).find((d) => d.startsWith('react-icons@')) if (!dir) throw new Error('react-icons not found') const dts = new URL(`${dir}/node_modules/react-icons/lu/index.d.ts`, pnpm) const content = readFileSync(dts, 'utf8') const names = [ 'LuCheck', 'LuCpu', 'LuMessageSquare', 'LuPencil', 'LuRefreshCw', 'LuSettings', 'LuStore', 'LuTrash2', 'LuX', 'LuAlertTriangle', 'LuTriangleAlert', 'LuRotateCw', 'LuShieldAlert', 'LuTimer', 'LuKeyRound', 'LuLogOut', 'LuSearch', 'LuSparkles', 'LuPlus', 'LuArrowUp', 'LuSquare', 'LuChevronDown', 'LuActivity' ] for (const n of names) { console.log(n, content.includes(`declare const ${n}:`) ? 'OK' : 'MISSING') }