From 11968273910d29f71c5a124df3dffaa19a1f5c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Mon, 13 Apr 2026 20:40:32 +0200 Subject: [PATCH] fix(ui): split tsup builds to avoid d.ts races (#1437) --- packages/ui/package.json | 2 +- packages/ui/tsup.config.react.ts | 23 ++++++++++++++++ packages/ui/tsup.config.solid.ts | 23 ++++++++++++++++ packages/ui/tsup.config.ts | 46 -------------------------------- 4 files changed, 47 insertions(+), 47 deletions(-) create mode 100644 packages/ui/tsup.config.react.ts create mode 100644 packages/ui/tsup.config.solid.ts delete mode 100644 packages/ui/tsup.config.ts diff --git a/packages/ui/package.json b/packages/ui/package.json index efedcd9c..914ed669 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -20,7 +20,7 @@ "README.md" ], "scripts": { - "build": "tsup" + "build": "tsup --config tsup.config.react.ts && tsup --config tsup.config.solid.ts" }, "dependencies": { "@paper-design/shaders": "0.0.72", diff --git a/packages/ui/tsup.config.react.ts b/packages/ui/tsup.config.react.ts new file mode 100644 index 00000000..aa28ae73 --- /dev/null +++ b/packages/ui/tsup.config.react.ts @@ -0,0 +1,23 @@ +import { defineConfig } from "tsup" + +export default defineConfig({ + entry: { + "react/index": "src/react/index.ts", + }, + tsconfig: "./tsconfig.react.json", + format: ["esm"], + dts: { + tsconfig: "./tsconfig.react.json", + }, + clean: true, + target: "es2022", + platform: "browser", + sourcemap: false, + splitting: false, + treeshake: true, + external: ["react", "react/jsx-runtime"], + esbuildOptions(options) { + options.jsx = "automatic" + options.jsxImportSource = "react" + }, +}) diff --git a/packages/ui/tsup.config.solid.ts b/packages/ui/tsup.config.solid.ts new file mode 100644 index 00000000..293f1bc0 --- /dev/null +++ b/packages/ui/tsup.config.solid.ts @@ -0,0 +1,23 @@ +import { defineConfig } from "tsup" + +export default defineConfig({ + entry: { + "solid/index": "src/solid/index.ts", + }, + tsconfig: "./tsconfig.solid.json", + format: ["esm"], + dts: { + tsconfig: "./tsconfig.solid.json", + }, + clean: false, + target: "es2022", + platform: "browser", + sourcemap: false, + splitting: false, + treeshake: true, + external: ["solid-js", "solid-js/jsx-runtime"], + esbuildOptions(options) { + options.jsx = "automatic" + options.jsxImportSource = "solid-js/h" + }, +}) diff --git a/packages/ui/tsup.config.ts b/packages/ui/tsup.config.ts deleted file mode 100644 index 88fe7467..00000000 --- a/packages/ui/tsup.config.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { defineConfig } from "tsup" - -export default defineConfig([ - { - entry: { - "react/index": "src/react/index.ts", - }, - tsconfig: "./tsconfig.react.json", - format: ["esm"], - dts: { - tsconfig: "./tsconfig.react.json", - }, - clean: true, - target: "es2022", - platform: "browser", - sourcemap: false, - splitting: false, - treeshake: true, - external: ["react", "react/jsx-runtime"], - esbuildOptions(options) { - options.jsx = "automatic" - options.jsxImportSource = "react" - }, - }, - { - entry: { - "solid/index": "src/solid/index.ts", - }, - tsconfig: "./tsconfig.solid.json", - format: ["esm"], - dts: { - tsconfig: "./tsconfig.solid.json", - }, - clean: false, - target: "es2022", - platform: "browser", - sourcemap: false, - splitting: false, - treeshake: true, - external: ["solid-js", "solid-js/jsx-runtime"], - esbuildOptions(options) { - options.jsx = "automatic" - options.jsxImportSource = "solid-js/h" - }, - }, -])