From 5805c81cadbbd09e07c44579f80f9fc9e8842946 Mon Sep 17 00:00:00 2001 From: afiqzudinhadi Date: Fri, 20 Jun 2025 17:40:59 +0800 Subject: [PATCH] chore: use tsup to build ui instead of bunchee --- package-lock.json | 85 +++++++++------------------------- packages/ui/package.json | 70 +++------------------------- packages/ui/tailwind.config.ts | 9 ++++ packages/ui/tsconfig.json | 2 +- packages/ui/tsup.config.ts | 8 ++++ 5 files changed, 47 insertions(+), 127 deletions(-) create mode 100644 packages/ui/tailwind.config.ts create mode 100644 packages/ui/tsup.config.ts diff --git a/package-lock.json b/package-lock.json index 134b4a1..b15f2aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -290,6 +290,7 @@ }, "apps/web": { "version": "0.0.0", + "extraneous": true, "dependencies": { "@remix-run/node": "^2.15.2", "@remix-run/react": "^2.15.2", @@ -319,62 +320,6 @@ "node": ">=18.0.0" } }, - "apps/web/node_modules/@remix-run/server-runtime": { - "version": "2.15.3", - "resolved": "https://registry.npmjs.org/@remix-run/server-runtime/-/server-runtime-2.15.3.tgz", - "integrity": "sha512-taHBe1DEqxZNjjj6OfkSYbup+sZPjbTgUhykaI+nHqrC2NDQuTiisBXhLwtx60GctONR/x0lWhF7R9ZGC5WsHw==", - "license": "MIT", - "dependencies": { - "@remix-run/router": "1.22.0", - "@types/cookie": "^0.6.0", - "@web3-storage/multipart-parser": "^1.0.0", - "cookie": "^0.6.0", - "set-cookie-parser": "^2.4.8", - "source-map": "^0.7.3", - "turbo-stream": "2.4.0" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "typescript": "^5.1.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "apps/web/node_modules/@vercel/remix": { - "version": "2.16.6", - "resolved": "https://registry.npmjs.org/@vercel/remix/-/remix-2.16.6.tgz", - "integrity": "sha512-TfnxoU7iUo41CzPqqGMWF/+Jyt2n2H/uEhaV+C6upfJbD25dBkjr0LswA+E5mWsZrweqxfir1ALM5ljxRXnuGQ==", - "license": "MIT", - "dependencies": { - "@vercel/static-config": "3.0.0", - "isbot": "^3.6.8", - "ts-morph": "12.0.0" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@remix-run/dev": "2.15.3", - "@remix-run/node": "2.15.3", - "@remix-run/server-runtime": "2.15.3", - "react": "*", - "react-dom": "*" - } - }, - "apps/web/node_modules/@vercel/remix/node_modules/isbot": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/isbot/-/isbot-3.8.0.tgz", - "integrity": "sha512-vne1mzQUTR+qsMLeCBL9+/tgnDXRyc2pygLGl/WsgA+EZKIiB5Ehu0CiVTHIIk30zhJ24uGz4M5Ppse37aR0Hg==", - "license": "Unlicense", - "engines": { - "node": ">=12" - } - }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -4026,11 +3971,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=10" } @@ -4042,11 +3989,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=10" } @@ -4058,11 +4007,13 @@ "cpu": [ "arm" ], + "dev": true, "license": "Apache-2.0", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=10" } @@ -4074,11 +4025,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=10" } @@ -4090,11 +4043,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=10" } @@ -4106,11 +4061,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=10" } @@ -4122,11 +4079,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "linux" ], + "peer": true, "engines": { "node": ">=10" } @@ -4138,11 +4097,13 @@ "cpu": [ "arm64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">=10" } @@ -4154,11 +4115,13 @@ "cpu": [ "ia32" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">=10" } @@ -4170,11 +4133,13 @@ "cpu": [ "x64" ], + "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ "win32" ], + "peer": true, "engines": { "node": ">=10" } @@ -4189,7 +4154,7 @@ "version": "0.5.17", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==", - "devOptional": true, + "dev": true, "license": "Apache-2.0", "dependencies": { "tslib": "^2.8.0" @@ -18443,10 +18408,6 @@ "defaults": "^1.0.3" } }, - "node_modules/web": { - "resolved": "apps/web", - "link": true - }, "node_modules/web-encoding": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", @@ -19004,10 +18965,10 @@ "@repo/typescript-config": "*", "@tailwindcss/postcss": "^4.1.10", "@types/node": "^22.15.32", - "bunchee": "^6.4.0", "eslint": "^9.29.0", "jest": "^29.7.0", "tailwindcss": "^4.1.10", + "tsup": "^8.5.0", "typescript": "5.8.2" }, "peerDependencies": { diff --git a/packages/ui/package.json b/packages/ui/package.json index 3f041f4..6cf5ea7 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -9,8 +9,8 @@ "dist" ], "scripts": { - "build": "bunchee", - "dev": "bunchee --watch", + "build": "npm run clean && tsup", + "dev": "npm run clean && tsup --watch", "check-types": "tsc --noEmit", "lint": "eslint src/", "test": "jest", @@ -28,10 +28,10 @@ "@repo/typescript-config": "*", "@tailwindcss/postcss": "^4.1.10", "@types/node": "^22.15.32", - "bunchee": "^6.4.0", "eslint": "^9.29.0", "jest": "^29.7.0", "tailwindcss": "^4.1.10", + "tsup": "^8.5.0", "typescript": "5.8.2" }, "peerDependencies": { @@ -41,68 +41,10 @@ "react-dom": ">=18" }, "exports": { - "./counter-button": { - "import": { - "types": "./dist/es/counter-button.d.mts", - "default": "./dist/es/counter-button.mjs" - }, - "require": { - "types": "./dist/cjs/counter-button.d.ts", - "default": "./dist/cjs/counter-button.js" - } - }, - "./link": { - "import": { - "types": "./dist/es/link.d.mts", - "default": "./dist/es/link.mjs" - }, - "require": { - "types": "./dist/cjs/link.d.ts", - "default": "./dist/cjs/link.js" - } - }, "./postcss.config": "./postcss.config.mjs", - "./src/styles/globals.css": "./src/styles/globals.css", - "./lib/utils": { - "import": { - "types": "./dist/es/lib/utils.d.mts", - "default": "./dist/es/lib/utils.mjs" - }, - "require": { - "types": "./dist/cjs/lib/utils.d.ts", - "default": "./dist/cjs/lib/utils.js" - } - }, - "./components/button": { - "import": { - "types": "./dist/es/components/button.d.mts", - "default": "./dist/es/components/button.mjs" - }, - "require": { - "types": "./dist/cjs/components/button.d.ts", - "default": "./dist/cjs/components/button.js" - } - }, - "./components/card": { - "import": { - "types": "./dist/es/components/card.d.mts", - "default": "./dist/es/components/card.mjs" - }, - "require": { - "types": "./dist/cjs/components/card.d.ts", - "default": "./dist/cjs/components/card.js" - } - } - }, - "typesVersions": { - "*": { - "button": [ - "src/components/button.tsx" - ], - "card": [ - "src/components/card.tsx" - ] - } + "./tailwind.config": "./tailwind.config.ts", + "./globals.css": "./dist/styles/globals.css", + "./*": "./dist/*" }, "dependencies": { "@radix-ui/react-slot": "^1.2.3", diff --git a/packages/ui/tailwind.config.ts b/packages/ui/tailwind.config.ts new file mode 100644 index 0000000..1ed818d --- /dev/null +++ b/packages/ui/tailwind.config.ts @@ -0,0 +1,9 @@ +import type { Config } from "tailwindcss"; + +export default { + content: [], + theme: { + extend: {}, + }, + plugins: [], +} satisfies Config; diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 7d23cec..2d03bd0 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -9,6 +9,6 @@ "@repo/ui/*": ["./src/*"] } }, - "include": ["."], + "include": [".", "src"], "exclude": ["dist", "build", "node_modules"] } diff --git a/packages/ui/tsup.config.ts b/packages/ui/tsup.config.ts new file mode 100644 index 0000000..d8f3953 --- /dev/null +++ b/packages/ui/tsup.config.ts @@ -0,0 +1,8 @@ +import { defineConfig, type Options } from "tsup"; + +export default defineConfig((options: Options) => ({ + entry: ["src/**/*"], + clean: true, + format: ["cjs", "esm"], + ...options, +}));