tailwindcss-patch 9.4.3 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cli-BztQHMRp.js → cli-CGyUnvFc.js} +3 -2
- package/dist/{cli-D0jXMGXf.mjs → cli-DRfALTSo.mjs} +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/commands/cli-runtime.d.mts +1 -1
- package/dist/commands/cli-runtime.d.ts +1 -1
- package/dist/commands/cli-runtime.js +2 -2
- package/dist/commands/cli-runtime.mjs +2 -2
- package/dist/{dist-DDcbvOwe.js → dist-DlC5vuI2.js} +1 -1
- package/dist/index.d.mts +7 -149
- package/dist/index.d.ts +8 -150
- package/dist/index.js +294 -521
- package/dist/index.mjs +6 -471
- package/dist/{validate-BuqRodYI.d.ts → validate-B5-08lrU.d.ts} +7 -251
- package/dist/{validate-oAkURzUC.d.mts → validate-CgrG4aAY.d.mts} +7 -251
- package/dist/{validate-Bug_WYcU.mjs → validate-Q00Ccqht.mjs} +8 -1405
- package/dist/{validate-DbuKewV-.js → validate-XiYmTZcd.js} +82 -1708
- package/package.json +8 -10
- package/src/api/tailwindcss-patcher.ts +8 -5
- package/src/extraction/candidate-extractor.ts +17 -701
- package/src/extraction/split-candidate-tokens.ts +5 -101
- package/src/options/types.ts +1 -2
- package/src/style-candidates.ts +5 -35
- package/src/style-generator.ts +11 -80
- package/src/types.ts +21 -95
- package/src/v3/index.ts +2 -2
- package/src/v4/index.ts +104 -28
- package/src/v3/style-generator.ts +0 -384
- package/src/v4/bare-arbitrary-values.ts +0 -545
- package/src/v4/candidates.ts +0 -316
- package/src/v4/engine.ts +0 -112
- package/src/v4/node-adapter.ts +0 -207
- package/src/v4/source-scan.ts +0 -432
- package/src/v4/source.ts +0 -235
- package/src/v4/style-generator.ts +0 -44
- package/src/v4/types.ts +0 -103
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.5.0",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=22.13.0"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://mangle.icebreaker.top/",
|
|
11
11
|
"repository": {
|
|
@@ -65,25 +65,23 @@
|
|
|
65
65
|
"@babel/parser": "^7.29.7",
|
|
66
66
|
"@babel/traverse": "^7.29.7",
|
|
67
67
|
"@babel/types": "^7.29.7",
|
|
68
|
-
"@tailwindcss/node": "^4.3.0",
|
|
69
|
-
"@tailwindcss/oxide": "^4.3.0",
|
|
70
68
|
"cac": "6.7.14",
|
|
71
69
|
"consola": "^3.4.2",
|
|
72
70
|
"fs-extra": "^11.3.5",
|
|
73
71
|
"local-pkg": "^1.2.1",
|
|
74
|
-
"micromatch": "^4.0.8",
|
|
75
72
|
"pathe": "^2.0.3",
|
|
76
73
|
"postcss": "^8.5.15",
|
|
77
74
|
"semver": "^7.8.4",
|
|
78
75
|
"tailwindcss-config": "^2.0.0",
|
|
79
|
-
"@tailwindcss-mangle/config": "7.0.2"
|
|
76
|
+
"@tailwindcss-mangle/config": "7.0.2",
|
|
77
|
+
"@tailwindcss-mangle/engine": "0.1.0"
|
|
80
78
|
},
|
|
81
79
|
"devDependencies": {
|
|
82
|
-
"@tailwindcss/postcss": "^4.3.
|
|
83
|
-
"@tailwindcss/vite": "^4.3.
|
|
84
|
-
"tailwindcss": "^4.3.
|
|
80
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
81
|
+
"@tailwindcss/vite": "^4.3.1",
|
|
82
|
+
"tailwindcss": "^4.3.1",
|
|
85
83
|
"tailwindcss-3": "npm:tailwindcss@^3.4.19",
|
|
86
|
-
"tailwindcss-4": "npm:tailwindcss@^4.3.
|
|
84
|
+
"tailwindcss-4": "npm:tailwindcss@^4.3.1"
|
|
87
85
|
},
|
|
88
86
|
"scripts": {
|
|
89
87
|
"dev": "tsdown --watch --sourcemap",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SourceEntry } from '@tailwindcss/
|
|
1
|
+
import type { TailwindV4SourcePattern as SourceEntry } from '@tailwindcss-mangle/engine/v4'
|
|
2
2
|
import type { PackageInfo } from 'local-pkg'
|
|
3
3
|
import type { NormalizedTailwindCssPatchOptions } from '../config'
|
|
4
4
|
import type { PatchResult, TailwindCollector, TailwindMajorVersion } from '../runtime/collector'
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
CacheReadMeta,
|
|
10
10
|
ExtractResult,
|
|
11
11
|
TailwindCssPatchOptions,
|
|
12
|
+
TailwindcssRuntimeContext,
|
|
12
13
|
TailwindTokenByFileMap,
|
|
13
14
|
TailwindTokenFileKey,
|
|
14
15
|
TailwindTokenReport,
|
|
@@ -104,9 +105,11 @@ function createCollector(
|
|
|
104
105
|
return new RuntimeCollector(packageInfo, options, majorVersion, snapshotFactory)
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
function getPackageInfoFromCwd(packageName: string, cwd: string): PackageInfo | undefined {
|
|
108
|
+
function getPackageInfoFromCwd(packageName: string, cwd: string, resolvePaths: string[] = []): PackageInfo | undefined {
|
|
108
109
|
try {
|
|
109
|
-
const packageJsonPath = createRequire(path.join(cwd, 'package.json')).resolve(`${packageName}/package.json
|
|
110
|
+
const packageJsonPath = createRequire(path.join(cwd, 'package.json')).resolve(`${packageName}/package.json`, {
|
|
111
|
+
paths: resolvePaths,
|
|
112
|
+
})
|
|
110
113
|
const packageJson = fs.readJSONSync(packageJsonPath) as PackageInfo['packageJson']
|
|
111
114
|
return {
|
|
112
115
|
name: packageName,
|
|
@@ -124,7 +127,7 @@ function getPackageInfoFromCwd(packageName: string, cwd: string): PackageInfo |
|
|
|
124
127
|
function getTailwindPackageInfo(options: NormalizedTailwindCssPatchOptions) {
|
|
125
128
|
const cwd = options.tailwind.cwd ?? options.projectRoot
|
|
126
129
|
const cwdPackageInfo = options.tailwind.resolve?.paths?.length
|
|
127
|
-
? getPackageInfoFromCwd(options.tailwind.packageName, cwd)
|
|
130
|
+
? getPackageInfoFromCwd(options.tailwind.packageName, cwd, options.tailwind.resolve.paths)
|
|
128
131
|
: undefined
|
|
129
132
|
return cwdPackageInfo
|
|
130
133
|
?? getPackageInfoSync(
|
|
@@ -194,7 +197,7 @@ export class TailwindcssPatcher {
|
|
|
194
197
|
return this.collector.getPatchStatus()
|
|
195
198
|
}
|
|
196
199
|
|
|
197
|
-
getContexts() {
|
|
200
|
+
getContexts(): TailwindcssRuntimeContext[] {
|
|
198
201
|
return this.collector.getContexts()
|
|
199
202
|
}
|
|
200
203
|
|