tailwindcss-patch 8.7.3 → 9.0.0-alpha.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 +45 -5
- package/dist/{chunk-7JAOSSRO.js → chunk-5CWNAWKP.js} +1 -1
- package/dist/{chunk-JHEI2MLC.mjs → chunk-A67ABH3M.mjs} +1 -1
- package/dist/{chunk-3T6WSV7F.mjs → chunk-SWLOK2S6.mjs} +476 -315
- package/dist/{chunk-EFYAZO6C.js → chunk-Z6OMJZTU.js} +456 -295
- package/dist/cli.js +5 -5
- package/dist/cli.mjs +2 -2
- package/dist/{dist-NW65QXLC.js → dist-7O2232CU.js} +1 -1
- package/dist/{dist-EMUBVNNO.mjs → dist-7UDSGIWH.mjs} +1 -1
- package/dist/index.d.mts +15 -107
- package/dist/index.d.ts +15 -107
- package/dist/index.js +6 -4
- package/dist/index.mjs +5 -3
- package/package.json +6 -5
package/dist/cli.js
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkZ6OMJZTUjs = require('./chunk-Z6OMJZTU.js');
|
|
6
|
+
require('./chunk-5CWNAWKP.js');
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
10
10
|
async function main() {
|
|
11
|
-
const cli =
|
|
11
|
+
const cli = _chunkZ6OMJZTUjs.createTailwindcssPatchCli.call(void 0, );
|
|
12
12
|
cli.help();
|
|
13
13
|
cli.parse(_process2.default.argv, { run: false });
|
|
14
14
|
await cli.runMatchedCommand();
|
|
15
15
|
}
|
|
16
16
|
main().catch((error) => {
|
|
17
|
-
if (error instanceof
|
|
17
|
+
if (error instanceof _chunkZ6OMJZTUjs.ValidateCommandError) {
|
|
18
18
|
_process2.default.exitCode = error.exitCode;
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
const message = error instanceof Error ? error.message : String(error);
|
|
22
|
-
|
|
22
|
+
_chunkZ6OMJZTUjs.logger_default.error(message);
|
|
23
23
|
_process2.default.exitCode = 1;
|
|
24
24
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }require('./chunk-5CWNAWKP.js');
|
|
2
2
|
|
|
3
3
|
// ../shared/dist/index.js
|
|
4
4
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,6 @@ import { SourceEntry } from '@tailwindcss/oxide';
|
|
|
2
2
|
import postcss, { Rule, Node } from 'postcss';
|
|
3
3
|
import { Config } from 'tailwindcss';
|
|
4
4
|
import { PackageResolvingOptions, PackageInfo } from 'local-pkg';
|
|
5
|
-
import { TailwindLocatorOptions, TailwindNextOptions } from '@tailwindcss-mangle/config';
|
|
6
|
-
export { defineConfig } from '@tailwindcss-mangle/config';
|
|
7
5
|
import { Command, CAC } from 'cac';
|
|
8
6
|
import * as consola from 'consola';
|
|
9
7
|
|
|
@@ -44,22 +42,6 @@ interface TailwindExtractionUserOptions {
|
|
|
44
42
|
/** Whether to strip the universal selector (`*`) from the final list. */
|
|
45
43
|
removeUniversalSelector?: boolean;
|
|
46
44
|
}
|
|
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
45
|
/**
|
|
64
46
|
* Options controlling how Tailwind contexts are exposed during runtime patching.
|
|
65
47
|
*/
|
|
@@ -85,16 +67,6 @@ interface PatchApplyUserOptions {
|
|
|
85
67
|
/** Extends the length-unit patch or disables it entirely. */
|
|
86
68
|
extendLengthUnits?: false | ExtendLengthUnitsUserOptions;
|
|
87
69
|
}
|
|
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
|
-
}
|
|
98
70
|
/**
|
|
99
71
|
* Shared configuration used for Tailwind v2/v3 patching flows.
|
|
100
72
|
*/
|
|
@@ -106,12 +78,6 @@ interface TailwindRuntimeConfigUserOptions {
|
|
|
106
78
|
/** Optional PostCSS plugin name to use instead of the default. */
|
|
107
79
|
postcssPlugin?: string;
|
|
108
80
|
}
|
|
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
|
-
}
|
|
115
81
|
/**
|
|
116
82
|
* Additional configuration specific to Tailwind CSS v4 extraction.
|
|
117
83
|
*/
|
|
@@ -129,10 +95,7 @@ interface TailwindV4RuntimeUserOptions {
|
|
|
129
95
|
* High-level Tailwind patch configuration shared across versions.
|
|
130
96
|
*/
|
|
131
97
|
interface TailwindcssUserOptions extends TailwindRuntimeConfigUserOptions {
|
|
132
|
-
/**
|
|
133
|
-
* Optional hint for picking the patch strategy.
|
|
134
|
-
* When omitted we infer from the installed Tailwind CSS package version.
|
|
135
|
-
*/
|
|
98
|
+
/** Explicit Tailwind CSS major version used by the current project. When omitted, the installed package version is inferred. */
|
|
136
99
|
version?: 2 | 3 | 4;
|
|
137
100
|
/** Tailwind package name if the project uses a fork. */
|
|
138
101
|
packageName?: string;
|
|
@@ -145,12 +108,6 @@ interface TailwindcssUserOptions extends TailwindRuntimeConfigUserOptions {
|
|
|
145
108
|
/** Options specific to Tailwind CSS v4 patching. */
|
|
146
109
|
v4?: TailwindV4RuntimeUserOptions;
|
|
147
110
|
}
|
|
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 {
|
|
153
|
-
}
|
|
154
111
|
/**
|
|
155
112
|
* Root configuration consumed by the Tailwind CSS patch runner.
|
|
156
113
|
*/
|
|
@@ -170,23 +127,6 @@ interface TailwindcssPatchOptions {
|
|
|
170
127
|
filter?: (className: string) => boolean;
|
|
171
128
|
/** Cache configuration or boolean to enable/disable quickly. */
|
|
172
129
|
cache?: boolean | CacheUserOptions;
|
|
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;
|
|
190
130
|
}
|
|
191
131
|
/**
|
|
192
132
|
* Stable shape for output configuration after normalization.
|
|
@@ -231,12 +171,12 @@ interface NormalizedTailwindV4Options {
|
|
|
231
171
|
/**
|
|
232
172
|
* Tailwind configuration ready for consumption by the runtime after normalization.
|
|
233
173
|
*/
|
|
234
|
-
interface NormalizedTailwindConfigOptions extends
|
|
174
|
+
interface NormalizedTailwindConfigOptions extends TailwindRuntimeConfigUserOptions {
|
|
235
175
|
packageName: string;
|
|
236
176
|
versionHint?: 2 | 3 | 4;
|
|
237
177
|
resolve?: PackageResolvingOptions;
|
|
238
|
-
v2?:
|
|
239
|
-
v3?:
|
|
178
|
+
v2?: TailwindRuntimeConfigUserOptions;
|
|
179
|
+
v3?: TailwindRuntimeConfigUserOptions;
|
|
240
180
|
v4?: NormalizedTailwindV4Options;
|
|
241
181
|
}
|
|
242
182
|
/** Grouped normalized feature flags. */
|
|
@@ -448,44 +388,6 @@ interface PatchRunnerResult {
|
|
|
448
388
|
extendLengthUnits?: ReturnType<typeof applyExtendLengthUnitsPatchV3> | ReturnType<typeof applyExtendLengthUnitsPatchV4>;
|
|
449
389
|
}
|
|
450
390
|
|
|
451
|
-
interface LegacyCacheOptions {
|
|
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
391
|
declare function normalizeOptions(options?: TailwindcssPatchOptions): NormalizedTailwindcssPatchOptions;
|
|
490
392
|
|
|
491
393
|
interface TailwindcssConfigModule {
|
|
@@ -493,7 +395,7 @@ interface TailwindcssConfigModule {
|
|
|
493
395
|
getConfig: (cwd?: string) => Promise<{
|
|
494
396
|
config?: {
|
|
495
397
|
registry?: unknown;
|
|
496
|
-
patch?:
|
|
398
|
+
patch?: unknown;
|
|
497
399
|
};
|
|
498
400
|
}>;
|
|
499
401
|
initConfig: (cwd: string) => Promise<unknown>;
|
|
@@ -525,22 +427,26 @@ declare function groupTokensByFile(report: TailwindTokenReport, options?: {
|
|
|
525
427
|
}): TailwindTokenByFileMap;
|
|
526
428
|
|
|
527
429
|
type TailwindMajorVersion = 2 | 3 | 4;
|
|
528
|
-
|
|
430
|
+
|
|
529
431
|
declare class TailwindcssPatcher {
|
|
530
432
|
readonly options: NormalizedTailwindcssPatchOptions;
|
|
531
433
|
readonly packageInfo: PackageInfo;
|
|
532
434
|
readonly majorVersion: TailwindMajorVersion;
|
|
533
435
|
private readonly cacheContext;
|
|
534
436
|
private readonly cacheStore;
|
|
535
|
-
|
|
437
|
+
private readonly collector;
|
|
438
|
+
private patchMemo;
|
|
439
|
+
constructor(options?: TailwindcssPatchOptions);
|
|
536
440
|
patch(): Promise<PatchRunnerResult>;
|
|
537
441
|
getPatchStatus(): Promise<PatchStatusReport>;
|
|
538
442
|
getContexts(): TailwindcssRuntimeContext[];
|
|
539
|
-
private
|
|
443
|
+
private createPatchSnapshot;
|
|
540
444
|
private collectClassSet;
|
|
445
|
+
private runTailwindBuildIfNeeded;
|
|
541
446
|
private debugCacheRead;
|
|
542
447
|
private mergeWithCache;
|
|
543
448
|
private mergeWithCacheSync;
|
|
449
|
+
private areSetsEqual;
|
|
544
450
|
getClassSet(): Promise<Set<string>>;
|
|
545
451
|
getClassSetSync(): Set<string> | undefined;
|
|
546
452
|
extract(options?: {
|
|
@@ -833,4 +739,6 @@ interface PatchStatusContext {
|
|
|
833
739
|
}
|
|
834
740
|
declare function getPatchStatusReport(context: PatchStatusContext): PatchStatusReport;
|
|
835
741
|
|
|
836
|
-
|
|
742
|
+
declare function defineConfig<T>(config: T): T;
|
|
743
|
+
|
|
744
|
+
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, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { SourceEntry } from '@tailwindcss/oxide';
|
|
|
2
2
|
import postcss, { Rule, Node } from 'postcss';
|
|
3
3
|
import { Config } from 'tailwindcss';
|
|
4
4
|
import { PackageResolvingOptions, PackageInfo } from 'local-pkg';
|
|
5
|
-
import { TailwindLocatorOptions, TailwindNextOptions } from '@tailwindcss-mangle/config';
|
|
6
|
-
export { defineConfig } from '@tailwindcss-mangle/config';
|
|
7
5
|
import { Command, CAC } from 'cac';
|
|
8
6
|
import * as consola from 'consola';
|
|
9
7
|
|
|
@@ -44,22 +42,6 @@ interface TailwindExtractionUserOptions {
|
|
|
44
42
|
/** Whether to strip the universal selector (`*`) from the final list. */
|
|
45
43
|
removeUniversalSelector?: boolean;
|
|
46
44
|
}
|
|
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
45
|
/**
|
|
64
46
|
* Options controlling how Tailwind contexts are exposed during runtime patching.
|
|
65
47
|
*/
|
|
@@ -85,16 +67,6 @@ interface PatchApplyUserOptions {
|
|
|
85
67
|
/** Extends the length-unit patch or disables it entirely. */
|
|
86
68
|
extendLengthUnits?: false | ExtendLengthUnitsUserOptions;
|
|
87
69
|
}
|
|
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
|
-
}
|
|
98
70
|
/**
|
|
99
71
|
* Shared configuration used for Tailwind v2/v3 patching flows.
|
|
100
72
|
*/
|
|
@@ -106,12 +78,6 @@ interface TailwindRuntimeConfigUserOptions {
|
|
|
106
78
|
/** Optional PostCSS plugin name to use instead of the default. */
|
|
107
79
|
postcssPlugin?: string;
|
|
108
80
|
}
|
|
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
|
-
}
|
|
115
81
|
/**
|
|
116
82
|
* Additional configuration specific to Tailwind CSS v4 extraction.
|
|
117
83
|
*/
|
|
@@ -129,10 +95,7 @@ interface TailwindV4RuntimeUserOptions {
|
|
|
129
95
|
* High-level Tailwind patch configuration shared across versions.
|
|
130
96
|
*/
|
|
131
97
|
interface TailwindcssUserOptions extends TailwindRuntimeConfigUserOptions {
|
|
132
|
-
/**
|
|
133
|
-
* Optional hint for picking the patch strategy.
|
|
134
|
-
* When omitted we infer from the installed Tailwind CSS package version.
|
|
135
|
-
*/
|
|
98
|
+
/** Explicit Tailwind CSS major version used by the current project. When omitted, the installed package version is inferred. */
|
|
136
99
|
version?: 2 | 3 | 4;
|
|
137
100
|
/** Tailwind package name if the project uses a fork. */
|
|
138
101
|
packageName?: string;
|
|
@@ -145,12 +108,6 @@ interface TailwindcssUserOptions extends TailwindRuntimeConfigUserOptions {
|
|
|
145
108
|
/** Options specific to Tailwind CSS v4 patching. */
|
|
146
109
|
v4?: TailwindV4RuntimeUserOptions;
|
|
147
110
|
}
|
|
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 {
|
|
153
|
-
}
|
|
154
111
|
/**
|
|
155
112
|
* Root configuration consumed by the Tailwind CSS patch runner.
|
|
156
113
|
*/
|
|
@@ -170,23 +127,6 @@ interface TailwindcssPatchOptions {
|
|
|
170
127
|
filter?: (className: string) => boolean;
|
|
171
128
|
/** Cache configuration or boolean to enable/disable quickly. */
|
|
172
129
|
cache?: boolean | CacheUserOptions;
|
|
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;
|
|
190
130
|
}
|
|
191
131
|
/**
|
|
192
132
|
* Stable shape for output configuration after normalization.
|
|
@@ -231,12 +171,12 @@ interface NormalizedTailwindV4Options {
|
|
|
231
171
|
/**
|
|
232
172
|
* Tailwind configuration ready for consumption by the runtime after normalization.
|
|
233
173
|
*/
|
|
234
|
-
interface NormalizedTailwindConfigOptions extends
|
|
174
|
+
interface NormalizedTailwindConfigOptions extends TailwindRuntimeConfigUserOptions {
|
|
235
175
|
packageName: string;
|
|
236
176
|
versionHint?: 2 | 3 | 4;
|
|
237
177
|
resolve?: PackageResolvingOptions;
|
|
238
|
-
v2?:
|
|
239
|
-
v3?:
|
|
178
|
+
v2?: TailwindRuntimeConfigUserOptions;
|
|
179
|
+
v3?: TailwindRuntimeConfigUserOptions;
|
|
240
180
|
v4?: NormalizedTailwindV4Options;
|
|
241
181
|
}
|
|
242
182
|
/** Grouped normalized feature flags. */
|
|
@@ -448,44 +388,6 @@ interface PatchRunnerResult {
|
|
|
448
388
|
extendLengthUnits?: ReturnType<typeof applyExtendLengthUnitsPatchV3> | ReturnType<typeof applyExtendLengthUnitsPatchV4>;
|
|
449
389
|
}
|
|
450
390
|
|
|
451
|
-
interface LegacyCacheOptions {
|
|
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
391
|
declare function normalizeOptions(options?: TailwindcssPatchOptions): NormalizedTailwindcssPatchOptions;
|
|
490
392
|
|
|
491
393
|
interface TailwindcssConfigModule {
|
|
@@ -493,7 +395,7 @@ interface TailwindcssConfigModule {
|
|
|
493
395
|
getConfig: (cwd?: string) => Promise<{
|
|
494
396
|
config?: {
|
|
495
397
|
registry?: unknown;
|
|
496
|
-
patch?:
|
|
398
|
+
patch?: unknown;
|
|
497
399
|
};
|
|
498
400
|
}>;
|
|
499
401
|
initConfig: (cwd: string) => Promise<unknown>;
|
|
@@ -525,22 +427,26 @@ declare function groupTokensByFile(report: TailwindTokenReport, options?: {
|
|
|
525
427
|
}): TailwindTokenByFileMap;
|
|
526
428
|
|
|
527
429
|
type TailwindMajorVersion = 2 | 3 | 4;
|
|
528
|
-
|
|
430
|
+
|
|
529
431
|
declare class TailwindcssPatcher {
|
|
530
432
|
readonly options: NormalizedTailwindcssPatchOptions;
|
|
531
433
|
readonly packageInfo: PackageInfo;
|
|
532
434
|
readonly majorVersion: TailwindMajorVersion;
|
|
533
435
|
private readonly cacheContext;
|
|
534
436
|
private readonly cacheStore;
|
|
535
|
-
|
|
437
|
+
private readonly collector;
|
|
438
|
+
private patchMemo;
|
|
439
|
+
constructor(options?: TailwindcssPatchOptions);
|
|
536
440
|
patch(): Promise<PatchRunnerResult>;
|
|
537
441
|
getPatchStatus(): Promise<PatchStatusReport>;
|
|
538
442
|
getContexts(): TailwindcssRuntimeContext[];
|
|
539
|
-
private
|
|
443
|
+
private createPatchSnapshot;
|
|
540
444
|
private collectClassSet;
|
|
445
|
+
private runTailwindBuildIfNeeded;
|
|
541
446
|
private debugCacheRead;
|
|
542
447
|
private mergeWithCache;
|
|
543
448
|
private mergeWithCacheSync;
|
|
449
|
+
private areSetsEqual;
|
|
544
450
|
getClassSet(): Promise<Set<string>>;
|
|
545
451
|
getClassSetSync(): Set<string> | undefined;
|
|
546
452
|
extract(options?: {
|
|
@@ -833,4 +739,6 @@ interface PatchStatusContext {
|
|
|
833
739
|
}
|
|
834
740
|
declare function getPatchStatusReport(context: PatchStatusContext): PatchStatusReport;
|
|
835
741
|
|
|
836
|
-
|
|
742
|
+
declare function defineConfig<T>(config: T): T;
|
|
743
|
+
|
|
744
|
+
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, 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
|
|
27
|
-
require('./chunk-
|
|
26
|
+
var _chunkZ6OMJZTUjs = require('./chunk-Z6OMJZTU.js');
|
|
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 = _chunkZ6OMJZTUjs.CacheStore; exports.MIGRATION_REPORT_KIND = _chunkZ6OMJZTUjs.MIGRATION_REPORT_KIND; exports.MIGRATION_REPORT_SCHEMA_VERSION = _chunkZ6OMJZTUjs.MIGRATION_REPORT_SCHEMA_VERSION; exports.TailwindcssPatcher = _chunkZ6OMJZTUjs.TailwindcssPatcher; exports.VALIDATE_EXIT_CODES = _chunkZ6OMJZTUjs.VALIDATE_EXIT_CODES; exports.VALIDATE_FAILURE_REASONS = _chunkZ6OMJZTUjs.VALIDATE_FAILURE_REASONS; exports.ValidateCommandError = _chunkZ6OMJZTUjs.ValidateCommandError; exports.collectClassesFromContexts = _chunkZ6OMJZTUjs.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunkZ6OMJZTUjs.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunkZ6OMJZTUjs.createTailwindcssPatchCli; exports.defineConfig = defineConfig; exports.extractProjectCandidatesWithPositions = _chunkZ6OMJZTUjs.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunkZ6OMJZTUjs.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunkZ6OMJZTUjs.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunkZ6OMJZTUjs.extractValidCandidates; exports.getPatchStatusReport = _chunkZ6OMJZTUjs.getPatchStatusReport; exports.groupTokensByFile = _chunkZ6OMJZTUjs.groupTokensByFile; exports.loadRuntimeContexts = _chunkZ6OMJZTUjs.loadRuntimeContexts; exports.logger = _chunkZ6OMJZTUjs.logger_default; exports.migrateConfigFiles = _chunkZ6OMJZTUjs.migrateConfigFiles; exports.mountTailwindcssPatchCommands = _chunkZ6OMJZTUjs.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunkZ6OMJZTUjs.normalizeOptions; exports.restoreConfigFiles = _chunkZ6OMJZTUjs.restoreConfigFiles; exports.runTailwindBuild = _chunkZ6OMJZTUjs.runTailwindBuild; exports.tailwindcssPatchCommands = _chunkZ6OMJZTUjs.tailwindcssPatchCommands;
|
package/dist/index.mjs
CHANGED
|
@@ -23,11 +23,13 @@ import {
|
|
|
23
23
|
restoreConfigFiles,
|
|
24
24
|
runTailwindBuild,
|
|
25
25
|
tailwindcssPatchCommands
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-SWLOK2S6.mjs";
|
|
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.1",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"@babel/traverse": "^7.29.0",
|
|
60
60
|
"@babel/types": "^7.29.0",
|
|
61
61
|
"@tailwindcss/node": "^4.2.1",
|
|
62
|
-
"cac": "^
|
|
62
|
+
"cac": "^7.0.0",
|
|
63
63
|
"consola": "^3.4.2",
|
|
64
|
-
"fs-extra": "^11.3.
|
|
64
|
+
"fs-extra": "^11.3.4",
|
|
65
65
|
"local-pkg": "^1.1.2",
|
|
66
66
|
"pathe": "^2.0.3",
|
|
67
|
-
"postcss": "^8.5.
|
|
67
|
+
"postcss": "^8.5.8",
|
|
68
68
|
"semver": "^7.7.4",
|
|
69
69
|
"tailwindcss-config": "^1.1.4",
|
|
70
|
-
"@tailwindcss-mangle/config": "
|
|
70
|
+
"@tailwindcss-mangle/config": "7.0.0-alpha.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@tailwindcss/oxide": "^4.2.1",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"build": "tsup",
|
|
83
83
|
"test": "vitest run",
|
|
84
84
|
"test:dev": "vitest",
|
|
85
|
+
"bench:cold-start": "node --import tsx bench/cold-start.ts",
|
|
85
86
|
"patch": "tsx dev/bin.ts install",
|
|
86
87
|
"r0": "tsx dev/bin.ts extract",
|
|
87
88
|
"r1": "tsx dev/bin.ts extract --css index.css"
|