tailwindcss-patch 8.4.2 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/{chunk-6WXBENUZ.js → chunk-CGQTZTVO.js} +963 -690
- package/dist/{chunk-K5JHLM3J.mjs → chunk-V4NW4IGL.mjs} +815 -542
- package/dist/cli.js +2 -2
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +33 -4
- package/dist/index.d.ts +33 -4
- package/dist/index.js +4 -2
- package/dist/index.mjs +3 -1
- package/package.json +9 -9
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkCGQTZTVOjs = require('./chunk-CGQTZTVO.js');
|
|
4
4
|
|
|
5
5
|
// src/cli.ts
|
|
6
|
-
var cli =
|
|
6
|
+
var cli = _chunkCGQTZTVOjs.createTailwindcssPatchCli.call(void 0, );
|
|
7
7
|
cli.help();
|
|
8
8
|
cli.parse();
|
package/dist/cli.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -280,6 +280,23 @@ interface ILengthUnitsPatchOptions {
|
|
|
280
280
|
overwrite?: boolean;
|
|
281
281
|
destPath?: string;
|
|
282
282
|
}
|
|
283
|
+
type PatchCheckStatus = 'applied' | 'not-applied' | 'skipped' | 'unsupported';
|
|
284
|
+
type PatchName = 'exposeContext' | 'extendLengthUnits';
|
|
285
|
+
interface PatchStatusEntry {
|
|
286
|
+
name: PatchName;
|
|
287
|
+
status: PatchCheckStatus;
|
|
288
|
+
reason?: string;
|
|
289
|
+
files: string[];
|
|
290
|
+
}
|
|
291
|
+
interface PatchStatusReport {
|
|
292
|
+
package: {
|
|
293
|
+
name?: string;
|
|
294
|
+
version?: string;
|
|
295
|
+
root: string;
|
|
296
|
+
};
|
|
297
|
+
majorVersion: 2 | 3 | 4;
|
|
298
|
+
entries: PatchStatusEntry[];
|
|
299
|
+
}
|
|
283
300
|
|
|
284
301
|
interface ExposeContextPatchParams {
|
|
285
302
|
rootDir: string;
|
|
@@ -388,14 +405,14 @@ declare class TailwindcssPatcher {
|
|
|
388
405
|
private readonly cacheStore;
|
|
389
406
|
constructor(options?: TailwindcssPatcherInitOptions);
|
|
390
407
|
patch(): Promise<PatchRunnerResult>;
|
|
408
|
+
getPatchStatus(): Promise<PatchStatusReport>;
|
|
391
409
|
getContexts(): TailwindcssRuntimeContext[];
|
|
392
410
|
private runTailwindBuildIfNeeded;
|
|
393
411
|
private collectClassSet;
|
|
394
|
-
private collectClassSetSync;
|
|
395
412
|
private mergeWithCache;
|
|
396
413
|
private mergeWithCacheSync;
|
|
397
414
|
getClassSet(): Promise<Set<string>>;
|
|
398
|
-
getClassSetSync(): Set<string
|
|
415
|
+
getClassSetSync(): Set<string> | undefined;
|
|
399
416
|
extract(options?: {
|
|
400
417
|
write?: boolean;
|
|
401
418
|
}): Promise<ExtractResult>;
|
|
@@ -430,7 +447,7 @@ declare class CacheStore {
|
|
|
430
447
|
|
|
431
448
|
declare const logger: consola.ConsolaInstance;
|
|
432
449
|
|
|
433
|
-
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init';
|
|
450
|
+
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init' | 'status';
|
|
434
451
|
declare const tailwindcssPatchCommands: TailwindcssPatchCommand[];
|
|
435
452
|
type TokenOutputFormat = 'json' | 'lines' | 'grouped-json';
|
|
436
453
|
type TokenGroupKey = 'relative' | 'absolute';
|
|
@@ -466,17 +483,22 @@ interface TokensCommandArgs extends BaseCommandArgs {
|
|
|
466
483
|
}
|
|
467
484
|
interface InitCommandArgs extends BaseCommandArgs {
|
|
468
485
|
}
|
|
486
|
+
interface StatusCommandArgs extends BaseCommandArgs {
|
|
487
|
+
json?: boolean;
|
|
488
|
+
}
|
|
469
489
|
interface TailwindcssPatchCommandArgMap {
|
|
470
490
|
install: InstallCommandArgs;
|
|
471
491
|
extract: ExtractCommandArgs;
|
|
472
492
|
tokens: TokensCommandArgs;
|
|
473
493
|
init: InitCommandArgs;
|
|
494
|
+
status: StatusCommandArgs;
|
|
474
495
|
}
|
|
475
496
|
interface TailwindcssPatchCommandResultMap {
|
|
476
497
|
install: void;
|
|
477
498
|
extract: ExtractResult;
|
|
478
499
|
tokens: TailwindTokenReport;
|
|
479
500
|
init: void;
|
|
501
|
+
status: PatchStatusReport;
|
|
480
502
|
}
|
|
481
503
|
interface TailwindcssPatchCommandContext<TCommand extends TailwindcssPatchCommand> {
|
|
482
504
|
cli: CAC;
|
|
@@ -508,6 +530,13 @@ declare function createTailwindcssPatchCli(options?: TailwindcssPatchCliOptions)
|
|
|
508
530
|
|
|
509
531
|
declare function normalizeOptions(options?: TailwindcssPatchOptions): NormalizedTailwindcssPatchOptions;
|
|
510
532
|
|
|
533
|
+
interface PatchStatusContext {
|
|
534
|
+
packageInfo: PackageInfo;
|
|
535
|
+
options: NormalizedTailwindcssPatchOptions;
|
|
536
|
+
majorVersion: 2 | 3 | 4;
|
|
537
|
+
}
|
|
538
|
+
declare function getPatchStatusReport(context: PatchStatusContext): PatchStatusReport;
|
|
539
|
+
|
|
511
540
|
declare function collectClassesFromContexts(contexts: TailwindcssRuntimeContext[], filter: (className: string) => boolean): Set<string>;
|
|
512
541
|
declare function collectClassesFromTailwindV4(options: NormalizedTailwindcssPatchOptions): Promise<Set<string>>;
|
|
513
542
|
|
|
@@ -521,4 +550,4 @@ interface TailwindBuildOptions {
|
|
|
521
550
|
}
|
|
522
551
|
declare function runTailwindBuild(options: TailwindBuildOptions): Promise<postcss.Result<postcss.Root>>;
|
|
523
552
|
|
|
524
|
-
export { CacheStore, type CacheStrategy, type ExtractResult, type ILengthUnitsPatchOptions, type NormalizedTailwindcssPatchOptions, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindcssPatchCli, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, groupTokensByFile, loadRuntimeContexts, logger, mountTailwindcssPatchCommands, normalizeOptions, runTailwindBuild, tailwindcssPatchCommands };
|
|
553
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -280,6 +280,23 @@ interface ILengthUnitsPatchOptions {
|
|
|
280
280
|
overwrite?: boolean;
|
|
281
281
|
destPath?: string;
|
|
282
282
|
}
|
|
283
|
+
type PatchCheckStatus = 'applied' | 'not-applied' | 'skipped' | 'unsupported';
|
|
284
|
+
type PatchName = 'exposeContext' | 'extendLengthUnits';
|
|
285
|
+
interface PatchStatusEntry {
|
|
286
|
+
name: PatchName;
|
|
287
|
+
status: PatchCheckStatus;
|
|
288
|
+
reason?: string;
|
|
289
|
+
files: string[];
|
|
290
|
+
}
|
|
291
|
+
interface PatchStatusReport {
|
|
292
|
+
package: {
|
|
293
|
+
name?: string;
|
|
294
|
+
version?: string;
|
|
295
|
+
root: string;
|
|
296
|
+
};
|
|
297
|
+
majorVersion: 2 | 3 | 4;
|
|
298
|
+
entries: PatchStatusEntry[];
|
|
299
|
+
}
|
|
283
300
|
|
|
284
301
|
interface ExposeContextPatchParams {
|
|
285
302
|
rootDir: string;
|
|
@@ -388,14 +405,14 @@ declare class TailwindcssPatcher {
|
|
|
388
405
|
private readonly cacheStore;
|
|
389
406
|
constructor(options?: TailwindcssPatcherInitOptions);
|
|
390
407
|
patch(): Promise<PatchRunnerResult>;
|
|
408
|
+
getPatchStatus(): Promise<PatchStatusReport>;
|
|
391
409
|
getContexts(): TailwindcssRuntimeContext[];
|
|
392
410
|
private runTailwindBuildIfNeeded;
|
|
393
411
|
private collectClassSet;
|
|
394
|
-
private collectClassSetSync;
|
|
395
412
|
private mergeWithCache;
|
|
396
413
|
private mergeWithCacheSync;
|
|
397
414
|
getClassSet(): Promise<Set<string>>;
|
|
398
|
-
getClassSetSync(): Set<string
|
|
415
|
+
getClassSetSync(): Set<string> | undefined;
|
|
399
416
|
extract(options?: {
|
|
400
417
|
write?: boolean;
|
|
401
418
|
}): Promise<ExtractResult>;
|
|
@@ -430,7 +447,7 @@ declare class CacheStore {
|
|
|
430
447
|
|
|
431
448
|
declare const logger: consola.ConsolaInstance;
|
|
432
449
|
|
|
433
|
-
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init';
|
|
450
|
+
type TailwindcssPatchCommand = 'install' | 'extract' | 'tokens' | 'init' | 'status';
|
|
434
451
|
declare const tailwindcssPatchCommands: TailwindcssPatchCommand[];
|
|
435
452
|
type TokenOutputFormat = 'json' | 'lines' | 'grouped-json';
|
|
436
453
|
type TokenGroupKey = 'relative' | 'absolute';
|
|
@@ -466,17 +483,22 @@ interface TokensCommandArgs extends BaseCommandArgs {
|
|
|
466
483
|
}
|
|
467
484
|
interface InitCommandArgs extends BaseCommandArgs {
|
|
468
485
|
}
|
|
486
|
+
interface StatusCommandArgs extends BaseCommandArgs {
|
|
487
|
+
json?: boolean;
|
|
488
|
+
}
|
|
469
489
|
interface TailwindcssPatchCommandArgMap {
|
|
470
490
|
install: InstallCommandArgs;
|
|
471
491
|
extract: ExtractCommandArgs;
|
|
472
492
|
tokens: TokensCommandArgs;
|
|
473
493
|
init: InitCommandArgs;
|
|
494
|
+
status: StatusCommandArgs;
|
|
474
495
|
}
|
|
475
496
|
interface TailwindcssPatchCommandResultMap {
|
|
476
497
|
install: void;
|
|
477
498
|
extract: ExtractResult;
|
|
478
499
|
tokens: TailwindTokenReport;
|
|
479
500
|
init: void;
|
|
501
|
+
status: PatchStatusReport;
|
|
480
502
|
}
|
|
481
503
|
interface TailwindcssPatchCommandContext<TCommand extends TailwindcssPatchCommand> {
|
|
482
504
|
cli: CAC;
|
|
@@ -508,6 +530,13 @@ declare function createTailwindcssPatchCli(options?: TailwindcssPatchCliOptions)
|
|
|
508
530
|
|
|
509
531
|
declare function normalizeOptions(options?: TailwindcssPatchOptions): NormalizedTailwindcssPatchOptions;
|
|
510
532
|
|
|
533
|
+
interface PatchStatusContext {
|
|
534
|
+
packageInfo: PackageInfo;
|
|
535
|
+
options: NormalizedTailwindcssPatchOptions;
|
|
536
|
+
majorVersion: 2 | 3 | 4;
|
|
537
|
+
}
|
|
538
|
+
declare function getPatchStatusReport(context: PatchStatusContext): PatchStatusReport;
|
|
539
|
+
|
|
511
540
|
declare function collectClassesFromContexts(contexts: TailwindcssRuntimeContext[], filter: (className: string) => boolean): Set<string>;
|
|
512
541
|
declare function collectClassesFromTailwindV4(options: NormalizedTailwindcssPatchOptions): Promise<Set<string>>;
|
|
513
542
|
|
|
@@ -521,4 +550,4 @@ interface TailwindBuildOptions {
|
|
|
521
550
|
}
|
|
522
551
|
declare function runTailwindBuild(options: TailwindBuildOptions): Promise<postcss.Result<postcss.Root>>;
|
|
523
552
|
|
|
524
|
-
export { CacheStore, type CacheStrategy, type ExtractResult, type ILengthUnitsPatchOptions, type NormalizedTailwindcssPatchOptions, type TailwindPatchRuntime, type TailwindTokenByFileMap, type TailwindTokenFileKey, type TailwindTokenLocation, type TailwindTokenReport, type TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, type TailwindcssPatchOptions, TailwindcssPatcher, type TailwindcssRuntimeContext, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindcssPatchCli, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, groupTokensByFile, loadRuntimeContexts, logger, mountTailwindcssPatchCommands, normalizeOptions, runTailwindBuild, tailwindcssPatchCommands };
|
|
553
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkCGQTZTVOjs = require('./chunk-CGQTZTVO.js');
|
|
19
20
|
|
|
20
21
|
// src/index.ts
|
|
21
22
|
var _config = require('@tailwindcss-mangle/config');
|
|
@@ -37,4 +38,5 @@ var _config = require('@tailwindcss-mangle/config');
|
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
|
|
42
|
+
exports.CacheStore = _chunkCGQTZTVOjs.CacheStore; exports.TailwindcssPatcher = _chunkCGQTZTVOjs.TailwindcssPatcher; exports.collectClassesFromContexts = _chunkCGQTZTVOjs.collectClassesFromContexts; exports.collectClassesFromTailwindV4 = _chunkCGQTZTVOjs.collectClassesFromTailwindV4; exports.createTailwindcssPatchCli = _chunkCGQTZTVOjs.createTailwindcssPatchCli; exports.defineConfig = _config.defineConfig; exports.extractProjectCandidatesWithPositions = _chunkCGQTZTVOjs.extractProjectCandidatesWithPositions; exports.extractRawCandidates = _chunkCGQTZTVOjs.extractRawCandidates; exports.extractRawCandidatesWithPositions = _chunkCGQTZTVOjs.extractRawCandidatesWithPositions; exports.extractValidCandidates = _chunkCGQTZTVOjs.extractValidCandidates; exports.getPatchStatusReport = _chunkCGQTZTVOjs.getPatchStatusReport; exports.groupTokensByFile = _chunkCGQTZTVOjs.groupTokensByFile; exports.loadRuntimeContexts = _chunkCGQTZTVOjs.loadRuntimeContexts; exports.logger = _chunkCGQTZTVOjs.logger_default; exports.mountTailwindcssPatchCommands = _chunkCGQTZTVOjs.mountTailwindcssPatchCommands; exports.normalizeOptions = _chunkCGQTZTVOjs.normalizeOptions; exports.runTailwindBuild = _chunkCGQTZTVOjs.runTailwindBuild; exports.tailwindcssPatchCommands = _chunkCGQTZTVOjs.tailwindcssPatchCommands;
|
package/dist/index.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
extractRawCandidates,
|
|
9
9
|
extractRawCandidatesWithPositions,
|
|
10
10
|
extractValidCandidates,
|
|
11
|
+
getPatchStatusReport,
|
|
11
12
|
groupTokensByFile,
|
|
12
13
|
loadRuntimeContexts,
|
|
13
14
|
logger_default,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
normalizeOptions,
|
|
16
17
|
runTailwindBuild,
|
|
17
18
|
tailwindcssPatchCommands
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-V4NW4IGL.mjs";
|
|
19
20
|
|
|
20
21
|
// src/index.ts
|
|
21
22
|
import { defineConfig } from "@tailwindcss-mangle/config";
|
|
@@ -30,6 +31,7 @@ export {
|
|
|
30
31
|
extractRawCandidates,
|
|
31
32
|
extractRawCandidatesWithPositions,
|
|
32
33
|
extractValidCandidates,
|
|
34
|
+
getPatchStatusReport,
|
|
33
35
|
groupTokensByFile,
|
|
34
36
|
loadRuntimeContexts,
|
|
35
37
|
logger_default as logger,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwindcss-patch",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"description": "patch tailwindcss for exposing context and extract classes",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@babel/parser": "^7.28.5",
|
|
55
55
|
"@babel/traverse": "^7.28.5",
|
|
56
56
|
"@babel/types": "^7.28.5",
|
|
57
|
-
"@tailwindcss/node": "^4.1.
|
|
57
|
+
"@tailwindcss/node": "^4.1.18",
|
|
58
58
|
"cac": "^6.7.14",
|
|
59
59
|
"consola": "^3.4.2",
|
|
60
60
|
"fs-extra": "^11.3.2",
|
|
@@ -62,16 +62,16 @@
|
|
|
62
62
|
"pathe": "^2.0.3",
|
|
63
63
|
"postcss": "^8.5.6",
|
|
64
64
|
"semver": "^7.7.3",
|
|
65
|
-
"tailwindcss-config": "^1.1.
|
|
65
|
+
"tailwindcss-config": "^1.1.3",
|
|
66
66
|
"@tailwindcss-mangle/config": "6.1.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@tailwindcss/oxide": "^4.1.
|
|
70
|
-
"@tailwindcss/postcss": "^4.1.
|
|
71
|
-
"@tailwindcss/vite": "^4.1.
|
|
72
|
-
"tailwindcss": "^4.1.
|
|
73
|
-
"tailwindcss-3": "npm:tailwindcss@^3.4.
|
|
74
|
-
"tailwindcss-4": "npm:tailwindcss@^4.1.
|
|
69
|
+
"@tailwindcss/oxide": "^4.1.18",
|
|
70
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
71
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
72
|
+
"tailwindcss": "^4.1.18",
|
|
73
|
+
"tailwindcss-3": "npm:tailwindcss@^3.4.19",
|
|
74
|
+
"tailwindcss-4": "npm:tailwindcss@^4.1.18"
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"dev": "tsup --watch --sourcemap",
|