tailwindcss-patch 2.0.5 → 2.1.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/cli.cjs +46 -0
- package/dist/cli.mjs +20 -13
- package/dist/{chunk-PZNRLYGX.mjs → index.cjs} +180 -253
- package/dist/index.mjs +522 -63
- package/package.json +4 -20
- package/dist/cli.d.mts +0 -2
- package/dist/cli.js +0 -643
- package/dist/index.d.mts +0 -149
- package/dist/index.js +0 -661
package/dist/index.d.mts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { Rule, Node } from 'postcss';
|
|
2
|
-
import { Config } from 'tailwindcss';
|
|
3
|
-
import { UserConfig } from '@tailwindcss-mangle/config';
|
|
4
|
-
export * from '@tailwindcss-mangle/config';
|
|
5
|
-
import { SyncOpts } from 'resolve';
|
|
6
|
-
|
|
7
|
-
type CacheStrategy = 'merge' | 'overwrite';
|
|
8
|
-
interface CacheOptions {
|
|
9
|
-
dir?: string;
|
|
10
|
-
cwd?: string;
|
|
11
|
-
file?: string;
|
|
12
|
-
strategy?: CacheStrategy;
|
|
13
|
-
}
|
|
14
|
-
type InternalCacheOptions = CacheOptions & {
|
|
15
|
-
enable?: boolean;
|
|
16
|
-
};
|
|
17
|
-
interface PatchOptions {
|
|
18
|
-
overwrite?: boolean;
|
|
19
|
-
paths?: string[];
|
|
20
|
-
basedir?: string;
|
|
21
|
-
custom?: (dir: string, ctx: Record<string, any>) => void;
|
|
22
|
-
}
|
|
23
|
-
interface InternalPatchOptions {
|
|
24
|
-
overwrite: boolean;
|
|
25
|
-
paths?: string[];
|
|
26
|
-
basedir?: string;
|
|
27
|
-
custom?: (dir: string, ctx: Record<string, any>) => void;
|
|
28
|
-
version?: string;
|
|
29
|
-
}
|
|
30
|
-
interface TailwindcssPatcherOptions {
|
|
31
|
-
cache?: CacheOptions | boolean;
|
|
32
|
-
patch?: PatchOptions;
|
|
33
|
-
}
|
|
34
|
-
type TailwindcssClassCache = Map<string, ({
|
|
35
|
-
layer: string;
|
|
36
|
-
options: Record<string, any>;
|
|
37
|
-
sort: Record<string, any>;
|
|
38
|
-
} | Rule)[]>;
|
|
39
|
-
type TailwindcssRuntimeContext = {
|
|
40
|
-
applyClassCache: Map<any, any>;
|
|
41
|
-
candidateRuleCache: Map<string | string, Set<[
|
|
42
|
-
{
|
|
43
|
-
arbitrary: any;
|
|
44
|
-
index: any;
|
|
45
|
-
layer: string;
|
|
46
|
-
options: any[];
|
|
47
|
-
parallelIndex: any;
|
|
48
|
-
parentLayer: string;
|
|
49
|
-
variants: any;
|
|
50
|
-
},
|
|
51
|
-
Node
|
|
52
|
-
]>>;
|
|
53
|
-
candidateRuleMap: Map<string | string, [object, Node][]>;
|
|
54
|
-
changedContent: any[];
|
|
55
|
-
classCache: TailwindcssClassCache;
|
|
56
|
-
disposables: any[];
|
|
57
|
-
getClassList: Function;
|
|
58
|
-
getClassOrder: Function;
|
|
59
|
-
getVariants: Function;
|
|
60
|
-
markInvalidUtilityCandidate: Function;
|
|
61
|
-
markInvalidUtilityNode: Function;
|
|
62
|
-
notClassCache: Set<string>;
|
|
63
|
-
offsets: {
|
|
64
|
-
layerPositions: object;
|
|
65
|
-
offsets: object;
|
|
66
|
-
reservedVariantBits: any;
|
|
67
|
-
variantOffsets: Map<string, any>;
|
|
68
|
-
};
|
|
69
|
-
postCssNodeCache: Map<object, [Node]>;
|
|
70
|
-
ruleCache: Set<[object, Node]>;
|
|
71
|
-
stylesheetCache: Record<string, Set<any>>;
|
|
72
|
-
tailwindConfig: Config;
|
|
73
|
-
userConfigPath: string | null;
|
|
74
|
-
variantMap: Map<string, [[object, Function]]>;
|
|
75
|
-
variantOptions: Map<string, object>;
|
|
76
|
-
};
|
|
77
|
-
type DeepRequired<T> = {
|
|
78
|
-
[K in keyof T]: Required<DeepRequired<T[K]>>;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
declare function getCacheOptions(options?: CacheOptions | boolean): InternalCacheOptions;
|
|
82
|
-
declare class CacheManager {
|
|
83
|
-
options: Required<CacheOptions> & {
|
|
84
|
-
filename: string;
|
|
85
|
-
};
|
|
86
|
-
constructor(options?: CacheOptions);
|
|
87
|
-
mkdir(cacheDirectory: string): string;
|
|
88
|
-
getOptions(options?: CacheOptions): Required<CacheOptions> & {
|
|
89
|
-
filename: string;
|
|
90
|
-
};
|
|
91
|
-
write(data: Set<string>): string | undefined;
|
|
92
|
-
read(): Set<string> | undefined;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare class TailwindcssPatcher {
|
|
96
|
-
rawOptions: TailwindcssPatcherOptions;
|
|
97
|
-
cacheOptions: InternalCacheOptions;
|
|
98
|
-
patchOptions: InternalPatchOptions;
|
|
99
|
-
patch: () => void;
|
|
100
|
-
cacheManager: CacheManager;
|
|
101
|
-
constructor(options?: TailwindcssPatcherOptions);
|
|
102
|
-
getPkgEntry(basedir?: string): string;
|
|
103
|
-
setCache(set: Set<string>): string | undefined;
|
|
104
|
-
getCache(): Set<string> | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
|
|
107
|
-
* 详见 taro weapp-tailwindcss 独立分包
|
|
108
|
-
* @param basedir
|
|
109
|
-
* @returns
|
|
110
|
-
*/
|
|
111
|
-
getClassSet(options?: {
|
|
112
|
-
basedir?: string;
|
|
113
|
-
cacheStrategy?: CacheStrategy;
|
|
114
|
-
removeUniversalSelector?: boolean;
|
|
115
|
-
}): Set<string>;
|
|
116
|
-
getContexts(basedir?: string): TailwindcssRuntimeContext[];
|
|
117
|
-
extract(options: UserConfig['patch']): Promise<string | undefined>;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
declare function getTailwindcssEntry(basedir?: string): string;
|
|
121
|
-
declare function getContexts(basedir?: string): TailwindcssRuntimeContext[];
|
|
122
|
-
declare function getClassCaches(basedir?: string): TailwindcssClassCache[];
|
|
123
|
-
declare function getClassCacheSet(basedir?: string, options?: {
|
|
124
|
-
removeUniversalSelector?: boolean;
|
|
125
|
-
}): Set<string>;
|
|
126
|
-
|
|
127
|
-
declare function inspectProcessTailwindFeaturesReturnContext(content: string): {
|
|
128
|
-
code: string;
|
|
129
|
-
hasPatched: boolean;
|
|
130
|
-
};
|
|
131
|
-
declare function inspectPostcssPlugin(content: string): {
|
|
132
|
-
code: string;
|
|
133
|
-
hasPatched: boolean;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
declare function getInstalledPkgJsonPath(options?: PatchOptions): string | undefined;
|
|
137
|
-
declare function getPatchOptions(options?: PatchOptions): InternalPatchOptions;
|
|
138
|
-
declare function createPatch(opt: InternalPatchOptions): () => any;
|
|
139
|
-
declare function monkeyPatchForExposingContext(twDir: string, opt: InternalPatchOptions): {
|
|
140
|
-
processTailwindFeatures?: string | undefined;
|
|
141
|
-
plugin?: string | undefined;
|
|
142
|
-
} & Record<string, any>;
|
|
143
|
-
declare function internalPatch(pkgJsonPath: string | undefined, options: InternalPatchOptions): any | undefined;
|
|
144
|
-
|
|
145
|
-
declare function ensureFileContent(filepaths: string | string[]): string | undefined;
|
|
146
|
-
declare function requireResolve(id: string, opts?: SyncOpts): string;
|
|
147
|
-
declare function ensureDir(p: string): Promise<void>;
|
|
148
|
-
|
|
149
|
-
export { CacheManager, CacheOptions, CacheStrategy, DeepRequired, InternalCacheOptions, InternalPatchOptions, PatchOptions, TailwindcssClassCache, TailwindcssPatcher, TailwindcssPatcherOptions, TailwindcssRuntimeContext, createPatch, ensureDir, ensureFileContent, getCacheOptions, getClassCacheSet, getClassCaches, getContexts, getInstalledPkgJsonPath, getPatchOptions, getTailwindcssEntry, inspectPostcssPlugin, inspectProcessTailwindFeaturesReturnContext, internalPatch, monkeyPatchForExposingContext, requireResolve };
|