diff --git a/packages/tsconfig/react-library.json b/packages/tsconfig/react-library.json index 36b62be..61df40c 100644 --- a/packages/tsconfig/react-library.json +++ b/packages/tsconfig/react-library.json @@ -6,6 +6,7 @@ "jsx": "react-jsx", "lib": ["ES2015", "DOM"], "module": "ESNext", - "target": "es6" + "target": "es6", + "noEmit": true, } } diff --git a/packages/ui/components.json b/packages/ui/components.json index 5d18d02..5bdb637 100644 --- a/packages/ui/components.json +++ b/packages/ui/components.json @@ -11,7 +11,7 @@ "prefix": "" }, "aliases": { - "components": "@ui/components", - "utils": "@ui/lib/utils" + "components": "@/ui/components", + "utils": "@/ui/lib/utils" } } diff --git a/packages/ui/package.json b/packages/ui/package.json index 3084a85..5eec2c7 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -35,8 +35,7 @@ "postcss": "^8.4.38", "tailwind-merge": "^2.3.0", "tailwindcss": "^3.4.3", - "tsup": "^8.0.2", - "@saroh/utils": "workspace:*" + "tsup": "^8.0.2" }, "author": "Mohit Kumar ", "homepage": "https://saroh.io", diff --git a/packages/ui/src/components/ui/button.tsx b/packages/ui/src/components/ui/button.tsx index 6d1a6ed..de863ad 100644 --- a/packages/ui/src/components/ui/button.tsx +++ b/packages/ui/src/components/ui/button.tsx @@ -1,11 +1,8 @@ -/* eslint-disable @typescript-eslint/no-unsafe-call -- no*/ -/* eslint-disable @typescript-eslint/no-unsafe-assignment -- some */ -/* eslint-disable import/no-extraneous-dependencies -- trying to remove error */ /* eslint-disable import/no-named-as-default-member -- showing unnecessary errors*/ import { Slot } from "@radix-ui/react-slot"; -import { cn } from "@saroh/utils"; import { cva, type VariantProps } from "class-variance-authority"; import React from "react"; +import { cn } from "../../lib/utils"; const buttonVariants = cva( "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", diff --git a/packages/ui/src/lib/utils.ts b/packages/ui/src/lib/utils.ts new file mode 100644 index 0000000..76341b3 --- /dev/null +++ b/packages/ui/src/lib/utils.ts @@ -0,0 +1,7 @@ +/* eslint-disable @typescript-eslint/explicit-function-return-type -- no */ +import { clsx, type ClassValue } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 57908d2..7f7bb72 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -1,11 +1,11 @@ { "extends": "tsconfig/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"], - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@ui/*": ["./src/*"] - } - } + "exclude": ["dist", "build", "node_modules"] + // "compilerOptions": { + // "baseUrl": ".", + // "paths": { + // "@/ui/*": ["./src/*"] + // } + // } } diff --git a/packages/ui/tsup.config.ts b/packages/ui/tsup.config.ts index 7ac7d69..d51c506 100644 --- a/packages/ui/tsup.config.ts +++ b/packages/ui/tsup.config.ts @@ -5,13 +5,15 @@ import { defineConfig, Options } from "tsup"; export default defineConfig((options: Options) => ({ entry: ["src/**/*.tsx"], - format: ["esm"], + format: ["esm", "cjs"], esbuildOptions(options) { options.banner = { js: '"use client"', }; }, dts: true, + target: "es2019", + clean: true, minify: true, external: ["react"], ...options, diff --git a/packages/utils/tsup.config.ts b/packages/utils/tsup.config.ts index a208a61..5773f25 100644 --- a/packages/utils/tsup.config.ts +++ b/packages/utils/tsup.config.ts @@ -2,7 +2,7 @@ import { defineConfig, Options } from "tsup"; export default defineConfig((options: Options) => ({ entry: ["src/**/*.ts"], - format: ["esm"], + format: ["esm", "cjs"], dts: true, minify: true, external: ["react"], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 212113d..5562255 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -793,9 +793,6 @@ importers: '@radix-ui/react-slot': specifier: ^1.0.2 version: 1.0.2(@types/react@18.3.2)(react@18.3.1) - '@saroh/utils': - specifier: workspace:* - version: link:../utils autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.38) diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 6b7962d..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "tsconfig/base.json" -}