From f0da6e7c6d3732927852e97377256ca2aa371c70 Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Sat, 22 Jun 2024 17:09:03 -0700 Subject: [PATCH] feat: mark react-ui components as client components (#296) --- packages/react-ui/package.json | 6 +++--- packages/react-ui/tsup.config.ts | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/react-ui/package.json b/packages/react-ui/package.json index 06fbb8a41..f1e630cf1 100644 --- a/packages/react-ui/package.json +++ b/packages/react-ui/package.json @@ -1,6 +1,6 @@ { "name": "@assistant-ui/react-ui", - "version": "0.0.2", + "version": "0.0.3", "license": "MIT", "exports": { ".": { @@ -14,8 +14,8 @@ } }, "./styles.css": { - "types": "./styles.css.d.ts", - "default": "./styles.css" + "types": "./dist/styles.css.d.ts", + "default": "./dist/styles.css" } }, "source": "./src/index.ts", diff --git a/packages/react-ui/tsup.config.ts b/packages/react-ui/tsup.config.ts index bf859d286..1a8c3c84a 100644 --- a/packages/react-ui/tsup.config.ts +++ b/packages/react-ui/tsup.config.ts @@ -34,6 +34,7 @@ const tailwindcssTransformerCode: Plugin = { "utf8", ), }); + await fs.promises.mkdir(outDir, { recursive: true }); await fs.promises.writeFile(path.join(outDir, "styles.css"), styleSheet); await fs.promises.writeFile( @@ -50,7 +51,12 @@ export default defineConfig(() => { format: ["cjs", "esm"], dts: true, sourcemap: true, - clean: true, + // clean: true, esbuildPlugins: [tailwindcssTransformerCode], + esbuildOptions: (options) => { + options.banner = { + js: '"use client";', + }; + }, }; });