Skip to content

Commit daabb93

Browse files
committed
chore: bump version
1 parent 2289746 commit daabb93

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

.changeset/free-days-battle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tailwindcss-patch": patch
3+
---
4+
5+
chore: bump version

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ export class CacheManager {
6969
return new Set<string>(data ?? [])
7070
}
7171
}
72-
catch (error) {
73-
logger.error(error)
72+
catch {
7473
try {
7574
isExisted && await fs.remove(filename)
7675
}

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

+6-10
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,15 @@ export class TailwindcssPatcher {
2929
this.patchOptions = getPatchOptions(options.patch)
3030

3131
this.cacheManager = new CacheManager(this.cacheOptions)
32-
this.filter = this.patchOptions.filter
32+
this.filter = function filter(className: string) {
33+
if (this.patchOptions.output?.removeUniversalSelector && className === '*') {
34+
return false
35+
}
36+
return Boolean(this.patchOptions.filter?.(className))
37+
}
3338
const packageInfo = getPackageInfoSync(
3439
this.patchOptions.packageName ?? 'tailwindcss',
3540
this.patchOptions.resolve,
36-
// defuOverrideArray<PackageResolvingOptions, Partial<PackageResolvingOptions>[]>(
37-
// this.patchOptions.resolve!,
38-
// {
39-
// paths: [import.meta.dirname],
40-
// },
41-
// ),
4241
)
4342

4443
if (!packageInfo) {
@@ -159,9 +158,6 @@ export class TailwindcssPatcher {
159158
const keys = classCacheMap.keys()
160159
for (const key of keys) {
161160
const v = key.toString()
162-
if (output?.removeUniversalSelector && v === '*') {
163-
continue
164-
}
165161
this.filter?.(v) && classSet.add(v)
166162
}
167163
}

packages/tailwindcss-patch/src/defaults.ts

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export function getPatchOptions(options?: PatchOptions) {
1818
return defu<InternalPatchOptions, Partial<InternalPatchOptions>[]>(
1919
options,
2020
{
21+
output: {
22+
removeUniversalSelector: true,
23+
},
2124
basedir: process.cwd(),
2225
},
2326
getDefaultPatchOptions(),

0 commit comments

Comments
 (0)