(absPath: string)
| 368 | } |
| 369 | |
| 370 | const buildComponentItem = async (absPath: string) => { |
| 371 | const name = path.basename(absPath, path.extname(absPath)) |
| 372 | const code = await read(absPath) |
| 373 | const specs = importSpecifiers(code) |
| 374 | const deps = topLevelPackages(specs) |
| 375 | const regDeps = await findInternalDepsForFile(absPath, specs) |
| 376 | const files: FileOut[] = [await fileEntryOther(absPath, 'registry:ui')] |
| 377 | const raw = { |
| 378 | $schema: 'https://ui.shadcn.com/schema/registry-item.json', |
| 379 | extends: 'none', |
| 380 | name, |
| 381 | type: 'registry:ui', |
| 382 | title: name, |
| 383 | description: name, |
| 384 | dependencies: deps.length ? deps : undefined, |
| 385 | registryDependencies: regDeps.length ? regDeps : undefined, |
| 386 | files, |
| 387 | } |
| 388 | return registryItemSchema.parse(raw) |
| 389 | } |
| 390 | |
| 391 | const buildLibItem = async (absPath: string) => { |
| 392 | const name = path.basename(absPath, path.extname(absPath)) |
no test coverage detected