Skip to content

Commit 5a09fcf

Browse files
authored
feat(cli): add tsconfig file detection based on the framework (#1330)
add main shadcn-ui cli changes
1 parent a553eac commit 5a09fcf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+10154
-2337
lines changed

apps/v4/registry/new-york-v4/ui/chart-area/AreaChart.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<script setup lang="ts" generic="T extends Record<string, any>">
2+
import type { BulletLegendItemInterface } from "@unovis/ts"
3+
import type { Component } from "vue"
24
import type { BaseChartProps } from "."
3-
import { type BulletLegendItemInterface, CurveType } from "@unovis/ts"
4-
import { Area, Axis, Line } from "@unovis/ts"
5+
import { Area, Axis, CurveType, Line } from "@unovis/ts"
6+
57
import { VisArea, VisAxis, VisLine, VisXYContainer } from "@unovis/vue"
68
import { useMounted } from "@vueuse/core"
79
import { useId } from "reka-ui"
8-
import { type Component, computed, ref } from "vue"
10+
import { computed, ref } from "vue"
911
import { cn } from "@/lib/utils"
1012
import { ChartCrosshair, ChartLegend, defaultColors } from "@/registry/new-york/ui/chart"
1113

apps/v4/registry/new-york-v4/ui/chart-bar/BarChart.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<script setup lang="ts" generic="T extends Record<string, any>">
22
import type { BulletLegendItemInterface } from "@unovis/ts"
3+
import type { Component } from "vue"
34
import type { BaseChartProps } from "."
45
import { Axis, GroupedBar, StackedBar } from "@unovis/ts"
56
import { VisAxis, VisGroupedBar, VisStackedBar, VisXYContainer } from "@unovis/vue"
67
import { useMounted } from "@vueuse/core"
7-
import { type Component, computed, ref } from "vue"
8+
import { computed, ref } from "vue"
89
import { cn } from "@/lib/utils"
910
import { ChartCrosshair, ChartLegend, defaultColors } from "@/registry/new-york/ui/chart"
1011

apps/v4/registry/new-york-v4/ui/chart-donut/DonutChart.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<script setup lang="ts" generic="T extends Record<string, any>">
2+
import type { Component } from "vue"
23
import type { BaseChartProps } from "."
34
import { Donut } from "@unovis/ts"
45
import { VisDonut, VisSingleContainer } from "@unovis/vue"
56
import { useMounted } from "@vueuse/core"
6-
import { type Component, computed, ref } from "vue"
7+
import { computed, ref } from "vue"
78
import { cn } from "@/lib/utils"
89
import { ChartSingleTooltip, defaultColors } from "@/registry/new-york/ui/chart"
910

apps/v4/registry/new-york-v4/ui/chart-line/LineChart.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<script setup lang="ts" generic="T extends Record<string, any>">
2+
import type { BulletLegendItemInterface } from "@unovis/ts"
3+
import type { Component } from "vue"
24
import type { BaseChartProps } from "."
3-
import { type BulletLegendItemInterface, CurveType } from "@unovis/ts"
4-
import { Axis, Line } from "@unovis/ts"
5+
import { Axis, CurveType, Line } from "@unovis/ts"
6+
57
import { VisAxis, VisLine, VisXYContainer } from "@unovis/vue"
68
import { useMounted } from "@vueuse/core"
7-
import { type Component, computed, ref } from "vue"
9+
import { computed, ref } from "vue"
810
import { cn } from "@/lib/utils"
911
import { ChartCrosshair, ChartLegend, defaultColors } from "@/registry/new-york/ui/chart"
1012

apps/v4/registry/new-york-v4/ui/chart/ChartCrosshair.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<script setup lang="ts">
2-
import type { BulletLegendItemInterface } from '@unovis/ts'
3-
import { omit } from '@unovis/ts'
4-
import { VisCrosshair, VisTooltip } from '@unovis/vue'
5-
import { type Component, createApp } from 'vue'
6-
import { ChartTooltip } from '.'
2+
import type { BulletLegendItemInterface } from "@unovis/ts"
3+
import type { Component } from "vue"
4+
import { omit } from "@unovis/ts"
5+
import { VisCrosshair, VisTooltip } from "@unovis/vue"
6+
import { createApp } from "vue"
7+
import { ChartTooltip } from "."
78
89
const props = withDefaults(defineProps<{
910
colors: string[]
@@ -21,7 +22,7 @@ function template(d: any) {
2122
return wm.get(d)
2223
}
2324
else {
24-
const componentDiv = document.createElement('div')
25+
const componentDiv = document.createElement("div")
2526
const omittedData = Object.entries(omit(d, [props.index])).map(([key, value]) => {
2627
const legendReference = props.items.find(i => i.name === key)
2728
return { ...legendReference, value }
@@ -34,7 +35,7 @@ function template(d: any) {
3435
}
3536
3637
function color(d: unknown, i: number) {
37-
return props.colors[i] ?? 'transparent'
38+
return props.colors[i] ?? "transparent"
3839
}
3940
</script>
4041

apps/v4/registry/new-york-v4/ui/chart/ChartSingleTooltip.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<script setup lang="ts">
2-
import type { BulletLegendItemInterface } from '@unovis/ts'
3-
import { omit } from '@unovis/ts'
4-
import { VisTooltip } from '@unovis/vue'
5-
import { type Component, createApp } from 'vue'
6-
import { ChartTooltip } from '.'
2+
import type { BulletLegendItemInterface } from "@unovis/ts"
3+
import type { Component } from "vue"
4+
import { omit } from "@unovis/ts"
5+
import { VisTooltip } from "@unovis/vue"
6+
import { createApp } from "vue"
7+
import { ChartTooltip } from "."
78
89
const props = defineProps<{
910
selector: string
@@ -22,7 +23,7 @@ function template(d: any, i: number, elements: (HTMLElement | SVGElement)[]) {
2223
return wm.get(d)
2324
}
2425
else {
25-
const componentDiv = document.createElement('div')
26+
const componentDiv = document.createElement("div")
2627
const omittedData = Object.entries(omit(d, [props.index])).map(([key, value]) => {
2728
const legendReference = props.items?.find(i => i.name === key)
2829
return { ...legendReference, value: valueFormatter(value) }
@@ -43,7 +44,7 @@ function template(d: any, i: number, elements: (HTMLElement | SVGElement)[]) {
4344
else {
4445
const style = getComputedStyle(elements[i])
4546
const omittedData = [{ name: data.name, value: valueFormatter(data[props.index]), color: style.fill }]
46-
const componentDiv = document.createElement('div')
47+
const componentDiv = document.createElement("div")
4748
const TooltipComponent = props.customTooltip ?? ChartTooltip
4849
createApp(TooltipComponent, { title: d[props.index], data: omittedData }).mount(componentDiv)
4950
wm.set(d, componentDiv.innerHTML)

apps/v4/registry/new-york-v4/ui/chart/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export { default as ChartCrosshair } from './ChartCrosshair.vue'
2-
export { default as ChartLegend } from './ChartLegend.vue'
3-
export { default as ChartSingleTooltip } from './ChartSingleTooltip.vue'
4-
export { default as ChartTooltip } from './ChartTooltip.vue'
1+
export { default as ChartCrosshair } from "./ChartCrosshair.vue"
2+
export { default as ChartLegend } from "./ChartLegend.vue"
3+
export { default as ChartSingleTooltip } from "./ChartSingleTooltip.vue"
4+
export { default as ChartTooltip } from "./ChartTooltip.vue"
55

66
export function defaultColors(count: number = 3) {
77
const quotient = Math.floor(count / 2)
@@ -15,4 +15,4 @@ export function defaultColors(count: number = 3) {
1515
]
1616
}
1717

18-
export * from './interface'
18+
export * from "./interface"

apps/v4/registry/new-york-v4/ui/chart/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Spacing } from '@unovis/ts'
1+
import type { Spacing } from "@unovis/ts"
22

33
type KeyOf<T extends Record<string, any>> = Extract<keyof T, string>
44

apps/www/src/registry/schema.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const registryItemTypeSchema = z.enum([
2121
"registry:component",
2222
"registry:ui",
2323
"registry:hook",
24+
"registry:composable",
2425
"registry:theme",
2526
"registry:page",
2627
])
@@ -46,19 +47,13 @@ export const registryItemCssVarsSchema = z.object({
4647
dark: z.record(z.string(), z.string()).optional(),
4748
})
4849

49-
export const registryItemCssSchema = z.record(
50-
z.string(),
51-
z.lazy(() =>
52-
z.union([
53-
z.string(),
54-
z.record(
55-
z.string(),
56-
z.union([z.string(), z.record(z.string(), z.string())]),
57-
),
58-
]),
59-
),
50+
// Recursive type for CSS properties that supports empty objects at any level.
51+
const cssValueSchema: z.ZodType<any> = z.lazy(() =>
52+
z.union([z.string(), z.record(z.string(), cssValueSchema)]),
6053
)
6154

55+
export const registryItemCssSchema = z.record(z.string(), cssValueSchema)
56+
6257
export const registryItemSchema = z.object({
6358
name: z.string(),
6459
type: registryItemTypeSchema,

packages/cli/package.json

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
"./registry": {
3333
"types": "./dist/registry/index.d.ts",
3434
"default": "./dist/registry/index.js"
35+
},
36+
"./schema": {
37+
"types": "./dist/schema/index.d.ts",
38+
"default": "./dist/schema/index.js"
39+
},
40+
"./mcp": {
41+
"types": "./dist/mcp/index.d.ts",
42+
"default": "./dist/mcp/index.js"
3543
}
3644
},
3745
"bin": "./dist/index.js",
@@ -56,40 +64,47 @@
5664
"test:ui": "vitest --ui"
5765
},
5866
"dependencies": {
67+
"@dotenvx/dotenvx": "^1.49.0",
68+
"@modelcontextprotocol/sdk": "^1.18.0",
5969
"@unovue/detypes": "^0.8.5",
6070
"@vue/compiler-sfc": "^3.5",
61-
"commander": "^14.0.0",
71+
"c12": "^3.2.0",
72+
"commander": "^14.0.1",
6273
"consola": "^3.4.2",
63-
"cosmiconfig": "^9.0.0",
74+
"dedent": "^1.7.0",
6475
"deepmerge": "^4.3.1",
6576
"diff": "^8.0.2",
66-
"fs-extra": "^11.3.0",
77+
"fs-extra": "^11.3.1",
78+
"fuzzysort": "^3.1.0",
6779
"get-tsconfig": "^4.10.1",
68-
"magic-string": "^0.30.17",
69-
"nypm": "^0.6.0",
80+
"magic-string": "^0.30.19",
81+
"nypm": "^0.6.1",
7082
"ofetch": "^1.4.1",
7183
"ora": "^8.2.0",
7284
"pathe": "catalog:",
73-
"postcss": "^8.5.3",
85+
"postcss": "^8.5.6",
7486
"prompts": "^2.4.2",
7587
"reka-ui": "catalog:",
76-
"stringify-object": "^5.0.0",
77-
"tailwindcss": "^4.1.7",
88+
"semver": "^7.7.2",
89+
"stringify-object": "^6.0.0",
90+
"tailwindcss": "^4.1.12",
7891
"tinyexec": "^1.0.1",
7992
"tinyglobby": "catalog:",
80-
"ts-morph": "^26.0.0",
81-
"undici": "^7.10.0",
93+
"ts-morph": "^27.0.0",
94+
"undici": "^7.16.0",
8295
"vue-metamorph": "^3.3.3",
83-
"zod": "catalog:"
96+
"zod": "catalog:",
97+
"zod-to-json-schema": "^3.24.6"
8498
},
8599
"devDependencies": {
86100
"@types/diff": "^8.0.0",
87101
"@types/fs-extra": "^11.0.4",
88-
"@types/node": "^22.15.21",
102+
"@types/node": "^22.16.0",
89103
"@types/prompts": "^2.4.9",
104+
"@types/semver": "^7.7.1",
90105
"@types/stringify-object": "^4.0.5",
91-
"msw": "^2.8.4",
92-
"tsdown": "^0.12.3",
106+
"msw": "^2.11.2",
107+
"tsdown": "^0.15.1",
93108
"type-fest": "^4.41.0",
94109
"typescript": "catalog:"
95110
}

0 commit comments

Comments
 (0)