fix: update file handling

This commit is contained in:
shadcn
2024-11-07 21:21:42 +04:00
parent 366d6b656b
commit eff1918d41
2 changed files with 867 additions and 868 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -288,15 +288,14 @@ export const Index: Record<string, any> = {
type: "${item.type}",
registryDependencies: ${JSON.stringify(item.registryDependencies)},
files: [${item.files?.map((file) => {
const resolvedFilePath = path.resolve(
`registry/${style.name}/${
typeof file === "string" ? file : file.path
}`
)
const filePath = `registry/${style.name}/${
typeof file === "string" ? file : file.path
}`
const resolvedFilePath = path.resolve(filePath)
return typeof file === "string"
? `"${resolvedFilePath}"`
: `{
path: "${resolvedFilePath}",
path: "${filePath}",
type: "${file.type}",
target: "${file.target ?? ""}"
}`