tailwind-styled-v4 5.0.12 → 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/animate.d.mts +4 -0
- package/dist/animate.d.ts +4 -0
- package/dist/animate.js +22 -0
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +22 -0
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +42 -0
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +42 -0
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +142 -0
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +142 -0
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +1045 -991
- package/dist/compiler.d.ts +1045 -991
- package/dist/compiler.js +888 -922
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +873 -908
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.js +1637 -340
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +1636 -339
- package/dist/engine.mjs.map +1 -1
- package/dist/index.js +1636 -339
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1636 -339
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +1060 -970
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +1060 -970
- package/dist/next.mjs.map +1 -1
- package/dist/shared.js +1607 -310
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +1607 -310
- package/dist/shared.mjs.map +1 -1
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/turbopackLoader.js +1610 -313
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +1610 -313
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +142 -0
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +142 -0
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +1622 -325
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +1622 -325
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +66 -15
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +66 -15
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/turbopackLoader.mjs
CHANGED
|
@@ -215,11 +215,484 @@ Tried paths: ${result.tried.join("\n")}`);
|
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
|
|
218
|
-
// packages/domain/compiler/src/
|
|
218
|
+
// packages/domain/compiler/src/compiler/cssGeneratorNative.ts
|
|
219
|
+
async function generateCssNative(classes, options) {
|
|
220
|
+
const { theme } = options;
|
|
221
|
+
const native = getNativeBridge();
|
|
222
|
+
if (!native?.generateCssNative) {
|
|
223
|
+
throw new Error(
|
|
224
|
+
"FATAL: Rust CSS generator (generateCssNative) is required but not available. Ensure native binding is properly loaded. Check that native/.node binary exists."
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
const themeJson = JSON.stringify(theme);
|
|
228
|
+
const css = native.generateCssNative(classes, themeJson);
|
|
229
|
+
return css;
|
|
230
|
+
}
|
|
231
|
+
function clearThemeCache() {
|
|
232
|
+
try {
|
|
233
|
+
const native = getNativeBridge();
|
|
234
|
+
if (!native?.clearThemeCache) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
native.clearThemeCache();
|
|
238
|
+
} catch {
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
var init_cssGeneratorNative = __esm({
|
|
242
|
+
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
243
|
+
init_nativeBridge();
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
// packages/domain/compiler/src/compiler/compilationNative.ts
|
|
248
|
+
function compileCssNative2(classes, prefix) {
|
|
249
|
+
const native = getNativeBridge();
|
|
250
|
+
if (!native?.compileCss) throw new Error("compileCss not available");
|
|
251
|
+
return native.compileCss(classes, prefix);
|
|
252
|
+
}
|
|
253
|
+
function compileCssLightning(classes) {
|
|
254
|
+
const native = getNativeBridge();
|
|
255
|
+
if (!native?.compileCssLightning) throw new Error("compileCssLightning not available");
|
|
256
|
+
return native.compileCssLightning(classes);
|
|
257
|
+
}
|
|
258
|
+
function extractTwStateConfigsNative(source, filename) {
|
|
259
|
+
const native = getNativeBridge();
|
|
260
|
+
if (!native?.extractTwStateConfigs) throw new Error("extractTwStateConfigs not available");
|
|
261
|
+
return native.extractTwStateConfigs(source, filename);
|
|
262
|
+
}
|
|
263
|
+
function generateStaticStateCssNative(inputs, resolvedCss) {
|
|
264
|
+
const native = getNativeBridge();
|
|
265
|
+
if (!native?.generateStaticStateCss) throw new Error("generateStaticStateCss not available");
|
|
266
|
+
return native.generateStaticStateCss(inputs, resolvedCss ?? null);
|
|
267
|
+
}
|
|
268
|
+
function extractAndGenerateStateCssNative(source, filename) {
|
|
269
|
+
const native = getNativeBridge();
|
|
270
|
+
if (!native?.extractAndGenerateStateCss) throw new Error("extractAndGenerateStateCss not available");
|
|
271
|
+
return native.extractAndGenerateStateCss(source, filename);
|
|
272
|
+
}
|
|
273
|
+
function layoutClassesToCss(classes) {
|
|
274
|
+
const native = getNativeBridge();
|
|
275
|
+
if (!native?.layoutClassesToCss) throw new Error("layoutClassesToCss not available");
|
|
276
|
+
return native.layoutClassesToCss(classes);
|
|
277
|
+
}
|
|
278
|
+
function hashContent(input, algorithm = "sha256", length = 8) {
|
|
279
|
+
const native = getNativeBridge();
|
|
280
|
+
if (!native?.hashContent) throw new Error("hashContent not available");
|
|
281
|
+
return native.hashContent(input, algorithm, length);
|
|
282
|
+
}
|
|
283
|
+
function extractTwContainerConfigs(source) {
|
|
284
|
+
const native = getNativeBridge();
|
|
285
|
+
if (!native?.extractTwContainerConfigs) throw new Error("extractTwContainerConfigs not available");
|
|
286
|
+
return native.extractTwContainerConfigs(source);
|
|
287
|
+
}
|
|
288
|
+
function parseAtomicClass(twClass) {
|
|
289
|
+
const native = getNativeBridge();
|
|
290
|
+
if (!native?.parseAtomicClass) throw new Error("parseAtomicClass not available");
|
|
291
|
+
return native.parseAtomicClass(twClass);
|
|
292
|
+
}
|
|
293
|
+
function generateAtomicCss(rulesJson) {
|
|
294
|
+
const native = getNativeBridge();
|
|
295
|
+
if (!native?.generateAtomicCss) throw new Error("generateAtomicCss not available");
|
|
296
|
+
return native.generateAtomicCss(rulesJson);
|
|
297
|
+
}
|
|
298
|
+
function toAtomicClasses(twClasses) {
|
|
299
|
+
const native = getNativeBridge();
|
|
300
|
+
if (!native?.toAtomicClasses) throw new Error("toAtomicClasses not available");
|
|
301
|
+
return native.toAtomicClasses(twClasses);
|
|
302
|
+
}
|
|
303
|
+
function clearAtomicRegistry() {
|
|
304
|
+
const native = getNativeBridge();
|
|
305
|
+
if (!native?.clearAtomicRegistry) return;
|
|
306
|
+
native.clearAtomicRegistry();
|
|
307
|
+
}
|
|
308
|
+
function atomicRegistrySize() {
|
|
309
|
+
const native = getNativeBridge();
|
|
310
|
+
if (!native?.atomicRegistrySize) return 0;
|
|
311
|
+
return native.atomicRegistrySize();
|
|
312
|
+
}
|
|
313
|
+
var init_compilationNative = __esm({
|
|
314
|
+
"packages/domain/compiler/src/compiler/compilationNative.ts"() {
|
|
315
|
+
init_nativeBridge();
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// packages/domain/compiler/src/compiler/cssCompilationNative.ts
|
|
320
|
+
function compileClass(input) {
|
|
321
|
+
const native = getNativeBridge();
|
|
322
|
+
if (!native?.compile_class) throw new Error("compile_class not available");
|
|
323
|
+
const resultJson = native.compile_class(input);
|
|
324
|
+
try {
|
|
325
|
+
return JSON.parse(resultJson);
|
|
326
|
+
} catch {
|
|
327
|
+
return {
|
|
328
|
+
selector: "",
|
|
329
|
+
declarations: "",
|
|
330
|
+
properties: [],
|
|
331
|
+
specificity: 0
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function compileClasses(inputs) {
|
|
336
|
+
const native = getNativeBridge();
|
|
337
|
+
if (!native?.compile_classes) throw new Error("compile_classes not available");
|
|
338
|
+
const resultJson = native.compile_classes(inputs);
|
|
339
|
+
try {
|
|
340
|
+
return JSON.parse(resultJson);
|
|
341
|
+
} catch {
|
|
342
|
+
return {
|
|
343
|
+
css: "",
|
|
344
|
+
resolved_classes: [],
|
|
345
|
+
unknown_classes: [],
|
|
346
|
+
size_bytes: 0,
|
|
347
|
+
duration_ms: 0
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function compileToCss(input, minify) {
|
|
352
|
+
const native = getNativeBridge();
|
|
353
|
+
if (!native?.compile_to_css) throw new Error("compile_to_css not available");
|
|
354
|
+
return native.compile_to_css(input, minify ?? false);
|
|
355
|
+
}
|
|
356
|
+
function compileToCssBatch(inputs, minify) {
|
|
357
|
+
const native = getNativeBridge();
|
|
358
|
+
if (!native?.compile_to_css_batch) throw new Error("compile_to_css_batch not available");
|
|
359
|
+
return native.compile_to_css_batch(inputs, minify ?? false);
|
|
360
|
+
}
|
|
361
|
+
function minifyCss(css) {
|
|
362
|
+
const native = getNativeBridge();
|
|
363
|
+
if (!native?.minify_css) throw new Error("minify_css not available");
|
|
364
|
+
return native.minify_css(css);
|
|
365
|
+
}
|
|
366
|
+
function compileAnimation(animationName, from, to) {
|
|
367
|
+
const native = getNativeBridge();
|
|
368
|
+
if (!native?.compile_animation) throw new Error("compile_animation not available");
|
|
369
|
+
const resultJson = native.compile_animation(animationName, from, to);
|
|
370
|
+
try {
|
|
371
|
+
return JSON.parse(resultJson);
|
|
372
|
+
} catch {
|
|
373
|
+
return {
|
|
374
|
+
animation_id: "",
|
|
375
|
+
keyframes_css: "",
|
|
376
|
+
animation_rule: "",
|
|
377
|
+
duration_ms: 0
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function compileKeyframes(name, stopsJson) {
|
|
382
|
+
const native = getNativeBridge();
|
|
383
|
+
if (!native?.compile_keyframes) throw new Error("compile_keyframes not available");
|
|
384
|
+
const resultJson = native.compile_keyframes(name, stopsJson);
|
|
385
|
+
try {
|
|
386
|
+
return JSON.parse(resultJson);
|
|
387
|
+
} catch {
|
|
388
|
+
return {
|
|
389
|
+
animation_id: "",
|
|
390
|
+
keyframes_css: "",
|
|
391
|
+
animation_rule: "",
|
|
392
|
+
duration_ms: 0
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function compileTheme(tokensJson, themeName, prefix) {
|
|
397
|
+
const native = getNativeBridge();
|
|
398
|
+
if (!native?.compile_theme) throw new Error("compile_theme not available");
|
|
399
|
+
const resultJson = native.compile_theme(tokensJson, themeName, prefix);
|
|
400
|
+
try {
|
|
401
|
+
return JSON.parse(resultJson);
|
|
402
|
+
} catch {
|
|
403
|
+
return {
|
|
404
|
+
selector: ":root",
|
|
405
|
+
variables: [],
|
|
406
|
+
variables_css: "",
|
|
407
|
+
theme_name: themeName
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function twMerge(classString) {
|
|
412
|
+
const native = getNativeBridge();
|
|
413
|
+
if (!native?.tw_merge) throw new Error("tw_merge not available");
|
|
414
|
+
return native.tw_merge(classString);
|
|
415
|
+
}
|
|
416
|
+
function twMergeMany(classStrings) {
|
|
417
|
+
const native = getNativeBridge();
|
|
418
|
+
if (!native?.tw_merge_many) throw new Error("tw_merge_many not available");
|
|
419
|
+
return native.tw_merge_many(classStrings);
|
|
420
|
+
}
|
|
421
|
+
function twMergeWithSeparator(classString, options) {
|
|
422
|
+
const native = getNativeBridge();
|
|
423
|
+
if (!native?.tw_merge_with_separator)
|
|
424
|
+
throw new Error("tw_merge_with_separator not available");
|
|
425
|
+
const opts = {
|
|
426
|
+
separator: options.separator,
|
|
427
|
+
debug: options.debug
|
|
428
|
+
};
|
|
429
|
+
return native.tw_merge_with_separator(classString, opts);
|
|
430
|
+
}
|
|
431
|
+
function twMergeManyWithSeparator(classStrings, options) {
|
|
432
|
+
const native = getNativeBridge();
|
|
433
|
+
if (!native?.tw_merge_many_with_separator)
|
|
434
|
+
throw new Error("tw_merge_many_with_separator not available");
|
|
435
|
+
const opts = {
|
|
436
|
+
separator: options.separator,
|
|
437
|
+
debug: options.debug
|
|
438
|
+
};
|
|
439
|
+
return native.tw_merge_many_with_separator(classStrings, opts);
|
|
440
|
+
}
|
|
441
|
+
function twMergeRaw(classLists) {
|
|
442
|
+
const native = getNativeBridge();
|
|
443
|
+
if (!native?.tw_merge_raw) throw new Error("tw_merge_raw not available");
|
|
444
|
+
return native.tw_merge_raw(classLists);
|
|
445
|
+
}
|
|
446
|
+
var init_cssCompilationNative = __esm({
|
|
447
|
+
"packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
|
|
448
|
+
init_nativeBridge();
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
// packages/domain/compiler/src/compiler/idRegistryNative.ts
|
|
453
|
+
function idRegistryCreate() {
|
|
454
|
+
const native = getNativeBridge();
|
|
455
|
+
if (!native?.id_registry_create) throw new Error("id_registry_create not available");
|
|
456
|
+
return native.id_registry_create();
|
|
457
|
+
}
|
|
458
|
+
function idRegistryGenerate(handle, name) {
|
|
459
|
+
const native = getNativeBridge();
|
|
460
|
+
if (!native?.id_registry_generate) throw new Error("id_registry_generate not available");
|
|
461
|
+
return native.id_registry_generate(handle, name);
|
|
462
|
+
}
|
|
463
|
+
function idRegistryLookup(handle, name) {
|
|
464
|
+
const native = getNativeBridge();
|
|
465
|
+
if (!native?.id_registry_lookup) throw new Error("id_registry_lookup not available");
|
|
466
|
+
return native.id_registry_lookup(handle, name);
|
|
467
|
+
}
|
|
468
|
+
function idRegistryNext(handle) {
|
|
469
|
+
const native = getNativeBridge();
|
|
470
|
+
if (!native?.id_registry_next) throw new Error("id_registry_next not available");
|
|
471
|
+
return native.id_registry_next(handle);
|
|
472
|
+
}
|
|
473
|
+
function idRegistryDestroy(handle) {
|
|
474
|
+
const native = getNativeBridge();
|
|
475
|
+
if (!native?.id_registry_destroy) return;
|
|
476
|
+
native.id_registry_destroy(handle);
|
|
477
|
+
}
|
|
478
|
+
function idRegistryReset(handle) {
|
|
479
|
+
const native = getNativeBridge();
|
|
480
|
+
if (!native?.id_registry_reset) return;
|
|
481
|
+
native.id_registry_reset(handle);
|
|
482
|
+
}
|
|
483
|
+
function idRegistrySnapshot(handle) {
|
|
484
|
+
const native = getNativeBridge();
|
|
485
|
+
if (!native?.id_registry_snapshot) throw new Error("id_registry_snapshot not available");
|
|
486
|
+
const snapshotJson = native.id_registry_snapshot(handle);
|
|
487
|
+
try {
|
|
488
|
+
return JSON.parse(snapshotJson);
|
|
489
|
+
} catch {
|
|
490
|
+
return {
|
|
491
|
+
handle,
|
|
492
|
+
next_id: 0,
|
|
493
|
+
entries: [],
|
|
494
|
+
total_entries: 0
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
function idRegistryActiveCount() {
|
|
499
|
+
const native = getNativeBridge();
|
|
500
|
+
if (!native?.id_registry_active_count) throw new Error("id_registry_active_count not available");
|
|
501
|
+
return native.id_registry_active_count();
|
|
502
|
+
}
|
|
503
|
+
function registerPropertyName(propertyName) {
|
|
504
|
+
const native = getNativeBridge();
|
|
505
|
+
if (!native?.register_property_name)
|
|
506
|
+
throw new Error("register_property_name not available");
|
|
507
|
+
return native.register_property_name(propertyName);
|
|
508
|
+
}
|
|
509
|
+
function registerValueName(valueName) {
|
|
510
|
+
const native = getNativeBridge();
|
|
511
|
+
if (!native?.register_value_name) throw new Error("register_value_name not available");
|
|
512
|
+
return native.register_value_name(valueName);
|
|
513
|
+
}
|
|
514
|
+
function propertyIdToString(propertyId) {
|
|
515
|
+
const native = getNativeBridge();
|
|
516
|
+
if (!native?.property_id_to_string) throw new Error("property_id_to_string not available");
|
|
517
|
+
return native.property_id_to_string(propertyId);
|
|
518
|
+
}
|
|
519
|
+
function valueIdToString(valueId) {
|
|
520
|
+
const native = getNativeBridge();
|
|
521
|
+
if (!native?.value_id_to_string) throw new Error("value_id_to_string not available");
|
|
522
|
+
return native.value_id_to_string(valueId);
|
|
523
|
+
}
|
|
524
|
+
function reverseLookupProperty(propertyId) {
|
|
525
|
+
const native = getNativeBridge();
|
|
526
|
+
if (!native?.reverse_lookup_property)
|
|
527
|
+
throw new Error("reverse_lookup_property not available");
|
|
528
|
+
return native.reverse_lookup_property(propertyId);
|
|
529
|
+
}
|
|
530
|
+
function reverseLookupValue(valueId) {
|
|
531
|
+
const native = getNativeBridge();
|
|
532
|
+
if (!native?.reverse_lookup_value) throw new Error("reverse_lookup_value not available");
|
|
533
|
+
return native.reverse_lookup_value(valueId);
|
|
534
|
+
}
|
|
535
|
+
function idRegistryExport(handle) {
|
|
536
|
+
const native = getNativeBridge();
|
|
537
|
+
if (!native?.id_registry_export) throw new Error("id_registry_export not available");
|
|
538
|
+
return native.id_registry_export(handle);
|
|
539
|
+
}
|
|
540
|
+
function idRegistryImport(importedData) {
|
|
541
|
+
const native = getNativeBridge();
|
|
542
|
+
if (!native?.id_registry_import) throw new Error("id_registry_import not available");
|
|
543
|
+
return native.id_registry_import(importedData);
|
|
544
|
+
}
|
|
545
|
+
var init_idRegistryNative = __esm({
|
|
546
|
+
"packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
|
|
547
|
+
init_nativeBridge();
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
// packages/domain/compiler/src/compiler/streamingNative.ts
|
|
552
|
+
function processFileChange(fileChangeJson) {
|
|
553
|
+
const native = getNativeBridge();
|
|
554
|
+
if (!native?.process_file_change) throw new Error("process_file_change not available");
|
|
555
|
+
const resultJson = native.process_file_change(fileChangeJson);
|
|
556
|
+
try {
|
|
557
|
+
return JSON.parse(resultJson);
|
|
558
|
+
} catch {
|
|
559
|
+
return {
|
|
560
|
+
file_path: "",
|
|
561
|
+
status: "error",
|
|
562
|
+
old_classes: [],
|
|
563
|
+
new_classes: [],
|
|
564
|
+
added_classes: [],
|
|
565
|
+
removed_classes: [],
|
|
566
|
+
changed: false,
|
|
567
|
+
fingerprint: "",
|
|
568
|
+
error: "Failed to parse result"
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
function computeIncrementalDiff(oldScanJson, newScanJson) {
|
|
573
|
+
const native = getNativeBridge();
|
|
574
|
+
if (!native?.compute_incremental_diff)
|
|
575
|
+
throw new Error("compute_incremental_diff not available");
|
|
576
|
+
const resultJson = native.compute_incremental_diff(oldScanJson, newScanJson);
|
|
577
|
+
try {
|
|
578
|
+
return JSON.parse(resultJson);
|
|
579
|
+
} catch {
|
|
580
|
+
return {
|
|
581
|
+
is_changed: false,
|
|
582
|
+
changes_count: 0,
|
|
583
|
+
diff: {
|
|
584
|
+
added_files: [],
|
|
585
|
+
removed_files: [],
|
|
586
|
+
modified_files: [],
|
|
587
|
+
added_classes: [],
|
|
588
|
+
removed_classes: [],
|
|
589
|
+
total_changes: 0
|
|
590
|
+
},
|
|
591
|
+
processing_time_ms: 0
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function createFingerprint(filePath, fileContent) {
|
|
596
|
+
const native = getNativeBridge();
|
|
597
|
+
if (!native?.create_fingerprint) throw new Error("create_fingerprint not available");
|
|
598
|
+
const fingerprintJson = native.create_fingerprint(filePath, fileContent);
|
|
599
|
+
try {
|
|
600
|
+
return JSON.parse(fingerprintJson);
|
|
601
|
+
} catch {
|
|
602
|
+
return {
|
|
603
|
+
file_path: filePath,
|
|
604
|
+
content_hash: "",
|
|
605
|
+
size_bytes: fileContent.length,
|
|
606
|
+
mtime_ms: Date.now(),
|
|
607
|
+
class_hash: "",
|
|
608
|
+
signature: ""
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function injectStateHash(css, stateHash) {
|
|
613
|
+
const native = getNativeBridge();
|
|
614
|
+
if (!native?.inject_state_hash) throw new Error("inject_state_hash not available");
|
|
615
|
+
const resultJson = native.inject_state_hash(css, stateHash);
|
|
616
|
+
try {
|
|
617
|
+
return JSON.parse(resultJson);
|
|
618
|
+
} catch {
|
|
619
|
+
return {
|
|
620
|
+
injected: false,
|
|
621
|
+
state_hash: stateHash,
|
|
622
|
+
affected_files: 0,
|
|
623
|
+
total_injected_bytes: 0
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
function pruneStaleCacheEntries(maxAgeSeconds, maxEntries) {
|
|
628
|
+
const native = getNativeBridge();
|
|
629
|
+
if (!native?.prune_stale_entries) throw new Error("prune_stale_entries not available");
|
|
630
|
+
const resultJson = native.prune_stale_entries(maxAgeSeconds, maxEntries);
|
|
631
|
+
try {
|
|
632
|
+
return JSON.parse(resultJson);
|
|
633
|
+
} catch {
|
|
634
|
+
return {
|
|
635
|
+
entries_before: 0,
|
|
636
|
+
entries_after: 0,
|
|
637
|
+
entries_removed: 0,
|
|
638
|
+
freed_bytes: 0
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function rebuildWorkspaceResult(rootDir, extensions) {
|
|
643
|
+
const native = getNativeBridge();
|
|
644
|
+
if (!native?.rebuild_workspace_result)
|
|
645
|
+
throw new Error("rebuild_workspace_result not available");
|
|
646
|
+
const resultJson = native.rebuild_workspace_result(rootDir, extensions || []);
|
|
647
|
+
try {
|
|
648
|
+
return JSON.parse(resultJson);
|
|
649
|
+
} catch {
|
|
650
|
+
return {
|
|
651
|
+
total_files_scanned: 0,
|
|
652
|
+
total_classes_found: 0,
|
|
653
|
+
unique_classes: 0,
|
|
654
|
+
build_time_ms: 0,
|
|
655
|
+
files_with_changes: 0
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
function scanFileNative(filePath, fileContent) {
|
|
660
|
+
const native = getNativeBridge();
|
|
661
|
+
if (!native?.scan_file_native) throw new Error("scan_file_native not available");
|
|
662
|
+
const resultJson = native.scan_file_native(filePath, fileContent);
|
|
663
|
+
try {
|
|
664
|
+
return JSON.parse(resultJson);
|
|
665
|
+
} catch {
|
|
666
|
+
return {
|
|
667
|
+
file: filePath,
|
|
668
|
+
classes: [],
|
|
669
|
+
added_classes: [],
|
|
670
|
+
removed_classes: [],
|
|
671
|
+
changed: false
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
function scanFilesBatchNative(filesJson) {
|
|
676
|
+
const native = getNativeBridge();
|
|
677
|
+
if (!native?.scan_files_batch_native)
|
|
678
|
+
throw new Error("scan_files_batch_native not available");
|
|
679
|
+
const resultJson = native.scan_files_batch_native(filesJson);
|
|
680
|
+
try {
|
|
681
|
+
return JSON.parse(resultJson);
|
|
682
|
+
} catch {
|
|
683
|
+
return [];
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
var init_streamingNative = __esm({
|
|
687
|
+
"packages/domain/compiler/src/compiler/streamingNative.ts"() {
|
|
688
|
+
init_nativeBridge();
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
// packages/domain/compiler/src/compiler/tailwindEngine.ts
|
|
219
693
|
var tailwindEngine_exports = {};
|
|
220
694
|
__export(tailwindEngine_exports, {
|
|
221
695
|
clearCache: () => clearCache,
|
|
222
|
-
generateRawCss: () => generateRawCss,
|
|
223
696
|
getCacheStats: () => getCacheStats,
|
|
224
697
|
processTailwindCssWithTargets: () => processTailwindCssWithTargets,
|
|
225
698
|
runCssPipeline: () => runCssPipeline,
|
|
@@ -253,48 +726,6 @@ function clearCache() {
|
|
|
253
726
|
_cacheHits = 0;
|
|
254
727
|
_cacheMisses = 0;
|
|
255
728
|
}
|
|
256
|
-
function loadTailwindEngine() {
|
|
257
|
-
if (_twEngine) return _twEngine;
|
|
258
|
-
if (_twEngineError) throw _twEngineError;
|
|
259
|
-
try {
|
|
260
|
-
const tw = require2("tailwindcss");
|
|
261
|
-
if (typeof tw.compile !== "function") {
|
|
262
|
-
throw new Error("tailwindcss v4 not found \u2014 compile() API missing. Check tailwindcss version >= 4.");
|
|
263
|
-
}
|
|
264
|
-
_twEngine = tw;
|
|
265
|
-
return _twEngine;
|
|
266
|
-
} catch (e) {
|
|
267
|
-
_twEngineError = e instanceof Error ? e : new Error(String(e));
|
|
268
|
-
throw _twEngineError;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
async function generateRawCss(classes, cssEntryContent, root) {
|
|
272
|
-
if (classes.length === 0) return "";
|
|
273
|
-
const tw = loadTailwindEngine();
|
|
274
|
-
const input = cssEntryContent ?? "@import 'tailwindcss';";
|
|
275
|
-
const { readFileSync, existsSync: existsSync2 } = await import('fs');
|
|
276
|
-
const { dirname, resolve: resolve2 } = await import('path');
|
|
277
|
-
const projectRoot = root ?? process.cwd();
|
|
278
|
-
const req = createRequire(resolve2(projectRoot, "package.json"));
|
|
279
|
-
const loadStylesheet = async (id, base) => {
|
|
280
|
-
try {
|
|
281
|
-
const cssId = id === "tailwindcss" ? "tailwindcss/index.css" : id === "tailwindcss/preflight" ? "tailwindcss/preflight.css" : id === "tailwindcss/utilities" ? "tailwindcss/utilities.css" : id === "tailwindcss/theme" ? "tailwindcss/theme.css" : id;
|
|
282
|
-
const pkgPath = req.resolve(cssId);
|
|
283
|
-
return { content: readFileSync(pkgPath, "utf-8"), base: dirname(pkgPath) };
|
|
284
|
-
} catch {
|
|
285
|
-
try {
|
|
286
|
-
const absPath = resolve2(base, id);
|
|
287
|
-
if (existsSync2(absPath)) {
|
|
288
|
-
return { content: readFileSync(absPath, "utf-8"), base: dirname(absPath) };
|
|
289
|
-
}
|
|
290
|
-
} catch {
|
|
291
|
-
}
|
|
292
|
-
return { content: "", base };
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
|
|
296
|
-
return compiler.build(classes);
|
|
297
|
-
}
|
|
298
729
|
function getThemeConfig() {
|
|
299
730
|
return {
|
|
300
731
|
colors: {
|
|
@@ -391,98 +822,920 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
|
391
822
|
_cacheMisses++;
|
|
392
823
|
let rawCss;
|
|
393
824
|
let usedRustCompiler = false;
|
|
825
|
+
const theme = getThemeConfig();
|
|
826
|
+
rawCss = await generateCssNative(unique, { theme });
|
|
827
|
+
usedRustCompiler = true;
|
|
828
|
+
const finalCss = minify ? postProcessWithLightning(rawCss) : rawCss;
|
|
829
|
+
if (process.env.DEBUG?.includes("compiler")) {
|
|
830
|
+
console.log(
|
|
831
|
+
`[Compiler] Generated CSS from ${unique.length} classes (${usedRustCompiler ? "Rust" : "JavaScript"})`,
|
|
832
|
+
`Size: ${finalCss.length} bytes`
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
const result = {
|
|
836
|
+
css: finalCss,
|
|
837
|
+
classes: unique,
|
|
838
|
+
sizeBytes: finalCss.length,
|
|
839
|
+
optimized: minify
|
|
840
|
+
};
|
|
841
|
+
_evictOldestIfNeeded();
|
|
842
|
+
_cssCache.set(cacheKey, result);
|
|
843
|
+
return result;
|
|
844
|
+
}
|
|
845
|
+
function runCssPipelineSync(_classes) {
|
|
846
|
+
return { css: "", classes: [], sizeBytes: 0, optimized: false };
|
|
847
|
+
}
|
|
848
|
+
function processTailwindCssWithTargets(css, targets) {
|
|
849
|
+
const native = getNativeBridge();
|
|
850
|
+
if (!native?.processTailwindCssWithTargets) {
|
|
851
|
+
throw new Error("FATAL: Native binding 'processTailwindCssWithTargets' is required but not available.");
|
|
852
|
+
}
|
|
853
|
+
const result = native.processTailwindCssWithTargets(css, targets ?? null);
|
|
854
|
+
if (!result?.css) {
|
|
855
|
+
throw new Error("FATAL: processTailwindCssWithTargets returned null");
|
|
856
|
+
}
|
|
857
|
+
return result.css;
|
|
858
|
+
}
|
|
859
|
+
var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
|
|
860
|
+
var init_tailwindEngine = __esm({
|
|
861
|
+
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
862
|
+
init_nativeBridge();
|
|
863
|
+
init_cssGeneratorNative();
|
|
864
|
+
createRequire(import.meta.url);
|
|
865
|
+
_cssCache = /* @__PURE__ */ new Map();
|
|
866
|
+
_cacheHits = 0;
|
|
867
|
+
_cacheMisses = 0;
|
|
868
|
+
MAX_CACHE_SIZE = 100;
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// packages/domain/compiler/src/compiler/index.ts
|
|
873
|
+
var init_compiler = __esm({
|
|
874
|
+
"packages/domain/compiler/src/compiler/index.ts"() {
|
|
875
|
+
init_cssGeneratorNative();
|
|
876
|
+
init_compilationNative();
|
|
877
|
+
init_cssCompilationNative();
|
|
878
|
+
init_idRegistryNative();
|
|
879
|
+
init_streamingNative();
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
|
|
883
|
+
// packages/domain/compiler/src/parser/index.ts
|
|
884
|
+
var parser_exports = {};
|
|
885
|
+
__export(parser_exports, {
|
|
886
|
+
astExtractClasses: () => astExtractClasses,
|
|
887
|
+
batchExtractClasses: () => batchExtractClasses,
|
|
888
|
+
checkAgainstSafelist: () => checkAgainstSafelist,
|
|
889
|
+
diffClassLists: () => diffClassLists,
|
|
890
|
+
extractAllClasses: () => extractAllClasses,
|
|
891
|
+
extractClassesFromSource: () => extractClassesFromSource,
|
|
892
|
+
extractComponentUsage: () => extractComponentUsage,
|
|
893
|
+
mergeClassesStatic: () => mergeClassesStatic,
|
|
894
|
+
normalizeAndDedupClasses: () => normalizeAndDedupClasses,
|
|
895
|
+
normalizeClasses: () => normalizeClasses,
|
|
896
|
+
parseClasses: () => parseClasses
|
|
897
|
+
});
|
|
898
|
+
var parseClasses, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
899
|
+
var init_parser = __esm({
|
|
900
|
+
"packages/domain/compiler/src/parser/index.ts"() {
|
|
901
|
+
init_nativeBridge();
|
|
902
|
+
parseClasses = (raw) => {
|
|
903
|
+
const native = getNativeBridge();
|
|
904
|
+
if (!native?.parseClasses) {
|
|
905
|
+
throw new Error("FATAL: Native binding 'parseClasses' is required but not available.");
|
|
906
|
+
}
|
|
907
|
+
return native.parseClasses(raw) || [];
|
|
908
|
+
};
|
|
909
|
+
extractAllClasses = (source) => {
|
|
910
|
+
const native = getNativeBridge();
|
|
911
|
+
if (!native?.extractAllClasses) {
|
|
912
|
+
throw new Error("FATAL: Native binding 'extractAllClasses' is required but not available.");
|
|
913
|
+
}
|
|
914
|
+
return native.extractAllClasses(source) || [];
|
|
915
|
+
};
|
|
916
|
+
extractClassesFromSource = (source) => {
|
|
917
|
+
const native = getNativeBridge();
|
|
918
|
+
if (!native?.extractClassesFromSource) {
|
|
919
|
+
throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
|
|
920
|
+
}
|
|
921
|
+
const result = native.extractClassesFromSource(source);
|
|
922
|
+
return Array.isArray(result) ? result.join(" ") : String(result || "");
|
|
923
|
+
};
|
|
924
|
+
astExtractClasses = (source, _filename) => {
|
|
925
|
+
const native = getNativeBridge();
|
|
926
|
+
if (!native?.extractClassesFromSource) {
|
|
927
|
+
throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
|
|
928
|
+
}
|
|
929
|
+
return native.extractClassesFromSource(source) || [];
|
|
930
|
+
};
|
|
931
|
+
normalizeClasses = (raw) => {
|
|
932
|
+
const result = normalizeAndDedupClasses(raw);
|
|
933
|
+
return result?.normalized || "";
|
|
934
|
+
};
|
|
935
|
+
mergeClassesStatic = (classes) => {
|
|
936
|
+
const result = normalizeAndDedupClasses(classes);
|
|
937
|
+
return result?.normalized || "";
|
|
938
|
+
};
|
|
939
|
+
normalizeAndDedupClasses = (raw) => {
|
|
940
|
+
const native = getNativeBridge();
|
|
941
|
+
if (!native?.normalizeAndDedupClasses) {
|
|
942
|
+
throw new Error("FATAL: Native binding 'normalizeAndDedupClasses' is required but not available.");
|
|
943
|
+
}
|
|
944
|
+
const result = native.normalizeAndDedupClasses(raw);
|
|
945
|
+
return result || { normalized: "", duplicatesRemoved: 0, uniqueCount: 0 };
|
|
946
|
+
};
|
|
947
|
+
extractComponentUsage = (source) => {
|
|
948
|
+
const native = getNativeBridge();
|
|
949
|
+
if (!native?.extractComponentUsage) {
|
|
950
|
+
throw new Error("FATAL: Native binding 'extractComponentUsage' is required but not available.");
|
|
951
|
+
}
|
|
952
|
+
return native.extractComponentUsage(source) || [];
|
|
953
|
+
};
|
|
954
|
+
batchExtractClasses = (filePaths) => {
|
|
955
|
+
const native = getNativeBridge();
|
|
956
|
+
if (!native?.batchExtractClasses) {
|
|
957
|
+
throw new Error("FATAL: Native binding 'batchExtractClasses' is required but not available.");
|
|
958
|
+
}
|
|
959
|
+
return native.batchExtractClasses(filePaths) || [];
|
|
960
|
+
};
|
|
961
|
+
checkAgainstSafelist = (classes, safelist) => {
|
|
962
|
+
const native = getNativeBridge();
|
|
963
|
+
if (!native?.checkAgainstSafelist) {
|
|
964
|
+
throw new Error("FATAL: Native binding 'checkAgainstSafelist' is required but not available.");
|
|
965
|
+
}
|
|
966
|
+
return native.checkAgainstSafelist(classes, safelist) || { matched: [], unmatched: [], safelistSize: 0 };
|
|
967
|
+
};
|
|
968
|
+
diffClassLists = (previous, current) => {
|
|
969
|
+
const native = getNativeBridge();
|
|
970
|
+
if (!native?.diffClassLists) {
|
|
971
|
+
throw new Error("FATAL: Native binding 'diffClassLists' is required but not available.");
|
|
972
|
+
}
|
|
973
|
+
return native.diffClassLists(previous, current) || { added: [], removed: [], unchanged: [], hasChanges: false };
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
// packages/domain/compiler/src/analyzer/analyzerNative.ts
|
|
979
|
+
function detectDeadCode(scanResultJson, css) {
|
|
980
|
+
const native = getNativeBridge();
|
|
981
|
+
if (!native?.detectDeadCode) throw new Error("detectDeadCode not available");
|
|
982
|
+
return native.detectDeadCode(scanResultJson, css);
|
|
983
|
+
}
|
|
984
|
+
function analyzeClassUsageNative(classes, scanResultJson, css) {
|
|
985
|
+
const native = getNativeBridge();
|
|
986
|
+
if (!native?.analyzeClassUsage) throw new Error("analyzeClassUsage not available");
|
|
987
|
+
return native.analyzeClassUsage(classes, scanResultJson, css);
|
|
988
|
+
}
|
|
989
|
+
function analyzeClassesNative(filesJson, cwd, flags) {
|
|
990
|
+
const native = getNativeBridge();
|
|
991
|
+
if (!native?.analyzeClasses) throw new Error("analyzeClasses not available");
|
|
992
|
+
return native.analyzeClasses(filesJson, cwd, flags ?? 0);
|
|
993
|
+
}
|
|
994
|
+
function analyzeRscNative(source, filename) {
|
|
995
|
+
const native = getNativeBridge();
|
|
996
|
+
if (!native?.analyzeRsc) throw new Error("analyzeRsc not available");
|
|
997
|
+
return native.analyzeRsc(source, filename);
|
|
998
|
+
}
|
|
999
|
+
function optimizeCssNative(css) {
|
|
1000
|
+
const native = getNativeBridge();
|
|
1001
|
+
if (!native?.processTailwindCssLightning) throw new Error("processTailwindCssLightning not available");
|
|
1002
|
+
const result = native.processTailwindCssLightning(css);
|
|
1003
|
+
return {
|
|
1004
|
+
css: result.css,
|
|
1005
|
+
originalSize: css.length,
|
|
1006
|
+
optimizedSize: result.size_bytes,
|
|
1007
|
+
reductionPercentage: (css.length - result.size_bytes) / css.length * 100
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
function processTailwindCssLightning(css) {
|
|
1011
|
+
const native = getNativeBridge();
|
|
1012
|
+
if (!native?.processTailwindCssLightning) throw new Error("processTailwindCssLightning not available");
|
|
1013
|
+
return native.processTailwindCssLightning(css);
|
|
1014
|
+
}
|
|
1015
|
+
function eliminateDeadCssNative(css, deadClasses) {
|
|
1016
|
+
const native = getNativeBridge();
|
|
1017
|
+
if (!native?.eliminateDeadCss) throw new Error("eliminateDeadCss not available");
|
|
1018
|
+
return native.eliminateDeadCss(css, deadClasses);
|
|
1019
|
+
}
|
|
1020
|
+
function hoistComponentsNative(source) {
|
|
1021
|
+
const native = getNativeBridge();
|
|
1022
|
+
if (!native?.hoistComponents) throw new Error("hoistComponents not available");
|
|
1023
|
+
return native.hoistComponents(source);
|
|
1024
|
+
}
|
|
1025
|
+
function compileVariantTableNative(configJson) {
|
|
1026
|
+
const native = getNativeBridge();
|
|
1027
|
+
if (!native?.compileVariantTable) throw new Error("compileVariantTable not available");
|
|
1028
|
+
return native.compileVariantTable(configJson);
|
|
1029
|
+
}
|
|
1030
|
+
function classifyAndSortClassesNative(classes) {
|
|
1031
|
+
const native = getNativeBridge();
|
|
1032
|
+
if (!native?.classifyAndSortClasses) throw new Error("classifyAndSortClasses not available");
|
|
1033
|
+
return native.classifyAndSortClasses(classes);
|
|
1034
|
+
}
|
|
1035
|
+
function mergeCssDeclarationsNative(cssChunks) {
|
|
1036
|
+
const native = getNativeBridge();
|
|
1037
|
+
if (!native?.mergeCssDeclarations) throw new Error("mergeCssDeclarations not available");
|
|
1038
|
+
return native.mergeCssDeclarations(cssChunks);
|
|
1039
|
+
}
|
|
1040
|
+
var init_analyzerNative = __esm({
|
|
1041
|
+
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
1042
|
+
init_nativeBridge();
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
|
|
1046
|
+
// packages/domain/compiler/src/analyzer/themeResolutionNative.ts
|
|
1047
|
+
function resolveVariants(configJson) {
|
|
1048
|
+
const native = getNativeBridge();
|
|
1049
|
+
if (!native?.resolve_variants) throw new Error("resolve_variants not available");
|
|
1050
|
+
const resultJson = native.resolve_variants(configJson);
|
|
1051
|
+
try {
|
|
1052
|
+
return JSON.parse(resultJson);
|
|
1053
|
+
} catch {
|
|
1054
|
+
return {
|
|
1055
|
+
variants: [],
|
|
1056
|
+
supported: [],
|
|
1057
|
+
deprecated: [],
|
|
1058
|
+
conflicting: []
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
function validateThemeConfig(configJson) {
|
|
1063
|
+
const native = getNativeBridge();
|
|
1064
|
+
if (!native?.validate_variant_config) throw new Error("validate_variant_config not available");
|
|
1065
|
+
const resultJson = native.validate_variant_config(configJson);
|
|
1066
|
+
try {
|
|
1067
|
+
return JSON.parse(resultJson);
|
|
1068
|
+
} catch {
|
|
1069
|
+
return {
|
|
1070
|
+
is_valid: false,
|
|
1071
|
+
errors: ["Unable to parse configuration"],
|
|
1072
|
+
warnings: [],
|
|
1073
|
+
suggestions: []
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
function resolveCascade(baseThemeJson, overridesJson) {
|
|
1078
|
+
const native = getNativeBridge();
|
|
1079
|
+
if (!native?.resolve_cascade) throw new Error("resolve_cascade not available");
|
|
1080
|
+
const resultJson = native.resolve_cascade(baseThemeJson, overridesJson);
|
|
1081
|
+
try {
|
|
1082
|
+
return JSON.parse(resultJson);
|
|
1083
|
+
} catch {
|
|
1084
|
+
return {
|
|
1085
|
+
base_theme: {},
|
|
1086
|
+
user_overrides: {},
|
|
1087
|
+
merged_theme: {},
|
|
1088
|
+
conflict_resolutions: []
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function resolveClassNames(classNames, themeJson) {
|
|
1093
|
+
const native = getNativeBridge();
|
|
1094
|
+
if (!native?.resolve_class_names) throw new Error("resolve_class_names not available");
|
|
1095
|
+
const resultJson = native.resolve_class_names(classNames, themeJson);
|
|
1096
|
+
try {
|
|
1097
|
+
return JSON.parse(resultJson);
|
|
1098
|
+
} catch {
|
|
1099
|
+
return [];
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
function resolveConflictGroup(groupName, themeJson) {
|
|
1103
|
+
const native = getNativeBridge();
|
|
1104
|
+
if (!native?.resolve_conflict_group)
|
|
1105
|
+
throw new Error("resolve_conflict_group not available");
|
|
1106
|
+
const resultJson = native.resolve_conflict_group(groupName, themeJson);
|
|
1107
|
+
try {
|
|
1108
|
+
return JSON.parse(resultJson);
|
|
1109
|
+
} catch {
|
|
1110
|
+
return {
|
|
1111
|
+
group_name: groupName,
|
|
1112
|
+
conflicting_classes: [],
|
|
1113
|
+
description: "",
|
|
1114
|
+
resolution_strategy: "last-wins"
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
function resolveThemeValue(keyPath, themeJson) {
|
|
1119
|
+
const native = getNativeBridge();
|
|
1120
|
+
if (!native?.resolve_theme_value) throw new Error("resolve_theme_value not available");
|
|
1121
|
+
return native.resolve_theme_value(keyPath, themeJson);
|
|
1122
|
+
}
|
|
1123
|
+
function resolveSimpleVariants(configJson) {
|
|
1124
|
+
const native = getNativeBridge();
|
|
1125
|
+
if (!native?.resolve_simple_variants) throw new Error("resolve_simple_variants not available");
|
|
1126
|
+
const resultJson = native.resolve_simple_variants(configJson);
|
|
1127
|
+
try {
|
|
1128
|
+
return JSON.parse(resultJson);
|
|
1129
|
+
} catch {
|
|
1130
|
+
return [];
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
var init_themeResolutionNative = __esm({
|
|
1134
|
+
"packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
|
|
1135
|
+
init_nativeBridge();
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
// packages/domain/compiler/src/analyzer/scannerNative.ts
|
|
1140
|
+
function scanWorkspace(root, extensions) {
|
|
1141
|
+
const native = getNativeBridge();
|
|
1142
|
+
if (!native?.scan_workspace) throw new Error("scan_workspace not available");
|
|
1143
|
+
return native.scan_workspace(root, extensions);
|
|
1144
|
+
}
|
|
1145
|
+
function extractClassesFromSourceNative(source) {
|
|
1146
|
+
const native = getNativeBridge();
|
|
1147
|
+
if (!native?.extract_classes_from_source) throw new Error("extract_classes_from_source not available");
|
|
1148
|
+
return native.extract_classes_from_source(source);
|
|
1149
|
+
}
|
|
1150
|
+
function batchExtractClassesNative(filePaths) {
|
|
1151
|
+
const native = getNativeBridge();
|
|
1152
|
+
if (!native?.batch_extract_classes) throw new Error("batch_extract_classes not available");
|
|
1153
|
+
return native.batch_extract_classes(filePaths);
|
|
1154
|
+
}
|
|
1155
|
+
function checkAgainstSafelistNative(classes, safelist) {
|
|
1156
|
+
const native = getNativeBridge();
|
|
1157
|
+
if (!native?.check_against_safelist) throw new Error("check_against_safelist not available");
|
|
1158
|
+
return native.check_against_safelist(classes, safelist);
|
|
1159
|
+
}
|
|
1160
|
+
function scanFile(filePath) {
|
|
1161
|
+
const native = getNativeBridge();
|
|
1162
|
+
if (!native?.scan_file) throw new Error("scan_file not available");
|
|
1163
|
+
return native.scan_file(filePath);
|
|
1164
|
+
}
|
|
1165
|
+
function collectFiles(root, extensions) {
|
|
1166
|
+
const native = getNativeBridge();
|
|
1167
|
+
if (!native?.collect_files) throw new Error("collect_files not available");
|
|
1168
|
+
return native.collect_files(root, extensions);
|
|
1169
|
+
}
|
|
1170
|
+
function walkAndPrefilterSourceFiles(root, extensions, _parallel) {
|
|
1171
|
+
const native = getNativeBridge();
|
|
1172
|
+
if (!native?.walk_and_prefilter_source_files) throw new Error("walk_and_prefilter_source_files not available");
|
|
1173
|
+
return native.walk_and_prefilter_source_files(root, extensions);
|
|
1174
|
+
}
|
|
1175
|
+
function generateSubComponentTypes(root, outputPath) {
|
|
1176
|
+
const native = getNativeBridge();
|
|
1177
|
+
if (!native?.generate_sub_component_types) throw new Error("generate_sub_component_types not available");
|
|
1178
|
+
return native.generate_sub_component_types(root, outputPath);
|
|
1179
|
+
}
|
|
1180
|
+
var init_scannerNative = __esm({
|
|
1181
|
+
"packages/domain/compiler/src/analyzer/scannerNative.ts"() {
|
|
1182
|
+
init_nativeBridge();
|
|
1183
|
+
}
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1186
|
+
// packages/domain/compiler/src/analyzer/index.ts
|
|
1187
|
+
var init_analyzer = __esm({
|
|
1188
|
+
"packages/domain/compiler/src/analyzer/index.ts"() {
|
|
1189
|
+
init_analyzerNative();
|
|
1190
|
+
init_themeResolutionNative();
|
|
1191
|
+
init_scannerNative();
|
|
1192
|
+
}
|
|
1193
|
+
});
|
|
1194
|
+
|
|
1195
|
+
// packages/domain/compiler/src/cache/cacheNative.ts
|
|
1196
|
+
function getCacheStatistics() {
|
|
1197
|
+
const native = getNativeBridge();
|
|
1198
|
+
if (!native?.get_cache_statistics) throw new Error("get_cache_statistics not available");
|
|
1199
|
+
const statsJson = native.get_cache_statistics();
|
|
1200
|
+
try {
|
|
1201
|
+
return JSON.parse(statsJson);
|
|
1202
|
+
} catch {
|
|
1203
|
+
return {
|
|
1204
|
+
parse_cache: { hits: 0, misses: 0, size: 0 },
|
|
1205
|
+
resolve_cache: { hits: 0, misses: 0, size: 0 },
|
|
1206
|
+
compile_cache: { hits: 0, misses: 0, size: 0 },
|
|
1207
|
+
css_gen_cache: { hits: 0, misses: 0, size: 0 },
|
|
1208
|
+
overall_hit_rate: 0,
|
|
1209
|
+
total_memory_bytes: 0
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
function clearAllCaches() {
|
|
1214
|
+
const native = getNativeBridge();
|
|
1215
|
+
if (!native?.clear_all_caches) return;
|
|
1216
|
+
try {
|
|
1217
|
+
native.clear_all_caches();
|
|
1218
|
+
} catch {
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
function clearParseCache() {
|
|
1222
|
+
const native = getNativeBridge();
|
|
1223
|
+
if (!native?.clear_parse_cache) return;
|
|
1224
|
+
try {
|
|
1225
|
+
native.clear_parse_cache();
|
|
1226
|
+
} catch {
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
function clearResolveCache() {
|
|
1230
|
+
const native = getNativeBridge();
|
|
1231
|
+
if (!native?.clear_resolve_cache) return;
|
|
1232
|
+
try {
|
|
1233
|
+
native.clear_resolve_cache();
|
|
1234
|
+
} catch {
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
function clearCompileCache() {
|
|
1238
|
+
const native = getNativeBridge();
|
|
1239
|
+
if (!native?.clear_compile_cache) return;
|
|
1240
|
+
try {
|
|
1241
|
+
native.clear_compile_cache();
|
|
1242
|
+
} catch {
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
function clearCssGenCache() {
|
|
1246
|
+
const native = getNativeBridge();
|
|
1247
|
+
if (!native?.clear_css_gen_cache) return;
|
|
1248
|
+
try {
|
|
1249
|
+
native.clear_css_gen_cache();
|
|
1250
|
+
} catch {
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
function getCacheOptimizationHints(hitRatePercent, memoryUsedMb) {
|
|
1254
|
+
const native = getNativeBridge();
|
|
1255
|
+
if (!native?.get_cache_optimization_hints)
|
|
1256
|
+
throw new Error("get_cache_optimization_hints not available");
|
|
1257
|
+
const hintsJson = native.get_cache_optimization_hints(
|
|
1258
|
+
Math.min(100, Math.max(0, hitRatePercent)),
|
|
1259
|
+
Math.max(1, memoryUsedMb)
|
|
1260
|
+
);
|
|
1261
|
+
try {
|
|
1262
|
+
return JSON.parse(hintsJson);
|
|
1263
|
+
} catch {
|
|
1264
|
+
return {
|
|
1265
|
+
current_strategy: "unknown",
|
|
1266
|
+
recommended_strategy: "increase_size",
|
|
1267
|
+
estimated_improvement_percent: 0,
|
|
1268
|
+
suggested_memory_mb: 256,
|
|
1269
|
+
notes: ["Unable to analyze cache statistics"]
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
function estimateOptimalCacheConfig(totalBudgetMb, workloadType) {
|
|
1274
|
+
const native = getNativeBridge();
|
|
1275
|
+
if (!native?.estimate_optimal_cache_config_native)
|
|
1276
|
+
throw new Error("estimate_optimal_cache_config_native not available");
|
|
1277
|
+
const configJson = native.estimate_optimal_cache_config_native(
|
|
1278
|
+
Math.max(64, totalBudgetMb),
|
|
1279
|
+
workloadType
|
|
1280
|
+
);
|
|
1281
|
+
try {
|
|
1282
|
+
return JSON.parse(configJson);
|
|
1283
|
+
} catch {
|
|
1284
|
+
return {
|
|
1285
|
+
parse_cache_size: 128,
|
|
1286
|
+
resolve_cache_size: 64,
|
|
1287
|
+
compile_cache_size: 256,
|
|
1288
|
+
css_gen_cache_size: 128,
|
|
1289
|
+
recommended_eviction_policy: "lru",
|
|
1290
|
+
ttl_seconds: 3600,
|
|
1291
|
+
expected_hit_rate_percent: 75
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
function cacheRead(cachePath) {
|
|
1296
|
+
const native = getNativeBridge();
|
|
1297
|
+
if (!native?.cache_read) throw new Error("cache_read not available");
|
|
1298
|
+
const result = native.cache_read(cachePath);
|
|
1299
|
+
try {
|
|
1300
|
+
return JSON.parse(result.entries_json || "[]");
|
|
1301
|
+
} catch {
|
|
1302
|
+
return [];
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
function cacheWrite(cachePath, entries) {
|
|
1306
|
+
const native = getNativeBridge();
|
|
1307
|
+
if (!native?.cache_write) throw new Error("cache_write not available");
|
|
1308
|
+
try {
|
|
1309
|
+
const result = native.cache_write(
|
|
1310
|
+
cachePath,
|
|
1311
|
+
entries.map((e) => ({
|
|
1312
|
+
file: e.file,
|
|
1313
|
+
content_hash: e.contentHash,
|
|
1314
|
+
classes: e.classes,
|
|
1315
|
+
mtime_ms: e.mtimeMs,
|
|
1316
|
+
size_bytes: e.sizeBytes
|
|
1317
|
+
}))
|
|
1318
|
+
);
|
|
1319
|
+
return typeof result === "boolean" ? result : result === true;
|
|
1320
|
+
} catch {
|
|
1321
|
+
return false;
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
function cachePriority(mtimeMs, sizeBytes, hitCount) {
|
|
1325
|
+
const native = getNativeBridge();
|
|
1326
|
+
if (!native?.cache_priority) throw new Error("cache_priority not available");
|
|
1327
|
+
return native.cache_priority(mtimeMs, sizeBytes, hitCount);
|
|
1328
|
+
}
|
|
1329
|
+
var init_cacheNative = __esm({
|
|
1330
|
+
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
1331
|
+
init_nativeBridge();
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
|
|
1335
|
+
// packages/domain/compiler/src/cache/index.ts
|
|
1336
|
+
var init_cache = __esm({
|
|
1337
|
+
"packages/domain/compiler/src/cache/index.ts"() {
|
|
1338
|
+
init_cacheNative();
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
|
|
1342
|
+
// packages/domain/compiler/src/redis/redisNative.ts
|
|
1343
|
+
function redisPing() {
|
|
1344
|
+
const native = getNativeBridge();
|
|
1345
|
+
if (!native?.redis_ping) throw new Error("redis_ping not available");
|
|
1346
|
+
return native.redis_ping();
|
|
1347
|
+
}
|
|
1348
|
+
function redisGet(key) {
|
|
1349
|
+
const native = getNativeBridge();
|
|
1350
|
+
if (!native?.redis_get) throw new Error("redis_get not available");
|
|
1351
|
+
const result = native.redis_get(key);
|
|
1352
|
+
return result === "nil" ? null : result;
|
|
1353
|
+
}
|
|
1354
|
+
function redisSet(key, value, ttl_seconds) {
|
|
1355
|
+
const native = getNativeBridge();
|
|
1356
|
+
if (!native?.redis_set) throw new Error("redis_set not available");
|
|
1357
|
+
return native.redis_set(key, value, ttl_seconds);
|
|
1358
|
+
}
|
|
1359
|
+
function redisDelete(key) {
|
|
1360
|
+
const native = getNativeBridge();
|
|
1361
|
+
if (!native?.redis_delete) throw new Error("redis_delete not available");
|
|
1362
|
+
return native.redis_delete(key);
|
|
1363
|
+
}
|
|
1364
|
+
function redisExists(key) {
|
|
1365
|
+
const native = getNativeBridge();
|
|
1366
|
+
if (!native?.redis_exists) throw new Error("redis_exists not available");
|
|
1367
|
+
return native.redis_exists(key);
|
|
1368
|
+
}
|
|
1369
|
+
function redisMget(keys) {
|
|
1370
|
+
const native = getNativeBridge();
|
|
1371
|
+
if (!native?.redis_mget) throw new Error("redis_mget not available");
|
|
1372
|
+
const result = native.redis_mget(keys);
|
|
1373
|
+
try {
|
|
1374
|
+
return JSON.parse(result);
|
|
1375
|
+
} catch {
|
|
1376
|
+
return keys.map(() => null);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
function redisMset(pairs) {
|
|
1380
|
+
const native = getNativeBridge();
|
|
1381
|
+
if (!native?.redis_mset) throw new Error("redis_mset not available");
|
|
1382
|
+
return native.redis_mset(pairs);
|
|
1383
|
+
}
|
|
1384
|
+
function redisFlushDb() {
|
|
1385
|
+
const native = getNativeBridge();
|
|
1386
|
+
if (!native?.redis_flush_db) throw new Error("redis_flush_db not available");
|
|
1387
|
+
return native.redis_flush_db();
|
|
1388
|
+
}
|
|
1389
|
+
function redisFlushAll() {
|
|
1390
|
+
const native = getNativeBridge();
|
|
1391
|
+
if (!native?.redis_flush_all) throw new Error("redis_flush_all not available");
|
|
1392
|
+
return native.redis_flush_all();
|
|
1393
|
+
}
|
|
1394
|
+
function redisPoolConnect(host, port, pool_size) {
|
|
1395
|
+
const native = getNativeBridge();
|
|
1396
|
+
if (!native?.redis_pool_connect) throw new Error("redis_pool_connect not available");
|
|
1397
|
+
return native.redis_pool_connect(host, port, pool_size);
|
|
1398
|
+
}
|
|
1399
|
+
function redisPoolStats() {
|
|
1400
|
+
const native = getNativeBridge();
|
|
1401
|
+
if (!native?.redis_pool_stats) throw new Error("redis_pool_stats not available");
|
|
1402
|
+
const result = native.redis_pool_stats();
|
|
1403
|
+
try {
|
|
1404
|
+
return JSON.parse(result);
|
|
1405
|
+
} catch {
|
|
1406
|
+
return {
|
|
1407
|
+
connected_count: 0,
|
|
1408
|
+
idle_count: 0,
|
|
1409
|
+
waiting_count: 0,
|
|
1410
|
+
total_requests: 0,
|
|
1411
|
+
total_errors: 0
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
function redisPoolReconnect() {
|
|
1416
|
+
const native = getNativeBridge();
|
|
1417
|
+
if (!native?.redis_pool_reconnect) throw new Error("redis_pool_reconnect not available");
|
|
1418
|
+
return native.redis_pool_reconnect();
|
|
1419
|
+
}
|
|
1420
|
+
function redisEnableCluster(initial_nodes) {
|
|
1421
|
+
const native = getNativeBridge();
|
|
1422
|
+
if (!native?.redis_enable_cluster) throw new Error("redis_enable_cluster not available");
|
|
1423
|
+
const result = native.redis_enable_cluster(initial_nodes);
|
|
1424
|
+
try {
|
|
1425
|
+
return JSON.parse(result);
|
|
1426
|
+
} catch {
|
|
1427
|
+
return {
|
|
1428
|
+
enabled: false,
|
|
1429
|
+
cluster_state: "error",
|
|
1430
|
+
nodes: [],
|
|
1431
|
+
slots_assigned: 0,
|
|
1432
|
+
slots_ok: 0,
|
|
1433
|
+
slots_fail: 0
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
function redisDisableCluster() {
|
|
1438
|
+
const native = getNativeBridge();
|
|
1439
|
+
if (!native?.redis_disable_cluster) throw new Error("redis_disable_cluster not available");
|
|
1440
|
+
return native.redis_disable_cluster();
|
|
1441
|
+
}
|
|
1442
|
+
function redisClusterStatus() {
|
|
1443
|
+
const native = getNativeBridge();
|
|
1444
|
+
if (!native?.redis_cluster_status) throw new Error("redis_cluster_status not available");
|
|
1445
|
+
const result = native.redis_cluster_status();
|
|
1446
|
+
try {
|
|
1447
|
+
return JSON.parse(result);
|
|
1448
|
+
} catch {
|
|
1449
|
+
return {
|
|
1450
|
+
enabled: false,
|
|
1451
|
+
cluster_state: "unknown",
|
|
1452
|
+
nodes: [],
|
|
1453
|
+
slots_assigned: 0,
|
|
1454
|
+
slots_ok: 0,
|
|
1455
|
+
slots_fail: 0
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
function redisSubscribe(channel) {
|
|
1460
|
+
const native = getNativeBridge();
|
|
1461
|
+
if (!native?.redis_subscribe) throw new Error("redis_subscribe not available");
|
|
1462
|
+
return native.redis_subscribe(channel);
|
|
1463
|
+
}
|
|
1464
|
+
function redisPublish(channel, message) {
|
|
1465
|
+
const native = getNativeBridge();
|
|
1466
|
+
if (!native?.redis_publish) throw new Error("redis_publish not available");
|
|
1467
|
+
return native.redis_publish(channel, message);
|
|
1468
|
+
}
|
|
1469
|
+
function redisExpirationSet(key, ttl_seconds) {
|
|
1470
|
+
const native = getNativeBridge();
|
|
1471
|
+
if (!native?.redis_expiration_set) throw new Error("redis_expiration_set not available");
|
|
1472
|
+
return native.redis_expiration_set(key, ttl_seconds);
|
|
1473
|
+
}
|
|
1474
|
+
function redisExpirationGet(key) {
|
|
1475
|
+
const native = getNativeBridge();
|
|
1476
|
+
if (!native?.redis_expiration_get) throw new Error("redis_expiration_get not available");
|
|
1477
|
+
const result = native.redis_expiration_get(key);
|
|
1478
|
+
try {
|
|
1479
|
+
return JSON.parse(result);
|
|
1480
|
+
} catch {
|
|
1481
|
+
return {
|
|
1482
|
+
key,
|
|
1483
|
+
ttl_seconds: -1,
|
|
1484
|
+
expiration_timestamp: 0,
|
|
1485
|
+
is_persistent: true
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
function redisInfo() {
|
|
1490
|
+
const native = getNativeBridge();
|
|
1491
|
+
if (!native?.redis_info) throw new Error("redis_info not available");
|
|
1492
|
+
return native.redis_info();
|
|
1493
|
+
}
|
|
1494
|
+
function redisMonitor() {
|
|
1495
|
+
const native = getNativeBridge();
|
|
1496
|
+
if (!native?.redis_monitor) throw new Error("redis_monitor not available");
|
|
1497
|
+
return native.redis_monitor();
|
|
1498
|
+
}
|
|
1499
|
+
function redisCacheSize() {
|
|
1500
|
+
const native = getNativeBridge();
|
|
1501
|
+
if (!native?.redis_cache_size) throw new Error("redis_cache_size not available");
|
|
1502
|
+
return native.redis_cache_size();
|
|
1503
|
+
}
|
|
1504
|
+
function redisCacheKeyCount() {
|
|
1505
|
+
const native = getNativeBridge();
|
|
1506
|
+
if (!native?.redis_cache_key_count) throw new Error("redis_cache_key_count not available");
|
|
1507
|
+
return native.redis_cache_key_count();
|
|
1508
|
+
}
|
|
1509
|
+
function redisCacheClear() {
|
|
1510
|
+
const native = getNativeBridge();
|
|
1511
|
+
if (!native?.redis_cache_clear) throw new Error("redis_cache_clear not available");
|
|
1512
|
+
return native.redis_cache_clear();
|
|
1513
|
+
}
|
|
1514
|
+
function redisCacheHitRate() {
|
|
1515
|
+
const native = getNativeBridge();
|
|
1516
|
+
if (!native?.redis_cache_hit_rate) throw new Error("redis_cache_hit_rate not available");
|
|
1517
|
+
return native.redis_cache_hit_rate();
|
|
1518
|
+
}
|
|
1519
|
+
function redisEnablePersistence(mode) {
|
|
1520
|
+
const native = getNativeBridge();
|
|
1521
|
+
if (!native?.redis_enable_persistence) throw new Error("redis_enable_persistence not available");
|
|
1522
|
+
return native.redis_enable_persistence(mode);
|
|
1523
|
+
}
|
|
1524
|
+
function redisDisablePersistence() {
|
|
1525
|
+
const native = getNativeBridge();
|
|
1526
|
+
if (!native?.redis_disable_persistence) throw new Error("redis_disable_persistence not available");
|
|
1527
|
+
return native.redis_disable_persistence();
|
|
1528
|
+
}
|
|
1529
|
+
function redisSnapshot() {
|
|
1530
|
+
const native = getNativeBridge();
|
|
1531
|
+
if (!native?.redis_snapshot) throw new Error("redis_snapshot not available");
|
|
1532
|
+
return native.redis_snapshot();
|
|
1533
|
+
}
|
|
1534
|
+
function redisMemoryStats() {
|
|
1535
|
+
const native = getNativeBridge();
|
|
1536
|
+
if (!native?.redis_memory_stats) throw new Error("redis_memory_stats not available");
|
|
1537
|
+
return native.redis_memory_stats();
|
|
1538
|
+
}
|
|
1539
|
+
function redisOptimizeMemory() {
|
|
1540
|
+
const native = getNativeBridge();
|
|
1541
|
+
if (!native?.redis_optimize_memory) throw new Error("redis_optimize_memory not available");
|
|
1542
|
+
return native.redis_optimize_memory();
|
|
1543
|
+
}
|
|
1544
|
+
function redisSetEvictionPolicy(policy) {
|
|
1545
|
+
const native = getNativeBridge();
|
|
1546
|
+
if (!native?.redis_set_eviction_policy) throw new Error("redis_set_eviction_policy not available");
|
|
1547
|
+
return native.redis_set_eviction_policy(policy);
|
|
1548
|
+
}
|
|
1549
|
+
function redisGetEvictionPolicy() {
|
|
1550
|
+
const native = getNativeBridge();
|
|
1551
|
+
if (!native?.redis_get_eviction_policy) throw new Error("redis_get_eviction_policy not available");
|
|
1552
|
+
return native.redis_get_eviction_policy();
|
|
1553
|
+
}
|
|
1554
|
+
function redisReplicate(target_host, target_port) {
|
|
1555
|
+
const native = getNativeBridge();
|
|
1556
|
+
if (!native?.redis_replicate) throw new Error("redis_replicate not available");
|
|
1557
|
+
return native.redis_replicate(target_host, target_port);
|
|
1558
|
+
}
|
|
1559
|
+
function redisReplicationStatus() {
|
|
1560
|
+
const native = getNativeBridge();
|
|
1561
|
+
if (!native?.redis_replication_status) throw new Error("redis_replication_status not available");
|
|
1562
|
+
return native.redis_replication_status();
|
|
1563
|
+
}
|
|
1564
|
+
function redisCacheSync(peers) {
|
|
1565
|
+
const native = getNativeBridge();
|
|
1566
|
+
if (!native?.redis_cache_sync) throw new Error("redis_cache_sync not available");
|
|
1567
|
+
return native.redis_cache_sync(peers);
|
|
1568
|
+
}
|
|
1569
|
+
function redisEnableCacheWarming(key_pattern) {
|
|
1570
|
+
const native = getNativeBridge();
|
|
1571
|
+
if (!native?.redis_enable_cache_warming) throw new Error("redis_enable_cache_warming not available");
|
|
1572
|
+
return native.redis_enable_cache_warming(key_pattern);
|
|
1573
|
+
}
|
|
1574
|
+
function redisDisableCacheWarming() {
|
|
1575
|
+
const native = getNativeBridge();
|
|
1576
|
+
if (!native?.redis_disable_cache_warming) throw new Error("redis_disable_cache_warming not available");
|
|
1577
|
+
return native.redis_disable_cache_warming();
|
|
1578
|
+
}
|
|
1579
|
+
function redisDiagnose() {
|
|
1580
|
+
const native = getNativeBridge();
|
|
1581
|
+
if (!native?.redis_diagnose) throw new Error("redis_diagnose not available");
|
|
1582
|
+
return native.redis_diagnose();
|
|
1583
|
+
}
|
|
1584
|
+
var init_redisNative = __esm({
|
|
1585
|
+
"packages/domain/compiler/src/redis/redisNative.ts"() {
|
|
1586
|
+
init_nativeBridge();
|
|
1587
|
+
}
|
|
1588
|
+
});
|
|
1589
|
+
|
|
1590
|
+
// packages/domain/compiler/src/redis/index.ts
|
|
1591
|
+
var init_redis = __esm({
|
|
1592
|
+
"packages/domain/compiler/src/redis/index.ts"() {
|
|
1593
|
+
init_redisNative();
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
|
|
1597
|
+
// packages/domain/compiler/src/watch/watchSystemNative.ts
|
|
1598
|
+
function startWatch(root_path, patterns) {
|
|
1599
|
+
const native = getNativeBridge();
|
|
1600
|
+
if (!native?.start_watch) throw new Error("start_watch not available");
|
|
1601
|
+
return native.start_watch(root_path, patterns);
|
|
1602
|
+
}
|
|
1603
|
+
function pollWatchEvents(handle, timeout_ms) {
|
|
1604
|
+
const native = getNativeBridge();
|
|
1605
|
+
if (!native?.poll_watch_events) throw new Error("poll_watch_events not available");
|
|
1606
|
+
const result = native.poll_watch_events(handle, timeout_ms);
|
|
1607
|
+
try {
|
|
1608
|
+
return JSON.parse(result);
|
|
1609
|
+
} catch {
|
|
1610
|
+
return [];
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
function stopWatch(handle) {
|
|
1614
|
+
const native = getNativeBridge();
|
|
1615
|
+
if (!native?.stop_watch) throw new Error("stop_watch not available");
|
|
1616
|
+
return native.stop_watch(handle);
|
|
1617
|
+
}
|
|
1618
|
+
function watchAddPattern(handle, pattern) {
|
|
1619
|
+
const native = getNativeBridge();
|
|
1620
|
+
if (!native?.watch_add_pattern) throw new Error("watch_add_pattern not available");
|
|
1621
|
+
return native.watch_add_pattern(handle, pattern);
|
|
1622
|
+
}
|
|
1623
|
+
function watchRemovePattern(handle, pattern) {
|
|
1624
|
+
const native = getNativeBridge();
|
|
1625
|
+
if (!native?.watch_remove_pattern) throw new Error("watch_remove_pattern not available");
|
|
1626
|
+
return native.watch_remove_pattern(handle, pattern);
|
|
1627
|
+
}
|
|
1628
|
+
function watchGetActiveHandles() {
|
|
1629
|
+
const native = getNativeBridge();
|
|
1630
|
+
if (!native?.watch_get_active_handles) throw new Error("watch_get_active_handles not available");
|
|
1631
|
+
const result = native.watch_get_active_handles();
|
|
394
1632
|
try {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
fallbackToJs: true,
|
|
399
|
-
logFallback: process.env.DEBUG?.includes("compiler") === true
|
|
400
|
-
});
|
|
401
|
-
usedRustCompiler = true;
|
|
402
|
-
} catch (error) {
|
|
403
|
-
if (process.env.DEBUG?.includes("compiler")) {
|
|
404
|
-
console.warn("[Compiler] Rust compiler failed, using JavaScript Tailwind:", error);
|
|
405
|
-
}
|
|
406
|
-
rawCss = await generateRawCss(unique, cssEntryContent, root);
|
|
407
|
-
}
|
|
408
|
-
const finalCss = minify ? postProcessWithLightning(rawCss) : rawCss;
|
|
409
|
-
if (process.env.DEBUG?.includes("compiler")) {
|
|
410
|
-
console.log(
|
|
411
|
-
`[Compiler] Generated CSS from ${unique.length} classes (${usedRustCompiler ? "Rust" : "JavaScript"})`,
|
|
412
|
-
`Size: ${finalCss.length} bytes`
|
|
413
|
-
);
|
|
1633
|
+
return JSON.parse(result);
|
|
1634
|
+
} catch {
|
|
1635
|
+
return [];
|
|
414
1636
|
}
|
|
415
|
-
const result = {
|
|
416
|
-
css: finalCss,
|
|
417
|
-
classes: unique,
|
|
418
|
-
sizeBytes: finalCss.length,
|
|
419
|
-
optimized: minify
|
|
420
|
-
};
|
|
421
|
-
_evictOldestIfNeeded();
|
|
422
|
-
_cssCache.set(cacheKey, result);
|
|
423
|
-
return result;
|
|
424
1637
|
}
|
|
425
|
-
function
|
|
426
|
-
|
|
1638
|
+
function watchClearAll() {
|
|
1639
|
+
const native = getNativeBridge();
|
|
1640
|
+
if (!native?.watch_clear_all) throw new Error("watch_clear_all not available");
|
|
1641
|
+
return native.watch_clear_all();
|
|
427
1642
|
}
|
|
428
|
-
function
|
|
1643
|
+
function watchEventTypeToString(event_type_code) {
|
|
429
1644
|
const native = getNativeBridge();
|
|
430
|
-
if (!native?.
|
|
431
|
-
|
|
1645
|
+
if (!native?.watch_event_type_to_string) throw new Error("watch_event_type_to_string not available");
|
|
1646
|
+
return native.watch_event_type_to_string(event_type_code);
|
|
1647
|
+
}
|
|
1648
|
+
function isWatchRunning(handle) {
|
|
1649
|
+
const native = getNativeBridge();
|
|
1650
|
+
if (!native?.is_watch_running) throw new Error("is_watch_running not available");
|
|
1651
|
+
return native.is_watch_running(handle);
|
|
1652
|
+
}
|
|
1653
|
+
function getWatchStats() {
|
|
1654
|
+
const native = getNativeBridge();
|
|
1655
|
+
if (!native?.get_watch_stats) throw new Error("get_watch_stats not available");
|
|
1656
|
+
const result = native.get_watch_stats();
|
|
1657
|
+
try {
|
|
1658
|
+
return JSON.parse(result);
|
|
1659
|
+
} catch {
|
|
1660
|
+
return {
|
|
1661
|
+
active_watchers: 0,
|
|
1662
|
+
total_events: 0,
|
|
1663
|
+
events_this_second: 0,
|
|
1664
|
+
average_latency_ms: 0,
|
|
1665
|
+
largest_batch_size: 0
|
|
1666
|
+
};
|
|
432
1667
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
1668
|
+
}
|
|
1669
|
+
function watchPause(handle) {
|
|
1670
|
+
const native = getNativeBridge();
|
|
1671
|
+
if (!native?.watch_pause) throw new Error("watch_pause not available");
|
|
1672
|
+
return native.watch_pause(handle);
|
|
1673
|
+
}
|
|
1674
|
+
function watchResume(handle) {
|
|
1675
|
+
const native = getNativeBridge();
|
|
1676
|
+
if (!native?.watch_resume) throw new Error("watch_resume not available");
|
|
1677
|
+
return native.watch_resume(handle);
|
|
1678
|
+
}
|
|
1679
|
+
function scanCacheOptimizations() {
|
|
1680
|
+
const native = getNativeBridge();
|
|
1681
|
+
if (!native?.scan_cache_optimizations) throw new Error("scan_cache_optimizations not available");
|
|
1682
|
+
return native.scan_cache_optimizations();
|
|
1683
|
+
}
|
|
1684
|
+
function getPluginHooks() {
|
|
1685
|
+
const native = getNativeBridge();
|
|
1686
|
+
if (!native?.get_plugin_hooks) throw new Error("get_plugin_hooks not available");
|
|
1687
|
+
const result = native.get_plugin_hooks();
|
|
1688
|
+
try {
|
|
1689
|
+
return JSON.parse(result);
|
|
1690
|
+
} catch {
|
|
1691
|
+
return [];
|
|
436
1692
|
}
|
|
437
|
-
return result.css;
|
|
438
1693
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
"
|
|
1694
|
+
function registerPluginHook(hook_name, handler_id) {
|
|
1695
|
+
const native = getNativeBridge();
|
|
1696
|
+
if (!native?.register_plugin_hook) throw new Error("register_plugin_hook not available");
|
|
1697
|
+
return native.register_plugin_hook(hook_name, handler_id);
|
|
1698
|
+
}
|
|
1699
|
+
function unregisterPluginHook(hook_name, handler_id) {
|
|
1700
|
+
const native = getNativeBridge();
|
|
1701
|
+
if (!native?.unregister_plugin_hook) throw new Error("unregister_plugin_hook not available");
|
|
1702
|
+
return native.unregister_plugin_hook(hook_name, handler_id);
|
|
1703
|
+
}
|
|
1704
|
+
function emitPluginHook(hook_name, data_json) {
|
|
1705
|
+
const native = getNativeBridge();
|
|
1706
|
+
if (!native?.emit_plugin_hook) throw new Error("emit_plugin_hook not available");
|
|
1707
|
+
return native.emit_plugin_hook(hook_name, data_json);
|
|
1708
|
+
}
|
|
1709
|
+
function getCompilationMetrics() {
|
|
1710
|
+
const native = getNativeBridge();
|
|
1711
|
+
if (!native?.get_compilation_metrics) throw new Error("get_compilation_metrics not available");
|
|
1712
|
+
return native.get_compilation_metrics();
|
|
1713
|
+
}
|
|
1714
|
+
function resetCompilationMetrics() {
|
|
1715
|
+
const native = getNativeBridge();
|
|
1716
|
+
if (!native?.reset_compilation_metrics) throw new Error("reset_compilation_metrics not available");
|
|
1717
|
+
return native.reset_compilation_metrics();
|
|
1718
|
+
}
|
|
1719
|
+
function validateCssOutput(css) {
|
|
1720
|
+
const native = getNativeBridge();
|
|
1721
|
+
if (!native?.validate_css_output) throw new Error("validate_css_output not available");
|
|
1722
|
+
return native.validate_css_output(css);
|
|
1723
|
+
}
|
|
1724
|
+
function getCompilerDiagnostics() {
|
|
1725
|
+
const native = getNativeBridge();
|
|
1726
|
+
if (!native?.get_compiler_diagnostics) throw new Error("get_compiler_diagnostics not available");
|
|
1727
|
+
return native.get_compiler_diagnostics();
|
|
1728
|
+
}
|
|
1729
|
+
var init_watchSystemNative = __esm({
|
|
1730
|
+
"packages/domain/compiler/src/watch/watchSystemNative.ts"() {
|
|
442
1731
|
init_nativeBridge();
|
|
443
|
-
init_cssGeneratorNative();
|
|
444
|
-
require2 = createRequire(import.meta.url);
|
|
445
|
-
_cssCache = /* @__PURE__ */ new Map();
|
|
446
|
-
_cacheHits = 0;
|
|
447
|
-
_cacheMisses = 0;
|
|
448
|
-
MAX_CACHE_SIZE = 100;
|
|
449
|
-
_twEngine = null;
|
|
450
|
-
_twEngineError = null;
|
|
451
1732
|
}
|
|
452
1733
|
});
|
|
453
1734
|
|
|
454
|
-
// packages/domain/compiler/src/
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
fallbackToJs = true,
|
|
459
|
-
logFallback = false
|
|
460
|
-
} = options;
|
|
461
|
-
try {
|
|
462
|
-
const native = getNativeBridge();
|
|
463
|
-
if (!native?.generateCssNative) {
|
|
464
|
-
throw new Error("generateCssNative not available in native binding");
|
|
465
|
-
}
|
|
466
|
-
const themeJson = JSON.stringify(theme);
|
|
467
|
-
const css = native.generateCssNative(classes, themeJson);
|
|
468
|
-
return css;
|
|
469
|
-
} catch (error) {
|
|
470
|
-
if (!fallbackToJs) {
|
|
471
|
-
throw error;
|
|
472
|
-
}
|
|
473
|
-
if (logFallback) {
|
|
474
|
-
console.warn(
|
|
475
|
-
"[CSS Compiler] Rust CSS generator unavailable, falling back to JavaScript Tailwind",
|
|
476
|
-
error instanceof Error ? error.message : String(error)
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
return generateRawCss(classes);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
var init_cssGeneratorNative = __esm({
|
|
483
|
-
"packages/domain/compiler/src/cssGeneratorNative.ts"() {
|
|
484
|
-
init_nativeBridge();
|
|
485
|
-
init_tailwindEngine();
|
|
1735
|
+
// packages/domain/compiler/src/watch/index.ts
|
|
1736
|
+
var init_watch = __esm({
|
|
1737
|
+
"packages/domain/compiler/src/watch/index.ts"() {
|
|
1738
|
+
init_watchSystemNative();
|
|
486
1739
|
}
|
|
487
1740
|
});
|
|
488
1741
|
function _layoutClassesToCss(classes) {
|
|
@@ -519,10 +1772,16 @@ function extractContainerCssFromSource(source) {
|
|
|
519
1772
|
}
|
|
520
1773
|
return rules.join("\n");
|
|
521
1774
|
}
|
|
522
|
-
var transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag,
|
|
1775
|
+
var transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, getRouteClasses, registerFileClasses, registerGlobalClasses, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
|
|
523
1776
|
var init_src2 = __esm({
|
|
524
1777
|
"packages/domain/compiler/src/index.ts"() {
|
|
525
1778
|
init_nativeBridge();
|
|
1779
|
+
init_compiler();
|
|
1780
|
+
init_parser();
|
|
1781
|
+
init_analyzer();
|
|
1782
|
+
init_cache();
|
|
1783
|
+
init_redis();
|
|
1784
|
+
init_watch();
|
|
526
1785
|
transformSource = (source, opts) => {
|
|
527
1786
|
const native = getNativeBridge();
|
|
528
1787
|
if (!native?.transformSource) {
|
|
@@ -566,58 +1825,19 @@ var init_src2 = __esm({
|
|
|
566
1825
|
const result = compileCssFromClasses(classes);
|
|
567
1826
|
return result?.code ? `<style data-tailwind-styled>${result.code}</style>` : "";
|
|
568
1827
|
};
|
|
569
|
-
compileCssNative = (classes, prefix = null) => {
|
|
570
|
-
return compileCssFromClasses(classes, prefix);
|
|
571
|
-
};
|
|
572
1828
|
generateCssForClasses = async (classes, _tailwindConfig, root, cssEntryContent, minify = false) => {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
extractClassesFromSource = (source) => {
|
|
585
|
-
const native = getNativeBridge();
|
|
586
|
-
if (!native?.extractClassesFromSource) {
|
|
587
|
-
throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
|
|
588
|
-
}
|
|
589
|
-
const result = native.extractClassesFromSource(source);
|
|
590
|
-
return Array.isArray(result) ? result.join(" ") : String(result || "");
|
|
591
|
-
};
|
|
592
|
-
astExtractClasses = (source, _filename) => {
|
|
593
|
-
const native = getNativeBridge();
|
|
594
|
-
if (!native?.extractClassesFromSource) {
|
|
595
|
-
throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
|
|
596
|
-
}
|
|
597
|
-
return native.extractClassesFromSource(source) || [];
|
|
598
|
-
};
|
|
599
|
-
parseClasses = (raw) => {
|
|
600
|
-
const native = getNativeBridge();
|
|
601
|
-
if (!native?.parseClasses) {
|
|
602
|
-
throw new Error("FATAL: Native binding 'parseClasses' is required but not available.");
|
|
603
|
-
}
|
|
604
|
-
return native.parseClasses(raw) || [];
|
|
605
|
-
};
|
|
606
|
-
normalizeClasses = (raw) => {
|
|
607
|
-
const result = normalizeAndDedupClasses(raw);
|
|
608
|
-
return result?.normalized || "";
|
|
609
|
-
};
|
|
610
|
-
mergeClassesStatic = (classes) => {
|
|
611
|
-
const result = normalizeAndDedupClasses(classes);
|
|
612
|
-
return result?.normalized || "";
|
|
613
|
-
};
|
|
614
|
-
normalizeAndDedupClasses = (raw) => {
|
|
615
|
-
const native = getNativeBridge();
|
|
616
|
-
if (!native?.normalizeAndDedupClasses) {
|
|
617
|
-
throw new Error("FATAL: Native binding 'normalizeAndDedupClasses' is required but not available.");
|
|
1829
|
+
try {
|
|
1830
|
+
const { runCssPipeline: runCssPipeline2 } = await Promise.resolve().then(() => (init_tailwindEngine(), tailwindEngine_exports));
|
|
1831
|
+
const result = await runCssPipeline2(classes, cssEntryContent, root, minify);
|
|
1832
|
+
return result.css;
|
|
1833
|
+
} catch {
|
|
1834
|
+
const native = getNativeBridge();
|
|
1835
|
+
if (!native?.transformSource) {
|
|
1836
|
+
throw new Error("FATAL: Native binding 'transformSource' is required but not available.");
|
|
1837
|
+
}
|
|
1838
|
+
const result = native.transformSource(classes.join(" "), {});
|
|
1839
|
+
return result?.code || "";
|
|
618
1840
|
}
|
|
619
|
-
const result = native.normalizeAndDedupClasses(raw);
|
|
620
|
-
return result || { normalized: "", duplicatesRemoved: 0, uniqueCount: 0 };
|
|
621
1841
|
};
|
|
622
1842
|
eliminateDeadCss = (css, deadClasses) => {
|
|
623
1843
|
const native = getNativeBridge();
|
|
@@ -650,16 +1870,10 @@ var init_src2 = __esm({
|
|
|
650
1870
|
const dead = native.detectDeadCode(JSON.stringify(scanResult), css);
|
|
651
1871
|
return eliminateDeadCss(css, new Set(dead.deadInCss ?? []));
|
|
652
1872
|
};
|
|
653
|
-
optimizeCss = (css) => {
|
|
654
|
-
const native = getNativeBridge();
|
|
655
|
-
if (!native?.optimizeCss) {
|
|
656
|
-
throw new Error("FATAL: Native binding 'optimizeCss' is required but not available.");
|
|
657
|
-
}
|
|
658
|
-
return native.optimizeCss(css);
|
|
659
|
-
};
|
|
660
1873
|
scanProjectUsage = (dirs, cwd) => {
|
|
1874
|
+
const { batchExtractClasses: batchExtractClasses2 } = (init_parser(), __toCommonJS(parser_exports));
|
|
661
1875
|
const files = dirs.map((dir) => path4__default.resolve(cwd, dir));
|
|
662
|
-
const results =
|
|
1876
|
+
const results = batchExtractClasses2(files) || [];
|
|
663
1877
|
const combined = {};
|
|
664
1878
|
for (const result of results) {
|
|
665
1879
|
if (result.ok && result.classes) {
|
|
@@ -671,109 +1885,6 @@ var init_src2 = __esm({
|
|
|
671
1885
|
}
|
|
672
1886
|
return combined;
|
|
673
1887
|
};
|
|
674
|
-
extractComponentUsage = (source) => {
|
|
675
|
-
const native = getNativeBridge();
|
|
676
|
-
if (!native?.extractComponentUsage) {
|
|
677
|
-
throw new Error("FATAL: Native binding 'extractComponentUsage' is required but not available.");
|
|
678
|
-
}
|
|
679
|
-
return native.extractComponentUsage(source) || [];
|
|
680
|
-
};
|
|
681
|
-
diffClassLists = (previous, current) => {
|
|
682
|
-
const native = getNativeBridge();
|
|
683
|
-
if (!native?.diffClassLists) {
|
|
684
|
-
throw new Error("FATAL: Native binding 'diffClassLists' is required but not available.");
|
|
685
|
-
}
|
|
686
|
-
return native.diffClassLists(previous, current) || { added: [], removed: [], unchanged: [], hasChanges: false };
|
|
687
|
-
};
|
|
688
|
-
batchExtractClasses = (filePaths) => {
|
|
689
|
-
const native = getNativeBridge();
|
|
690
|
-
if (!native?.batchExtractClasses) {
|
|
691
|
-
throw new Error("FATAL: Native binding 'batchExtractClasses' is required but not available.");
|
|
692
|
-
}
|
|
693
|
-
return native.batchExtractClasses(filePaths) || [];
|
|
694
|
-
};
|
|
695
|
-
checkAgainstSafelist = (classes, safelist) => {
|
|
696
|
-
const native = getNativeBridge();
|
|
697
|
-
if (!native?.checkAgainstSafelist) {
|
|
698
|
-
throw new Error("FATAL: Native binding 'checkAgainstSafelist' is required but not available.");
|
|
699
|
-
}
|
|
700
|
-
return native.checkAgainstSafelist(classes, safelist) || { matched: [], unmatched: [], safelistSize: 0 };
|
|
701
|
-
};
|
|
702
|
-
hoistComponents = (source) => {
|
|
703
|
-
const native = getNativeBridge();
|
|
704
|
-
if (!native?.hoistComponents) {
|
|
705
|
-
throw new Error("FATAL: Native binding 'hoistComponents' is required but not available.");
|
|
706
|
-
}
|
|
707
|
-
return native.hoistComponents(source) || { code: source, hoisted: [], warnings: [] };
|
|
708
|
-
};
|
|
709
|
-
compileVariantTable = (configJson) => {
|
|
710
|
-
const native = getNativeBridge();
|
|
711
|
-
if (!native?.compileVariantTable) {
|
|
712
|
-
throw new Error("FATAL: Native binding 'compileVariantTable' is required but not available.");
|
|
713
|
-
}
|
|
714
|
-
return native.compileVariantTable(configJson) || { id: "", tableJson: "{}", keys: [], defaultKey: "", combinations: 0 };
|
|
715
|
-
};
|
|
716
|
-
compileVariants = (componentId, config) => {
|
|
717
|
-
return compileVariantTable(JSON.stringify({ componentId, ...config }));
|
|
718
|
-
};
|
|
719
|
-
classifyAndSortClasses = (classes) => {
|
|
720
|
-
const native = getNativeBridge();
|
|
721
|
-
if (!native?.classifyAndSortClasses) {
|
|
722
|
-
throw new Error("FATAL: Native binding 'classifyAndSortClasses' is required but not available.");
|
|
723
|
-
}
|
|
724
|
-
return native.classifyAndSortClasses(classes) || [];
|
|
725
|
-
};
|
|
726
|
-
mergeCssDeclarations = (cssChunks) => {
|
|
727
|
-
const native = getNativeBridge();
|
|
728
|
-
if (!native?.mergeCssDeclarations) {
|
|
729
|
-
throw new Error("FATAL: Native binding 'mergeCssDeclarations' is required but not available.");
|
|
730
|
-
}
|
|
731
|
-
return native.mergeCssDeclarations(cssChunks) || { declarationsJson: "{}", declarationString: "", count: 0 };
|
|
732
|
-
};
|
|
733
|
-
analyzeClassUsage = (classes, scanResultJson, css) => {
|
|
734
|
-
const native = getNativeBridge();
|
|
735
|
-
if (!native?.analyzeClassUsage) {
|
|
736
|
-
throw new Error("FATAL: Native binding 'analyzeClassUsage' is required but not available.");
|
|
737
|
-
}
|
|
738
|
-
return native.analyzeClassUsage(classes, scanResultJson, css) || [];
|
|
739
|
-
};
|
|
740
|
-
analyzeRsc = (source, filename) => {
|
|
741
|
-
const native = getNativeBridge();
|
|
742
|
-
if (!native?.analyzeRsc) {
|
|
743
|
-
throw new Error("FATAL: Native binding 'analyzeRsc' is required but not available.");
|
|
744
|
-
}
|
|
745
|
-
return native.analyzeRsc(source, filename) || { isServer: true, needsClientDirective: false, clientReasons: [] };
|
|
746
|
-
};
|
|
747
|
-
analyzeFile = (source, filename) => {
|
|
748
|
-
const rsc = analyzeRsc(source, filename);
|
|
749
|
-
return {
|
|
750
|
-
isServer: rsc?.isServer ?? true,
|
|
751
|
-
needsClientDirective: rsc?.needsClientDirective ?? false,
|
|
752
|
-
clientReasons: rsc?.clientReasons ?? [],
|
|
753
|
-
interactiveClasses: [],
|
|
754
|
-
canStaticResolveVariants: true
|
|
755
|
-
};
|
|
756
|
-
};
|
|
757
|
-
analyzeVariantUsage = (_source, _componentName, _variantKeys) => {
|
|
758
|
-
return { resolved: {}, dynamic: [] };
|
|
759
|
-
};
|
|
760
|
-
injectClientDirective = (source) => {
|
|
761
|
-
if (!source.includes('"use client"') && !source.includes("'use client'")) {
|
|
762
|
-
return '"use client";\n' + source;
|
|
763
|
-
}
|
|
764
|
-
return source;
|
|
765
|
-
};
|
|
766
|
-
injectServerOnlyComment = (source) => {
|
|
767
|
-
return `/* @server-only */
|
|
768
|
-
${source}`;
|
|
769
|
-
};
|
|
770
|
-
analyzeClasses = (filesJson, cwd, flags) => {
|
|
771
|
-
const native = getNativeBridge();
|
|
772
|
-
if (!native?.analyzeClasses) {
|
|
773
|
-
throw new Error("FATAL: Native binding 'analyzeClasses' is required but not available.");
|
|
774
|
-
}
|
|
775
|
-
return native.analyzeClasses(filesJson, cwd, flags);
|
|
776
|
-
};
|
|
777
1888
|
generateSafelist = (scanDirs, outputPath, cwd) => {
|
|
778
1889
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
779
1890
|
const allClasses = Object.keys(classes).sort();
|
|
@@ -837,7 +1948,8 @@ ${source}`;
|
|
|
837
1948
|
if (containerCss) cssChunks.push(containerCss);
|
|
838
1949
|
const combined = cssChunks.join("\n").trim();
|
|
839
1950
|
if (combined) staticCss = combined;
|
|
840
|
-
} catch {
|
|
1951
|
+
} catch (err) {
|
|
1952
|
+
console.debug("Static CSS extraction warning:", err);
|
|
841
1953
|
}
|
|
842
1954
|
return {
|
|
843
1955
|
code: result?.code || "",
|
|
@@ -922,7 +2034,46 @@ ${source}`;
|
|
|
922
2034
|
return [];
|
|
923
2035
|
};
|
|
924
2036
|
bucketSort = (classes) => {
|
|
925
|
-
|
|
2037
|
+
const native = getNativeBridge();
|
|
2038
|
+
if (!native?.classifyAndSortClasses) {
|
|
2039
|
+
throw new Error("FATAL: Native binding 'classifyAndSortClasses' is required but not available.");
|
|
2040
|
+
}
|
|
2041
|
+
const sorted = native.classifyAndSortClasses(classes);
|
|
2042
|
+
return sorted.map((c) => c.raw ?? c);
|
|
2043
|
+
};
|
|
2044
|
+
analyzeFile = (source, filename) => {
|
|
2045
|
+
const native = getNativeBridge();
|
|
2046
|
+
if (!native?.analyzeRsc) {
|
|
2047
|
+
throw new Error("FATAL: Native binding 'analyzeRsc' is required but not available.");
|
|
2048
|
+
}
|
|
2049
|
+
const rsc = native.analyzeRsc(source, filename);
|
|
2050
|
+
return {
|
|
2051
|
+
isServer: rsc?.isServer ?? true,
|
|
2052
|
+
needsClientDirective: rsc?.needsClientDirective ?? false,
|
|
2053
|
+
clientReasons: rsc?.clientReasons ?? [],
|
|
2054
|
+
interactiveClasses: [],
|
|
2055
|
+
canStaticResolveVariants: true
|
|
2056
|
+
};
|
|
2057
|
+
};
|
|
2058
|
+
analyzeVariantUsage = (_source, _componentName, _variantKeys) => {
|
|
2059
|
+
return { resolved: {}, dynamic: [] };
|
|
2060
|
+
};
|
|
2061
|
+
injectClientDirective = (source) => {
|
|
2062
|
+
if (!source.includes('"use client"') && !source.includes("'use client'")) {
|
|
2063
|
+
return '"use client";\n' + source;
|
|
2064
|
+
}
|
|
2065
|
+
return source;
|
|
2066
|
+
};
|
|
2067
|
+
injectServerOnlyComment = (source) => {
|
|
2068
|
+
return `/* @server-only */
|
|
2069
|
+
${source}`;
|
|
2070
|
+
};
|
|
2071
|
+
analyzeClasses = (filesJson, cwd, flags) => {
|
|
2072
|
+
const native = getNativeBridge();
|
|
2073
|
+
if (!native?.analyzeClasses) {
|
|
2074
|
+
throw new Error("FATAL: Native binding 'analyzeClasses' is required but not available.");
|
|
2075
|
+
}
|
|
2076
|
+
return native.analyzeClasses(filesJson, cwd, flags);
|
|
926
2077
|
};
|
|
927
2078
|
extractTwStateConfigs = (source, filename) => {
|
|
928
2079
|
const native = getNativeBridge();
|
|
@@ -931,23 +2082,25 @@ ${source}`;
|
|
|
931
2082
|
}
|
|
932
2083
|
return native.extractTwStateConfigs(source, filename);
|
|
933
2084
|
};
|
|
934
|
-
generateStaticStateCss = (
|
|
935
|
-
const
|
|
936
|
-
|
|
937
|
-
|
|
2085
|
+
generateStaticStateCss = (entries, _themeConfig) => {
|
|
2086
|
+
const rules = [];
|
|
2087
|
+
for (const entry of entries) {
|
|
2088
|
+
const stateConfig = JSON.parse(entry.statesJson);
|
|
2089
|
+
for (const [stateName, classes] of Object.entries(stateConfig)) {
|
|
2090
|
+
rules.push({
|
|
2091
|
+
selector: `.${entry.componentName}[data-state="${stateName}"]`,
|
|
2092
|
+
declarations: classes,
|
|
2093
|
+
cssRule: `.${entry.componentName}[data-state="${stateName}"]{${classes}}`,
|
|
2094
|
+
componentName: entry.componentName,
|
|
2095
|
+
stateName
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
938
2098
|
}
|
|
939
|
-
return
|
|
2099
|
+
return rules;
|
|
940
2100
|
};
|
|
941
2101
|
extractAndGenerateStateCss = (source, filename) => {
|
|
942
|
-
const
|
|
943
|
-
|
|
944
|
-
const configs = extractTwStateConfigs(source, filename);
|
|
945
|
-
if (configs.length === 0) return [];
|
|
946
|
-
return generateStaticStateCss(
|
|
947
|
-
configs.map((c) => ({ tag: c.tag, componentName: c.componentName, statesJson: c.statesJson }))
|
|
948
|
-
);
|
|
949
|
-
}
|
|
950
|
-
return native.extractAndGenerateStateCss(source, filename);
|
|
2102
|
+
const entries = extractTwStateConfigs(source, filename);
|
|
2103
|
+
return generateStaticStateCss(entries);
|
|
951
2104
|
};
|
|
952
2105
|
}
|
|
953
2106
|
});
|
|
@@ -956,75 +2109,219 @@ ${source}`;
|
|
|
956
2109
|
var internal_exports = {};
|
|
957
2110
|
__export(internal_exports, {
|
|
958
2111
|
adaptNativeResult: () => adaptNativeResult,
|
|
959
|
-
|
|
2112
|
+
analyzeClassUsageNative: () => analyzeClassUsageNative,
|
|
960
2113
|
analyzeClasses: () => analyzeClasses,
|
|
2114
|
+
analyzeClassesNative: () => analyzeClassesNative,
|
|
961
2115
|
analyzeFile: () => analyzeFile,
|
|
962
|
-
|
|
2116
|
+
analyzeRscNative: () => analyzeRscNative,
|
|
963
2117
|
analyzeVariantUsage: () => analyzeVariantUsage,
|
|
964
2118
|
astExtractClasses: () => astExtractClasses,
|
|
2119
|
+
atomicRegistrySize: () => atomicRegistrySize,
|
|
965
2120
|
batchExtractClasses: () => batchExtractClasses,
|
|
2121
|
+
batchExtractClassesNative: () => batchExtractClassesNative,
|
|
966
2122
|
bucketSort: () => bucketSort,
|
|
967
2123
|
buildStyleTag: () => buildStyleTag,
|
|
2124
|
+
cachePriority: () => cachePriority,
|
|
2125
|
+
cacheRead: () => cacheRead,
|
|
2126
|
+
cacheWrite: () => cacheWrite,
|
|
968
2127
|
checkAgainstSafelist: () => checkAgainstSafelist,
|
|
969
|
-
|
|
2128
|
+
checkAgainstSafelistNative: () => checkAgainstSafelistNative,
|
|
2129
|
+
classifyAndSortClassesNative: () => classifyAndSortClassesNative,
|
|
970
2130
|
classifyNode: () => classifyNode,
|
|
2131
|
+
clearAllCaches: () => clearAllCaches,
|
|
2132
|
+
clearAtomicRegistry: () => clearAtomicRegistry,
|
|
971
2133
|
clearCache: () => clearCache,
|
|
2134
|
+
clearCompileCache: () => clearCompileCache,
|
|
2135
|
+
clearCssGenCache: () => clearCssGenCache,
|
|
2136
|
+
clearParseCache: () => clearParseCache,
|
|
2137
|
+
clearResolveCache: () => clearResolveCache,
|
|
2138
|
+
clearThemeCache: () => clearThemeCache,
|
|
2139
|
+
collectFiles: () => collectFiles,
|
|
2140
|
+
compileAnimation: () => compileAnimation,
|
|
2141
|
+
compileClass: () => compileClass,
|
|
2142
|
+
compileClasses: () => compileClasses,
|
|
972
2143
|
compileCssFromClasses: () => compileCssFromClasses,
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
2144
|
+
compileCssLightning: () => compileCssLightning,
|
|
2145
|
+
compileCssNative2: () => compileCssNative2,
|
|
2146
|
+
compileKeyframes: () => compileKeyframes,
|
|
2147
|
+
compileTheme: () => compileTheme,
|
|
2148
|
+
compileToCss: () => compileToCss,
|
|
2149
|
+
compileToCssBatch: () => compileToCssBatch,
|
|
2150
|
+
compileVariantTableNative: () => compileVariantTableNative,
|
|
2151
|
+
computeIncrementalDiff: () => computeIncrementalDiff,
|
|
2152
|
+
createFingerprint: () => createFingerprint,
|
|
976
2153
|
detectConflicts: () => detectConflicts,
|
|
2154
|
+
detectDeadCode: () => detectDeadCode,
|
|
977
2155
|
diffClassLists: () => diffClassLists,
|
|
978
2156
|
eliminateDeadCss: () => eliminateDeadCss,
|
|
2157
|
+
eliminateDeadCssNative: () => eliminateDeadCssNative,
|
|
2158
|
+
emitPluginHook: () => emitPluginHook,
|
|
2159
|
+
estimateOptimalCacheConfig: () => estimateOptimalCacheConfig,
|
|
979
2160
|
extractAllClasses: () => extractAllClasses,
|
|
980
2161
|
extractAndGenerateStateCss: () => extractAndGenerateStateCss,
|
|
2162
|
+
extractAndGenerateStateCssNative: () => extractAndGenerateStateCssNative,
|
|
981
2163
|
extractClassesFromSource: () => extractClassesFromSource,
|
|
2164
|
+
extractClassesFromSourceNative: () => extractClassesFromSourceNative,
|
|
982
2165
|
extractComponentUsage: () => extractComponentUsage,
|
|
983
2166
|
extractContainerCssFromSource: () => extractContainerCssFromSource,
|
|
2167
|
+
extractTwContainerConfigs: () => extractTwContainerConfigs,
|
|
984
2168
|
extractTwStateConfigs: () => extractTwStateConfigs,
|
|
2169
|
+
extractTwStateConfigsNative: () => extractTwStateConfigsNative,
|
|
985
2170
|
fileToRoute: () => fileToRoute,
|
|
986
2171
|
findDeadVariants: () => findDeadVariants,
|
|
2172
|
+
generateAtomicCss: () => generateAtomicCss,
|
|
987
2173
|
generateCssForClasses: () => generateCssForClasses,
|
|
988
|
-
|
|
2174
|
+
generateCssNative: () => generateCssNative,
|
|
989
2175
|
generateSafelist: () => generateSafelist,
|
|
990
2176
|
generateStaticStateCss: () => generateStaticStateCss,
|
|
2177
|
+
generateStaticStateCssNative: () => generateStaticStateCssNative,
|
|
2178
|
+
generateSubComponentTypes: () => generateSubComponentTypes,
|
|
991
2179
|
getAllRoutes: () => getAllRoutes,
|
|
992
2180
|
getBucketEngine: () => getBucketEngine,
|
|
2181
|
+
getCacheOptimizationHints: () => getCacheOptimizationHints,
|
|
2182
|
+
getCacheStatistics: () => getCacheStatistics,
|
|
993
2183
|
getCacheStats: () => getCacheStats,
|
|
2184
|
+
getCompilationMetrics: () => getCompilationMetrics,
|
|
2185
|
+
getCompilerDiagnostics: () => getCompilerDiagnostics,
|
|
994
2186
|
getContentPaths: () => getContentPaths,
|
|
995
2187
|
getIncrementalEngine: () => getIncrementalEngine,
|
|
996
2188
|
getNativeBridge: () => getNativeBridge,
|
|
2189
|
+
getPluginHooks: () => getPluginHooks,
|
|
997
2190
|
getRouteClasses: () => getRouteClasses,
|
|
2191
|
+
getWatchStats: () => getWatchStats,
|
|
998
2192
|
hasTwUsage: () => hasTwUsage,
|
|
999
|
-
|
|
2193
|
+
hashContent: () => hashContent,
|
|
2194
|
+
hoistComponentsNative: () => hoistComponentsNative,
|
|
2195
|
+
idRegistryActiveCount: () => idRegistryActiveCount,
|
|
2196
|
+
idRegistryCreate: () => idRegistryCreate,
|
|
2197
|
+
idRegistryDestroy: () => idRegistryDestroy,
|
|
2198
|
+
idRegistryExport: () => idRegistryExport,
|
|
2199
|
+
idRegistryGenerate: () => idRegistryGenerate,
|
|
2200
|
+
idRegistryImport: () => idRegistryImport,
|
|
2201
|
+
idRegistryLookup: () => idRegistryLookup,
|
|
2202
|
+
idRegistryNext: () => idRegistryNext,
|
|
2203
|
+
idRegistryReset: () => idRegistryReset,
|
|
2204
|
+
idRegistrySnapshot: () => idRegistrySnapshot,
|
|
1000
2205
|
injectClientDirective: () => injectClientDirective,
|
|
1001
2206
|
injectServerOnlyComment: () => injectServerOnlyComment,
|
|
2207
|
+
injectStateHash: () => injectStateHash,
|
|
1002
2208
|
isAlreadyTransformed: () => isAlreadyTransformed,
|
|
2209
|
+
isWatchRunning: () => isWatchRunning,
|
|
2210
|
+
layoutClassesToCss: () => layoutClassesToCss,
|
|
1003
2211
|
loadSafelist: () => loadSafelist,
|
|
1004
2212
|
loadTailwindConfig: () => loadTailwindConfig,
|
|
1005
2213
|
mergeClassesStatic: () => mergeClassesStatic,
|
|
1006
|
-
|
|
2214
|
+
mergeCssDeclarationsNative: () => mergeCssDeclarationsNative,
|
|
2215
|
+
minifyCss: () => minifyCss,
|
|
1007
2216
|
normalizeAndDedupClasses: () => normalizeAndDedupClasses,
|
|
1008
2217
|
normalizeClasses: () => normalizeClasses,
|
|
1009
|
-
|
|
2218
|
+
optimizeCssNative: () => optimizeCssNative,
|
|
2219
|
+
parseAtomicClass: () => parseAtomicClass,
|
|
1010
2220
|
parseClasses: () => parseClasses,
|
|
2221
|
+
pollWatchEvents: () => pollWatchEvents,
|
|
2222
|
+
processFileChange: () => processFileChange,
|
|
2223
|
+
processTailwindCssLightning: () => processTailwindCssLightning,
|
|
2224
|
+
propertyIdToString: () => propertyIdToString,
|
|
2225
|
+
pruneStaleCacheEntries: () => pruneStaleCacheEntries,
|
|
2226
|
+
rebuildWorkspaceResult: () => rebuildWorkspaceResult,
|
|
2227
|
+
redisCacheClear: () => redisCacheClear,
|
|
2228
|
+
redisCacheHitRate: () => redisCacheHitRate,
|
|
2229
|
+
redisCacheKeyCount: () => redisCacheKeyCount,
|
|
2230
|
+
redisCacheSize: () => redisCacheSize,
|
|
2231
|
+
redisCacheSync: () => redisCacheSync,
|
|
2232
|
+
redisClusterStatus: () => redisClusterStatus,
|
|
2233
|
+
redisDelete: () => redisDelete,
|
|
2234
|
+
redisDiagnose: () => redisDiagnose,
|
|
2235
|
+
redisDisableCacheWarming: () => redisDisableCacheWarming,
|
|
2236
|
+
redisDisableCluster: () => redisDisableCluster,
|
|
2237
|
+
redisDisablePersistence: () => redisDisablePersistence,
|
|
2238
|
+
redisEnableCacheWarming: () => redisEnableCacheWarming,
|
|
2239
|
+
redisEnableCluster: () => redisEnableCluster,
|
|
2240
|
+
redisEnablePersistence: () => redisEnablePersistence,
|
|
2241
|
+
redisExists: () => redisExists,
|
|
2242
|
+
redisExpirationGet: () => redisExpirationGet,
|
|
2243
|
+
redisExpirationSet: () => redisExpirationSet,
|
|
2244
|
+
redisFlushAll: () => redisFlushAll,
|
|
2245
|
+
redisFlushDb: () => redisFlushDb,
|
|
2246
|
+
redisGet: () => redisGet,
|
|
2247
|
+
redisGetEvictionPolicy: () => redisGetEvictionPolicy,
|
|
2248
|
+
redisInfo: () => redisInfo,
|
|
2249
|
+
redisMemoryStats: () => redisMemoryStats,
|
|
2250
|
+
redisMget: () => redisMget,
|
|
2251
|
+
redisMonitor: () => redisMonitor,
|
|
2252
|
+
redisMset: () => redisMset,
|
|
2253
|
+
redisOptimizeMemory: () => redisOptimizeMemory,
|
|
2254
|
+
redisPing: () => redisPing,
|
|
2255
|
+
redisPoolConnect: () => redisPoolConnect,
|
|
2256
|
+
redisPoolReconnect: () => redisPoolReconnect,
|
|
2257
|
+
redisPoolStats: () => redisPoolStats,
|
|
2258
|
+
redisPublish: () => redisPublish,
|
|
2259
|
+
redisReplicate: () => redisReplicate,
|
|
2260
|
+
redisReplicationStatus: () => redisReplicationStatus,
|
|
2261
|
+
redisSet: () => redisSet,
|
|
2262
|
+
redisSetEvictionPolicy: () => redisSetEvictionPolicy,
|
|
2263
|
+
redisSnapshot: () => redisSnapshot,
|
|
2264
|
+
redisSubscribe: () => redisSubscribe,
|
|
1011
2265
|
registerFileClasses: () => registerFileClasses,
|
|
1012
2266
|
registerGlobalClasses: () => registerGlobalClasses,
|
|
2267
|
+
registerPluginHook: () => registerPluginHook,
|
|
2268
|
+
registerPropertyName: () => registerPropertyName,
|
|
2269
|
+
registerValueName: () => registerValueName,
|
|
1013
2270
|
resetBucketEngine: () => resetBucketEngine,
|
|
2271
|
+
resetCompilationMetrics: () => resetCompilationMetrics,
|
|
1014
2272
|
resetIncrementalEngine: () => resetIncrementalEngine,
|
|
2273
|
+
resolveCascade: () => resolveCascade,
|
|
2274
|
+
resolveClassNames: () => resolveClassNames,
|
|
2275
|
+
resolveConflictGroup: () => resolveConflictGroup,
|
|
2276
|
+
resolveSimpleVariants: () => resolveSimpleVariants,
|
|
2277
|
+
resolveThemeValue: () => resolveThemeValue,
|
|
2278
|
+
resolveVariants: () => resolveVariants,
|
|
2279
|
+
reverseLookupProperty: () => reverseLookupProperty,
|
|
2280
|
+
reverseLookupValue: () => reverseLookupValue,
|
|
1015
2281
|
runCssPipeline: () => runCssPipeline,
|
|
1016
2282
|
runCssPipelineSync: () => runCssPipelineSync,
|
|
1017
2283
|
runElimination: () => runElimination,
|
|
1018
2284
|
runLoaderTransform: () => runLoaderTransform,
|
|
2285
|
+
scanCacheOptimizations: () => scanCacheOptimizations,
|
|
2286
|
+
scanFile: () => scanFile,
|
|
2287
|
+
scanFileNative: () => scanFileNative,
|
|
2288
|
+
scanFilesBatchNative: () => scanFilesBatchNative,
|
|
1019
2289
|
scanProjectUsage: () => scanProjectUsage,
|
|
2290
|
+
scanWorkspace: () => scanWorkspace,
|
|
1020
2291
|
shouldProcess: () => shouldProcess,
|
|
1021
2292
|
shouldSkipFile: () => shouldSkipFile,
|
|
1022
|
-
|
|
2293
|
+
startWatch: () => startWatch,
|
|
2294
|
+
stopWatch: () => stopWatch,
|
|
2295
|
+
toAtomicClasses: () => toAtomicClasses,
|
|
2296
|
+
transformSource: () => transformSource,
|
|
2297
|
+
twMerge: () => twMerge,
|
|
2298
|
+
twMergeMany: () => twMergeMany,
|
|
2299
|
+
twMergeManyWithSeparator: () => twMergeManyWithSeparator,
|
|
2300
|
+
twMergeRaw: () => twMergeRaw,
|
|
2301
|
+
twMergeWithSeparator: () => twMergeWithSeparator,
|
|
2302
|
+
unregisterPluginHook: () => unregisterPluginHook,
|
|
2303
|
+
validateCssOutput: () => validateCssOutput,
|
|
2304
|
+
validateThemeConfig: () => validateThemeConfig,
|
|
2305
|
+
valueIdToString: () => valueIdToString,
|
|
2306
|
+
walkAndPrefilterSourceFiles: () => walkAndPrefilterSourceFiles,
|
|
2307
|
+
watchAddPattern: () => watchAddPattern,
|
|
2308
|
+
watchClearAll: () => watchClearAll,
|
|
2309
|
+
watchEventTypeToString: () => watchEventTypeToString,
|
|
2310
|
+
watchGetActiveHandles: () => watchGetActiveHandles,
|
|
2311
|
+
watchPause: () => watchPause,
|
|
2312
|
+
watchRemovePattern: () => watchRemovePattern,
|
|
2313
|
+
watchResume: () => watchResume
|
|
1023
2314
|
});
|
|
1024
2315
|
var init_internal = __esm({
|
|
1025
2316
|
"packages/domain/compiler/src/internal.ts"() {
|
|
1026
2317
|
init_src2();
|
|
1027
2318
|
init_tailwindEngine();
|
|
2319
|
+
init_compiler();
|
|
2320
|
+
init_parser();
|
|
2321
|
+
init_analyzer();
|
|
2322
|
+
init_cache();
|
|
2323
|
+
init_redis();
|
|
2324
|
+
init_watch();
|
|
1028
2325
|
}
|
|
1029
2326
|
});
|
|
1030
2327
|
|