mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-19 22:01:33 +00:00
Compare commits
2 Commits
shadcn@2.0
...
shadcn@2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ef7967b0d | ||
|
|
64b2f1a5ad |
@@ -62,6 +62,7 @@ export const registryEntrySchema = z.object({
|
||||
category: z.string().optional(),
|
||||
subcategory: z.string().optional(),
|
||||
chunks: z.array(blockChunkSchema).optional(),
|
||||
docs: z.string().optional(),
|
||||
})
|
||||
|
||||
export const registrySchema = z.array(registryEntrySchema)
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @shadcn/ui
|
||||
|
||||
## 2.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#4820](https://github.com/shadcn-ui/ui/pull/4820) [`64b2f1a`](https://github.com/shadcn-ui/ui/commit/64b2f1a5ad865c831045c954fec85e0fec2289e7) Thanks [@shadcn](https://github.com/shadcn)! - add docs support
|
||||
|
||||
## 2.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "shadcn",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.6",
|
||||
"description": "Add components to your apps.",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { type Config } from "@/src/utils/get-config"
|
||||
import { handleError } from "@/src/utils/handle-error"
|
||||
import { logger } from "@/src/utils/logger"
|
||||
import { registryResolveItemsTree } from "@/src/utils/registry"
|
||||
import { spinner } from "@/src/utils/spinner"
|
||||
import { updateCssVars } from "@/src/utils/updaters/update-css-vars"
|
||||
@@ -48,4 +49,8 @@ export async function addComponents(
|
||||
overwrite: options.overwrite,
|
||||
silent: options.silent,
|
||||
})
|
||||
|
||||
if (tree.docs) {
|
||||
logger.info(tree.docs)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,6 +321,13 @@ export async function registryResolveItemsTree(
|
||||
cssVars = deepmerge(cssVars, item.cssVars ?? {})
|
||||
})
|
||||
|
||||
let docs = ""
|
||||
payload.forEach((item) => {
|
||||
if (item.docs) {
|
||||
docs += `${item.docs}\n`
|
||||
}
|
||||
})
|
||||
|
||||
return registryResolvedItemsTreeSchema.parse({
|
||||
dependencies: deepmerge.all(
|
||||
payload.map((item) => item.dependencies ?? [])
|
||||
@@ -331,6 +338,7 @@ export async function registryResolveItemsTree(
|
||||
files: deepmerge.all(payload.map((item) => item.files ?? [])),
|
||||
tailwind,
|
||||
cssVars,
|
||||
docs,
|
||||
})
|
||||
} catch (error) {
|
||||
handleError(error)
|
||||
|
||||
@@ -46,6 +46,7 @@ export const registryItemSchema = z.object({
|
||||
tailwind: registryItemTailwindSchema.optional(),
|
||||
cssVars: registryItemCssVarsSchema.optional(),
|
||||
meta: z.record(z.string(), z.any()).optional(),
|
||||
docs: z.string().optional(),
|
||||
})
|
||||
|
||||
export type RegistryItem = z.infer<typeof registryItemSchema>
|
||||
@@ -82,4 +83,5 @@ export const registryResolvedItemsTreeSchema = registryItemSchema.pick({
|
||||
files: true,
|
||||
tailwind: true,
|
||||
cssVars: true,
|
||||
docs: true,
|
||||
})
|
||||
|
||||
@@ -20,6 +20,7 @@ exports[`registryResolveItemTree > should resolve index 1`] = `
|
||||
"tailwind-merge",
|
||||
],
|
||||
"devDependencies": [],
|
||||
"docs": "",
|
||||
"files": [
|
||||
{
|
||||
"content": ""use client"
|
||||
@@ -93,6 +94,7 @@ exports[`registryResolveItemTree > should resolve items tree 1`] = `
|
||||
"@radix-ui/react-slot",
|
||||
],
|
||||
"devDependencies": [],
|
||||
"docs": "",
|
||||
"files": [
|
||||
{
|
||||
"content": "import * as React from "react"
|
||||
@@ -171,6 +173,7 @@ exports[`registryResolveItemTree > should resolve multiple items tree 1`] = `
|
||||
"@radix-ui/react-dialog",
|
||||
],
|
||||
"devDependencies": [],
|
||||
"docs": "",
|
||||
"files": [
|
||||
{
|
||||
"content": "import * as React from "react"
|
||||
|
||||
Reference in New Issue
Block a user