Skip to content

Commit

Permalink
Merge pull request #3 from cnpem/feat-shadcn-cli
Browse files Browse the repository at this point in the history
update shadcn cli usage
  • Loading branch information
brnovasco authored Sep 10, 2024
2 parents 0e8cc88 + 5aa4f46 commit cdb6f51
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-peaches-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sophys-web/ui": minor
---

Update to new shadcn-cli
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "turbo clean",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"format:check": "prettier --check \"**/*.{ts,tsx,md}\"",
"ui-add": "turbo run ui-add"
"ui-add": "pnpm dlx shadcn@latest add -c packages/ui"
},
"devDependencies": {
"@sophys-web/typescript-config": "workspace:*",
Expand Down
8 changes: 5 additions & 3 deletions packages/ui/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"prefix": ""
},
"aliases": {
"components": "src/",
"utils": "@sophys-web/ui",
"ui": "src/"
"components": "@/src/",
"utils": "@/src/lib/utils",
"ui": "@/src/",
"hooks": "@/src/hooks",
"lib": "@/src/lib"
}
}
3 changes: 1 addition & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"clean": "rm -rf dist .turbo node_modules",
"lint": "eslint src/",
"dev": "tailwindcss -i ./src/styles.css -o ./dist/index.css --watch",
"type-check": "tsc --noEmit",
"ui-add": "pnpm dlx shadcn-ui add"
"type-check": "tsc --noEmit"
},
"peerDependencies": {
"react": "^18.3.1"
Expand Down
7 changes: 1 addition & 6 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
export { cn } from "./lib/utils";
6 changes: 6 additions & 0 deletions packages/ui/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
8 changes: 7 additions & 1 deletion packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"extends": "@sophys-web/typescript-config/react-library.json",
"include": ["."],
"exclude": ["dist", "build", "node_modules"]
"exclude": ["dist", "build", "node_modules"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}
}
4 changes: 0 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
},
"clean": {
"cache": false
},
"ui-add": {
"cache": false,
"interactive": true
}
},
"globalEnv": ["AUTH_SECRET", "PORT"],
Expand Down

0 comments on commit cdb6f51

Please sign in to comment.