Skip to content

Commit

Permalink
chore: improve isAllowedClassName preflight
Browse files Browse the repository at this point in the history
  • Loading branch information
sonofmagic committed Feb 18, 2025
1 parent 13b72d8 commit 64c0189
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 107 deletions.
6 changes: 6 additions & 0 deletions .changeset/breezy-teeth-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"weapp-tailwindcss": patch
"@weapp-tailwindcss/postcss": patch
---

feat: improve `isAllowedClassName` preflight
3 changes: 2 additions & 1 deletion .changeset/fuzzy-hotels-jam.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"weapp-tailwindcss": patch
---

feat: add resolve option
feat: add `resolve` option

2 changes: 1 addition & 1 deletion apps/web-postcss7-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"postinstall": "weapp-tw patch"
},
"dependencies": {
"tailwindcss-patch": "^6.0.4"
"tailwindcss-patch": "^6.0.5"
},
"devDependencies": {
"autoprefixer": "^9.8.8",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@
"@types/webpack": "^5.28.5",
"@types/webpack-sources": "^3.2.3",
"@types/webpack4": "npm:@types/webpack@^4.41.39",
"@vitest/coverage-v8": "~3.0.5",
"@vitest/ui": "~3.0.5",
"@vitest/coverage-v8": "~3.0.6",
"@vitest/ui": "~3.0.6",
"@weapp-tailwindcss/shared": "workspace:*",
"anymatch": "^3.1.3",
"autoprefixer": "^10.4.20",
Expand Down Expand Up @@ -234,7 +234,7 @@
"vinyl-fs": "^4.0.0",
"vite": "^6.1.0",
"vite-plugin-inspect": "^10.2.1",
"vitest": "~3.0.5",
"vitest": "~3.0.6",
"weapp-tailwindcss": "workspace:*",
"weapp-tailwindcss-children": "^0.1.0",
"webpack": "^5.98.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"types": "./dist/index.d.ts"
},
"dependencies": {
"@weapp-core/escape": "~4.0.0",
"@weapp-core/escape": "~4.0.1",
"@weapp-tailwindcss/shared": "workspace:*",
"postcss": "~8.5.2",
"postcss-preset-env": "^10.1.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/weapp-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"@babel/parser": "~7.26.9",
"@babel/traverse": "~7.26.9",
"@babel/types": "~7.26.9",
"@weapp-core/escape": "~4.0.0",
"@weapp-core/escape": "~4.0.1",
"@weapp-core/regex": "~1.0.1",
"@weapp-tailwindcss/init": "workspace:*",
"@weapp-tailwindcss/logger": "workspace:*",
Expand All @@ -179,7 +179,7 @@
"magic-string": "0.30.17",
"md5": "2.3.0",
"semver": "~7.7.1",
"tailwindcss-patch": "~6.0.4",
"tailwindcss-patch": "~6.0.5",
"webpack-sources": "3.2.3"
}
}
4 changes: 4 additions & 0 deletions packages/weapp-tailwindcss/src/tailwindcss/patcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { PackageResolvingOptions } from 'local-pkg'
import type { CacheOptions, ILengthUnitsPatchOptions, TailwindcssUserConfig } from 'tailwindcss-patch'
import path from 'node:path'
import process from 'node:process'
import { isAllowedClassName } from '@weapp-core/escape'
import { TailwindcssPatcher } from 'tailwindcss-patch'

export interface CreateTailwindcssPatcherOptions {
Expand Down Expand Up @@ -38,6 +39,9 @@ export function createTailwindcssPatcher(options?: CreateTailwindcssPatcherOptio
},
tailwindcss,
resolve,
filter: (x) => {
return !isAllowedClassName(x)
},
// for example
// resolve: {
// paths: [
Expand Down
218 changes: 119 additions & 99 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 64c0189

Please sign in to comment.