diff --git a/CHANGELOG.md b/CHANGELOG.md index 2059564..1d0c306 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## v0.2.0 + +### Changes + +- feat: improve shadcn ecosystem compatibility +- Add components.json to enable shadcn CLI recognition +- Register list and file-upload components in registry.json + ## v0.1.1 ### New Features diff --git a/components.json b/components.json new file mode 100644 index 0000000..7720b53 --- /dev/null +++ b/components.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.css", + "css": "src/tailwind.css" + }, + "aliases": { + "components": "@matechat/react", + "utils": "@matechat/react/utils" + } +} diff --git a/package.json b/package.json index b43965c..fdb3cd5 100644 --- a/package.json +++ b/package.json @@ -87,10 +87,10 @@ "prepublishOnly": "pnpm run build", "preview": "pnpm --filter @matechat/react-playground dev", "registry:build": "shadcn build --output docs/doc_build/r", - "test": "vitest", + "test": "vitest run --pool=vmForks", "typecheck": "tsc --noEmit" }, "type": "module", "types": "./dist/*.d.ts", - "version": "0.1.1" + "version": "0.2.0" } diff --git a/playground/components.json b/playground/components.json new file mode 100644 index 0000000..7aada78 --- /dev/null +++ b/playground/components.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/tailwind.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "aliases": { + "components": "@matechat/react/components", + "utils": "@matechat/react/lib/utils", + "ui": "@matechat/react/components/ui", + "lib": "@matechat/react/lib", + "hooks": "@matechat/react/hooks" + }, + "registries": {} +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96a91de..0fb668e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3255,7 +3255,7 @@ packages: glob@8.1.0: resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} engines: {node: '>=12'} - deprecated: Glob versions prior to v9 are no longer supported + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me globals-docs@2.4.1: resolution: {integrity: sha512-qpPnUKkWnz8NESjrCvnlGklsgiQzlq+rcCxoG5uNQ+dNA7cFMCmn231slLAwS2N/PlkzZ3COL8CcS10jXmLHqg==} @@ -4860,6 +4860,7 @@ packages: rolldown-vite@7.2.1: resolution: {integrity: sha512-J1QRxf8zlYNvjAY1fB6zW+FLr0K26/IpKFrGM+Za0Ko6meJUMlHBk+LV19gAb8sfSluH4/6dyWKVS2dvNU4RLQ==} engines: {node: ^20.19.0 || >=22.12.0} + deprecated: Use 7.3.1 for migration purposes. For the most recent updates, migrate to Vite 8 once you're ready. hasBin: true peerDependencies: '@types/node': ^20.19.0 || >=22.12.0 @@ -5362,10 +5363,12 @@ packages: tar@7.4.3: resolution: {integrity: sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me tar@7.5.1: resolution: {integrity: sha512-nlGpxf+hv0v7GkWBK2V9spgactGOp0qvfWRxUMjqHyzrt3SgwE48DIv/FhqPHJYLHpgW1opq3nERbz5Anq7n1g==} engines: {node: '>=18'} + deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me terser-webpack-plugin@5.3.14: resolution: {integrity: sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw==} diff --git a/registry.json b/registry.json index 594c402..521babb 100644 --- a/registry.json +++ b/registry.json @@ -64,6 +64,30 @@ "remark-math", "react-syntax-highlighter" ] + }, + { + "name": "list", + "type": "registry:block", + "title": "List", + "description": "MateChat List", + "files": [ + { + "path": "src/list.tsx", + "type": "registry:component" + } + ] + }, + { + "name": "file-upload", + "type": "registry:block", + "title": "FileUpload", + "description": "MateChat FileUpload", + "files": [ + { + "path": "src/file-upload.tsx", + "type": "registry:component" + } + ] } ] } diff --git a/src/lib/utils.ts b/src/lib/utils.ts new file mode 100644 index 0000000..365058c --- /dev/null +++ b/src/lib/utils.ts @@ -0,0 +1,6 @@ +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +}