tailwindcss-patch 8.6.0 → 8.7.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { SourceEntry } from '@tailwindcss/oxide';
2
- import postcss, { Node, Rule } from '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
- * Controls how extracted class lists are written to disk.
33
+ * Preferred options for extraction output behavior.
34
34
  */
35
- interface OutputUserOptions {
35
+ interface TailwindExtractionUserOptions {
36
36
  /** Whether to produce an output file. */
37
- enabled?: boolean;
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
- * Feature switches that toggle optional Tailwind patch capabilities.
78
+ * Preferred options for runtime patch behavior.
63
79
  */
64
- interface FeatureUserOptions {
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 TailwindConfigUserOptions {
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 TailwindV4UserOptions {
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 TailwindUserOptions extends TailwindConfigUserOptions {
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?: TailwindConfigUserOptions;
142
+ v2?: TailwindRuntimeConfigUserOptions;
109
143
  /** Overrides applied when patching Tailwind CSS v3. */
110
- v3?: TailwindConfigUserOptions;
144
+ v3?: TailwindRuntimeConfigUserOptions;
111
145
  /** Options specific to Tailwind CSS v4 patching. */
112
- v4?: TailwindV4UserOptions;
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
- cwd?: string;
123
- /** Whether to overwrite generated artifacts (e.g., caches, outputs). */
124
- overwrite?: boolean;
125
- /** Tailwind-specific configuration grouped by major version. */
126
- tailwind?: TailwindUserOptions;
127
- /** Feature toggles for optional helpers. */
128
- features?: FeatureUserOptions;
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
- /** Output configuration or boolean to inherits defaults. */
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>;
@@ -380,6 +489,7 @@ interface LegacyTailwindcssPatcherOptions {
380
489
  interface ExtractValidCandidatesOption {
381
490
  sources?: SourceEntry[];
382
491
  base?: string;
492
+ baseFallbacks?: string[];
383
493
  css?: string;
384
494
  cwd?: string;
385
495
  }
@@ -406,6 +516,7 @@ declare class TailwindcssPatcher {
406
516
  readonly options: NormalizedTailwindcssPatchOptions;
407
517
  readonly packageInfo: PackageInfo;
408
518
  readonly majorVersion: TailwindMajorVersion;
519
+ private readonly cacheContext;
409
520
  private readonly cacheStore;
410
521
  constructor(options?: TailwindcssPatcherInitOptions);
411
522
  patch(): Promise<PatchRunnerResult>;
@@ -413,6 +524,7 @@ declare class TailwindcssPatcher {
413
524
  getContexts(): TailwindcssRuntimeContext[];
414
525
  private runTailwindBuildIfNeeded;
415
526
  private collectClassSet;
527
+ private debugCacheRead;
416
528
  private mergeWithCache;
417
529
  private mergeWithCacheSync;
418
530
  getClassSet(): Promise<Set<string>>;
@@ -420,6 +532,7 @@ declare class TailwindcssPatcher {
420
532
  extract(options?: {
421
533
  write?: boolean;
422
534
  }): Promise<ExtractResult>;
535
+ clearCache(options?: CacheClearOptions): Promise<CacheClearResult>;
423
536
  extractValidCandidates: typeof extractValidCandidates;
424
537
  collectContentTokens(options?: {
425
538
  cwd?: string;
@@ -435,9 +548,15 @@ declare class TailwindcssPatcher {
435
548
 
436
549
  declare class CacheStore {
437
550
  private readonly options;
551
+ private readonly context?;
438
552
  private readonly driver;
553
+ private readonly lockPath;
439
554
  private memoryCache;
440
- constructor(options: NormalizedCacheOptions);
555
+ private memoryIndex;
556
+ private lastReadMeta;
557
+ constructor(options: NormalizedCacheOptions, context?: CacheContextDescriptor | undefined);
558
+ private isContextAware;
559
+ private createEmptyIndex;
441
560
  private ensureDir;
442
561
  private ensureDirSync;
443
562
  private createTempPath;
@@ -445,16 +564,128 @@ declare class CacheStore {
445
564
  private replaceCacheFileSync;
446
565
  private cleanupTempFile;
447
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;
448
580
  write(data: Set<string>): Promise<string | undefined>;
449
581
  writeSync(data: Set<string>): string | undefined;
582
+ readWithMeta(): Promise<CacheReadResult>;
583
+ readWithMetaSync(): CacheReadResult;
450
584
  read(): Promise<Set<string>>;
451
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;
452
591
  }
453
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
+
454
657
  declare const logger: consola.ConsolaInstance;
455
658
 
456
- type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init' | 'status';
659
+ type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init' | 'migrate' | 'restore' | 'validate' | 'status';
457
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
+ }
458
689
  type TokenOutputFormat = 'json' | 'lines' | 'grouped-json';
459
690
  type TokenGroupKey = 'relative' | 'absolute';
460
691
  type CacOptionConfig = Parameters<Command['option']>[2];
@@ -489,6 +720,29 @@ interface TokensCommandArgs extends BaseCommandArgs {
489
720
  }
490
721
  interface InitCommandArgs extends BaseCommandArgs {
491
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
+ }
492
746
  interface StatusCommandArgs extends BaseCommandArgs {
493
747
  json?: boolean;
494
748
  }
@@ -497,6 +751,9 @@ interface TailwindcssPatchCommandArgMap {
497
751
  extract: ExtractCommandArgs;
498
752
  tokens: TokensCommandArgs;
499
753
  init: InitCommandArgs;
754
+ migrate: MigrateCommandArgs;
755
+ restore: RestoreCommandArgs;
756
+ validate: ValidateCommandArgs;
500
757
  status: StatusCommandArgs;
501
758
  }
502
759
  interface TailwindcssPatchCommandResultMap {
@@ -504,6 +761,9 @@ interface TailwindcssPatchCommandResultMap {
504
761
  extract: ExtractResult;
505
762
  tokens: TailwindTokenReport;
506
763
  init: void;
764
+ migrate: ConfigFileMigrationReport;
765
+ restore: RestoreConfigFilesResult;
766
+ validate: RestoreConfigFilesResult;
507
767
  status: PatchStatusReport;
508
768
  }
509
769
  interface TailwindcssPatchCommandContext<TCommand extends TailwindcssPatchCommand> {
@@ -556,4 +816,4 @@ interface TailwindBuildOptions {
556
816
  }
557
817
  declare function runTailwindBuild(options: TailwindBuildOptions): Promise<postcss.Result<postcss.Root>>;
558
818
 
559
- 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
- var _chunkJ27TPXH5js = require('./chunk-J27TPXH5.js');
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+ var _chunkATKR3J24js = require('./chunk-ATKR3J24.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
- exports.CacheStore = _chunkJ27TPXH5js.CacheStore; exports.TailwindcssPatcher = _chunkJ27TPXH5js.TailwindcssPatcher; exports.collectClassesFromContexts = _chunkJ27TPXH5js.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunkJ27TPXH5js.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunkJ27TPXH5js.createTailwindcssPatchCli; exports.defineConfig = _config.defineConfig; exports.extractProjectCandidatesWithPositions = _chunkJ27TPXH5js.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunkJ27TPXH5js.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunkJ27TPXH5js.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunkJ27TPXH5js.extractValidCandidates; exports.getPatchStatusReport = _chunkJ27TPXH5js.getPatchStatusReport; exports.groupTokensByFile = _chunkJ27TPXH5js.groupTokensByFile; exports.loadRuntimeContexts = _chunkJ27TPXH5js.loadRuntimeContexts; exports.logger = _chunkJ27TPXH5js.logger_default; exports.mountTailwindcssPatchCommands = _chunkJ27TPXH5js.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunkJ27TPXH5js.normalizeOptions; exports.runTailwindBuild = _chunkJ27TPXH5js.runTailwindBuild; exports.tailwindcssPatchCommands = _chunkJ27TPXH5js.tailwindcssPatchCommands;
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+ exports.CacheStore = _chunkATKR3J24js.CacheStore; exports.MIGRATION_REPORT_KIND = _chunkATKR3J24js.MIGRATION_REPORT_KIND; exports.MIGRATION_REPORT_SCHEMA_VERSION = _chunkATKR3J24js.MIGRATION_REPORT_SCHEMA_VERSION; exports.TailwindcssPatcher = _chunkATKR3J24js.TailwindcssPatcher; exports.VALIDATE_EXIT_CODES = _chunkATKR3J24js.VALIDATE_EXIT_CODES; exports.VALIDATE_FAILURE_REASONS = _chunkATKR3J24js.VALIDATE_FAILURE_REASONS; exports.ValidateCommandError = _chunkATKR3J24js.ValidateCommandError; exports.collectClassesFromContexts = _chunkATKR3J24js.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunkATKR3J24js.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunkATKR3J24js.createTailwindcssPatchCli; exports.defineConfig = _config.defineConfig; exports.extractProjectCandidatesWithPositions = _chunkATKR3J24js.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunkATKR3J24js.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunkATKR3J24js.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunkATKR3J24js.extractValidCandidates; exports.getPatchStatusReport = _chunkATKR3J24js.getPatchStatusReport; exports.groupTokensByFile = _chunkATKR3J24js.groupTokensByFile; exports.loadRuntimeContexts = _chunkATKR3J24js.loadRuntimeContexts; exports.logger = _chunkATKR3J24js.logger_default; exports.migrateConfigFiles = _chunkATKR3J24js.migrateConfigFiles; exports.mountTailwindcssPatchCommands = _chunkATKR3J24js.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunkATKR3J24js.normalizeOptions; exports.restoreConfigFiles = _chunkATKR3J24js.restoreConfigFiles; exports.runTailwindBuild = _chunkATKR3J24js.runTailwindBuild; exports.tailwindcssPatchCommands = _chunkATKR3J24js.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-RVSD53YX.mjs";
26
+ } from "./chunk-2YHCFHVA.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.6.0",
3
+ "version": "8.7.0",
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,10 +54,10 @@
50
54
  }
51
55
  },
52
56
  "dependencies": {
53
- "@babel/generator": "^7.28.5",
54
- "@babel/parser": "^7.28.5",
55
- "@babel/traverse": "^7.28.5",
56
- "@babel/types": "^7.28.5",
57
+ "@babel/generator": "^7.29.1",
58
+ "@babel/parser": "^7.29.0",
59
+ "@babel/traverse": "^7.29.0",
60
+ "@babel/types": "^7.29.0",
57
61
  "@tailwindcss/node": "^4.1.18",
58
62
  "cac": "^6.7.14",
59
63
  "consola": "^3.4.2",
@@ -61,9 +65,9 @@
61
65
  "local-pkg": "^1.1.2",
62
66
  "pathe": "^2.0.3",
63
67
  "postcss": "^8.5.6",
64
- "semver": "^7.7.3",
65
- "tailwindcss-config": "^1.1.3",
66
- "@tailwindcss-mangle/config": "6.1.0"
68
+ "semver": "^7.7.4",
69
+ "tailwindcss-config": "^1.1.4",
70
+ "@tailwindcss-mangle/config": "6.1.1"
67
71
  },
68
72
  "devDependencies": {
69
73
  "@tailwindcss/oxide": "^4.1.18",