v0.6.0: beautifului 整合 + 会话/工作区/队列/权限/命令/附件全链路
- beautifului.dev 组件直连:Sidebar Nav、Tool Chips、Approval Card(抽屉化)、Streaming/Thinking、Code Block、Selection Actions、Prompt Bar、Search
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// 下载 beautifului.dev registry:索引 + 候选组件 JSON,保存到 scripts/beautifului/
|
||||
import { mkdir, writeFile } from 'node:fs/promises'
|
||||
|
||||
const outDir = new URL('./beautifului/', import.meta.url)
|
||||
await mkdir(outDir, { recursive: true })
|
||||
|
||||
async function grab(slug) {
|
||||
const r = await fetch(`https://www.beautifului.dev/r/${slug}.json`)
|
||||
if (!r.ok) {
|
||||
console.log(slug, '=> HTTP', r.status)
|
||||
return null
|
||||
}
|
||||
const text = await r.text()
|
||||
await writeFile(new URL(`${slug}.json`, outDir), text)
|
||||
return JSON.parse(text)
|
||||
}
|
||||
|
||||
// 1) registry 索引
|
||||
const idx = await grab('registry')
|
||||
if (idx) {
|
||||
const items = Array.isArray(idx) ? idx : idx.items || []
|
||||
console.log('=== registry index ===')
|
||||
for (const it of items) console.log('-', it.name, '|', it.title || '', '|', it.type || '')
|
||||
}
|
||||
|
||||
// 2) 候选组件(含传递依赖)
|
||||
const wanted = [
|
||||
'foundation',
|
||||
'loading-state',
|
||||
'streaming-text',
|
||||
'tool-chips',
|
||||
'approval-card',
|
||||
'button',
|
||||
'glide-menu',
|
||||
'task-rows',
|
||||
'prompt-bar',
|
||||
'selection-actions',
|
||||
'shimmer',
|
||||
'stream-text'
|
||||
]
|
||||
console.log('=== components ===')
|
||||
for (const s of wanted) {
|
||||
const j = await grab(s)
|
||||
if (!j) continue
|
||||
const files = (j.files || []).map((f) => f.path).join(', ')
|
||||
console.log(`${s}: deps=${JSON.stringify(j.dependencies || [])} files=[${files}]`)
|
||||
}
|
||||
Reference in New Issue
Block a user