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