tailwind-styled-v4 5.0.11 → 5.0.13
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 +100 -4
- package/dist/{analyzeWorkspace-DDOQdzzI.d.ts → analyzeWorkspace-CopJNGmi.d.ts} +2 -0
- package/dist/{analyzeWorkspace-BS5O4rhC.d.mts → analyzeWorkspace-DpVPccjz.d.mts} +2 -0
- package/dist/analyzer.d.mts +4 -4
- package/dist/analyzer.d.ts +4 -4
- package/dist/analyzer.js +34 -69
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +33 -68
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.d.mts +4 -0
- package/dist/animate.d.ts +4 -0
- package/dist/animate.js +33 -11
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +33 -11
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +57 -6
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +57 -6
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +404 -190
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +401 -187
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +2700 -212
- package/dist/compiler.d.ts +2700 -212
- package/dist/compiler.js +1996 -503
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +1847 -448
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js +17 -4
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +17 -4
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.d.mts +11 -470
- package/dist/engine.d.ts +11 -470
- package/dist/engine.js +2777 -455
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +2776 -454
- package/dist/engine.mjs.map +1 -1
- package/dist/index-BDQw13kn.d.ts +464 -0
- package/dist/index-DJv28Uzq.d.mts +464 -0
- package/dist/index.browser.mjs +143 -255
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +23 -39
- package/dist/index.d.ts +23 -39
- package/dist/index.js +7234 -1400
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7234 -1400
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +44 -1
- package/dist/next.d.ts +44 -1
- package/dist/next.js +3224 -1065
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +3223 -1066
- package/dist/next.mjs.map +1 -1
- package/dist/rspack.d.mts +9 -0
- package/dist/rspack.d.ts +9 -0
- package/dist/rspack.js +99 -61
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +99 -61
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.d.mts +8 -0
- package/dist/runtime-css.d.ts +8 -0
- package/dist/runtime-css.js +23 -7
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +23 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/scanner.js +16 -37
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +15 -36
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +107 -1
- package/dist/shared.d.ts +107 -1
- package/dist/shared.js +3014 -466
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +3008 -445
- package/dist/shared.mjs.map +1 -1
- package/dist/svelte.js +39 -35
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +38 -34
- package/dist/svelte.mjs.map +1 -1
- package/dist/theme.js +85 -76
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +83 -74
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +2351 -187
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +2351 -187
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +404 -190
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +401 -187
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +2657 -320
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +2657 -320
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +39 -35
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +38 -34
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +190 -33
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +190 -33
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/index.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
- package/package.json +9 -4
- package/CHANGELOG.md +0 -285
package/dist/engine.d.ts
CHANGED
|
@@ -1,317 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-BDQw13kn.js';
|
|
2
|
+
export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-BDQw13kn.js';
|
|
3
|
+
import { z } from 'zod';
|
|
2
4
|
import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.js';
|
|
3
5
|
export { S as ScanFileResult } from './schemas-DR-SLxZZ.js';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
declare class RuleId {
|
|
7
|
-
readonly value: number;
|
|
8
|
-
constructor(value: number);
|
|
9
|
-
toString(): string;
|
|
10
|
-
}
|
|
11
|
-
declare class SelectorId {
|
|
12
|
-
readonly value: number;
|
|
13
|
-
constructor(value: number);
|
|
14
|
-
toString(): string;
|
|
15
|
-
}
|
|
16
|
-
declare class VariantChainId {
|
|
17
|
-
readonly value: number;
|
|
18
|
-
constructor(value: number);
|
|
19
|
-
toString(): string;
|
|
20
|
-
}
|
|
21
|
-
declare class PropertyId {
|
|
22
|
-
readonly value: number;
|
|
23
|
-
readonly name?: string | undefined;
|
|
24
|
-
constructor(value: number, name?: string | undefined);
|
|
25
|
-
toString(): string;
|
|
26
|
-
}
|
|
27
|
-
declare class ValueId {
|
|
28
|
-
readonly value: number;
|
|
29
|
-
readonly name?: string | undefined;
|
|
30
|
-
constructor(value: number, name?: string | undefined);
|
|
31
|
-
toString(): string;
|
|
32
|
-
}
|
|
33
|
-
declare class LayerId {
|
|
34
|
-
readonly value: number;
|
|
35
|
-
constructor(value: number);
|
|
36
|
-
toString(): string;
|
|
37
|
-
}
|
|
38
|
-
declare class ConditionId {
|
|
39
|
-
readonly value: number;
|
|
40
|
-
constructor(value: number);
|
|
41
|
-
toString(): string;
|
|
42
|
-
}
|
|
43
|
-
declare class CascadeResolutionId {
|
|
44
|
-
readonly value: number;
|
|
45
|
-
constructor(value: number);
|
|
46
|
-
toString(): string;
|
|
47
|
-
}
|
|
48
|
-
declare enum Origin {
|
|
49
|
-
UserAgent = 0,
|
|
50
|
-
UserNormal = 1,
|
|
51
|
-
AuthorNormal = 2,
|
|
52
|
-
AuthorImportant = 3,
|
|
53
|
-
UserImportant = 4
|
|
54
|
-
}
|
|
55
|
-
declare enum Importance {
|
|
56
|
-
Normal = 0,
|
|
57
|
-
Important = 1
|
|
58
|
-
}
|
|
59
|
-
declare enum ConditionResult {
|
|
60
|
-
Active = 0,
|
|
61
|
-
Inactive = 1,
|
|
62
|
-
Unknown = 2
|
|
63
|
-
}
|
|
64
|
-
declare enum CascadeStage {
|
|
65
|
-
Origin = 0,
|
|
66
|
-
Layer = 1,
|
|
67
|
-
Importance = 2,
|
|
68
|
-
Specificity = 3,
|
|
69
|
-
Order = 4
|
|
70
|
-
}
|
|
71
|
-
type ResolutionCause = {
|
|
72
|
-
type: "LowerOrigin";
|
|
73
|
-
winnerOrigin: Origin;
|
|
74
|
-
loserOrigin: Origin;
|
|
75
|
-
} | {
|
|
76
|
-
type: "LowerLayer";
|
|
77
|
-
winnerLayer: string;
|
|
78
|
-
loserLayer: string;
|
|
79
|
-
} | {
|
|
80
|
-
type: "LowerImportance";
|
|
81
|
-
} | {
|
|
82
|
-
type: "LowerSpecificity";
|
|
83
|
-
delta: number;
|
|
84
|
-
} | {
|
|
85
|
-
type: "EarlierOrder";
|
|
86
|
-
delta: number;
|
|
87
|
-
} | {
|
|
88
|
-
type: "InactiveCondition";
|
|
89
|
-
condition: string;
|
|
90
|
-
};
|
|
91
|
-
interface ResolutionReason {
|
|
92
|
-
causes: readonly ResolutionCause[];
|
|
93
|
-
finalDecision: string;
|
|
94
|
-
}
|
|
95
|
-
interface SelectorIR {
|
|
96
|
-
id: SelectorId;
|
|
97
|
-
normalized: string;
|
|
98
|
-
specificity: number;
|
|
99
|
-
parts: readonly string[];
|
|
100
|
-
}
|
|
101
|
-
interface VariantChainIR {
|
|
102
|
-
id: VariantChainId;
|
|
103
|
-
chain: readonly VariantChainId[];
|
|
104
|
-
conditionGraphId: number | null;
|
|
105
|
-
}
|
|
106
|
-
interface ConditionIR {
|
|
107
|
-
id: ConditionId;
|
|
108
|
-
conditionType: string;
|
|
109
|
-
expression: string;
|
|
110
|
-
}
|
|
111
|
-
interface RuleIR {
|
|
112
|
-
id: RuleId;
|
|
113
|
-
selector: SelectorId;
|
|
114
|
-
variantChain: VariantChainId;
|
|
115
|
-
property: PropertyId;
|
|
116
|
-
value: ValueId;
|
|
117
|
-
origin: Origin;
|
|
118
|
-
importance: Importance;
|
|
119
|
-
layer: LayerId | null;
|
|
120
|
-
layerOrder: number;
|
|
121
|
-
specificity: number;
|
|
122
|
-
condition: ConditionId | null;
|
|
123
|
-
conditionResult: ConditionResult;
|
|
124
|
-
insertionOrder: number;
|
|
125
|
-
fingerprint: string;
|
|
126
|
-
source: SourceLocation;
|
|
127
|
-
}
|
|
128
|
-
interface PropertyBucketIR {
|
|
129
|
-
property: PropertyId;
|
|
130
|
-
rules: readonly RuleId[];
|
|
131
|
-
}
|
|
132
|
-
interface CascadeResolutionIR {
|
|
133
|
-
id: CascadeResolutionId;
|
|
134
|
-
property: PropertyId;
|
|
135
|
-
winner: RuleId;
|
|
136
|
-
losers: readonly RuleId[];
|
|
137
|
-
reason: ResolutionReason;
|
|
138
|
-
stage: CascadeStage;
|
|
139
|
-
}
|
|
140
|
-
interface StyleGraphIR {
|
|
141
|
-
ruleConflicts: Map<RuleId, readonly RuleId[]>;
|
|
142
|
-
}
|
|
143
|
-
interface FinalComputedStyleIR {
|
|
144
|
-
className: string;
|
|
145
|
-
resolvedProperties: Map<PropertyId, CascadeResolutionId>;
|
|
146
|
-
}
|
|
147
|
-
interface SourceLocation {
|
|
148
|
-
file: string;
|
|
149
|
-
line: number;
|
|
150
|
-
column: number;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Generate a short fingerprint string from a list of ordered parts.
|
|
154
|
-
*
|
|
155
|
-
* Hot path — called on every class conflict check and IR node creation.
|
|
156
|
-
* Delegates to Rust `create_fingerprint()` (FNV-1a, base-36 output) when the
|
|
157
|
-
* native binding is available; falls back to the pure-JS djb2 variant otherwise.
|
|
158
|
-
*/
|
|
159
|
-
declare function createFingerprint(parts: string[]): string;
|
|
160
|
-
declare function createResolutionReason(causes: ResolutionCause[], finalDecision: string): ResolutionReason;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* tailwind-styled-v4 — Cascade Resolver
|
|
164
|
-
*
|
|
165
|
-
* JS layer: state management (rule collection, class registration).
|
|
166
|
-
* Rust layer: cascade algorithm (sort, compare, resolve winner/loser).
|
|
167
|
-
*
|
|
168
|
-
* Moved to native: compareCascade, resolveProperty, buildResolutionReason,
|
|
169
|
-
* determineCascadeStage — all pure computation, zero browser API.
|
|
170
|
-
*
|
|
171
|
-
* Rust #[napi] fn: resolve_cascade(rules_json: String) -> String
|
|
172
|
-
*/
|
|
173
|
-
|
|
174
|
-
declare class CascadeResolver {
|
|
175
|
-
private readonly rules;
|
|
176
|
-
private readonly classRules;
|
|
177
|
-
private readonly styleGraph;
|
|
178
|
-
addRule(rule: RuleIR): void;
|
|
179
|
-
addRules(rules: RuleIR[]): void;
|
|
180
|
-
registerClass(className: string, ruleIds: RuleId[]): void;
|
|
181
|
-
getRule(ruleId: RuleId): RuleIR | undefined;
|
|
182
|
-
getClassRules(className: string): RuleId[] | undefined;
|
|
183
|
-
getStyleGraph(): StyleGraphIR;
|
|
184
|
-
/**
|
|
185
|
-
* Resolve cascade for a specific class.
|
|
186
|
-
* Delegates sort + winner selection to Rust.
|
|
187
|
-
*/
|
|
188
|
-
resolveByClassName(className: string): {
|
|
189
|
-
resolvedProperties: Map<PropertyId, CascadeResolutionIR>;
|
|
190
|
-
} | null;
|
|
191
|
-
/**
|
|
192
|
-
* Resolve cascade for all rules.
|
|
193
|
-
* Delegates sort + winner selection to Rust.
|
|
194
|
-
*/
|
|
195
|
-
resolveAllProperties(): Map<PropertyId, CascadeResolutionIR>;
|
|
196
|
-
/**
|
|
197
|
-
* Resolve cascade for a specific set of rule IDs.
|
|
198
|
-
*/
|
|
199
|
-
resolveForClass(classRuleIds: RuleId[]): Map<PropertyId, CascadeResolutionIR>;
|
|
200
|
-
/**
|
|
201
|
-
* Resolve cascade for a single property bucket.
|
|
202
|
-
*/
|
|
203
|
-
resolveProperty(property: PropertyId): CascadeResolutionIR | null;
|
|
204
|
-
getResolution(_id: CascadeResolutionId): CascadeResolutionIR | undefined;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* tailwind-styled-v4 — Cascade Tracer
|
|
209
|
-
*
|
|
210
|
-
* Delegates cascade resolution to CascadeResolver (Rust-backed).
|
|
211
|
-
* JS layer: format trace output only.
|
|
212
|
-
*
|
|
213
|
-
* Removed from JS: resolvePropertyTraced, compareCascadeTraced,
|
|
214
|
-
* buildResolutionReasonTraced, determineCascadeStageTraced.
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
interface VariantTrace {
|
|
218
|
-
name: string;
|
|
219
|
-
value: string;
|
|
220
|
-
source: SourceLocation;
|
|
221
|
-
}
|
|
222
|
-
interface RuleTrace {
|
|
223
|
-
property: string;
|
|
224
|
-
value: string;
|
|
225
|
-
applied: boolean;
|
|
226
|
-
reason: string | null;
|
|
227
|
-
source: SourceLocation;
|
|
228
|
-
specificity: number;
|
|
229
|
-
}
|
|
230
|
-
interface ConflictTrace {
|
|
231
|
-
property: string;
|
|
232
|
-
winner: string;
|
|
233
|
-
loser: string;
|
|
234
|
-
stage: string;
|
|
235
|
-
causes: string[];
|
|
236
|
-
}
|
|
237
|
-
interface FinalStyleProperty {
|
|
238
|
-
property: string;
|
|
239
|
-
value: string;
|
|
240
|
-
}
|
|
241
|
-
interface TraceResult {
|
|
242
|
-
class: string;
|
|
243
|
-
definedAt: SourceLocation;
|
|
244
|
-
variants: VariantTrace[];
|
|
245
|
-
rules: RuleTrace[];
|
|
246
|
-
conflicts: ConflictTrace[];
|
|
247
|
-
finalStyle: FinalStyleProperty[];
|
|
248
|
-
}
|
|
249
|
-
interface ProvenanceData {
|
|
250
|
-
className: string;
|
|
251
|
-
source: SourceLocation;
|
|
252
|
-
variants: Map<string, VariantTrace>;
|
|
253
|
-
rules: Map<string, RuleIR[]>;
|
|
254
|
-
}
|
|
255
|
-
declare function buildProvenanceChain(className: string): ProvenanceData;
|
|
256
|
-
declare function trace(className: string, resolver: CascadeResolver): TraceResult;
|
|
257
|
-
|
|
258
|
-
interface EngineMetricsSnapshot {
|
|
259
|
-
eventsReceived: number;
|
|
260
|
-
eventsProcessed: number;
|
|
261
|
-
batchesProcessed: number;
|
|
262
|
-
incrementalUpdates: number;
|
|
263
|
-
fullRescans: number;
|
|
264
|
-
skippedLargeFiles: number;
|
|
265
|
-
queueMaxSize: number;
|
|
266
|
-
lastBuildMs: number;
|
|
267
|
-
avgBuildMs: number;
|
|
268
|
-
}
|
|
269
|
-
declare class EngineMetricsCollector {
|
|
270
|
-
private eventsReceived;
|
|
271
|
-
private eventsProcessed;
|
|
272
|
-
private batchesProcessed;
|
|
273
|
-
private incrementalUpdates;
|
|
274
|
-
private fullRescans;
|
|
275
|
-
private skippedLargeFiles;
|
|
276
|
-
private queueMaxSize;
|
|
277
|
-
private lastBuildMs;
|
|
278
|
-
private totalBuildMs;
|
|
279
|
-
markEventReceived(queueSize: number): void;
|
|
280
|
-
markBatchProcessed(batchSize: number): void;
|
|
281
|
-
markIncremental(): void;
|
|
282
|
-
markFullRescan(): void;
|
|
283
|
-
markSkippedLargeFile(): void;
|
|
284
|
-
markBuildDuration(ms: number): void;
|
|
285
|
-
snapshot(): EngineMetricsSnapshot;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
interface EnginePluginContext {
|
|
289
|
-
root: string;
|
|
290
|
-
timestamp: number;
|
|
291
|
-
}
|
|
292
|
-
interface EngineWatchContext {
|
|
293
|
-
root: string;
|
|
294
|
-
timestamp: number;
|
|
295
|
-
}
|
|
296
|
-
interface EnginePlugin {
|
|
297
|
-
name: string;
|
|
298
|
-
beforeScan?(context: EnginePluginContext): void | Promise<void>;
|
|
299
|
-
afterScan?(scan: ScanWorkspaceResult, context: EnginePluginContext): ScanWorkspaceResult | undefined | Promise<ScanWorkspaceResult | undefined>;
|
|
300
|
-
transformClasses?(classes: string[], context: EnginePluginContext): string[] | undefined | Promise<string[] | undefined>;
|
|
301
|
-
beforeBuild?(scan: ScanWorkspaceResult, context: EnginePluginContext): void | Promise<void>;
|
|
302
|
-
afterBuild?(result: BuildResult, context: EnginePluginContext): BuildResult | undefined | Promise<BuildResult | undefined>;
|
|
303
|
-
onError?(error: Error, context: EnginePluginContext): void | Promise<void>;
|
|
304
|
-
beforeWatch?(context: EngineWatchContext): void | Promise<void>;
|
|
305
|
-
afterWatch?(context: EngineWatchContext): void | Promise<void>;
|
|
306
|
-
}
|
|
307
|
-
declare function runBeforeScan(plugins: EnginePlugin[], context: EnginePluginContext): Promise<void>;
|
|
308
|
-
declare function runAfterScan(plugins: EnginePlugin[], scan: ScanWorkspaceResult, context: EnginePluginContext): Promise<ScanWorkspaceResult>;
|
|
309
|
-
declare function runTransformClasses(plugins: EnginePlugin[], classes: string[], context: EnginePluginContext): Promise<string[]>;
|
|
310
|
-
declare function runBeforeBuild(plugins: EnginePlugin[], scan: ScanWorkspaceResult, context: EnginePluginContext): Promise<void>;
|
|
311
|
-
declare function runAfterBuild(plugins: EnginePlugin[], result: BuildResult, context: EnginePluginContext): Promise<BuildResult>;
|
|
312
|
-
declare function runOnError(plugins: EnginePlugin[], error: Error, context: EnginePluginContext): Promise<void>;
|
|
313
|
-
declare function runBeforeWatch(plugins: EnginePlugin[], context: EngineWatchContext): Promise<void>;
|
|
314
|
-
declare function runAfterWatch(plugins: EnginePlugin[], context: EngineWatchContext): Promise<void>;
|
|
6
|
+
import './analyzeWorkspace-CopJNGmi.js';
|
|
315
7
|
|
|
316
8
|
interface ClassBundleInfo {
|
|
317
9
|
className: string;
|
|
@@ -440,11 +132,13 @@ declare class ReverseLookup {
|
|
|
440
132
|
/**
|
|
441
133
|
* tailwind-styled-v4 — CSS → IR converter
|
|
442
134
|
*
|
|
443
|
-
* Native handles: CSS parsing, class extraction, variant splitting, specificity
|
|
444
|
-
*
|
|
135
|
+
* Native handles: CSS parsing, class extraction, variant splitting, specificity,
|
|
136
|
+
* ID assignment, fingerprinting, layer detection, IR assembly.
|
|
137
|
+
* JS handles: Typed ID wrapper construction, RuleIR object shape.
|
|
445
138
|
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
139
|
+
* ## Migration summary (Priority 1)
|
|
140
|
+
* Sebelum: `parseCssRules()` + JS loop (N × NAPI calls untuk fingerprint + propertyId + valueId)
|
|
141
|
+
* Sesudah: `assembleCssIr()` → satu NAPI call, JS hanya wrap angka ke typed objects
|
|
448
142
|
*/
|
|
449
143
|
|
|
450
144
|
interface ParseCssToIrOptions {
|
|
@@ -580,157 +274,4 @@ declare const parseEngineWatchOptions: (options: unknown) => {
|
|
|
580
274
|
largeFileThreshold?: number | undefined;
|
|
581
275
|
};
|
|
582
276
|
|
|
583
|
-
|
|
584
|
-
root?: string;
|
|
585
|
-
scanner?: ScanWorkspaceOptions;
|
|
586
|
-
compileCss?: boolean;
|
|
587
|
-
tailwindConfigPath?: string;
|
|
588
|
-
plugins?: EnginePlugin[];
|
|
589
|
-
/** Enable analyzer integration - provides semantic report (unused classes, conflicts). Default: false */
|
|
590
|
-
analyze?: boolean;
|
|
591
|
-
}
|
|
592
|
-
interface EngineWatchOptions {
|
|
593
|
-
debounceMs?: number;
|
|
594
|
-
maxEventsPerFlush?: number;
|
|
595
|
-
largeFileThreshold?: number;
|
|
596
|
-
}
|
|
597
|
-
interface BuildResult {
|
|
598
|
-
scan: ScanWorkspaceResult;
|
|
599
|
-
mergedClassList: string;
|
|
600
|
-
css: string;
|
|
601
|
-
/** Analyzer semantic report - present when analyze: true in options */
|
|
602
|
-
analysis?: {
|
|
603
|
-
unusedClasses: string[];
|
|
604
|
-
classConflicts: Array<{
|
|
605
|
-
className: string;
|
|
606
|
-
files: string[];
|
|
607
|
-
classes?: string[];
|
|
608
|
-
message?: string;
|
|
609
|
-
}>;
|
|
610
|
-
classUsage: Record<string, number>;
|
|
611
|
-
semantic?: AnalyzerSemanticReport;
|
|
612
|
-
report: AnalyzerReport;
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
type EngineBuildWatchEventType = "initial" | "change" | "unlink" | "full-rescan";
|
|
616
|
-
type EngineWatchEvent = {
|
|
617
|
-
type: EngineBuildWatchEventType;
|
|
618
|
-
filePath?: string;
|
|
619
|
-
result: BuildResult;
|
|
620
|
-
metrics?: EngineMetricsSnapshot;
|
|
621
|
-
} | {
|
|
622
|
-
type: "error";
|
|
623
|
-
filePath?: string;
|
|
624
|
-
error: string;
|
|
625
|
-
metrics?: EngineMetricsSnapshot;
|
|
626
|
-
};
|
|
627
|
-
interface TailwindStyledEngine {
|
|
628
|
-
scan(): Promise<ScanWorkspaceResult>;
|
|
629
|
-
scanWorkspace(): Promise<ScanWorkspaceResult>;
|
|
630
|
-
analyzeWorkspace(): Promise<Awaited<ReturnType<typeof analyzeWorkspace$1>>>;
|
|
631
|
-
generateSafelist(): Promise<string[]>;
|
|
632
|
-
build(): Promise<BuildResult>;
|
|
633
|
-
watch(onEvent: (event: EngineWatchEvent) => void, options?: EngineWatchOptions): Promise<{
|
|
634
|
-
close(): void;
|
|
635
|
-
}>;
|
|
636
|
-
}
|
|
637
|
-
declare function createEngine(rawOptions?: EngineOptions): Promise<TailwindStyledEngine>;
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* Scan workspace dan return hasil scan.
|
|
641
|
-
* Facade tipis di atas scanWorkspaceAsync dari @tailwind-styled/scanner.
|
|
642
|
-
*
|
|
643
|
-
* @example
|
|
644
|
-
* const result = await scanWorkspace({ root: "./src" })
|
|
645
|
-
* console.log(result.uniqueClasses)
|
|
646
|
-
*/
|
|
647
|
-
declare function scanWorkspace(opts?: {
|
|
648
|
-
root?: string;
|
|
649
|
-
extensions?: string[];
|
|
650
|
-
ignoreDirectories?: string[];
|
|
651
|
-
}): Promise<ScanWorkspaceResult>;
|
|
652
|
-
/**
|
|
653
|
-
* Analyze workspace — scan + analyze classes.
|
|
654
|
-
* Facade di atas runWorkspaceAnalysis.
|
|
655
|
-
*
|
|
656
|
-
* @example
|
|
657
|
-
* const report = await analyzeWorkspace({ root: "./src" })
|
|
658
|
-
* console.log(report.topClasses)
|
|
659
|
-
*/
|
|
660
|
-
declare function analyzeWorkspace(opts?: {
|
|
661
|
-
root?: string;
|
|
662
|
-
top?: number;
|
|
663
|
-
}): Promise<Awaited<ReturnType<typeof analyzeWorkspace$1>>>;
|
|
664
|
-
/**
|
|
665
|
-
* Generate safelist dari scan result.
|
|
666
|
-
* Berguna untuk Tailwind config safelist generation.
|
|
667
|
-
*
|
|
668
|
-
* @example
|
|
669
|
-
* const safelist = await generateSafelist({ root: "./src" })
|
|
670
|
-
* // Pakai di tailwind.config.ts: { safelist }
|
|
671
|
-
*/
|
|
672
|
-
declare function generateSafelist(opts?: {
|
|
673
|
-
root?: string;
|
|
674
|
-
}): Promise<string[]>;
|
|
675
|
-
/**
|
|
676
|
-
* Build CSS dari scan result.
|
|
677
|
-
* One-shot build tanpa watch mode.
|
|
678
|
-
*
|
|
679
|
-
* @example
|
|
680
|
-
* const result = await build({ root: "./src" })
|
|
681
|
-
* fs.writeFileSync("dist/tailwind.css", result.css)
|
|
682
|
-
*/
|
|
683
|
-
declare function build(opts?: EngineOptions): Promise<{
|
|
684
|
-
css: string;
|
|
685
|
-
classes: string[];
|
|
686
|
-
totalFiles: number;
|
|
687
|
-
}>;
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* High-level trace API — satu entry point untuk semua tooling.
|
|
691
|
-
*
|
|
692
|
-
* Dipakai oleh:
|
|
693
|
-
* - CLI: `tw trace <class>`
|
|
694
|
-
* - DevTools: TracePanel fetch
|
|
695
|
-
* - Dashboard: trace endpoint
|
|
696
|
-
*
|
|
697
|
-
* @example
|
|
698
|
-
* const result = await traceClass("flex", scanResult, cssString)
|
|
699
|
-
* console.log(result.finalStyle) // [{ property: "display", value: "flex" }]
|
|
700
|
-
*/
|
|
701
|
-
declare function traceClass(className: string, scanResult: ScanWorkspaceResult, css: string): Promise<TraceResult | null>;
|
|
702
|
-
/**
|
|
703
|
-
* Trace multiple classes at once — for batch inspection.
|
|
704
|
-
*/
|
|
705
|
-
declare function traceClasses(classNames: string[], scanResult: ScanWorkspaceResult, css: string): Promise<Map<string, TraceResult>>;
|
|
706
|
-
interface InspectionReport {
|
|
707
|
-
className: string;
|
|
708
|
-
/** CSS rules yang dihasilkan */
|
|
709
|
-
css: string;
|
|
710
|
-
/** Properties yang di-set */
|
|
711
|
-
properties: Array<{
|
|
712
|
-
property: string;
|
|
713
|
-
value: string;
|
|
714
|
-
}>;
|
|
715
|
-
/** Classes yang berkonflik dengan ini */
|
|
716
|
-
conflicts: string[];
|
|
717
|
-
/** Files yang menggunakan class ini */
|
|
718
|
-
usedIn: string[];
|
|
719
|
-
/** Risk level untuk removal */
|
|
720
|
-
risk: "low" | "medium" | "high";
|
|
721
|
-
/** Estimated bundle contribution */
|
|
722
|
-
bundleBytes: number;
|
|
723
|
-
}
|
|
724
|
-
/**
|
|
725
|
-
* Inspect a single class — gabungan trace + impact + usage.
|
|
726
|
-
* Reusable surface untuk CLI (`tw why`), DevTools panel, dashboard endpoint.
|
|
727
|
-
*
|
|
728
|
-
* @example
|
|
729
|
-
* const report = await inspectClass("flex", scanResult, cssString)
|
|
730
|
-
* console.log(report.properties) // [{ property: "display", value: "flex" }]
|
|
731
|
-
* console.log(report.usedIn) // ["src/Button.tsx", "src/Card.tsx"]
|
|
732
|
-
* console.log(report.risk) // "low"
|
|
733
|
-
*/
|
|
734
|
-
declare function inspectClass(className: string, scanResult: ScanWorkspaceResult, css?: string): Promise<InspectionReport>;
|
|
735
|
-
|
|
736
|
-
export { type BuildResult, type BuildResultInput, BuildResultSchema, type BundleAnalysisResult, BundleAnalyzer, type CascadeResolutionIR, CascadeResolutionId, CascadeResolver, CascadeStage, type ClassBundleInfo, type ClassUsage, type ComponentImpact, type ConditionIR, ConditionId, ConditionResult, type ConflictTrace, EngineMetricsCollector, type EngineMetricsSnapshot, type EngineOptions, type EngineOptionsInput, EngineOptionsSchema, type EnginePlugin, type EnginePluginContext, type EngineWatchContext, type EngineWatchEvent, type EngineWatchOptions, type EngineWatchOptionsInput, EngineWatchOptionsSchema, type FinalComputedStyleIR, type FinalStyleProperty, type ImpactReport, ImpactTracker, Importance, type InspectionReport, LayerId, Origin, type PropertyBucketIR, PropertyId, type ResolutionCause, type ResolutionReason, ReverseLookup, type ReverseLookupResult, type RuleIR, RuleId, type RuleTrace, ScanWorkspaceOptions, ScanWorkspaceResult, type SelectorIR, SelectorId, type SourceLocation, type StyleGraphIR, type TailwindStyledEngine, type TraceResult, ValueId, type VariantChainIR, VariantChainId, type VariantTrace, type WatchCallback, type WatchEvent, type WatchEventKind, type WatchHandle, type WorkspaceWatcher, analyzeWorkspace, applyIncrementalChange, build, buildProvenanceChain, createEngine, createFingerprint, createResolutionReason, generateSafelist, inspectClass, parseCssToIr, parseEngineOptions, parseEngineWatchOptions, runAfterBuild, runAfterScan, runAfterWatch, runBeforeBuild, runBeforeScan, runBeforeWatch, runOnError, runTransformClasses, scanWorkspace, trace, traceClass, traceClasses, watchWorkspace$1 as watchWorkspaceLegacy, watchWorkspace as watchWorkspaceNative };
|
|
277
|
+
export { type BuildResultInput, BuildResultSchema, type BundleAnalysisResult, BundleAnalyzer, type ClassBundleInfo, type ClassUsage, type ComponentImpact, type EngineOptionsInput, EngineOptionsSchema, EnginePlugin, type EngineWatchOptionsInput, EngineWatchOptionsSchema, type ImpactReport, ImpactTracker, ReverseLookup, type ReverseLookupResult, RuleIR, RuleId, ScanWorkspaceOptions, ScanWorkspaceResult, SourceLocation, type WatchCallback, type WatchEvent, type WatchEventKind, type WatchHandle, type WorkspaceWatcher, applyIncrementalChange, parseCssToIr, parseEngineOptions, parseEngineWatchOptions, watchWorkspace$1 as watchWorkspaceLegacy, watchWorkspace as watchWorkspaceNative };
|