Skip to content

Commit 2b91de7

Browse files
committed
chore: bump version
1 parent 1ee84cb commit 2b91de7

File tree

8 files changed

+3754
-1630
lines changed

8 files changed

+3754
-1630
lines changed

.changeset/warm-planets-throw.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"unplugin-tailwindcss-mangle": patch
3+
"tailwindcss-patch": patch
4+
---
5+
6+
feat: make cache sync and add getClassCacheSetV3 method

package.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -33,63 +33,63 @@
3333
},
3434
"devDependencies": {
3535
"@changesets/changelog-github": "^0.5.1",
36-
"@changesets/cli": "^2.28.1",
36+
"@changesets/cli": "^2.29.2",
3737
"@commitlint/cli": "^19.8.0",
3838
"@commitlint/config-conventional": "^19.8.0",
3939
"@commitlint/prompt-cli": "^19.8.0",
4040
"@commitlint/types": "^19.8.0",
41-
"@icebreakers/eslint-config": "^1.1.0",
42-
"@icebreakers/monorepo": "^0.7.9",
41+
"@icebreakers/eslint-config": "^1.1.1",
42+
"@icebreakers/monorepo": "^0.7.10",
4343
"@icebreakers/stylelint-config": "^1.0.0",
4444
"@rollup/pluginutils": "^5.1.4",
4545
"@tailwindcss-mangle/core": "workspace:*",
4646
"@tailwindcss-mangle/shared": "workspace:*",
4747
"@tsconfig/recommended": "^1.0.8",
48-
"@types/babel__generator": "^7.6.8",
48+
"@types/babel__generator": "^7.27.0",
4949
"@types/babel__helper-plugin-utils": "^7.10.3",
5050
"@types/babel__traverse": "^7.20.7",
5151
"@types/fs-extra": "^11.0.4",
5252
"@types/get-value": "^3.0.5",
53-
"@types/git-url-parse": "^9.0.3",
53+
"@types/git-url-parse": "^16.0.2",
5454
"@types/html-minifier-terser": "^7.0.2",
5555
"@types/klaw": "^3.0.6",
5656
"@types/lint-staged": "^13.3.0",
5757
"@types/lodash": "^4.17.16",
5858
"@types/lodash-es": "^4.17.12",
5959
"@types/micromatch": "^4.0.9",
60-
"@types/node": "^22.14.0",
60+
"@types/node": "^22.15.2",
6161
"@types/resolve": "^1.20.6",
6262
"@types/semver": "^7.7.0",
6363
"@types/set-value": "^4.0.3",
64-
"@vitest/coverage-v8": "~3.1.1",
65-
"astro": "^5.5.6",
64+
"@vitest/coverage-v8": "~3.1.2",
65+
"astro": "^5.7.5",
6666
"ci-info": "^4.2.0",
6767
"comment-json": "^4.2.5",
6868
"cross-env": "^7.0.3",
6969
"css-loader": "^7.1.2",
7070
"dedent": "^1.5.3",
7171
"defu": "^6.1.4",
7272
"del": "^8.0.0",
73-
"dotenv": "^16.4.7",
74-
"eslint": "^9.23.0",
73+
"dotenv": "^16.5.0",
74+
"eslint": "^9.25.1",
7575
"execa": "^9.5.2",
7676
"fast-glob": "^3.3.3",
77-
"fdir": "^6.4.3",
77+
"fdir": "^6.4.4",
7878
"fs-extra": "^11.3.0",
7979
"get-value": "^4.0.1",
8080
"html-minifier-terser": "^7.2.0",
8181
"html-webpack-plugin": "^5.6.3",
8282
"husky": "^9.1.7",
8383
"klaw": "^4.1.0",
84-
"lint-staged": "^15.5.0",
84+
"lint-staged": "^15.5.1",
8585
"local-pkg": "^1.1.1",
8686
"lodash": "^4.17.21",
8787
"lodash-es": "^4.17.21",
8888
"micromatch": "^4.0.8",
8989
"mini-css-extract-plugin": "^2.9.2",
9090
"normalize-newline": "^4.1.0",
9191
"only-allow": "^1.2.1",
92-
"openai": "^4.91.1",
92+
"openai": "^4.96.0",
9393
"pathe": "^2.0.3",
9494
"picomatch": "^4.0.2",
9595
"pkg-types": "^2.1.0",
@@ -98,23 +98,23 @@
9898
"postcss7": "npm:postcss@7",
9999
"prettier": "^3.5.3",
100100
"rimraf": "^6.0.1",
101-
"rollup": "^4.39.0",
101+
"rollup": "^4.40.0",
102102
"set-value": "^4.1.0",
103103
"tailwindcss": "^3.4.17",
104104
"tailwindcss-patch": "workspace:*",
105105
"tailwindcss2": "npm:@tailwindcss/postcss7-compat@^2.2.17",
106106
"tslib": "^2.8.1",
107107
"tsup": "^8.4.0",
108108
"tsx": "^4.19.3",
109-
"turbo": "^2.4.4",
110-
"typescript": "^5.8.2",
109+
"turbo": "^2.5.1",
110+
"typescript": "^5.8.3",
111111
"unbuild": "^3.5.0",
112-
"unplugin": "^2.2.2",
112+
"unplugin": "^2.3.2",
113113
"unplugin-tailwindcss-mangle": "workspace:*",
114-
"vite": "^6.2.4",
114+
"vite": "^6.3.3",
115115
"vite-tsconfig-paths": "^5.1.4",
116-
"vitest": "~3.1.1",
117-
"webpack": "^5.98.0",
116+
"vitest": "~3.1.2",
117+
"webpack": "^5.99.7",
118118
"webpack-build-utils": "^0.0.7",
119119
"yaml": "^2.7.1"
120120
}

