Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore(dify-ui): migrate class merging to cn (#41693)

Stephen Zhoub7570ce4b71b
diff --git a/packages/dify-ui/package.json b/packages/dify-ui/package.json
index 3a06d88f131..71da5d3d9d7 100644
--- a/packages/dify-ui/package.json
+++ b/packages/dify-ui/package.json
@@ -171,8 +171,7 @@
"type-check": "tsc"
},
"dependencies": {
- "clsx": "catalog:",
- "tailwind-merge": "catalog:"
+ "cn": "catalog:"
},
"devDependencies": {
"@base-ui/react": "catalog:",
diff --git a/packages/dify-ui/src/cn.ts b/packages/dify-ui/src/cn.ts
index 252b2b9dc4f..ae9e5a7c376 100644
--- a/packages/dify-ui/src/cn.ts
+++ b/packages/dify-ui/src/cn.ts
@@ -1,9 +1 @@
-import type { ClassValue } from 'clsx'
-import { clsx } from 'clsx'
-import { twMerge } from 'tailwind-merge'
-
-function cn(...inputs: ClassValue[]) {
- return twMerge(clsx(inputs))
-}
-
-export { cn }
+export { cn } from 'cn'
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 429790217f5..8dac7518f5f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -261,9 +261,9 @@ catalogs:
cli-table3:
specifier: 0.6.5
version: 0.6.5
- clsx:
- specifier: 2.1.1
- version: 2.1.1
+ cn:
+ specifier: 0.2.4
+ version: 0.2.4
code-inspector-plugin:
specifier: 1.6.6
version: 1.6.6
@@ -552,9 +552,6 @@ catalogs:
string-ts:
specifier: 2.3.1
version: 2.3.1
- tailwind-merge:
- specifier: 3.6.0
- version: 3.6.0
tailwindcss:
specifier: 4.3.3
version: 4.3.3
@@ -954,12 +951,9 @@ importers:
packages/dify-ui:
dependencies:
- clsx:
+ cn:
specifier: 'catalog:'
- version: 2.1.1
- tailwind-merge:
- specifier: 'catalog:'
- version: 3.6.0
+ version: 0.2.4
devDependencies:
'@base-ui/react':
specifier: 'catalog:'
@@ -5416,6 +5410,11 @@ packages:
resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}
engines: {node: '>=6'}
+ resolution: {integrity: sha512-SzQvoh5FwizWtQg9+JueKdjWhlfCZMdu5DqNHm9q1wUlRVmKb9WXlepR9bTTbPwzEOyX1ujJ6lcCppmn3bNUCg==}
+ engines: {node: '>=20'}
+ hasBin: true
+
resolution: {integrity: sha512-NQ8CWmMbFiZ+ck34Zxw4/awjIYcyutNPiVCdPe2hVXMD/NG2D+aWAz8NI2krOIagGnbny8j/YCyoiDsNRbnAbQ==}
@@ -12703,6 +12702,8 @@ snapshots:
+
dependencies:
'@code-inspector/core': 1.6.6([email protected])
@@ -17089,7 +17090,7 @@ time:
[email protected]: '2025-11-25T23:28:06.854Z'
[email protected]: '2024-11-26T08:20:34.604Z'
[email protected]: '2024-05-12T16:36:50.079Z'
- [email protected]: '2024-04-23T05:26:04.645Z'
+ [email protected]: '2026-09-02T09:26:36.212Z'
[email protected]: '2026-07-07T04:00:26.523Z'
[email protected]: '2026-08-15T03:33:20.323Z'
[email protected]: '2026-04-24T22:15:18.933Z'
@@ -17187,7 +17188,6 @@ time:
[email protected]: '2026-08-20T10:52:53.637Z'
[email protected]: '2026-08-24T14:07:33.027Z'
[email protected]: '2025-11-28T17:33:10.099Z'
- [email protected]: '2026-05-10T12:56:43.142Z'
[email protected]: '2026-07-16T12:03:35.267Z'
[email protected]: '2026-08-24T07:31:22.093Z'
[email protected]: '2026-08-30T00:46:16.265Z'
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 28b40c1b9cc..c8a43e068eb 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -148,7 +148,7 @@ catalog:
chokidar: 5.0.0
class-variance-authority: 0.7.1
cli-table3: 0.6.5
- clsx: 2.1.1
+ cn: 0.2.4
code-inspector-plugin: 1.6.6
concurrently: 10.0.5
copy-to-clipboard: 4.0.2
@@ -245,7 +245,6 @@ catalog:
storybook: 10.5.10
streamdown: 2.6.0
string-ts: 2.3.1
- tailwind-merge: 3.6.0
tailwindcss: 4.3.3
tldts: 7.4.11
tsx: 4.23.13