- beautifului.dev 组件直连:Sidebar Nav、Tool Chips、Approval Card(抽屉化)、Streaming/Thinking、Code Block、Selection Actions、Prompt Bar、Search
19 lines
854 B
JavaScript
19 lines
854 B
JavaScript
// 校验 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')
|
|
}
|