Skip to content

Commit bc8d3c9

Browse files
committed
chore(deps): bump version
1 parent 6d925c3 commit bc8d3c9

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

.changeset/dull-tigers-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@weapp-tailwindcss/merge": patch
3+
---
4+
5+
chore: 拆分 cn 和 cva 为了更小的包体积

packages/merge/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
"types": "./dist/index.d.ts",
3737
"import": "./dist/index.js",
3838
"require": "./dist/index.cjs"
39+
},
40+
"./cva": {
41+
"types": "./dist/cva.d.ts",
42+
"import": "./dist/cva.js",
43+
"require": "./dist/cva.cjs"
3944
}
4045
},
4146
"main": "./dist/index.cjs",

packages/merge/src/cva.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { cva as _cva } from 'class-variance-authority'
2+
import { escape } from 'weapp-tailwindcss/escape'
3+
4+
export function cva(...inputs: Parameters<typeof _cva>) {
5+
const fn = _cva(...inputs)
6+
return (...props: Parameters<typeof fn>) => {
7+
return escape(fn(...props))
8+
}
9+
}

packages/merge/src/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { cva as _cva } from 'class-variance-authority'
21
import { type ClassValue, clsx } from 'clsx'
32
import { twMerge } from 'tailwind-merge'
43
import { escape, weappTwIgnore } from 'weapp-tailwindcss/escape'
@@ -7,13 +6,6 @@ export function cn(...inputs: ClassValue[]) {
76
return escape(twMerge(clsx(inputs)))
87
}
98

10-
export function cva(...inputs: Parameters<typeof _cva>) {
11-
const fn = _cva(...inputs)
12-
return (...props: Parameters<typeof fn>) => {
13-
return escape(fn(...props))
14-
}
15-
}
16-
179
export {
1810
weappTwIgnore,
1911
}

packages/merge/tsup.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { defineConfig } from 'tsup'
22

33
export default defineConfig({
4-
entry: ['src/index.ts'], // , 'src/cli.ts'],
4+
entry: [
5+
'src/index.ts',
6+
'src/cva.ts',
7+
], // , 'src/cli.ts'],
58
shims: true,
69
format: ['cjs', 'esm'],
710
clean: true,

0 commit comments

Comments
 (0)