tailwindcss-patch 8.7.4-alpha.0 → 9.0.0-alpha.2
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 +65 -5
- package/dist/{chunk-ZXW4S356.js → chunk-TOAZIPHJ.js} +295 -285
- package/dist/{chunk-6ZDYMYHE.mjs → chunk-VDWTCQ74.mjs} +259 -249
- package/dist/cli.js +4 -4
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +46 -134
- package/dist/index.d.ts +46 -134
- package/dist/index.js +5 -3
- package/dist/index.mjs +4 -2
- package/package.json +8 -3
- package/src/api/tailwindcss-patcher.ts +424 -0
- package/src/babel/index.ts +12 -0
- package/src/cache/context.ts +212 -0
- package/src/cache/store.ts +1440 -0
- package/src/cache/types.ts +71 -0
- package/src/cli.ts +20 -0
- package/src/commands/basic-handlers.ts +145 -0
- package/src/commands/cli.ts +56 -0
- package/src/commands/command-context.ts +77 -0
- package/src/commands/command-definitions.ts +102 -0
- package/src/commands/command-metadata.ts +68 -0
- package/src/commands/command-registrar.ts +39 -0
- package/src/commands/command-runtime.ts +33 -0
- package/src/commands/default-handler-map.ts +25 -0
- package/src/commands/migrate-config.ts +104 -0
- package/src/commands/migrate-handler.ts +67 -0
- package/src/commands/migration-aggregation.ts +100 -0
- package/src/commands/migration-args.ts +85 -0
- package/src/commands/migration-file-executor.ts +189 -0
- package/src/commands/migration-output.ts +115 -0
- package/src/commands/migration-report-loader.ts +26 -0
- package/src/commands/migration-report.ts +21 -0
- package/src/commands/migration-source.ts +318 -0
- package/src/commands/migration-target-files.ts +161 -0
- package/src/commands/migration-target-resolver.ts +34 -0
- package/src/commands/migration-types.ts +65 -0
- package/src/commands/restore-handler.ts +24 -0
- package/src/commands/status-handler.ts +17 -0
- package/src/commands/status-output.ts +60 -0
- package/src/commands/token-output.ts +30 -0
- package/src/commands/types.ts +137 -0
- package/src/commands/validate-handler.ts +42 -0
- package/src/commands/validate.ts +83 -0
- package/src/config/index.ts +25 -0
- package/src/config/workspace.ts +87 -0
- package/src/constants.ts +4 -0
- package/src/extraction/candidate-extractor.ts +354 -0
- package/src/index.ts +57 -0
- package/src/install/class-collector.ts +1 -0
- package/src/install/context-registry.ts +1 -0
- package/src/install/index.ts +5 -0
- package/src/install/patch-runner.ts +1 -0
- package/src/install/process-tailwindcss.ts +1 -0
- package/src/install/status.ts +1 -0
- package/src/logger.ts +5 -0
- package/src/options/legacy.ts +93 -0
- package/src/options/normalize.ts +262 -0
- package/src/options/types.ts +217 -0
- package/src/patching/operations/export-context/index.ts +110 -0
- package/src/patching/operations/export-context/postcss-v2.ts +235 -0
- package/src/patching/operations/export-context/postcss-v3.ts +249 -0
- package/src/patching/operations/extend-length-units.ts +197 -0
- package/src/patching/patch-runner.ts +46 -0
- package/src/patching/status.ts +262 -0
- package/src/runtime/class-collector.ts +105 -0
- package/src/runtime/collector.ts +148 -0
- package/src/runtime/context-registry.ts +65 -0
- package/src/runtime/process-tailwindcss.ts +115 -0
- package/src/types.ts +159 -0
- package/src/utils.ts +52 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { TailwindcssMangleConfig } from '@tailwindcss-mangle/config';
|
|
1
2
|
import { SourceEntry } from '@tailwindcss/oxide';
|
|
2
3
|
import postcss, { Rule, Node } from 'postcss';
|
|
3
4
|
import { Config } from 'tailwindcss';
|
|
4
5
|
import { PackageResolvingOptions, PackageInfo } from 'local-pkg';
|
|
5
|
-
import { TailwindLocatorOptions, TailwindNextOptions } from '@tailwindcss-mangle/config';
|
|
6
|
-
export { defineConfig } from '@tailwindcss-mangle/config';
|
|
7
6
|
import { Command, CAC } from 'cac';
|
|
8
7
|
import * as consola from 'consola';
|
|
9
8
|
|
|
@@ -12,7 +11,7 @@ type CacheDriver = 'file' | 'memory' | 'noop';
|
|
|
12
11
|
/**
|
|
13
12
|
* Configures how the Tailwind class cache is stored and where it lives on disk.
|
|
14
13
|
*/
|
|
15
|
-
interface
|
|
14
|
+
interface CacheOptions {
|
|
16
15
|
/** Whether caching is enabled. */
|
|
17
16
|
enabled?: boolean;
|
|
18
17
|
/** Working directory used when resolving cache paths. */
|
|
@@ -32,7 +31,7 @@ interface CacheUserOptions {
|
|
|
32
31
|
/**
|
|
33
32
|
* Preferred options for extraction output behavior.
|
|
34
33
|
*/
|
|
35
|
-
interface
|
|
34
|
+
interface ExtractOptions {
|
|
36
35
|
/** Whether to produce an output file. */
|
|
37
36
|
write?: boolean;
|
|
38
37
|
/** Optional absolute or relative path to the output file. */
|
|
@@ -44,61 +43,32 @@ interface TailwindExtractionUserOptions {
|
|
|
44
43
|
/** Whether to strip the universal selector (`*`) from the final list. */
|
|
45
44
|
removeUniversalSelector?: boolean;
|
|
46
45
|
}
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated Use `TailwindExtractionUserOptions`.
|
|
49
|
-
* Legacy output options kept for backward compatibility and will be removed in the next major version.
|
|
50
|
-
*/
|
|
51
|
-
interface OutputUserOptions {
|
|
52
|
-
/** @deprecated Use `extract.write` instead. */
|
|
53
|
-
enabled?: boolean;
|
|
54
|
-
/** @deprecated Use `extract.file` instead. */
|
|
55
|
-
file?: string;
|
|
56
|
-
/** @deprecated Use `extract.format` instead. */
|
|
57
|
-
format?: 'json' | 'lines';
|
|
58
|
-
/** @deprecated Use `extract.pretty` instead. */
|
|
59
|
-
pretty?: number | boolean;
|
|
60
|
-
/** @deprecated Use `extract.removeUniversalSelector` instead. */
|
|
61
|
-
removeUniversalSelector?: boolean;
|
|
62
|
-
}
|
|
63
46
|
/**
|
|
64
47
|
* Options controlling how Tailwind contexts are exposed during runtime patching.
|
|
65
48
|
*/
|
|
66
|
-
interface
|
|
49
|
+
interface ExposeContextOptions {
|
|
67
50
|
/** Name of the property used to reference an exposed context. */
|
|
68
51
|
refProperty?: string;
|
|
69
52
|
}
|
|
70
53
|
/**
|
|
71
54
|
* Extends the built-in length-unit patch with custom defaults.
|
|
72
55
|
*/
|
|
73
|
-
interface
|
|
56
|
+
interface ExtendLengthUnitsOptions extends Partial<ILengthUnitsPatchOptions> {
|
|
74
57
|
/** Enables or disables the length-unit patch. */
|
|
75
58
|
enabled?: boolean;
|
|
76
59
|
}
|
|
77
60
|
/**
|
|
78
61
|
* Preferred options for runtime patch behavior.
|
|
79
62
|
*/
|
|
80
|
-
interface
|
|
63
|
+
interface ApplyOptions {
|
|
81
64
|
/** Whether patched files can be overwritten on disk. */
|
|
82
65
|
overwrite?: boolean;
|
|
83
66
|
/** Whether to expose runtime Tailwind contexts (or configure how they are exposed). */
|
|
84
|
-
exposeContext?: boolean |
|
|
67
|
+
exposeContext?: boolean | ExposeContextOptions;
|
|
85
68
|
/** Extends the length-unit patch or disables it entirely. */
|
|
86
|
-
extendLengthUnits?: false |
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* @deprecated Use `PatchApplyUserOptions`.
|
|
90
|
-
* Legacy nested feature options kept for backward compatibility and will be removed in the next major version.
|
|
91
|
-
*/
|
|
92
|
-
interface FeatureUserOptions {
|
|
93
|
-
/** @deprecated Use `apply.exposeContext` instead. */
|
|
94
|
-
exposeContext?: boolean | ExposeContextUserOptions;
|
|
95
|
-
/** @deprecated Use `apply.extendLengthUnits` instead. */
|
|
96
|
-
extendLengthUnits?: false | ExtendLengthUnitsUserOptions;
|
|
69
|
+
extendLengthUnits?: false | ExtendLengthUnitsOptions;
|
|
97
70
|
}
|
|
98
|
-
|
|
99
|
-
* Shared configuration used for Tailwind v2/v3 patching flows.
|
|
100
|
-
*/
|
|
101
|
-
interface TailwindRuntimeConfigUserOptions {
|
|
71
|
+
interface TailwindRuntimeOptionsBase {
|
|
102
72
|
/** Path to a Tailwind config file when auto-detection is insufficient. */
|
|
103
73
|
config?: string;
|
|
104
74
|
/** Custom working directory used when resolving config-relative paths. */
|
|
@@ -107,15 +77,19 @@ interface TailwindRuntimeConfigUserOptions {
|
|
|
107
77
|
postcssPlugin?: string;
|
|
108
78
|
}
|
|
109
79
|
/**
|
|
110
|
-
*
|
|
111
|
-
* Legacy naming kept for backward compatibility and will be removed in the next major version.
|
|
80
|
+
* Configuration specific to Tailwind CSS v2 patching flows.
|
|
112
81
|
*/
|
|
113
|
-
interface
|
|
82
|
+
interface TailwindV2Options extends TailwindRuntimeOptionsBase {
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Configuration specific to Tailwind CSS v3 patching flows.
|
|
86
|
+
*/
|
|
87
|
+
interface TailwindV3Options extends TailwindRuntimeOptionsBase {
|
|
114
88
|
}
|
|
115
89
|
/**
|
|
116
90
|
* Additional configuration specific to Tailwind CSS v4 extraction.
|
|
117
91
|
*/
|
|
118
|
-
interface
|
|
92
|
+
interface TailwindV4Options {
|
|
119
93
|
/** Base directory used when resolving v4 content sources and configs. */
|
|
120
94
|
base?: string;
|
|
121
95
|
/** Raw CSS passed directly to the v4 design system. */
|
|
@@ -128,65 +102,39 @@ interface TailwindV4RuntimeUserOptions {
|
|
|
128
102
|
/**
|
|
129
103
|
* High-level Tailwind patch configuration shared across versions.
|
|
130
104
|
*/
|
|
131
|
-
interface
|
|
132
|
-
/**
|
|
133
|
-
* Optional hint for picking the patch strategy.
|
|
134
|
-
* When omitted we infer from the installed Tailwind CSS package version.
|
|
135
|
-
*/
|
|
105
|
+
interface TailwindCssOptions extends TailwindRuntimeOptionsBase {
|
|
106
|
+
/** Explicit Tailwind CSS major version used by the current project. When omitted, the installed package version is inferred. */
|
|
136
107
|
version?: 2 | 3 | 4;
|
|
137
108
|
/** Tailwind package name if the project uses a fork. */
|
|
138
109
|
packageName?: string;
|
|
139
110
|
/** Package resolution options forwarded to `local-pkg`. */
|
|
140
111
|
resolve?: PackageResolvingOptions;
|
|
141
112
|
/** Overrides applied when patching Tailwind CSS v2. */
|
|
142
|
-
v2?:
|
|
113
|
+
v2?: TailwindV2Options;
|
|
143
114
|
/** Overrides applied when patching Tailwind CSS v3. */
|
|
144
|
-
v3?:
|
|
115
|
+
v3?: TailwindV3Options;
|
|
145
116
|
/** Options specific to Tailwind CSS v4 patching. */
|
|
146
|
-
v4?:
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* @deprecated Use `TailwindcssUserOptions`.
|
|
150
|
-
* Legacy naming kept for backward compatibility and will be removed in the next major version.
|
|
151
|
-
*/
|
|
152
|
-
interface TailwindUserOptions extends TailwindcssUserOptions {
|
|
117
|
+
v4?: TailwindV4Options;
|
|
153
118
|
}
|
|
154
119
|
/**
|
|
155
120
|
* Root configuration consumed by the Tailwind CSS patch runner.
|
|
156
121
|
*/
|
|
157
|
-
interface
|
|
122
|
+
interface TailwindCssPatchOptions {
|
|
158
123
|
/**
|
|
159
124
|
* Base directory used when resolving Tailwind resources.
|
|
160
125
|
* Defaults to `process.cwd()`.
|
|
161
126
|
*/
|
|
162
127
|
projectRoot?: string;
|
|
163
128
|
/** Preferred Tailwind runtime configuration. */
|
|
164
|
-
tailwindcss?:
|
|
129
|
+
tailwindcss?: TailwindCssOptions;
|
|
165
130
|
/** Preferred patch toggles. */
|
|
166
|
-
apply?:
|
|
131
|
+
apply?: ApplyOptions;
|
|
167
132
|
/** Preferred extraction output settings. */
|
|
168
|
-
extract?:
|
|
133
|
+
extract?: ExtractOptions;
|
|
169
134
|
/** Optional function that filters final class names. */
|
|
170
135
|
filter?: (className: string) => boolean;
|
|
171
136
|
/** Cache configuration or boolean to enable/disable quickly. */
|
|
172
|
-
cache?: boolean |
|
|
173
|
-
/**
|
|
174
|
-
* Base directory used when resolving Tailwind resources.
|
|
175
|
-
* Defaults to `process.cwd()`.
|
|
176
|
-
* @deprecated Use `projectRoot` instead.
|
|
177
|
-
*/
|
|
178
|
-
cwd?: string;
|
|
179
|
-
/**
|
|
180
|
-
* Whether to overwrite generated artifacts (e.g., caches, outputs).
|
|
181
|
-
* @deprecated Use `apply.overwrite` instead.
|
|
182
|
-
*/
|
|
183
|
-
overwrite?: boolean;
|
|
184
|
-
/** @deprecated Use `tailwindcss` instead. */
|
|
185
|
-
tailwind?: TailwindUserOptions;
|
|
186
|
-
/** @deprecated Use `apply` instead. */
|
|
187
|
-
features?: FeatureUserOptions;
|
|
188
|
-
/** @deprecated Use `extract` instead. */
|
|
189
|
-
output?: OutputUserOptions;
|
|
137
|
+
cache?: boolean | CacheOptions;
|
|
190
138
|
}
|
|
191
139
|
/**
|
|
192
140
|
* Stable shape for output configuration after normalization.
|
|
@@ -231,12 +179,12 @@ interface NormalizedTailwindV4Options {
|
|
|
231
179
|
/**
|
|
232
180
|
* Tailwind configuration ready for consumption by the runtime after normalization.
|
|
233
181
|
*/
|
|
234
|
-
interface NormalizedTailwindConfigOptions extends
|
|
182
|
+
interface NormalizedTailwindConfigOptions extends TailwindRuntimeOptionsBase {
|
|
235
183
|
packageName: string;
|
|
236
184
|
versionHint?: 2 | 3 | 4;
|
|
237
185
|
resolve?: PackageResolvingOptions;
|
|
238
|
-
v2?:
|
|
239
|
-
v3?:
|
|
186
|
+
v2?: TailwindV2Options;
|
|
187
|
+
v3?: TailwindV3Options;
|
|
240
188
|
v4?: NormalizedTailwindV4Options;
|
|
241
189
|
}
|
|
242
190
|
/** Grouped normalized feature flags. */
|
|
@@ -245,7 +193,7 @@ interface NormalizedFeatureOptions {
|
|
|
245
193
|
extendLengthUnits: NormalizedExtendLengthUnitsOptions | null;
|
|
246
194
|
}
|
|
247
195
|
/** Final normalized shape consumed throughout the patch runtime. */
|
|
248
|
-
interface
|
|
196
|
+
interface NormalizedTailwindCssPatchOptions {
|
|
249
197
|
projectRoot: string;
|
|
250
198
|
overwrite: boolean;
|
|
251
199
|
tailwind: NormalizedTailwindConfigOptions;
|
|
@@ -382,7 +330,7 @@ interface TailwindTokenReport {
|
|
|
382
330
|
}
|
|
383
331
|
type TailwindTokenByFileMap = Record<string, TailwindTokenLocation[]>;
|
|
384
332
|
interface TailwindPatchRuntime {
|
|
385
|
-
options:
|
|
333
|
+
options: NormalizedTailwindCssPatchOptions;
|
|
386
334
|
majorVersion: 2 | 3 | 4;
|
|
387
335
|
}
|
|
388
336
|
|
|
@@ -448,52 +396,14 @@ interface PatchRunnerResult {
|
|
|
448
396
|
extendLengthUnits?: ReturnType<typeof applyExtendLengthUnitsPatchV3> | ReturnType<typeof applyExtendLengthUnitsPatchV4>;
|
|
449
397
|
}
|
|
450
398
|
|
|
451
|
-
|
|
452
|
-
dir?: string;
|
|
453
|
-
cwd?: string;
|
|
454
|
-
file?: string;
|
|
455
|
-
strategy?: 'merge' | 'overwrite';
|
|
456
|
-
enabled?: boolean;
|
|
457
|
-
}
|
|
458
|
-
interface LegacyOutputOptions {
|
|
459
|
-
filename?: string;
|
|
460
|
-
loose?: boolean;
|
|
461
|
-
removeUniversalSelector?: boolean;
|
|
462
|
-
}
|
|
463
|
-
interface LegacyTailwindcssOptions {
|
|
464
|
-
version?: 2 | 3 | 4;
|
|
465
|
-
v2?: TailwindLocatorOptions;
|
|
466
|
-
v3?: TailwindLocatorOptions;
|
|
467
|
-
v4?: TailwindNextOptions;
|
|
468
|
-
config?: string;
|
|
469
|
-
cwd?: string;
|
|
470
|
-
}
|
|
471
|
-
interface LegacyPatchOptions {
|
|
472
|
-
packageName?: string;
|
|
473
|
-
output?: LegacyOutputOptions;
|
|
474
|
-
tailwindcss?: LegacyTailwindcssOptions;
|
|
475
|
-
overwrite?: boolean;
|
|
476
|
-
applyPatches?: {
|
|
477
|
-
exportContext?: boolean;
|
|
478
|
-
extendLengthUnits?: boolean | ILengthUnitsPatchOptions;
|
|
479
|
-
};
|
|
480
|
-
filter?: (className: string) => boolean;
|
|
481
|
-
cwd?: string;
|
|
482
|
-
resolve?: PackageResolvingOptions;
|
|
483
|
-
}
|
|
484
|
-
interface LegacyTailwindcssPatcherOptions {
|
|
485
|
-
cache?: LegacyCacheOptions | boolean;
|
|
486
|
-
patch?: LegacyPatchOptions;
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
declare function normalizeOptions(options?: TailwindcssPatchOptions): NormalizedTailwindcssPatchOptions;
|
|
399
|
+
declare function normalizeOptions(options?: TailwindCssPatchOptions): NormalizedTailwindCssPatchOptions;
|
|
490
400
|
|
|
491
401
|
interface TailwindcssConfigModule {
|
|
492
402
|
CONFIG_NAME: string;
|
|
493
403
|
getConfig: (cwd?: string) => Promise<{
|
|
494
404
|
config?: {
|
|
495
405
|
registry?: unknown;
|
|
496
|
-
patch?:
|
|
406
|
+
patch?: unknown;
|
|
497
407
|
};
|
|
498
408
|
}>;
|
|
499
409
|
initConfig: (cwd: string) => Promise<unknown>;
|
|
@@ -525,22 +435,22 @@ declare function groupTokensByFile(report: TailwindTokenReport, options?: {
|
|
|
525
435
|
}): TailwindTokenByFileMap;
|
|
526
436
|
|
|
527
437
|
type TailwindMajorVersion = 2 | 3 | 4;
|
|
528
|
-
|
|
438
|
+
|
|
529
439
|
declare class TailwindcssPatcher {
|
|
530
|
-
readonly options:
|
|
440
|
+
readonly options: NormalizedTailwindCssPatchOptions;
|
|
531
441
|
readonly packageInfo: PackageInfo;
|
|
532
442
|
readonly majorVersion: TailwindMajorVersion;
|
|
533
443
|
private readonly cacheContext;
|
|
534
444
|
private readonly cacheStore;
|
|
445
|
+
private readonly collector;
|
|
535
446
|
private patchMemo;
|
|
536
|
-
|
|
537
|
-
constructor(options?: TailwindcssPatcherInitOptions);
|
|
447
|
+
constructor(options?: TailwindCssPatchOptions);
|
|
538
448
|
patch(): Promise<PatchRunnerResult>;
|
|
539
449
|
getPatchStatus(): Promise<PatchStatusReport>;
|
|
540
450
|
getContexts(): TailwindcssRuntimeContext[];
|
|
541
|
-
private runTailwindBuildIfNeeded;
|
|
542
451
|
private createPatchSnapshot;
|
|
543
452
|
private collectClassSet;
|
|
453
|
+
private runTailwindBuildIfNeeded;
|
|
544
454
|
private debugCacheRead;
|
|
545
455
|
private mergeWithCache;
|
|
546
456
|
private mergeWithCacheSync;
|
|
@@ -764,8 +674,8 @@ interface TailwindcssPatchCommandContext<TCommand extends TailwindcssPatchComman
|
|
|
764
674
|
cwd: string;
|
|
765
675
|
logger: typeof logger;
|
|
766
676
|
loadConfig: () => Promise<TailwindcssConfigResult>;
|
|
767
|
-
loadPatchOptions: (overrides?:
|
|
768
|
-
createPatcher: (overrides?:
|
|
677
|
+
loadPatchOptions: (overrides?: TailwindCssPatchOptions) => Promise<TailwindCssPatchOptions>;
|
|
678
|
+
createPatcher: (overrides?: TailwindCssPatchOptions) => Promise<TailwindcssPatcher>;
|
|
769
679
|
}
|
|
770
680
|
type TailwindcssPatchCommandHandler<TCommand extends TailwindcssPatchCommand> = (context: TailwindcssPatchCommandContext<TCommand>, next: () => Promise<TailwindcssPatchCommandResultMap[TCommand]>) => Promise<TailwindcssPatchCommandResultMap[TCommand]> | TailwindcssPatchCommandResultMap[TCommand];
|
|
771
681
|
type TailwindcssPatchCommandHandlerMap = Partial<{
|
|
@@ -818,7 +728,7 @@ declare function migrateConfigFiles(options: MigrateConfigFilesOptions): Promise
|
|
|
818
728
|
declare function restoreConfigFiles(options: RestoreConfigFilesOptions): Promise<RestoreConfigFilesResult>;
|
|
819
729
|
|
|
820
730
|
declare function collectClassesFromContexts(contexts: TailwindcssRuntimeContext[], filter: (className: string) => boolean): Set<string>;
|
|
821
|
-
declare function collectClassesFromTailwindV4(options:
|
|
731
|
+
declare function collectClassesFromTailwindV4(options: NormalizedTailwindCssPatchOptions): Promise<Set<string>>;
|
|
822
732
|
|
|
823
733
|
declare function loadRuntimeContexts(packageInfo: PackageInfo, majorVersion: 2 | 3 | 4, refProperty: string): TailwindcssRuntimeContext[];
|
|
824
734
|
|
|
@@ -832,9 +742,11 @@ declare function runTailwindBuild(options: TailwindBuildOptions): Promise<postcs
|
|
|
832
742
|
|
|
833
743
|
interface PatchStatusContext {
|
|
834
744
|
packageInfo: PackageInfo;
|
|
835
|
-
options:
|
|
745
|
+
options: NormalizedTailwindCssPatchOptions;
|
|
836
746
|
majorVersion: 2 | 3 | 4;
|
|
837
747
|
}
|
|
838
748
|
declare function getPatchStatusReport(context: PatchStatusContext): PatchStatusReport;
|
|
839
749
|
|
|
840
|
-
|
|
750
|
+
declare function defineConfig<T extends TailwindcssMangleConfig>(config: T): T;
|
|
751
|
+
|
|
752
|
+
export { type ApplyOptions, type CacheClearOptions, type CacheClearResult, type CacheClearScope, type CacheContextMetadata, type CacheOptions, type CacheReadMeta, CacheStore, type CacheStrategy, type ConfigFileMigrationEntry, type ConfigFileMigrationReport, type ExposeContextOptions, type ExtendLengthUnitsOptions, type ExtractOptions, type ExtractResult, type ILengthUnitsPatchOptions, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, type MigrateConfigFilesOptions, type NormalizedTailwindCssPatchOptions, type PatchCheckStatus, type PatchName, type PatchStatusEntry, type PatchStatusReport, type RestoreConfigFilesOptions, type RestoreConfigFilesResult, type TailwindCssOptions, type TailwindCssPatchOptions, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindV2Options, type TailwindV3Options, type TailwindV4Options, type TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, type ValidateFailureReason, type ValidateFailureSummary, type ValidateJsonFailurePayload, type ValidateJsonSuccessPayload, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindcssPatchCli, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
package/dist/index.js
CHANGED
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkTOAZIPHJjs = require('./chunk-TOAZIPHJ.js');
|
|
27
27
|
require('./chunk-5CWNAWKP.js');
|
|
28
28
|
|
|
29
29
|
// src/index.ts
|
|
30
|
-
|
|
30
|
+
function defineConfig(config) {
|
|
31
|
+
return config;
|
|
32
|
+
}
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
|
|
@@ -54,4 +56,4 @@ var _config = require('@tailwindcss-mangle/config');
|
|
|
54
56
|
|
|
55
57
|
|
|
56
58
|
|
|
57
|
-
exports.CacheStore =
|
|
59
|
+
exports.CacheStore = _chunkTOAZIPHJjs.CacheStore; exports.MIGRATION_REPORT_KIND = _chunkTOAZIPHJjs.MIGRATION_REPORT_KIND; exports.MIGRATION_REPORT_SCHEMA_VERSION = _chunkTOAZIPHJjs.MIGRATION_REPORT_SCHEMA_VERSION; exports.TailwindcssPatcher = _chunkTOAZIPHJjs.TailwindcssPatcher; exports.VALIDATE_EXIT_CODES = _chunkTOAZIPHJjs.VALIDATE_EXIT_CODES; exports.VALIDATE_FAILURE_REASONS = _chunkTOAZIPHJjs.VALIDATE_FAILURE_REASONS; exports.ValidateCommandError = _chunkTOAZIPHJjs.ValidateCommandError; exports.collectClassesFromContexts = _chunkTOAZIPHJjs.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunkTOAZIPHJjs.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunkTOAZIPHJjs.createTailwindcssPatchCli; exports.defineConfig = defineConfig; exports.extractProjectCandidatesWithPositions = _chunkTOAZIPHJjs.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunkTOAZIPHJjs.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunkTOAZIPHJjs.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunkTOAZIPHJjs.extractValidCandidates; exports.getPatchStatusReport = _chunkTOAZIPHJjs.getPatchStatusReport; exports.groupTokensByFile = _chunkTOAZIPHJjs.groupTokensByFile; exports.loadRuntimeContexts = _chunkTOAZIPHJjs.loadRuntimeContexts; exports.logger = _chunkTOAZIPHJjs.logger_default; exports.migrateConfigFiles = _chunkTOAZIPHJjs.migrateConfigFiles; exports.mountTailwindcssPatchCommands = _chunkTOAZIPHJjs.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunkTOAZIPHJjs.normalizeOptions; exports.restoreConfigFiles = _chunkTOAZIPHJjs.restoreConfigFiles; exports.runTailwindBuild = _chunkTOAZIPHJjs.runTailwindBuild; exports.tailwindcssPatchCommands = _chunkTOAZIPHJjs.tailwindcssPatchCommands;
|
package/dist/index.mjs
CHANGED
|
@@ -23,11 +23,13 @@ import {
|
|
|
23
23
|
restoreConfigFiles,
|
|
24
24
|
runTailwindBuild,
|
|
25
25
|
tailwindcssPatchCommands
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VDWTCQ74.mjs";
|
|
27
27
|
import "./chunk-A67ABH3M.mjs";
|
|
28
28
|
|
|
29
29
|
// src/index.ts
|
|
30
|
-
|
|
30
|
+
function defineConfig(config) {
|
|
31
|
+
return config;
|
|
32
|
+
}
|
|
31
33
|
export {
|
|
32
34
|
CacheStore,
|
|
33
35
|
MIGRATION_REPORT_KIND,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-alpha.2",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,8 +39,12 @@
|
|
|
39
39
|
"files": [
|
|
40
40
|
"bin",
|
|
41
41
|
"dist",
|
|
42
|
-
"schema"
|
|
42
|
+
"schema",
|
|
43
|
+
"src"
|
|
43
44
|
],
|
|
45
|
+
"tsd": {
|
|
46
|
+
"directory": "test-d"
|
|
47
|
+
},
|
|
44
48
|
"publishConfig": {
|
|
45
49
|
"access": "public",
|
|
46
50
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -67,7 +71,7 @@
|
|
|
67
71
|
"postcss": "^8.5.8",
|
|
68
72
|
"semver": "^7.7.4",
|
|
69
73
|
"tailwindcss-config": "^1.1.4",
|
|
70
|
-
"@tailwindcss-mangle/config": "
|
|
74
|
+
"@tailwindcss-mangle/config": "7.0.0-alpha.2"
|
|
71
75
|
},
|
|
72
76
|
"devDependencies": {
|
|
73
77
|
"@tailwindcss/oxide": "^4.2.1",
|
|
@@ -81,6 +85,7 @@
|
|
|
81
85
|
"dev": "tsup --watch --sourcemap",
|
|
82
86
|
"build": "tsup",
|
|
83
87
|
"test": "vitest run",
|
|
88
|
+
"test:types": "pnpm build && tsd --typings dist/index.d.mts --files test-d/**/*.test-d.ts",
|
|
84
89
|
"test:dev": "vitest",
|
|
85
90
|
"bench:cold-start": "node --import tsx bench/cold-start.ts",
|
|
86
91
|
"patch": "tsx dev/bin.ts install",
|