Skip to content

Commit

Permalink
refactor: move registry into its own package (#264)
Browse files Browse the repository at this point in the history
* refactor: move registry into its own package

* add changeset
  • Loading branch information
Yonom authored Jun 20, 2024
1 parent 0d83f67 commit 1f8cc5e
Show file tree
Hide file tree
Showing 36 changed files with 192 additions and 138 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-ravens-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"assistant-ui": patch
---

refactor: make cli package more lightweight
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ dist/

apps/www/public/registry/
packages/react/README.md
packages/cli/README.md
2 changes: 1 addition & 1 deletion apps/www/components/ui/assistant-ui/assistant-modal.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "assistant-ui/registry/assistant-ui/assistant-modal";
export * from "@assistant-ui/shadcn-registry/registry/assistant-ui/assistant-modal";
2 changes: 1 addition & 1 deletion apps/www/components/ui/assistant-ui/codeblock.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "assistant-ui/registry/assistant-ui/experimental/codeblock";
export * from "@assistant-ui/shadcn-registry/registry/assistant-ui/experimental/codeblock";
2 changes: 1 addition & 1 deletion apps/www/components/ui/assistant-ui/markdown-text.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "assistant-ui/registry/assistant-ui/experimental/markdown-text";
export * from "@assistant-ui/shadcn-registry/registry/assistant-ui/experimental/markdown-text";
2 changes: 1 addition & 1 deletion apps/www/components/ui/assistant-ui/thread.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "assistant-ui/registry/assistant-ui/full/thread";
export * from "@assistant-ui/shadcn-registry/registry/assistant-ui/full/thread";
4 changes: 2 additions & 2 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
"scripts": {
"dev": "next dev",
"build": "pnpm run build:registry && next build",
"build:registry": "pnpm --filter assistant-ui run build:registry",
"build:registry": "pnpm --filter @assistant-ui/shadcn-registry run build:registry",
"start": "next start"
},
"dependencies": {
"@ai-sdk/openai": "^0.0.29",
"@ai-sdk/react": "^0.0.2",
"@assistant-ui/react": "workspace:*",
"@assistant-ui/react-ai-sdk": "workspace:*",
"@assistant-ui/shadcn-registry": "workspace:*",
"@calcom/embed-react": "^1.5.0",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
Expand All @@ -30,7 +31,6 @@
"@radix-ui/themes": "^3.0.5",
"@vercel/analytics": "^1.3.1",
"ai": "^3.1.36",
"assistant-ui": "workspace:*",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"lucide-react": "^0.395.0",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "assistant-ui",
"name": "@assistant-ui/monorepo",
"private": true,
"scripts": {
"lint": "biome lint .",
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# `assistant-ui` CLI

This package contains the command line interface for `assistant-ui`.

## Usage

```sh
npx assistant-ui@latest add
```
34 changes: 4 additions & 30 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,20 @@
"commander": "^12.1.0",
"cosmiconfig": "^9.0.0",
"cross-spawn": "^7.0.3",
"shadcn-ui": "0.8.0",
"tsconfig-paths": "^4.2.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@assistant-ui/react": "workspace:*",
"@assistant-ui/react-markdown": "workspace:*",
"@assistant-ui/tsconfig": "workspace:*",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tooltip": "^1.0.7",
"@types/cross-spawn": "^6.0.6",
"@types/node": "^20.14.2",
"@types/react": "^18",
"@types/react-syntax-highlighter": "^15.5.13",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"lucide-react": "^0.395.0",
"react": "^18.3.1",
"react-resizable-panels": "^2.0.19",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"rimraf": "^5.0.7",
"shadcn-ui": "0.8.0",
"tailwind-merge": "^2.3.0",
"tailwindcss": "^3.4.4",
"tailwindcss-animate": "^1.0.7",
"tsup": "^8.1.0",
"tsx": "^4.15.6"
"tsup": "^8.1.0"
},
"files": [
"dist",
"README.md"
],
"files": ["dist", "README.md"],
"bin": "./dist/index.js",
"scripts": {
"build": "tsup src/index.ts --format esm --sourcemap",
"build:registry": "tsx ./scripts/build-registry.ts",
"prepublish": "cp ../../README.md ./README.md"
"build": "tsup src/index.ts --format esm --sourcemap"
},
"publishConfig": {
"access": "public",
Expand Down
1 change: 1 addition & 0 deletions packages/react-hook-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"devDependencies": {
"@assistant-ui/react": "workspace:*",
"@assistant-ui/tsconfig": "workspace:*",
"@types/node": "^20.14.2",
"tsup": "^8.1.0"
},
"publishConfig": {
Expand Down
1 change: 1 addition & 0 deletions packages/react-markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"devDependencies": {
"@assistant-ui/react": "workspace:*",
"@assistant-ui/tsconfig": "workspace:*",
"@types/node": "^20.14.2",
"tsup": "^8.1.0"
},
"publishConfig": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions packages/shadcn-registry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@assistant-ui/shadcn-registry",
"version": "0.0.1",
"private": true,
"license": "MIT",
"type": "module",
"dependencies": {},
"devDependencies": {
"@assistant-ui/react": "workspace:*",
"@assistant-ui/react-markdown": "workspace:*",
"@assistant-ui/tsconfig": "workspace:*",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tooltip": "^1.0.7",
"@types/node": "^20.14.2",
"@types/react": "^18",
"@types/react-syntax-highlighter": "^15.5.13",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"lucide-react": "^0.395.0",
"react": "^18.3.1",
"react-resizable-panels": "^2.0.19",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"rimraf": "^5.0.7",
"tailwind-merge": "^2.3.0",
"tailwindcss": "^3.4.4",
"tailwindcss-animate": "^1.0.7",
"tsx": "^4.15.6"
},
"scripts": {
"build": "tsx ./scripts/build-registry.ts"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/shadcn-registry/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@assistant-ui/tsconfig/base.json",
"compilerOptions": {
"paths": {
"@/*": ["./*"],
"@assistant-ui/*": ["../../packages/*/src"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 1f8cc5e

Please sign in to comment.