tailwindcss-patch 8.2.3 → 8.3.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/README.md +20 -0
- package/dist/{chunk-CFH3UEW6.js → chunk-7ZWFVW77.js} +476 -166
- package/dist/{chunk-KH3TRSVT.mjs → chunk-SN7IO2IS.mjs} +443 -133
- package/dist/cli.js +3 -233
- package/dist/cli.mjs +3 -233
- package/dist/index.d.mts +98 -1
- package/dist/index.d.ts +98 -1
- package/dist/index.js +8 -2
- package/dist/index.mjs +9 -3
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -4,69 +4,135 @@ import { Config } from 'tailwindcss';
|
|
|
4
4
|
import { PackageResolvingOptions, PackageInfo } from 'local-pkg';
|
|
5
5
|
import { TailwindLocatorOptions, TailwindNextOptions } from '@tailwindcss-mangle/config';
|
|
6
6
|
export { defineConfig } from '@tailwindcss-mangle/config';
|
|
7
|
+
import { CAC } from 'cac';
|
|
7
8
|
import * as consola from 'consola';
|
|
8
9
|
|
|
9
10
|
type CacheStrategy = 'merge' | 'overwrite';
|
|
11
|
+
/**
|
|
12
|
+
* Configures how the Tailwind class cache is stored and where it lives on disk.
|
|
13
|
+
*/
|
|
10
14
|
interface CacheUserOptions {
|
|
15
|
+
/** Whether caching is enabled. */
|
|
11
16
|
enabled?: boolean;
|
|
17
|
+
/** Working directory used when resolving cache paths. */
|
|
12
18
|
cwd?: string;
|
|
19
|
+
/** Directory where cache files are written. */
|
|
13
20
|
dir?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Cache filename. Defaults to `class-cache.json` inside the derived cache folder
|
|
23
|
+
* when omitted.
|
|
24
|
+
*/
|
|
14
25
|
file?: string;
|
|
26
|
+
/** Strategy used when merging new class lists with an existing cache. */
|
|
15
27
|
strategy?: CacheStrategy;
|
|
16
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Controls how extracted class lists are written to disk.
|
|
31
|
+
*/
|
|
17
32
|
interface OutputUserOptions {
|
|
33
|
+
/** Whether to produce an output file. */
|
|
18
34
|
enabled?: boolean;
|
|
35
|
+
/** Optional absolute or relative path to the output file. */
|
|
19
36
|
file?: string;
|
|
37
|
+
/** Output format, defaults to JSON when omitted. */
|
|
20
38
|
format?: 'json' | 'lines';
|
|
39
|
+
/** Pretty-print spacing (truthy value enables indentation). */
|
|
21
40
|
pretty?: number | boolean;
|
|
41
|
+
/** Whether to strip the universal selector (`*`) from the final list. */
|
|
22
42
|
removeUniversalSelector?: boolean;
|
|
23
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Options controlling how Tailwind contexts are exposed during runtime patching.
|
|
46
|
+
*/
|
|
24
47
|
interface ExposeContextUserOptions {
|
|
48
|
+
/** Name of the property used to reference an exposed context. */
|
|
25
49
|
refProperty?: string;
|
|
26
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Extends the built-in length-unit patch with custom defaults.
|
|
53
|
+
*/
|
|
27
54
|
interface ExtendLengthUnitsUserOptions extends Partial<ILengthUnitsPatchOptions> {
|
|
55
|
+
/** Enables or disables the length-unit patch. */
|
|
28
56
|
enabled?: boolean;
|
|
29
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Feature switches that toggle optional Tailwind patch capabilities.
|
|
60
|
+
*/
|
|
30
61
|
interface FeatureUserOptions {
|
|
62
|
+
/** Whether to expose runtime Tailwind contexts (or configure how they are exposed). */
|
|
31
63
|
exposeContext?: boolean | ExposeContextUserOptions;
|
|
64
|
+
/** Extends the length-unit patch or disables it entirely. */
|
|
32
65
|
extendLengthUnits?: false | ExtendLengthUnitsUserOptions;
|
|
33
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Shared configuration used for Tailwind v2/v3 patching flows.
|
|
69
|
+
*/
|
|
34
70
|
interface TailwindConfigUserOptions {
|
|
71
|
+
/** Path to a Tailwind config file when auto-detection is insufficient. */
|
|
35
72
|
config?: string;
|
|
73
|
+
/** Custom working directory used when resolving config-relative paths. */
|
|
36
74
|
cwd?: string;
|
|
75
|
+
/** Optional PostCSS plugin name to use instead of the default. */
|
|
37
76
|
postcssPlugin?: string;
|
|
38
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Additional configuration specific to Tailwind CSS v4 extraction.
|
|
80
|
+
*/
|
|
39
81
|
interface TailwindV4UserOptions {
|
|
82
|
+
/** Base directory used when resolving v4 content sources and configs. */
|
|
40
83
|
base?: string;
|
|
84
|
+
/** Raw CSS passed directly to the v4 design system. */
|
|
41
85
|
css?: string;
|
|
86
|
+
/** Set of CSS entry files that should be scanned for `@config` directives. */
|
|
42
87
|
cssEntries?: string[];
|
|
88
|
+
/** Overrides the content sources scanned by the oxide scanner. */
|
|
43
89
|
sources?: SourceEntry[];
|
|
44
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* High-level Tailwind patch configuration shared across versions.
|
|
93
|
+
*/
|
|
45
94
|
interface TailwindUserOptions extends TailwindConfigUserOptions {
|
|
46
95
|
/**
|
|
47
96
|
* Optional hint for picking the patch strategy.
|
|
48
97
|
* When omitted we infer from the installed Tailwind CSS package version.
|
|
49
98
|
*/
|
|
50
99
|
version?: 2 | 3 | 4;
|
|
100
|
+
/** Tailwind package name if the project uses a fork. */
|
|
51
101
|
packageName?: string;
|
|
102
|
+
/** Package resolution options forwarded to `local-pkg`. */
|
|
52
103
|
resolve?: PackageResolvingOptions;
|
|
104
|
+
/** Overrides applied when patching Tailwind CSS v2. */
|
|
53
105
|
v2?: TailwindConfigUserOptions;
|
|
106
|
+
/** Overrides applied when patching Tailwind CSS v3. */
|
|
54
107
|
v3?: TailwindConfigUserOptions;
|
|
108
|
+
/** Options specific to Tailwind CSS v4 patching. */
|
|
55
109
|
v4?: TailwindV4UserOptions;
|
|
56
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Root configuration consumed by the Tailwind CSS patch runner.
|
|
113
|
+
*/
|
|
57
114
|
interface TailwindcssPatchOptions {
|
|
58
115
|
/**
|
|
59
116
|
* Base directory used when resolving Tailwind resources.
|
|
60
117
|
* Defaults to `process.cwd()`.
|
|
61
118
|
*/
|
|
62
119
|
cwd?: string;
|
|
120
|
+
/** Whether to overwrite generated artifacts (e.g., caches, outputs). */
|
|
63
121
|
overwrite?: boolean;
|
|
122
|
+
/** Tailwind-specific configuration grouped by major version. */
|
|
64
123
|
tailwind?: TailwindUserOptions;
|
|
124
|
+
/** Feature toggles for optional helpers. */
|
|
65
125
|
features?: FeatureUserOptions;
|
|
126
|
+
/** Optional function that filters final class names. */
|
|
66
127
|
filter?: (className: string) => boolean;
|
|
128
|
+
/** Cache configuration or boolean to enable/disable quickly. */
|
|
67
129
|
cache?: boolean | CacheUserOptions;
|
|
130
|
+
/** Output configuration or boolean to inherits defaults. */
|
|
68
131
|
output?: OutputUserOptions;
|
|
69
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Stable shape for output configuration after normalization.
|
|
135
|
+
*/
|
|
70
136
|
interface NormalizedOutputOptions {
|
|
71
137
|
enabled: boolean;
|
|
72
138
|
file?: string;
|
|
@@ -74,6 +140,9 @@ interface NormalizedOutputOptions {
|
|
|
74
140
|
pretty: number | false;
|
|
75
141
|
removeUniversalSelector: boolean;
|
|
76
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Stable cache configuration used internally after defaults are applied.
|
|
145
|
+
*/
|
|
77
146
|
interface NormalizedCacheOptions {
|
|
78
147
|
enabled: boolean;
|
|
79
148
|
cwd: string;
|
|
@@ -82,19 +151,27 @@ interface NormalizedCacheOptions {
|
|
|
82
151
|
path: string;
|
|
83
152
|
strategy: CacheStrategy;
|
|
84
153
|
}
|
|
154
|
+
/** Tracks whether runtime contexts should be exposed and via which property. */
|
|
85
155
|
interface NormalizedExposeContextOptions {
|
|
86
156
|
enabled: boolean;
|
|
87
157
|
refProperty: string;
|
|
88
158
|
}
|
|
159
|
+
/** Normalized representation of the extend-length-units feature flag. */
|
|
89
160
|
interface NormalizedExtendLengthUnitsOptions extends ILengthUnitsPatchOptions {
|
|
90
161
|
enabled: boolean;
|
|
91
162
|
}
|
|
163
|
+
/** Normalized Tailwind v4 configuration consumed by runtime helpers. */
|
|
92
164
|
interface NormalizedTailwindV4Options {
|
|
93
165
|
base: string;
|
|
166
|
+
configuredBase?: string;
|
|
94
167
|
css?: string;
|
|
95
168
|
cssEntries: string[];
|
|
96
169
|
sources: SourceEntry[];
|
|
170
|
+
hasUserDefinedSources: boolean;
|
|
97
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Tailwind configuration ready for consumption by the runtime after normalization.
|
|
174
|
+
*/
|
|
98
175
|
interface NormalizedTailwindConfigOptions extends TailwindConfigUserOptions {
|
|
99
176
|
packageName: string;
|
|
100
177
|
versionHint?: 2 | 3 | 4;
|
|
@@ -103,10 +180,12 @@ interface NormalizedTailwindConfigOptions extends TailwindConfigUserOptions {
|
|
|
103
180
|
v3?: TailwindConfigUserOptions;
|
|
104
181
|
v4?: NormalizedTailwindV4Options;
|
|
105
182
|
}
|
|
183
|
+
/** Grouped normalized feature flags. */
|
|
106
184
|
interface NormalizedFeatureOptions {
|
|
107
185
|
exposeContext: NormalizedExposeContextOptions;
|
|
108
186
|
extendLengthUnits: NormalizedExtendLengthUnitsOptions | null;
|
|
109
187
|
}
|
|
188
|
+
/** Final normalized shape consumed throughout the patch runtime. */
|
|
110
189
|
interface NormalizedTailwindcssPatchOptions {
|
|
111
190
|
projectRoot: string;
|
|
112
191
|
overwrite: boolean;
|
|
@@ -344,6 +423,24 @@ declare class CacheStore {
|
|
|
344
423
|
readSync(): Set<string>;
|
|
345
424
|
}
|
|
346
425
|
|
|
426
|
+
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init';
|
|
427
|
+
declare const tailwindcssPatchCommands: TailwindcssPatchCommand[];
|
|
428
|
+
interface TailwindcssPatchCommandOptions {
|
|
429
|
+
name?: string;
|
|
430
|
+
aliases?: string[];
|
|
431
|
+
}
|
|
432
|
+
interface TailwindcssPatchCliMountOptions {
|
|
433
|
+
commandPrefix?: string;
|
|
434
|
+
commands?: TailwindcssPatchCommand[];
|
|
435
|
+
commandOptions?: Partial<Record<TailwindcssPatchCommand, TailwindcssPatchCommandOptions>>;
|
|
436
|
+
}
|
|
437
|
+
interface TailwindcssPatchCliOptions {
|
|
438
|
+
name?: string;
|
|
439
|
+
mountOptions?: TailwindcssPatchCliMountOptions;
|
|
440
|
+
}
|
|
441
|
+
declare function createTailwindcssPatchCli(options?: TailwindcssPatchCliOptions): CAC;
|
|
442
|
+
declare function mountTailwindcssPatchCommands(cli: CAC, options?: TailwindcssPatchCliMountOptions): CAC;
|
|
443
|
+
|
|
347
444
|
declare const logger: consola.ConsolaInstance;
|
|
348
445
|
|
|
349
446
|
declare function normalizeOptions(options?: TailwindcssPatchOptions): NormalizedTailwindcssPatchOptions;
|
|
@@ -361,4 +458,4 @@ interface TailwindBuildOptions {
|
|
|
361
458
|
}
|
|
362
459
|
declare function runTailwindBuild(options: TailwindBuildOptions): Promise<postcss.Result<postcss.Root>>;
|
|
363
460
|
|
|
364
|
-
export { CacheStore, type CacheStrategy, type ExtractResult, type ILengthUnitsPatchOptions, type NormalizedTailwindcssPatchOptions, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, collectClassesFromContexts, collectClassesFromTailwindV4, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, groupTokensByFile, loadRuntimeContexts, logger, normalizeOptions, runTailwindBuild };
|
|
461
|
+
export { CacheStore, type CacheStrategy, type ExtractResult, type ILengthUnitsPatchOptions, type NormalizedTailwindcssPatchOptions, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandOptions, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindcssPatchCli, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, groupTokensByFile, loadRuntimeContexts, logger, mountTailwindcssPatchCommands, normalizeOptions, runTailwindBuild, tailwindcssPatchCommands };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,69 +4,135 @@ import { Config } from 'tailwindcss';
|
|
|
4
4
|
import { PackageResolvingOptions, PackageInfo } from 'local-pkg';
|
|
5
5
|
import { TailwindLocatorOptions, TailwindNextOptions } from '@tailwindcss-mangle/config';
|
|
6
6
|
export { defineConfig } from '@tailwindcss-mangle/config';
|
|
7
|
+
import { CAC } from 'cac';
|
|
7
8
|
import * as consola from 'consola';
|
|
8
9
|
|
|
9
10
|
type CacheStrategy = 'merge' | 'overwrite';
|
|
11
|
+
/**
|
|
12
|
+
* Configures how the Tailwind class cache is stored and where it lives on disk.
|
|
13
|
+
*/
|
|
10
14
|
interface CacheUserOptions {
|
|
15
|
+
/** Whether caching is enabled. */
|
|
11
16
|
enabled?: boolean;
|
|
17
|
+
/** Working directory used when resolving cache paths. */
|
|
12
18
|
cwd?: string;
|
|
19
|
+
/** Directory where cache files are written. */
|
|
13
20
|
dir?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Cache filename. Defaults to `class-cache.json` inside the derived cache folder
|
|
23
|
+
* when omitted.
|
|
24
|
+
*/
|
|
14
25
|
file?: string;
|
|
26
|
+
/** Strategy used when merging new class lists with an existing cache. */
|
|
15
27
|
strategy?: CacheStrategy;
|
|
16
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Controls how extracted class lists are written to disk.
|
|
31
|
+
*/
|
|
17
32
|
interface OutputUserOptions {
|
|
33
|
+
/** Whether to produce an output file. */
|
|
18
34
|
enabled?: boolean;
|
|
35
|
+
/** Optional absolute or relative path to the output file. */
|
|
19
36
|
file?: string;
|
|
37
|
+
/** Output format, defaults to JSON when omitted. */
|
|
20
38
|
format?: 'json' | 'lines';
|
|
39
|
+
/** Pretty-print spacing (truthy value enables indentation). */
|
|
21
40
|
pretty?: number | boolean;
|
|
41
|
+
/** Whether to strip the universal selector (`*`) from the final list. */
|
|
22
42
|
removeUniversalSelector?: boolean;
|
|
23
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Options controlling how Tailwind contexts are exposed during runtime patching.
|
|
46
|
+
*/
|
|
24
47
|
interface ExposeContextUserOptions {
|
|
48
|
+
/** Name of the property used to reference an exposed context. */
|
|
25
49
|
refProperty?: string;
|
|
26
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Extends the built-in length-unit patch with custom defaults.
|
|
53
|
+
*/
|
|
27
54
|
interface ExtendLengthUnitsUserOptions extends Partial<ILengthUnitsPatchOptions> {
|
|
55
|
+
/** Enables or disables the length-unit patch. */
|
|
28
56
|
enabled?: boolean;
|
|
29
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Feature switches that toggle optional Tailwind patch capabilities.
|
|
60
|
+
*/
|
|
30
61
|
interface FeatureUserOptions {
|
|
62
|
+
/** Whether to expose runtime Tailwind contexts (or configure how they are exposed). */
|
|
31
63
|
exposeContext?: boolean | ExposeContextUserOptions;
|
|
64
|
+
/** Extends the length-unit patch or disables it entirely. */
|
|
32
65
|
extendLengthUnits?: false | ExtendLengthUnitsUserOptions;
|
|
33
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Shared configuration used for Tailwind v2/v3 patching flows.
|
|
69
|
+
*/
|
|
34
70
|
interface TailwindConfigUserOptions {
|
|
71
|
+
/** Path to a Tailwind config file when auto-detection is insufficient. */
|
|
35
72
|
config?: string;
|
|
73
|
+
/** Custom working directory used when resolving config-relative paths. */
|
|
36
74
|
cwd?: string;
|
|
75
|
+
/** Optional PostCSS plugin name to use instead of the default. */
|
|
37
76
|
postcssPlugin?: string;
|
|
38
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Additional configuration specific to Tailwind CSS v4 extraction.
|
|
80
|
+
*/
|
|
39
81
|
interface TailwindV4UserOptions {
|
|
82
|
+
/** Base directory used when resolving v4 content sources and configs. */
|
|
40
83
|
base?: string;
|
|
84
|
+
/** Raw CSS passed directly to the v4 design system. */
|
|
41
85
|
css?: string;
|
|
86
|
+
/** Set of CSS entry files that should be scanned for `@config` directives. */
|
|
42
87
|
cssEntries?: string[];
|
|
88
|
+
/** Overrides the content sources scanned by the oxide scanner. */
|
|
43
89
|
sources?: SourceEntry[];
|
|
44
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* High-level Tailwind patch configuration shared across versions.
|
|
93
|
+
*/
|
|
45
94
|
interface TailwindUserOptions extends TailwindConfigUserOptions {
|
|
46
95
|
/**
|
|
47
96
|
* Optional hint for picking the patch strategy.
|
|
48
97
|
* When omitted we infer from the installed Tailwind CSS package version.
|
|
49
98
|
*/
|
|
50
99
|
version?: 2 | 3 | 4;
|
|
100
|
+
/** Tailwind package name if the project uses a fork. */
|
|
51
101
|
packageName?: string;
|
|
102
|
+
/** Package resolution options forwarded to `local-pkg`. */
|
|
52
103
|
resolve?: PackageResolvingOptions;
|
|
104
|
+
/** Overrides applied when patching Tailwind CSS v2. */
|
|
53
105
|
v2?: TailwindConfigUserOptions;
|
|
106
|
+
/** Overrides applied when patching Tailwind CSS v3. */
|
|
54
107
|
v3?: TailwindConfigUserOptions;
|
|
108
|
+
/** Options specific to Tailwind CSS v4 patching. */
|
|
55
109
|
v4?: TailwindV4UserOptions;
|
|
56
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Root configuration consumed by the Tailwind CSS patch runner.
|
|
113
|
+
*/
|
|
57
114
|
interface TailwindcssPatchOptions {
|
|
58
115
|
/**
|
|
59
116
|
* Base directory used when resolving Tailwind resources.
|
|
60
117
|
* Defaults to `process.cwd()`.
|
|
61
118
|
*/
|
|
62
119
|
cwd?: string;
|
|
120
|
+
/** Whether to overwrite generated artifacts (e.g., caches, outputs). */
|
|
63
121
|
overwrite?: boolean;
|
|
122
|
+
/** Tailwind-specific configuration grouped by major version. */
|
|
64
123
|
tailwind?: TailwindUserOptions;
|
|
124
|
+
/** Feature toggles for optional helpers. */
|
|
65
125
|
features?: FeatureUserOptions;
|
|
126
|
+
/** Optional function that filters final class names. */
|
|
66
127
|
filter?: (className: string) => boolean;
|
|
128
|
+
/** Cache configuration or boolean to enable/disable quickly. */
|
|
67
129
|
cache?: boolean | CacheUserOptions;
|
|
130
|
+
/** Output configuration or boolean to inherits defaults. */
|
|
68
131
|
output?: OutputUserOptions;
|
|
69
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Stable shape for output configuration after normalization.
|
|
135
|
+
*/
|
|
70
136
|
interface NormalizedOutputOptions {
|
|
71
137
|
enabled: boolean;
|
|
72
138
|
file?: string;
|
|
@@ -74,6 +140,9 @@ interface NormalizedOutputOptions {
|
|
|
74
140
|
pretty: number | false;
|
|
75
141
|
removeUniversalSelector: boolean;
|
|
76
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Stable cache configuration used internally after defaults are applied.
|
|
145
|
+
*/
|
|
77
146
|
interface NormalizedCacheOptions {
|
|
78
147
|
enabled: boolean;
|
|
79
148
|
cwd: string;
|
|
@@ -82,19 +151,27 @@ interface NormalizedCacheOptions {
|
|
|
82
151
|
path: string;
|
|
83
152
|
strategy: CacheStrategy;
|
|
84
153
|
}
|
|
154
|
+
/** Tracks whether runtime contexts should be exposed and via which property. */
|
|
85
155
|
interface NormalizedExposeContextOptions {
|
|
86
156
|
enabled: boolean;
|
|
87
157
|
refProperty: string;
|
|
88
158
|
}
|
|
159
|
+
/** Normalized representation of the extend-length-units feature flag. */
|
|
89
160
|
interface NormalizedExtendLengthUnitsOptions extends ILengthUnitsPatchOptions {
|
|
90
161
|
enabled: boolean;
|
|
91
162
|
}
|
|
163
|
+
/** Normalized Tailwind v4 configuration consumed by runtime helpers. */
|
|
92
164
|
interface NormalizedTailwindV4Options {
|
|
93
165
|
base: string;
|
|
166
|
+
configuredBase?: string;
|
|
94
167
|
css?: string;
|
|
95
168
|
cssEntries: string[];
|
|
96
169
|
sources: SourceEntry[];
|
|
170
|
+
hasUserDefinedSources: boolean;
|
|
97
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Tailwind configuration ready for consumption by the runtime after normalization.
|
|
174
|
+
*/
|
|
98
175
|
interface NormalizedTailwindConfigOptions extends TailwindConfigUserOptions {
|
|
99
176
|
packageName: string;
|
|
100
177
|
versionHint?: 2 | 3 | 4;
|
|
@@ -103,10 +180,12 @@ interface NormalizedTailwindConfigOptions extends TailwindConfigUserOptions {
|
|
|
103
180
|
v3?: TailwindConfigUserOptions;
|
|
104
181
|
v4?: NormalizedTailwindV4Options;
|
|
105
182
|
}
|
|
183
|
+
/** Grouped normalized feature flags. */
|
|
106
184
|
interface NormalizedFeatureOptions {
|
|
107
185
|
exposeContext: NormalizedExposeContextOptions;
|
|
108
186
|
extendLengthUnits: NormalizedExtendLengthUnitsOptions | null;
|
|
109
187
|
}
|
|
188
|
+
/** Final normalized shape consumed throughout the patch runtime. */
|
|
110
189
|
interface NormalizedTailwindcssPatchOptions {
|
|
111
190
|
projectRoot: string;
|
|
112
191
|
overwrite: boolean;
|
|
@@ -344,6 +423,24 @@ declare class CacheStore {
|
|
|
344
423
|
readSync(): Set<string>;
|
|
345
424
|
}
|
|
346
425
|
|
|
426
|
+
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init';
|
|
427
|
+
declare const tailwindcssPatchCommands: TailwindcssPatchCommand[];
|
|
428
|
+
interface TailwindcssPatchCommandOptions {
|
|
429
|
+
name?: string;
|
|
430
|
+
aliases?: string[];
|
|
431
|
+
}
|
|
432
|
+
interface TailwindcssPatchCliMountOptions {
|
|
433
|
+
commandPrefix?: string;
|
|
434
|
+
commands?: TailwindcssPatchCommand[];
|
|
435
|
+
commandOptions?: Partial<Record<TailwindcssPatchCommand, TailwindcssPatchCommandOptions>>;
|
|
436
|
+
}
|
|
437
|
+
interface TailwindcssPatchCliOptions {
|
|
438
|
+
name?: string;
|
|
439
|
+
mountOptions?: TailwindcssPatchCliMountOptions;
|
|
440
|
+
}
|
|
441
|
+
declare function createTailwindcssPatchCli(options?: TailwindcssPatchCliOptions): CAC;
|
|
442
|
+
declare function mountTailwindcssPatchCommands(cli: CAC, options?: TailwindcssPatchCliMountOptions): CAC;
|
|
443
|
+
|
|
347
444
|
declare const logger: consola.ConsolaInstance;
|
|
348
445
|
|
|
349
446
|
declare function normalizeOptions(options?: TailwindcssPatchOptions): NormalizedTailwindcssPatchOptions;
|
|
@@ -361,4 +458,4 @@ interface TailwindBuildOptions {
|
|
|
361
458
|
}
|
|
362
459
|
declare function runTailwindBuild(options: TailwindBuildOptions): Promise<postcss.Result<postcss.Root>>;
|
|
363
460
|
|
|
364
|
-
export { CacheStore, type CacheStrategy, type ExtractResult, type ILengthUnitsPatchOptions, type NormalizedTailwindcssPatchOptions, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, collectClassesFromContexts, collectClassesFromTailwindV4, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, groupTokensByFile, loadRuntimeContexts, logger, normalizeOptions, runTailwindBuild };
|
|
461
|
+
export { CacheStore, type CacheStrategy, type ExtractResult, type ILengthUnitsPatchOptions, type NormalizedTailwindcssPatchOptions, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandOptions, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindcssPatchCli, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, groupTokensByFile, loadRuntimeContexts, logger, mountTailwindcssPatchCommands, normalizeOptions, runTailwindBuild, tailwindcssPatchCommands };
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunk7ZWFVW77js = require('./chunk-7ZWFVW77.js');
|
|
16
19
|
|
|
17
20
|
// src/index.ts
|
|
18
21
|
var _config = require('@tailwindcss-mangle/config');
|
|
@@ -31,4 +34,7 @@ var _config = require('@tailwindcss-mangle/config');
|
|
|
31
34
|
|
|
32
35
|
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
exports.CacheStore = _chunk7ZWFVW77js.CacheStore; exports.TailwindcssPatcher = _chunk7ZWFVW77js.TailwindcssPatcher; exports.collectClassesFromContexts = _chunk7ZWFVW77js.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunk7ZWFVW77js.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunk7ZWFVW77js.createTailwindcssPatchCli; exports.defineConfig = _config.defineConfig; exports.extractProjectCandidatesWithPositions = _chunk7ZWFVW77js.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunk7ZWFVW77js.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunk7ZWFVW77js.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunk7ZWFVW77js.extractValidCandidates; exports.groupTokensByFile = _chunk7ZWFVW77js.groupTokensByFile; exports.loadRuntimeContexts = _chunk7ZWFVW77js.loadRuntimeContexts; exports.logger = _chunk7ZWFVW77js.logger_default; exports.mountTailwindcssPatchCommands = _chunk7ZWFVW77js.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunk7ZWFVW77js.normalizeOptions; exports.runTailwindBuild = _chunk7ZWFVW77js.runTailwindBuild; exports.tailwindcssPatchCommands = _chunk7ZWFVW77js.tailwindcssPatchCommands;
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
TailwindcssPatcher,
|
|
4
4
|
collectClassesFromContexts,
|
|
5
5
|
collectClassesFromTailwindV4,
|
|
6
|
+
createTailwindcssPatchCli,
|
|
6
7
|
extractProjectCandidatesWithPositions,
|
|
7
8
|
extractRawCandidates,
|
|
8
9
|
extractRawCandidatesWithPositions,
|
|
@@ -10,9 +11,11 @@ import {
|
|
|
10
11
|
groupTokensByFile,
|
|
11
12
|
loadRuntimeContexts,
|
|
12
13
|
logger_default,
|
|
14
|
+
mountTailwindcssPatchCommands,
|
|
13
15
|
normalizeOptions,
|
|
14
|
-
runTailwindBuild
|
|
15
|
-
|
|
16
|
+
runTailwindBuild,
|
|
17
|
+
tailwindcssPatchCommands
|
|
18
|
+
} from "./chunk-SN7IO2IS.mjs";
|
|
16
19
|
|
|
17
20
|
// src/index.ts
|
|
18
21
|
import { defineConfig } from "@tailwindcss-mangle/config";
|
|
@@ -21,6 +24,7 @@ export {
|
|
|
21
24
|
TailwindcssPatcher,
|
|
22
25
|
collectClassesFromContexts,
|
|
23
26
|
collectClassesFromTailwindV4,
|
|
27
|
+
createTailwindcssPatchCli,
|
|
24
28
|
defineConfig,
|
|
25
29
|
extractProjectCandidatesWithPositions,
|
|
26
30
|
extractRawCandidates,
|
|
@@ -29,6 +33,8 @@ export {
|
|
|
29
33
|
groupTokensByFile,
|
|
30
34
|
loadRuntimeContexts,
|
|
31
35
|
logger_default as logger,
|
|
36
|
+
mountTailwindcssPatchCommands,
|
|
32
37
|
normalizeOptions,
|
|
33
|
-
runTailwindBuild
|
|
38
|
+
runTailwindBuild,
|
|
39
|
+
tailwindcssPatchCommands
|
|
34
40
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@tailwindcss/vite": "^4.1.17",
|
|
72
72
|
"tailwindcss": "^4.1.17",
|
|
73
73
|
"tailwindcss-3": "npm:tailwindcss@^3.4.18",
|
|
74
|
-
"tailwindcss-4": "npm:tailwindcss@^4.1.
|
|
74
|
+
"tailwindcss-4": "npm:tailwindcss@^4.1.17"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"dev": "tsup --watch --sourcemap",
|