tailwindcss-patch 8.6.1 → 8.7.1
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 +193 -11
- package/dist/chunk-K3NZYVML.js +4743 -0
- package/dist/chunk-OK2PBYIA.mjs +4739 -0
- package/dist/cli.js +20 -5
- package/dist/cli.mjs +20 -5
- package/dist/index.d.mts +282 -23
- package/dist/index.d.ts +282 -23
- package/dist/index.js +16 -2
- package/dist/index.mjs +15 -1
- package/package.json +18 -14
- package/schema/migration-report.schema.json +144 -0
- package/schema/restore-result.schema.json +68 -0
- package/schema/validate-result.schema.json +122 -0
- package/dist/chunk-DRPYVUDA.js +0 -2462
- package/dist/chunk-LOJHMBK5.mjs +0 -2458
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SourceEntry } from '@tailwindcss/oxide';
|
|
2
|
-
import postcss, {
|
|
2
|
+
import postcss, { Rule, Node } from 'postcss';
|
|
3
3
|
import { Config } from 'tailwindcss';
|
|
4
4
|
import { PackageResolvingOptions, PackageInfo } from 'local-pkg';
|
|
5
5
|
import { TailwindLocatorOptions, TailwindNextOptions, getConfig } from '@tailwindcss-mangle/config';
|
|
@@ -30,11 +30,11 @@ interface CacheUserOptions {
|
|
|
30
30
|
driver?: CacheDriver;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Preferred options for extraction output behavior.
|
|
34
34
|
*/
|
|
35
|
-
interface
|
|
35
|
+
interface TailwindExtractionUserOptions {
|
|
36
36
|
/** Whether to produce an output file. */
|
|
37
|
-
|
|
37
|
+
write?: boolean;
|
|
38
38
|
/** Optional absolute or relative path to the output file. */
|
|
39
39
|
file?: string;
|
|
40
40
|
/** Output format, defaults to JSON when omitted. */
|
|
@@ -44,6 +44,22 @@ interface OutputUserOptions {
|
|
|
44
44
|
/** Whether to strip the universal selector (`*`) from the final list. */
|
|
45
45
|
removeUniversalSelector?: boolean;
|
|
46
46
|
}
|
|
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
|
+
}
|
|
47
63
|
/**
|
|
48
64
|
* Options controlling how Tailwind contexts are exposed during runtime patching.
|
|
49
65
|
*/
|
|
@@ -59,18 +75,30 @@ interface ExtendLengthUnitsUserOptions extends Partial<ILengthUnitsPatchOptions>
|
|
|
59
75
|
enabled?: boolean;
|
|
60
76
|
}
|
|
61
77
|
/**
|
|
62
|
-
*
|
|
78
|
+
* Preferred options for runtime patch behavior.
|
|
63
79
|
*/
|
|
64
|
-
interface
|
|
80
|
+
interface PatchApplyUserOptions {
|
|
81
|
+
/** Whether patched files can be overwritten on disk. */
|
|
82
|
+
overwrite?: boolean;
|
|
65
83
|
/** Whether to expose runtime Tailwind contexts (or configure how they are exposed). */
|
|
66
84
|
exposeContext?: boolean | ExposeContextUserOptions;
|
|
67
85
|
/** Extends the length-unit patch or disables it entirely. */
|
|
68
86
|
extendLengthUnits?: false | ExtendLengthUnitsUserOptions;
|
|
69
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;
|
|
97
|
+
}
|
|
70
98
|
/**
|
|
71
99
|
* Shared configuration used for Tailwind v2/v3 patching flows.
|
|
72
100
|
*/
|
|
73
|
-
interface
|
|
101
|
+
interface TailwindRuntimeConfigUserOptions {
|
|
74
102
|
/** Path to a Tailwind config file when auto-detection is insufficient. */
|
|
75
103
|
config?: string;
|
|
76
104
|
/** Custom working directory used when resolving config-relative paths. */
|
|
@@ -78,10 +106,16 @@ interface TailwindConfigUserOptions {
|
|
|
78
106
|
/** Optional PostCSS plugin name to use instead of the default. */
|
|
79
107
|
postcssPlugin?: string;
|
|
80
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated Use `TailwindRuntimeConfigUserOptions`.
|
|
111
|
+
* Legacy naming kept for backward compatibility and will be removed in the next major version.
|
|
112
|
+
*/
|
|
113
|
+
interface TailwindConfigUserOptions extends TailwindRuntimeConfigUserOptions {
|
|
114
|
+
}
|
|
81
115
|
/**
|
|
82
116
|
* Additional configuration specific to Tailwind CSS v4 extraction.
|
|
83
117
|
*/
|
|
84
|
-
interface
|
|
118
|
+
interface TailwindV4RuntimeUserOptions {
|
|
85
119
|
/** Base directory used when resolving v4 content sources and configs. */
|
|
86
120
|
base?: string;
|
|
87
121
|
/** Raw CSS passed directly to the v4 design system. */
|
|
@@ -94,7 +128,7 @@ interface TailwindV4UserOptions {
|
|
|
94
128
|
/**
|
|
95
129
|
* High-level Tailwind patch configuration shared across versions.
|
|
96
130
|
*/
|
|
97
|
-
interface
|
|
131
|
+
interface TailwindcssUserOptions extends TailwindRuntimeConfigUserOptions {
|
|
98
132
|
/**
|
|
99
133
|
* Optional hint for picking the patch strategy.
|
|
100
134
|
* When omitted we infer from the installed Tailwind CSS package version.
|
|
@@ -105,11 +139,17 @@ interface TailwindUserOptions extends TailwindConfigUserOptions {
|
|
|
105
139
|
/** Package resolution options forwarded to `local-pkg`. */
|
|
106
140
|
resolve?: PackageResolvingOptions;
|
|
107
141
|
/** Overrides applied when patching Tailwind CSS v2. */
|
|
108
|
-
v2?:
|
|
142
|
+
v2?: TailwindRuntimeConfigUserOptions;
|
|
109
143
|
/** Overrides applied when patching Tailwind CSS v3. */
|
|
110
|
-
v3?:
|
|
144
|
+
v3?: TailwindRuntimeConfigUserOptions;
|
|
111
145
|
/** Options specific to Tailwind CSS v4 patching. */
|
|
112
|
-
v4?:
|
|
146
|
+
v4?: TailwindV4RuntimeUserOptions;
|
|
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 {
|
|
113
153
|
}
|
|
114
154
|
/**
|
|
115
155
|
* Root configuration consumed by the Tailwind CSS patch runner.
|
|
@@ -119,18 +159,33 @@ interface TailwindcssPatchOptions {
|
|
|
119
159
|
* Base directory used when resolving Tailwind resources.
|
|
120
160
|
* Defaults to `process.cwd()`.
|
|
121
161
|
*/
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
|
|
162
|
+
projectRoot?: string;
|
|
163
|
+
/** Preferred Tailwind runtime configuration. */
|
|
164
|
+
tailwindcss?: TailwindcssUserOptions;
|
|
165
|
+
/** Preferred patch toggles. */
|
|
166
|
+
apply?: PatchApplyUserOptions;
|
|
167
|
+
/** Preferred extraction output settings. */
|
|
168
|
+
extract?: TailwindExtractionUserOptions;
|
|
129
169
|
/** Optional function that filters final class names. */
|
|
130
170
|
filter?: (className: string) => boolean;
|
|
131
171
|
/** Cache configuration or boolean to enable/disable quickly. */
|
|
132
172
|
cache?: boolean | CacheUserOptions;
|
|
133
|
-
/**
|
|
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. */
|
|
134
189
|
output?: OutputUserOptions;
|
|
135
190
|
}
|
|
136
191
|
/**
|
|
@@ -200,6 +255,60 @@ interface NormalizedTailwindcssPatchOptions {
|
|
|
200
255
|
filter: (className: string) => boolean;
|
|
201
256
|
}
|
|
202
257
|
|
|
258
|
+
declare const CACHE_SCHEMA_VERSION = 2;
|
|
259
|
+
declare const CACHE_FINGERPRINT_VERSION = 1;
|
|
260
|
+
type CacheSchemaVersion = typeof CACHE_SCHEMA_VERSION;
|
|
261
|
+
type CacheFingerprintVersion = typeof CACHE_FINGERPRINT_VERSION;
|
|
262
|
+
type CacheClearScope = 'current' | 'all';
|
|
263
|
+
interface CacheContextMetadata {
|
|
264
|
+
fingerprintVersion: CacheFingerprintVersion;
|
|
265
|
+
projectRootRealpath: string;
|
|
266
|
+
processCwdRealpath: string;
|
|
267
|
+
cacheCwdRealpath: string;
|
|
268
|
+
tailwindConfigPath?: string;
|
|
269
|
+
tailwindConfigMtimeMs?: number;
|
|
270
|
+
tailwindPackageRootRealpath: string;
|
|
271
|
+
tailwindPackageVersion: string;
|
|
272
|
+
patcherVersion: string;
|
|
273
|
+
majorVersion: 2 | 3 | 4;
|
|
274
|
+
optionsHash: string;
|
|
275
|
+
}
|
|
276
|
+
interface CacheContextDescriptor {
|
|
277
|
+
fingerprint: string;
|
|
278
|
+
metadata: CacheContextMetadata;
|
|
279
|
+
}
|
|
280
|
+
interface CacheIndexEntry {
|
|
281
|
+
context: CacheContextMetadata;
|
|
282
|
+
values: string[];
|
|
283
|
+
updatedAt: string;
|
|
284
|
+
}
|
|
285
|
+
interface CacheIndexFileV2 {
|
|
286
|
+
schemaVersion: CacheSchemaVersion;
|
|
287
|
+
updatedAt: string;
|
|
288
|
+
contexts: Record<string, CacheIndexEntry>;
|
|
289
|
+
}
|
|
290
|
+
type CacheReadReason = 'hit' | 'cache-disabled' | 'noop-driver' | 'file-missing' | 'context-not-found' | 'context-mismatch' | 'legacy-schema' | 'invalid-schema';
|
|
291
|
+
interface CacheReadMeta {
|
|
292
|
+
hit: boolean;
|
|
293
|
+
reason: CacheReadReason;
|
|
294
|
+
fingerprint?: string;
|
|
295
|
+
schemaVersion?: number;
|
|
296
|
+
details: string[];
|
|
297
|
+
}
|
|
298
|
+
interface CacheReadResult {
|
|
299
|
+
data: Set<string>;
|
|
300
|
+
meta: CacheReadMeta;
|
|
301
|
+
}
|
|
302
|
+
interface CacheClearOptions {
|
|
303
|
+
scope?: CacheClearScope;
|
|
304
|
+
}
|
|
305
|
+
interface CacheClearResult {
|
|
306
|
+
scope: CacheClearScope;
|
|
307
|
+
filesRemoved: number;
|
|
308
|
+
entriesRemoved: number;
|
|
309
|
+
contextsRemoved: number;
|
|
310
|
+
}
|
|
311
|
+
|
|
203
312
|
type TailwindcssClassCacheEntry = Rule | {
|
|
204
313
|
layer: string;
|
|
205
314
|
options: Record<string, any>;
|
|
@@ -407,6 +516,7 @@ declare class TailwindcssPatcher {
|
|
|
407
516
|
readonly options: NormalizedTailwindcssPatchOptions;
|
|
408
517
|
readonly packageInfo: PackageInfo;
|
|
409
518
|
readonly majorVersion: TailwindMajorVersion;
|
|
519
|
+
private readonly cacheContext;
|
|
410
520
|
private readonly cacheStore;
|
|
411
521
|
constructor(options?: TailwindcssPatcherInitOptions);
|
|
412
522
|
patch(): Promise<PatchRunnerResult>;
|
|
@@ -414,6 +524,7 @@ declare class TailwindcssPatcher {
|
|
|
414
524
|
getContexts(): TailwindcssRuntimeContext[];
|
|
415
525
|
private runTailwindBuildIfNeeded;
|
|
416
526
|
private collectClassSet;
|
|
527
|
+
private debugCacheRead;
|
|
417
528
|
private mergeWithCache;
|
|
418
529
|
private mergeWithCacheSync;
|
|
419
530
|
getClassSet(): Promise<Set<string>>;
|
|
@@ -421,6 +532,7 @@ declare class TailwindcssPatcher {
|
|
|
421
532
|
extract(options?: {
|
|
422
533
|
write?: boolean;
|
|
423
534
|
}): Promise<ExtractResult>;
|
|
535
|
+
clearCache(options?: CacheClearOptions): Promise<CacheClearResult>;
|
|
424
536
|
extractValidCandidates: typeof extractValidCandidates;
|
|
425
537
|
collectContentTokens(options?: {
|
|
426
538
|
cwd?: string;
|
|
@@ -436,9 +548,15 @@ declare class TailwindcssPatcher {
|
|
|
436
548
|
|
|
437
549
|
declare class CacheStore {
|
|
438
550
|
private readonly options;
|
|
551
|
+
private readonly context?;
|
|
439
552
|
private readonly driver;
|
|
553
|
+
private readonly lockPath;
|
|
440
554
|
private memoryCache;
|
|
441
|
-
|
|
555
|
+
private memoryIndex;
|
|
556
|
+
private lastReadMeta;
|
|
557
|
+
constructor(options: NormalizedCacheOptions, context?: CacheContextDescriptor | undefined);
|
|
558
|
+
private isContextAware;
|
|
559
|
+
private createEmptyIndex;
|
|
442
560
|
private ensureDir;
|
|
443
561
|
private ensureDirSync;
|
|
444
562
|
private createTempPath;
|
|
@@ -446,16 +564,128 @@ declare class CacheStore {
|
|
|
446
564
|
private replaceCacheFileSync;
|
|
447
565
|
private cleanupTempFile;
|
|
448
566
|
private cleanupTempFileSync;
|
|
567
|
+
private delay;
|
|
568
|
+
private acquireLock;
|
|
569
|
+
private releaseLockSyncOrAsync;
|
|
570
|
+
private acquireLockSync;
|
|
571
|
+
private withFileLock;
|
|
572
|
+
private withFileLockSync;
|
|
573
|
+
private normalizeContextEntry;
|
|
574
|
+
private normalizeIndexFile;
|
|
575
|
+
private readParsedCacheFile;
|
|
576
|
+
private readParsedCacheFileSync;
|
|
577
|
+
private findProjectMatch;
|
|
578
|
+
private writeIndexFile;
|
|
579
|
+
private writeIndexFileSync;
|
|
449
580
|
write(data: Set<string>): Promise<string | undefined>;
|
|
450
581
|
writeSync(data: Set<string>): string | undefined;
|
|
582
|
+
readWithMeta(): Promise<CacheReadResult>;
|
|
583
|
+
readWithMetaSync(): CacheReadResult;
|
|
451
584
|
read(): Promise<Set<string>>;
|
|
452
585
|
readSync(): Set<string>;
|
|
586
|
+
getLastReadMeta(): CacheReadMeta;
|
|
587
|
+
private countEntriesFromParsed;
|
|
588
|
+
clear(options?: CacheClearOptions): Promise<CacheClearResult>;
|
|
589
|
+
clearSync(options?: CacheClearOptions): CacheClearResult;
|
|
590
|
+
readIndexSnapshot(): CacheIndexFileV2 | undefined;
|
|
453
591
|
}
|
|
454
592
|
|
|
593
|
+
declare const MIGRATION_REPORT_KIND = "tw-patch-migrate-report";
|
|
594
|
+
declare const MIGRATION_REPORT_SCHEMA_VERSION = 1;
|
|
595
|
+
interface ConfigFileMigrationEntry {
|
|
596
|
+
file: string;
|
|
597
|
+
changed: boolean;
|
|
598
|
+
written: boolean;
|
|
599
|
+
rolledBack: boolean;
|
|
600
|
+
backupFile?: string;
|
|
601
|
+
changes: string[];
|
|
602
|
+
}
|
|
603
|
+
interface ConfigFileMigrationReport {
|
|
604
|
+
reportKind: typeof MIGRATION_REPORT_KIND;
|
|
605
|
+
schemaVersion: typeof MIGRATION_REPORT_SCHEMA_VERSION;
|
|
606
|
+
generatedAt: string;
|
|
607
|
+
tool: {
|
|
608
|
+
name: string;
|
|
609
|
+
version: string;
|
|
610
|
+
};
|
|
611
|
+
cwd: string;
|
|
612
|
+
dryRun: boolean;
|
|
613
|
+
rollbackOnError: boolean;
|
|
614
|
+
backupDirectory?: string;
|
|
615
|
+
scannedFiles: number;
|
|
616
|
+
changedFiles: number;
|
|
617
|
+
writtenFiles: number;
|
|
618
|
+
backupsWritten: number;
|
|
619
|
+
unchangedFiles: number;
|
|
620
|
+
missingFiles: number;
|
|
621
|
+
entries: ConfigFileMigrationEntry[];
|
|
622
|
+
}
|
|
623
|
+
interface MigrateConfigFilesOptions {
|
|
624
|
+
cwd: string;
|
|
625
|
+
files?: string[];
|
|
626
|
+
dryRun?: boolean;
|
|
627
|
+
workspace?: boolean;
|
|
628
|
+
maxDepth?: number;
|
|
629
|
+
rollbackOnError?: boolean;
|
|
630
|
+
backupDir?: string;
|
|
631
|
+
include?: string[];
|
|
632
|
+
exclude?: string[];
|
|
633
|
+
}
|
|
634
|
+
interface RestoreConfigFilesOptions {
|
|
635
|
+
cwd: string;
|
|
636
|
+
reportFile: string;
|
|
637
|
+
dryRun?: boolean;
|
|
638
|
+
strict?: boolean;
|
|
639
|
+
}
|
|
640
|
+
interface RestoreConfigFilesResult {
|
|
641
|
+
cwd: string;
|
|
642
|
+
reportFile: string;
|
|
643
|
+
reportKind?: string;
|
|
644
|
+
reportSchemaVersion?: number;
|
|
645
|
+
dryRun: boolean;
|
|
646
|
+
strict: boolean;
|
|
647
|
+
scannedEntries: number;
|
|
648
|
+
restorableEntries: number;
|
|
649
|
+
restoredFiles: number;
|
|
650
|
+
missingBackups: number;
|
|
651
|
+
skippedEntries: number;
|
|
652
|
+
restored: string[];
|
|
653
|
+
}
|
|
654
|
+
declare function migrateConfigFiles(options: MigrateConfigFilesOptions): Promise<ConfigFileMigrationReport>;
|
|
655
|
+
declare function restoreConfigFiles(options: RestoreConfigFilesOptions): Promise<RestoreConfigFilesResult>;
|
|
656
|
+
|
|
455
657
|
declare const logger: consola.ConsolaInstance;
|
|
456
658
|
|
|
457
|
-
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init' | 'status';
|
|
659
|
+
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init' | 'migrate' | 'restore' | 'validate' | 'status';
|
|
458
660
|
declare const tailwindcssPatchCommands: TailwindcssPatchCommand[];
|
|
661
|
+
declare const VALIDATE_EXIT_CODES: {
|
|
662
|
+
readonly OK: 0;
|
|
663
|
+
readonly REPORT_INCOMPATIBLE: 21;
|
|
664
|
+
readonly MISSING_BACKUPS: 22;
|
|
665
|
+
readonly IO_ERROR: 23;
|
|
666
|
+
readonly UNKNOWN_ERROR: 24;
|
|
667
|
+
};
|
|
668
|
+
declare const VALIDATE_FAILURE_REASONS: readonly ["report-incompatible", "missing-backups", "io-error", "unknown-error"];
|
|
669
|
+
type ValidateFailureReason = (typeof VALIDATE_FAILURE_REASONS)[number];
|
|
670
|
+
interface ValidateFailureSummary {
|
|
671
|
+
reason: ValidateFailureReason;
|
|
672
|
+
exitCode: number;
|
|
673
|
+
message: string;
|
|
674
|
+
}
|
|
675
|
+
interface ValidateJsonSuccessPayload extends RestoreConfigFilesResult {
|
|
676
|
+
ok: true;
|
|
677
|
+
}
|
|
678
|
+
interface ValidateJsonFailurePayload {
|
|
679
|
+
ok: false;
|
|
680
|
+
reason: ValidateFailureReason;
|
|
681
|
+
exitCode: number;
|
|
682
|
+
message: string;
|
|
683
|
+
}
|
|
684
|
+
declare class ValidateCommandError extends Error {
|
|
685
|
+
reason: ValidateFailureReason;
|
|
686
|
+
exitCode: number;
|
|
687
|
+
constructor(summary: ValidateFailureSummary, options?: ErrorOptions);
|
|
688
|
+
}
|
|
459
689
|
type TokenOutputFormat = 'json' | 'lines' | 'grouped-json';
|
|
460
690
|
type TokenGroupKey = 'relative' | 'absolute';
|
|
461
691
|
type CacOptionConfig = Parameters<Command['option']>[2];
|
|
@@ -490,6 +720,29 @@ interface TokensCommandArgs extends BaseCommandArgs {
|
|
|
490
720
|
}
|
|
491
721
|
interface InitCommandArgs extends BaseCommandArgs {
|
|
492
722
|
}
|
|
723
|
+
interface MigrateCommandArgs extends BaseCommandArgs {
|
|
724
|
+
config?: string;
|
|
725
|
+
dryRun?: boolean;
|
|
726
|
+
workspace?: boolean;
|
|
727
|
+
maxDepth?: string | number;
|
|
728
|
+
include?: string | string[];
|
|
729
|
+
exclude?: string | string[];
|
|
730
|
+
reportFile?: string;
|
|
731
|
+
backupDir?: string;
|
|
732
|
+
check?: boolean;
|
|
733
|
+
json?: boolean;
|
|
734
|
+
}
|
|
735
|
+
interface RestoreCommandArgs extends BaseCommandArgs {
|
|
736
|
+
reportFile?: string;
|
|
737
|
+
dryRun?: boolean;
|
|
738
|
+
strict?: boolean;
|
|
739
|
+
json?: boolean;
|
|
740
|
+
}
|
|
741
|
+
interface ValidateCommandArgs extends BaseCommandArgs {
|
|
742
|
+
reportFile?: string;
|
|
743
|
+
strict?: boolean;
|
|
744
|
+
json?: boolean;
|
|
745
|
+
}
|
|
493
746
|
interface StatusCommandArgs extends BaseCommandArgs {
|
|
494
747
|
json?: boolean;
|
|
495
748
|
}
|
|
@@ -498,6 +751,9 @@ interface TailwindcssPatchCommandArgMap {
|
|
|
498
751
|
extract: ExtractCommandArgs;
|
|
499
752
|
tokens: TokensCommandArgs;
|
|
500
753
|
init: InitCommandArgs;
|
|
754
|
+
migrate: MigrateCommandArgs;
|
|
755
|
+
restore: RestoreCommandArgs;
|
|
756
|
+
validate: ValidateCommandArgs;
|
|
501
757
|
status: StatusCommandArgs;
|
|
502
758
|
}
|
|
503
759
|
interface TailwindcssPatchCommandResultMap {
|
|
@@ -505,6 +761,9 @@ interface TailwindcssPatchCommandResultMap {
|
|
|
505
761
|
extract: ExtractResult;
|
|
506
762
|
tokens: TailwindTokenReport;
|
|
507
763
|
init: void;
|
|
764
|
+
migrate: ConfigFileMigrationReport;
|
|
765
|
+
restore: RestoreConfigFilesResult;
|
|
766
|
+
validate: RestoreConfigFilesResult;
|
|
508
767
|
status: PatchStatusReport;
|
|
509
768
|
}
|
|
510
769
|
interface TailwindcssPatchCommandContext<TCommand extends TailwindcssPatchCommand> {
|
|
@@ -557,4 +816,4 @@ interface TailwindBuildOptions {
|
|
|
557
816
|
}
|
|
558
817
|
declare function runTailwindBuild(options: TailwindBuildOptions): Promise<postcss.Result<postcss.Root>>;
|
|
559
818
|
|
|
560
|
-
export { CacheStore, type CacheStrategy, type ExtractResult, type ILengthUnitsPatchOptions, type NormalizedTailwindcssPatchOptions, type PatchCheckStatus, type PatchName, type PatchStatusEntry, type PatchStatusReport, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindcssPatchCli, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, logger, mountTailwindcssPatchCommands, normalizeOptions, runTailwindBuild, tailwindcssPatchCommands };
|
|
819
|
+
export { type CacheClearOptions, type CacheClearResult, type CacheClearScope, type CacheContextMetadata, type CacheReadMeta, CacheStore, type CacheStrategy, type ConfigFileMigrationEntry, type ConfigFileMigrationReport, 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 TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, type ValidateFailureReason, type ValidateFailureSummary, type ValidateJsonFailurePayload, type ValidateJsonSuccessPayload, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindcssPatchCli, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,14 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var _chunkK3NZYVMLjs = require('./chunk-K3NZYVML.js');
|
|
20
27
|
|
|
21
28
|
// src/index.ts
|
|
22
29
|
var _config = require('@tailwindcss-mangle/config');
|
|
@@ -39,4 +46,11 @@ var _config = require('@tailwindcss-mangle/config');
|
|
|
39
46
|
|
|
40
47
|
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
exports.CacheStore = _chunkK3NZYVMLjs.CacheStore; exports.MIGRATION_REPORT_KIND = _chunkK3NZYVMLjs.MIGRATION_REPORT_KIND; exports.MIGRATION_REPORT_SCHEMA_VERSION = _chunkK3NZYVMLjs.MIGRATION_REPORT_SCHEMA_VERSION; exports.TailwindcssPatcher = _chunkK3NZYVMLjs.TailwindcssPatcher; exports.VALIDATE_EXIT_CODES = _chunkK3NZYVMLjs.VALIDATE_EXIT_CODES; exports.VALIDATE_FAILURE_REASONS = _chunkK3NZYVMLjs.VALIDATE_FAILURE_REASONS; exports.ValidateCommandError = _chunkK3NZYVMLjs.ValidateCommandError; exports.collectClassesFromContexts = _chunkK3NZYVMLjs.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunkK3NZYVMLjs.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunkK3NZYVMLjs.createTailwindcssPatchCli; exports.defineConfig = _config.defineConfig; exports.extractProjectCandidatesWithPositions = _chunkK3NZYVMLjs.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunkK3NZYVMLjs.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunkK3NZYVMLjs.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunkK3NZYVMLjs.extractValidCandidates; exports.getPatchStatusReport = _chunkK3NZYVMLjs.getPatchStatusReport; exports.groupTokensByFile = _chunkK3NZYVMLjs.groupTokensByFile; exports.loadRuntimeContexts = _chunkK3NZYVMLjs.loadRuntimeContexts; exports.logger = _chunkK3NZYVMLjs.logger_default; exports.migrateConfigFiles = _chunkK3NZYVMLjs.migrateConfigFiles; exports.mountTailwindcssPatchCommands = _chunkK3NZYVMLjs.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunkK3NZYVMLjs.normalizeOptions; exports.restoreConfigFiles = _chunkK3NZYVMLjs.restoreConfigFiles; exports.runTailwindBuild = _chunkK3NZYVMLjs.runTailwindBuild; exports.tailwindcssPatchCommands = _chunkK3NZYVMLjs.tailwindcssPatchCommands;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CacheStore,
|
|
3
|
+
MIGRATION_REPORT_KIND,
|
|
4
|
+
MIGRATION_REPORT_SCHEMA_VERSION,
|
|
3
5
|
TailwindcssPatcher,
|
|
6
|
+
VALIDATE_EXIT_CODES,
|
|
7
|
+
VALIDATE_FAILURE_REASONS,
|
|
8
|
+
ValidateCommandError,
|
|
4
9
|
collectClassesFromContexts,
|
|
5
10
|
collectClassesFromTailwindV4,
|
|
6
11
|
createTailwindcssPatchCli,
|
|
@@ -12,17 +17,24 @@ import {
|
|
|
12
17
|
groupTokensByFile,
|
|
13
18
|
loadRuntimeContexts,
|
|
14
19
|
logger_default,
|
|
20
|
+
migrateConfigFiles,
|
|
15
21
|
mountTailwindcssPatchCommands,
|
|
16
22
|
normalizeOptions,
|
|
23
|
+
restoreConfigFiles,
|
|
17
24
|
runTailwindBuild,
|
|
18
25
|
tailwindcssPatchCommands
|
|
19
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OK2PBYIA.mjs";
|
|
20
27
|
|
|
21
28
|
// src/index.ts
|
|
22
29
|
import { defineConfig } from "@tailwindcss-mangle/config";
|
|
23
30
|
export {
|
|
24
31
|
CacheStore,
|
|
32
|
+
MIGRATION_REPORT_KIND,
|
|
33
|
+
MIGRATION_REPORT_SCHEMA_VERSION,
|
|
25
34
|
TailwindcssPatcher,
|
|
35
|
+
VALIDATE_EXIT_CODES,
|
|
36
|
+
VALIDATE_FAILURE_REASONS,
|
|
37
|
+
ValidateCommandError,
|
|
26
38
|
collectClassesFromContexts,
|
|
27
39
|
collectClassesFromTailwindV4,
|
|
28
40
|
createTailwindcssPatchCli,
|
|
@@ -35,8 +47,10 @@ export {
|
|
|
35
47
|
groupTokensByFile,
|
|
36
48
|
loadRuntimeContexts,
|
|
37
49
|
logger_default as logger,
|
|
50
|
+
migrateConfigFiles,
|
|
38
51
|
mountTailwindcssPatchCommands,
|
|
39
52
|
normalizeOptions,
|
|
53
|
+
restoreConfigFiles,
|
|
40
54
|
runTailwindBuild,
|
|
41
55
|
tailwindcssPatchCommands
|
|
42
56
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.1",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
25
|
"import": "./dist/index.mjs",
|
|
26
26
|
"require": "./dist/index.js"
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
|
+
"./migration-report.schema.json": "./schema/migration-report.schema.json",
|
|
29
|
+
"./restore-result.schema.json": "./schema/restore-result.schema.json",
|
|
30
|
+
"./validate-result.schema.json": "./schema/validate-result.schema.json"
|
|
28
31
|
},
|
|
29
32
|
"main": "./dist/index.js",
|
|
30
33
|
"module": "./dist/index.mjs",
|
|
@@ -35,7 +38,8 @@
|
|
|
35
38
|
},
|
|
36
39
|
"files": [
|
|
37
40
|
"bin",
|
|
38
|
-
"dist"
|
|
41
|
+
"dist",
|
|
42
|
+
"schema"
|
|
39
43
|
],
|
|
40
44
|
"publishConfig": {
|
|
41
45
|
"access": "public",
|
|
@@ -50,25 +54,25 @@
|
|
|
50
54
|
}
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
|
-
"@babel/generator": "^7.
|
|
54
|
-
"@babel/parser": "^7.
|
|
55
|
-
"@babel/traverse": "^7.
|
|
56
|
-
"@babel/types": "^7.
|
|
57
|
-
"@tailwindcss/node": "^4.
|
|
57
|
+
"@babel/generator": "^7.29.1",
|
|
58
|
+
"@babel/parser": "^7.29.0",
|
|
59
|
+
"@babel/traverse": "^7.29.0",
|
|
60
|
+
"@babel/types": "^7.29.0",
|
|
61
|
+
"@tailwindcss/node": "^4.2.0",
|
|
58
62
|
"cac": "^6.7.14",
|
|
59
63
|
"consola": "^3.4.2",
|
|
60
64
|
"fs-extra": "^11.3.3",
|
|
61
65
|
"local-pkg": "^1.1.2",
|
|
62
66
|
"pathe": "^2.0.3",
|
|
63
67
|
"postcss": "^8.5.6",
|
|
64
|
-
"semver": "^7.7.
|
|
65
|
-
"tailwindcss-config": "^1.1.
|
|
66
|
-
"@tailwindcss-mangle/config": "6.1.
|
|
68
|
+
"semver": "^7.7.4",
|
|
69
|
+
"tailwindcss-config": "^1.1.4",
|
|
70
|
+
"@tailwindcss-mangle/config": "6.1.1"
|
|
67
71
|
},
|
|
68
72
|
"devDependencies": {
|
|
69
|
-
"@tailwindcss/oxide": "^4.
|
|
70
|
-
"@tailwindcss/postcss": "^4.
|
|
71
|
-
"@tailwindcss/vite": "^4.
|
|
73
|
+
"@tailwindcss/oxide": "^4.2.0",
|
|
74
|
+
"@tailwindcss/postcss": "^4.2.0",
|
|
75
|
+
"@tailwindcss/vite": "^4.2.0",
|
|
72
76
|
"tailwindcss": "^4.1.18",
|
|
73
77
|
"tailwindcss-3": "npm:tailwindcss@^3.4.19",
|
|
74
78
|
"tailwindcss-4": "npm:tailwindcss@^4.1.18"
|