packages/tailwindcss-patch/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@
8888
"tailwindcss-config": "^1.0.0"
8989
},
9090
"devDependencies": {
91-
"@tailwindcss/node": "^4.1.1",
92-
"@tailwindcss/oxide": "^4.1.1",
93-
"@tailwindcss/postcss": "^4.1.1",
94-
"@tailwindcss/vite": "^4.1.1",
91+
"@tailwindcss/node": "^4.1.4",
92+
"@tailwindcss/oxide": "^4.1.4",
93+
"@tailwindcss/postcss": "^4.1.4",
94+
"@tailwindcss/vite": "^4.1.4",
9595
"tailwindcss": "^4.1.1",
9696
"tailwindcss-3": "npm:tailwindcss@^3",
9797
"tailwindcss-4": "npm:tailwindcss@^4.1.1"

packages/tailwindcss-patch/src/core/cache.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,29 +49,29 @@ export class CacheManager {
4949
}
5050
}
5151

52-
async write(data: Set<string>) {
52+
write(data: Set<string>) {
5353
try {
5454
const { filename } = this.options
55-
await fs.outputJSON(filename, [...data])
55+
fs.outputJSONSync(filename, [...data])
5656
return filename
5757
}
5858
catch (error) {
5959
logger.error(error)
6060
}
6161
}
6262

63-
async read() {
63+
read() {
6464
const { filename } = this.options
65-
const isExisted = await fs.exists(filename)
65+
const isExisted = fs.existsSync(filename)
6666
try {
6767
if (isExisted) {
68-
const data = await fs.readJSON(filename)
68+
const data = fs.readJSONSync(filename)
6969
return new Set<string>(data ?? [])
7070
}
7171
}
7272
catch {
7373
try {
74-
isExisted && await fs.remove(filename)
74+
isExisted && fs.removeSync(filename)
7575
}
7676
catch (error) {
7777
logger.error(error)

packages/tailwindcss-patch/src/core/patcher.ts

+36-1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ export class TailwindcssPatcher {
169169
return classSet
170170
}
171171

172+
getClassCacheSetV3(): Set<string> {
173+
const classSet = new Set<string>()
174+
175+
const classCaches = this.getClassCaches()
176+
177+
for (const classCacheMap of classCaches) {
178+
const keys = classCacheMap.keys()
179+
for (const key of keys) {
180+
const v = key.toString()
181+
this.filter?.(v) && classSet.add(v)
182+
}
183+
}
184+
185+
return classSet
186+
}
187+
172188
/**
173189
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
174190
*/
@@ -179,7 +195,26 @@ export class TailwindcssPatcher {
179195
set.size > 0 && this.setCache(set)
180196
}
181197
else if (cacheStrategy === 'merge') {
182-
const cacheSet = await this.getCache()
198+
const cacheSet = this.getCache()
199+
if (cacheSet) {
200+
for (const x of cacheSet) {
201+
set.add(x)
202+
}
203+
}
204+
this.setCache(set)
205+
}
206+
207+
return set
208+
}
209+
210+
getClassSetV3() {
211+
const cacheStrategy = this.cacheOptions.strategy ?? 'merge'
212+
const set = this.getClassCacheSetV3()
213+
if (cacheStrategy === 'overwrite') {
214+
set.size > 0 && this.setCache(set)
215+
}
216+
else if (cacheStrategy === 'merge') {
217+
const cacheSet = this.getCache()
183218
if (cacheSet) {
184219
for (const x of cacheSet) {
185220
set.add(x)

packages/unplugin-tailwindcss-mangle/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"@tailwindcss-mangle/shared": "workspace:^",
7878
"is-css-request": "^1.0.1",
7979
"magic-string": "^0.30.17",
80-
"unplugin": "^2.2.2"
80+
"unplugin": "^2.3.2"
8181
},
8282
"publishConfig": {
8383
"access": "public",

0 commit comments

Comments
 (0)