tailwind-styled-v4 5.0.12 → 5.0.14

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.
Files changed (69) hide show
  1. package/README.md +100 -4
  2. package/dist/animate.d.mts +4 -0
  3. package/dist/animate.d.ts +4 -0
  4. package/dist/animate.js +22 -0
  5. package/dist/animate.js.map +1 -1
  6. package/dist/animate.mjs +22 -0
  7. package/dist/animate.mjs.map +1 -1
  8. package/dist/atomic.js +56 -14
  9. package/dist/atomic.js.map +1 -1
  10. package/dist/atomic.mjs +56 -14
  11. package/dist/atomic.mjs.map +1 -1
  12. package/dist/cli.js +156 -14
  13. package/dist/cli.js.map +1 -1
  14. package/dist/cli.mjs +156 -14
  15. package/dist/cli.mjs.map +1 -1
  16. package/dist/compiler.d.mts +1045 -991
  17. package/dist/compiler.d.ts +1045 -991
  18. package/dist/compiler.js +891 -925
  19. package/dist/compiler.js.map +1 -1
  20. package/dist/compiler.mjs +890 -925
  21. package/dist/compiler.mjs.map +1 -1
  22. package/dist/engine.js +1651 -354
  23. package/dist/engine.js.map +1 -1
  24. package/dist/engine.mjs +1650 -353
  25. package/dist/engine.mjs.map +1 -1
  26. package/dist/index.browser.mjs +3 -1
  27. package/dist/index.browser.mjs.map +1 -1
  28. package/dist/index.js +1682 -365
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +1682 -365
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/next.js +1076 -986
  33. package/dist/next.js.map +1 -1
  34. package/dist/next.mjs +1076 -986
  35. package/dist/next.mjs.map +1 -1
  36. package/dist/shared.d.mts +3 -2
  37. package/dist/shared.d.ts +3 -2
  38. package/dist/shared.js +1595 -298
  39. package/dist/shared.js.map +1 -1
  40. package/dist/shared.mjs +1595 -298
  41. package/dist/shared.mjs.map +1 -1
  42. package/dist/svelte.js +42 -24
  43. package/dist/svelte.js.map +1 -1
  44. package/dist/svelte.mjs +42 -24
  45. package/dist/svelte.mjs.map +1 -1
  46. package/dist/turbopackLoader.js +1606 -309
  47. package/dist/turbopackLoader.js.map +1 -1
  48. package/dist/turbopackLoader.mjs +1606 -309
  49. package/dist/turbopackLoader.mjs.map +1 -1
  50. package/dist/tw.js +156 -14
  51. package/dist/tw.js.map +1 -1
  52. package/dist/tw.mjs +156 -14
  53. package/dist/tw.mjs.map +1 -1
  54. package/dist/vite.js +1636 -339
  55. package/dist/vite.js.map +1 -1
  56. package/dist/vite.mjs +1636 -339
  57. package/dist/vite.mjs.map +1 -1
  58. package/dist/vue.js +42 -24
  59. package/dist/vue.js.map +1 -1
  60. package/dist/vue.mjs +42 -24
  61. package/dist/vue.mjs.map +1 -1
  62. package/dist/webpackLoader.js +80 -29
  63. package/dist/webpackLoader.js.map +1 -1
  64. package/dist/webpackLoader.mjs +80 -29
  65. package/dist/webpackLoader.mjs.map +1 -1
  66. package/native/tailwind-styled-native.node +0 -0
  67. package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
  68. package/package.json +3 -2
  69. package/native/index.node +0 -0
package/dist/shared.mjs CHANGED
@@ -856,27 +856,15 @@ function resolveNativeBinary(runtimeDir) {
856
856
  }
857
857
  tried.push(`env:${envPath} (not found)`);
858
858
  }
859
- const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
860
- for (const pkg of prebuiltPkgs) {
861
- try {
862
- const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
863
- if (fs3.existsSync(candidate)) {
864
- return { path: candidate, source: "prebuilt", platform, tried };
865
- }
866
- tried.push(`prebuilt:${pkg} (resolved but missing)`);
867
- } catch {
868
- tried.push(`prebuilt:${pkg} (not installed)`);
869
- }
870
- }
871
859
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
872
- const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
860
+ const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser", "index"];
873
861
  if (runtimeDir) {
874
862
  for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
875
863
  const pkgRoot = path.resolve(runtimeDir, depth);
876
864
  for (const bin of BINARY_NAMES_SELF) {
877
865
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
878
866
  const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
879
- tried.push(`self-bundled:${candidate}`);
867
+ tried.push(`native:${candidate}`);
880
868
  if (fs3.existsSync(candidate)) {
881
869
  return { path: candidate, source: "prebuilt", platform, tried };
882
870
  }
@@ -884,6 +872,18 @@ function resolveNativeBinary(runtimeDir) {
884
872
  }
885
873
  }
886
874
  }
875
+ const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
876
+ for (const pkg of prebuiltPkgs) {
877
+ try {
878
+ const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
879
+ if (fs3.existsSync(candidate)) {
880
+ return { path: candidate, source: "prebuilt", platform, tried };
881
+ }
882
+ tried.push(`prebuilt:${pkg} (resolved but missing)`);
883
+ } catch {
884
+ tried.push(`prebuilt:${pkg} (not installed)`);
885
+ }
886
+ }
887
887
  const cwd = process.cwd();
888
888
  const base = runtimeDir ?? cwd;
889
889
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
@@ -1056,11 +1056,484 @@ Tried paths: ${result.tried.join("\n")}`);
1056
1056
  }
1057
1057
  });
1058
1058
 
1059
- // packages/domain/compiler/src/tailwindEngine.ts
1059
+ // packages/domain/compiler/src/compiler/cssGeneratorNative.ts
1060
+ async function generateCssNative(classes, options) {
1061
+ const { theme } = options;
1062
+ const native = getNativeBridge();
1063
+ if (!native?.generateCssNative) {
1064
+ throw new Error(
1065
+ "FATAL: Rust CSS generator (generateCssNative) is required but not available. Ensure native binding is properly loaded. Check that native/.node binary exists."
1066
+ );
1067
+ }
1068
+ const themeJson = JSON.stringify(theme);
1069
+ const css = native.generateCssNative(classes, themeJson);
1070
+ return css;
1071
+ }
1072
+ function clearThemeCache() {
1073
+ try {
1074
+ const native = getNativeBridge();
1075
+ if (!native?.clearThemeCache) {
1076
+ return;
1077
+ }
1078
+ native.clearThemeCache();
1079
+ } catch {
1080
+ }
1081
+ }
1082
+ var init_cssGeneratorNative = __esm({
1083
+ "packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
1084
+ init_nativeBridge();
1085
+ }
1086
+ });
1087
+
1088
+ // packages/domain/compiler/src/compiler/compilationNative.ts
1089
+ function compileCssNative2(classes, prefix) {
1090
+ const native = getNativeBridge();
1091
+ if (!native?.compileCss) throw new Error("compileCss not available");
1092
+ return native.compileCss(classes, prefix);
1093
+ }
1094
+ function compileCssLightning(classes) {
1095
+ const native = getNativeBridge();
1096
+ if (!native?.compileCssLightning) throw new Error("compileCssLightning not available");
1097
+ return native.compileCssLightning(classes);
1098
+ }
1099
+ function extractTwStateConfigsNative(source, filename) {
1100
+ const native = getNativeBridge();
1101
+ if (!native?.extractTwStateConfigs) throw new Error("extractTwStateConfigs not available");
1102
+ return native.extractTwStateConfigs(source, filename);
1103
+ }
1104
+ function generateStaticStateCssNative(inputs, resolvedCss) {
1105
+ const native = getNativeBridge();
1106
+ if (!native?.generateStaticStateCss) throw new Error("generateStaticStateCss not available");
1107
+ return native.generateStaticStateCss(inputs, resolvedCss ?? null);
1108
+ }
1109
+ function extractAndGenerateStateCssNative(source, filename) {
1110
+ const native = getNativeBridge();
1111
+ if (!native?.extractAndGenerateStateCss) throw new Error("extractAndGenerateStateCss not available");
1112
+ return native.extractAndGenerateStateCss(source, filename);
1113
+ }
1114
+ function layoutClassesToCss(classes) {
1115
+ const native = getNativeBridge();
1116
+ if (!native?.layoutClassesToCss) throw new Error("layoutClassesToCss not available");
1117
+ return native.layoutClassesToCss(classes);
1118
+ }
1119
+ function hashContent(input, algorithm = "sha256", length = 8) {
1120
+ const native = getNativeBridge();
1121
+ if (!native?.hashContent) throw new Error("hashContent not available");
1122
+ return native.hashContent(input, algorithm, length);
1123
+ }
1124
+ function extractTwContainerConfigs(source) {
1125
+ const native = getNativeBridge();
1126
+ if (!native?.extractTwContainerConfigs) throw new Error("extractTwContainerConfigs not available");
1127
+ return native.extractTwContainerConfigs(source);
1128
+ }
1129
+ function parseAtomicClass(twClass) {
1130
+ const native = getNativeBridge();
1131
+ if (!native?.parseAtomicClass) throw new Error("parseAtomicClass not available");
1132
+ return native.parseAtomicClass(twClass);
1133
+ }
1134
+ function generateAtomicCss(rulesJson) {
1135
+ const native = getNativeBridge();
1136
+ if (!native?.generateAtomicCss) throw new Error("generateAtomicCss not available");
1137
+ return native.generateAtomicCss(rulesJson);
1138
+ }
1139
+ function toAtomicClasses(twClasses) {
1140
+ const native = getNativeBridge();
1141
+ if (!native?.toAtomicClasses) throw new Error("toAtomicClasses not available");
1142
+ return native.toAtomicClasses(twClasses);
1143
+ }
1144
+ function clearAtomicRegistry() {
1145
+ const native = getNativeBridge();
1146
+ if (!native?.clearAtomicRegistry) return;
1147
+ native.clearAtomicRegistry();
1148
+ }
1149
+ function atomicRegistrySize() {
1150
+ const native = getNativeBridge();
1151
+ if (!native?.atomicRegistrySize) return 0;
1152
+ return native.atomicRegistrySize();
1153
+ }
1154
+ var init_compilationNative = __esm({
1155
+ "packages/domain/compiler/src/compiler/compilationNative.ts"() {
1156
+ init_nativeBridge();
1157
+ }
1158
+ });
1159
+
1160
+ // packages/domain/compiler/src/compiler/cssCompilationNative.ts
1161
+ function compileClass(input) {
1162
+ const native = getNativeBridge();
1163
+ if (!native?.compile_class) throw new Error("compile_class not available");
1164
+ const resultJson = native.compile_class(input);
1165
+ try {
1166
+ return JSON.parse(resultJson);
1167
+ } catch {
1168
+ return {
1169
+ selector: "",
1170
+ declarations: "",
1171
+ properties: [],
1172
+ specificity: 0
1173
+ };
1174
+ }
1175
+ }
1176
+ function compileClasses(inputs) {
1177
+ const native = getNativeBridge();
1178
+ if (!native?.compile_classes) throw new Error("compile_classes not available");
1179
+ const resultJson = native.compile_classes(inputs);
1180
+ try {
1181
+ return JSON.parse(resultJson);
1182
+ } catch {
1183
+ return {
1184
+ css: "",
1185
+ resolved_classes: [],
1186
+ unknown_classes: [],
1187
+ size_bytes: 0,
1188
+ duration_ms: 0
1189
+ };
1190
+ }
1191
+ }
1192
+ function compileToCss(input, minify) {
1193
+ const native = getNativeBridge();
1194
+ if (!native?.compile_to_css) throw new Error("compile_to_css not available");
1195
+ return native.compile_to_css(input, minify ?? false);
1196
+ }
1197
+ function compileToCssBatch(inputs, minify) {
1198
+ const native = getNativeBridge();
1199
+ if (!native?.compile_to_css_batch) throw new Error("compile_to_css_batch not available");
1200
+ return native.compile_to_css_batch(inputs, minify ?? false);
1201
+ }
1202
+ function minifyCss(css) {
1203
+ const native = getNativeBridge();
1204
+ if (!native?.minify_css) throw new Error("minify_css not available");
1205
+ return native.minify_css(css);
1206
+ }
1207
+ function compileAnimation(animationName, from, to) {
1208
+ const native = getNativeBridge();
1209
+ if (!native?.compile_animation) throw new Error("compile_animation not available");
1210
+ const resultJson = native.compile_animation(animationName, from, to);
1211
+ try {
1212
+ return JSON.parse(resultJson);
1213
+ } catch {
1214
+ return {
1215
+ animation_id: "",
1216
+ keyframes_css: "",
1217
+ animation_rule: "",
1218
+ duration_ms: 0
1219
+ };
1220
+ }
1221
+ }
1222
+ function compileKeyframes(name, stopsJson) {
1223
+ const native = getNativeBridge();
1224
+ if (!native?.compile_keyframes) throw new Error("compile_keyframes not available");
1225
+ const resultJson = native.compile_keyframes(name, stopsJson);
1226
+ try {
1227
+ return JSON.parse(resultJson);
1228
+ } catch {
1229
+ return {
1230
+ animation_id: "",
1231
+ keyframes_css: "",
1232
+ animation_rule: "",
1233
+ duration_ms: 0
1234
+ };
1235
+ }
1236
+ }
1237
+ function compileTheme(tokensJson, themeName, prefix) {
1238
+ const native = getNativeBridge();
1239
+ if (!native?.compile_theme) throw new Error("compile_theme not available");
1240
+ const resultJson = native.compile_theme(tokensJson, themeName, prefix);
1241
+ try {
1242
+ return JSON.parse(resultJson);
1243
+ } catch {
1244
+ return {
1245
+ selector: ":root",
1246
+ variables: [],
1247
+ variables_css: "",
1248
+ theme_name: themeName
1249
+ };
1250
+ }
1251
+ }
1252
+ function twMerge(classString) {
1253
+ const native = getNativeBridge();
1254
+ if (!native?.tw_merge) throw new Error("tw_merge not available");
1255
+ return native.tw_merge(classString);
1256
+ }
1257
+ function twMergeMany(classStrings) {
1258
+ const native = getNativeBridge();
1259
+ if (!native?.tw_merge_many) throw new Error("tw_merge_many not available");
1260
+ return native.tw_merge_many(classStrings);
1261
+ }
1262
+ function twMergeWithSeparator(classString, options) {
1263
+ const native = getNativeBridge();
1264
+ if (!native?.tw_merge_with_separator)
1265
+ throw new Error("tw_merge_with_separator not available");
1266
+ const opts = {
1267
+ separator: options.separator,
1268
+ debug: options.debug
1269
+ };
1270
+ return native.tw_merge_with_separator(classString, opts);
1271
+ }
1272
+ function twMergeManyWithSeparator(classStrings, options) {
1273
+ const native = getNativeBridge();
1274
+ if (!native?.tw_merge_many_with_separator)
1275
+ throw new Error("tw_merge_many_with_separator not available");
1276
+ const opts = {
1277
+ separator: options.separator,
1278
+ debug: options.debug
1279
+ };
1280
+ return native.tw_merge_many_with_separator(classStrings, opts);
1281
+ }
1282
+ function twMergeRaw(classLists) {
1283
+ const native = getNativeBridge();
1284
+ if (!native?.tw_merge_raw) throw new Error("tw_merge_raw not available");
1285
+ return native.tw_merge_raw(classLists);
1286
+ }
1287
+ var init_cssCompilationNative = __esm({
1288
+ "packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
1289
+ init_nativeBridge();
1290
+ }
1291
+ });
1292
+
1293
+ // packages/domain/compiler/src/compiler/idRegistryNative.ts
1294
+ function idRegistryCreate() {
1295
+ const native = getNativeBridge();
1296
+ if (!native?.id_registry_create) throw new Error("id_registry_create not available");
1297
+ return native.id_registry_create();
1298
+ }
1299
+ function idRegistryGenerate(handle, name) {
1300
+ const native = getNativeBridge();
1301
+ if (!native?.id_registry_generate) throw new Error("id_registry_generate not available");
1302
+ return native.id_registry_generate(handle, name);
1303
+ }
1304
+ function idRegistryLookup(handle, name) {
1305
+ const native = getNativeBridge();
1306
+ if (!native?.id_registry_lookup) throw new Error("id_registry_lookup not available");
1307
+ return native.id_registry_lookup(handle, name);
1308
+ }
1309
+ function idRegistryNext(handle) {
1310
+ const native = getNativeBridge();
1311
+ if (!native?.id_registry_next) throw new Error("id_registry_next not available");
1312
+ return native.id_registry_next(handle);
1313
+ }
1314
+ function idRegistryDestroy(handle) {
1315
+ const native = getNativeBridge();
1316
+ if (!native?.id_registry_destroy) return;
1317
+ native.id_registry_destroy(handle);
1318
+ }
1319
+ function idRegistryReset(handle) {
1320
+ const native = getNativeBridge();
1321
+ if (!native?.id_registry_reset) return;
1322
+ native.id_registry_reset(handle);
1323
+ }
1324
+ function idRegistrySnapshot(handle) {
1325
+ const native = getNativeBridge();
1326
+ if (!native?.id_registry_snapshot) throw new Error("id_registry_snapshot not available");
1327
+ const snapshotJson = native.id_registry_snapshot(handle);
1328
+ try {
1329
+ return JSON.parse(snapshotJson);
1330
+ } catch {
1331
+ return {
1332
+ handle,
1333
+ next_id: 0,
1334
+ entries: [],
1335
+ total_entries: 0
1336
+ };
1337
+ }
1338
+ }
1339
+ function idRegistryActiveCount() {
1340
+ const native = getNativeBridge();
1341
+ if (!native?.id_registry_active_count) throw new Error("id_registry_active_count not available");
1342
+ return native.id_registry_active_count();
1343
+ }
1344
+ function registerPropertyName(propertyName) {
1345
+ const native = getNativeBridge();
1346
+ if (!native?.register_property_name)
1347
+ throw new Error("register_property_name not available");
1348
+ return native.register_property_name(propertyName);
1349
+ }
1350
+ function registerValueName(valueName) {
1351
+ const native = getNativeBridge();
1352
+ if (!native?.register_value_name) throw new Error("register_value_name not available");
1353
+ return native.register_value_name(valueName);
1354
+ }
1355
+ function propertyIdToString(propertyId) {
1356
+ const native = getNativeBridge();
1357
+ if (!native?.property_id_to_string) throw new Error("property_id_to_string not available");
1358
+ return native.property_id_to_string(propertyId);
1359
+ }
1360
+ function valueIdToString(valueId) {
1361
+ const native = getNativeBridge();
1362
+ if (!native?.value_id_to_string) throw new Error("value_id_to_string not available");
1363
+ return native.value_id_to_string(valueId);
1364
+ }
1365
+ function reverseLookupProperty(propertyId) {
1366
+ const native = getNativeBridge();
1367
+ if (!native?.reverse_lookup_property)
1368
+ throw new Error("reverse_lookup_property not available");
1369
+ return native.reverse_lookup_property(propertyId);
1370
+ }
1371
+ function reverseLookupValue(valueId) {
1372
+ const native = getNativeBridge();
1373
+ if (!native?.reverse_lookup_value) throw new Error("reverse_lookup_value not available");
1374
+ return native.reverse_lookup_value(valueId);
1375
+ }
1376
+ function idRegistryExport(handle) {
1377
+ const native = getNativeBridge();
1378
+ if (!native?.id_registry_export) throw new Error("id_registry_export not available");
1379
+ return native.id_registry_export(handle);
1380
+ }
1381
+ function idRegistryImport(importedData) {
1382
+ const native = getNativeBridge();
1383
+ if (!native?.id_registry_import) throw new Error("id_registry_import not available");
1384
+ return native.id_registry_import(importedData);
1385
+ }
1386
+ var init_idRegistryNative = __esm({
1387
+ "packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
1388
+ init_nativeBridge();
1389
+ }
1390
+ });
1391
+
1392
+ // packages/domain/compiler/src/compiler/streamingNative.ts
1393
+ function processFileChange(fileChangeJson) {
1394
+ const native = getNativeBridge();
1395
+ if (!native?.process_file_change) throw new Error("process_file_change not available");
1396
+ const resultJson = native.process_file_change(fileChangeJson);
1397
+ try {
1398
+ return JSON.parse(resultJson);
1399
+ } catch {
1400
+ return {
1401
+ file_path: "",
1402
+ status: "error",
1403
+ old_classes: [],
1404
+ new_classes: [],
1405
+ added_classes: [],
1406
+ removed_classes: [],
1407
+ changed: false,
1408
+ fingerprint: "",
1409
+ error: "Failed to parse result"
1410
+ };
1411
+ }
1412
+ }
1413
+ function computeIncrementalDiff(oldScanJson, newScanJson) {
1414
+ const native = getNativeBridge();
1415
+ if (!native?.compute_incremental_diff)
1416
+ throw new Error("compute_incremental_diff not available");
1417
+ const resultJson = native.compute_incremental_diff(oldScanJson, newScanJson);
1418
+ try {
1419
+ return JSON.parse(resultJson);
1420
+ } catch {
1421
+ return {
1422
+ is_changed: false,
1423
+ changes_count: 0,
1424
+ diff: {
1425
+ added_files: [],
1426
+ removed_files: [],
1427
+ modified_files: [],
1428
+ added_classes: [],
1429
+ removed_classes: [],
1430
+ total_changes: 0
1431
+ },
1432
+ processing_time_ms: 0
1433
+ };
1434
+ }
1435
+ }
1436
+ function createFingerprint(filePath, fileContent) {
1437
+ const native = getNativeBridge();
1438
+ if (!native?.create_fingerprint) throw new Error("create_fingerprint not available");
1439
+ const fingerprintJson = native.create_fingerprint(filePath, fileContent);
1440
+ try {
1441
+ return JSON.parse(fingerprintJson);
1442
+ } catch {
1443
+ return {
1444
+ file_path: filePath,
1445
+ content_hash: "",
1446
+ size_bytes: fileContent.length,
1447
+ mtime_ms: Date.now(),
1448
+ class_hash: "",
1449
+ signature: ""
1450
+ };
1451
+ }
1452
+ }
1453
+ function injectStateHash(css, stateHash) {
1454
+ const native = getNativeBridge();
1455
+ if (!native?.inject_state_hash) throw new Error("inject_state_hash not available");
1456
+ const resultJson = native.inject_state_hash(css, stateHash);
1457
+ try {
1458
+ return JSON.parse(resultJson);
1459
+ } catch {
1460
+ return {
1461
+ injected: false,
1462
+ state_hash: stateHash,
1463
+ affected_files: 0,
1464
+ total_injected_bytes: 0
1465
+ };
1466
+ }
1467
+ }
1468
+ function pruneStaleCacheEntries(maxAgeSeconds, maxEntries) {
1469
+ const native = getNativeBridge();
1470
+ if (!native?.prune_stale_entries) throw new Error("prune_stale_entries not available");
1471
+ const resultJson = native.prune_stale_entries(maxAgeSeconds, maxEntries);
1472
+ try {
1473
+ return JSON.parse(resultJson);
1474
+ } catch {
1475
+ return {
1476
+ entries_before: 0,
1477
+ entries_after: 0,
1478
+ entries_removed: 0,
1479
+ freed_bytes: 0
1480
+ };
1481
+ }
1482
+ }
1483
+ function rebuildWorkspaceResult(rootDir, extensions) {
1484
+ const native = getNativeBridge();
1485
+ if (!native?.rebuild_workspace_result)
1486
+ throw new Error("rebuild_workspace_result not available");
1487
+ const resultJson = native.rebuild_workspace_result(rootDir, extensions || []);
1488
+ try {
1489
+ return JSON.parse(resultJson);
1490
+ } catch {
1491
+ return {
1492
+ total_files_scanned: 0,
1493
+ total_classes_found: 0,
1494
+ unique_classes: 0,
1495
+ build_time_ms: 0,
1496
+ files_with_changes: 0
1497
+ };
1498
+ }
1499
+ }
1500
+ function scanFileNative(filePath, fileContent) {
1501
+ const native = getNativeBridge();
1502
+ if (!native?.scan_file_native) throw new Error("scan_file_native not available");
1503
+ const resultJson = native.scan_file_native(filePath, fileContent);
1504
+ try {
1505
+ return JSON.parse(resultJson);
1506
+ } catch {
1507
+ return {
1508
+ file: filePath,
1509
+ classes: [],
1510
+ added_classes: [],
1511
+ removed_classes: [],
1512
+ changed: false
1513
+ };
1514
+ }
1515
+ }
1516
+ function scanFilesBatchNative(filesJson) {
1517
+ const native = getNativeBridge();
1518
+ if (!native?.scan_files_batch_native)
1519
+ throw new Error("scan_files_batch_native not available");
1520
+ const resultJson = native.scan_files_batch_native(filesJson);
1521
+ try {
1522
+ return JSON.parse(resultJson);
1523
+ } catch {
1524
+ return [];
1525
+ }
1526
+ }
1527
+ var init_streamingNative = __esm({
1528
+ "packages/domain/compiler/src/compiler/streamingNative.ts"() {
1529
+ init_nativeBridge();
1530
+ }
1531
+ });
1532
+
1533
+ // packages/domain/compiler/src/compiler/tailwindEngine.ts
1060
1534
  var tailwindEngine_exports = {};
1061
1535
  __export(tailwindEngine_exports, {
1062
1536
  clearCache: () => clearCache,
1063
- generateRawCss: () => generateRawCss,
1064
1537
  getCacheStats: () => getCacheStats,
1065
1538
  processTailwindCssWithTargets: () => processTailwindCssWithTargets,
1066
1539
  runCssPipeline: () => runCssPipeline,
@@ -1094,48 +1567,6 @@ function clearCache() {
1094
1567
  _cacheHits = 0;
1095
1568
  _cacheMisses = 0;
1096
1569
  }
1097
- function loadTailwindEngine() {
1098
- if (_twEngine) return _twEngine;
1099
- if (_twEngineError) throw _twEngineError;
1100
- try {
1101
- const tw = require2("tailwindcss");
1102
- if (typeof tw.compile !== "function") {
1103
- throw new Error("tailwindcss v4 not found \u2014 compile() API missing. Check tailwindcss version >= 4.");
1104
- }
1105
- _twEngine = tw;
1106
- return _twEngine;
1107
- } catch (e) {
1108
- _twEngineError = e instanceof Error ? e : new Error(String(e));
1109
- throw _twEngineError;
1110
- }
1111
- }
1112
- async function generateRawCss(classes, cssEntryContent, root) {
1113
- if (classes.length === 0) return "";
1114
- const tw = loadTailwindEngine();
1115
- const input = cssEntryContent ?? "@import 'tailwindcss';";
1116
- const { readFileSync, existsSync: existsSync3 } = await import('fs');
1117
- const { dirname, resolve: resolve2 } = await import('path');
1118
- const projectRoot = root ?? process.cwd();
1119
- const req = createRequire(resolve2(projectRoot, "package.json"));
1120
- const loadStylesheet = async (id, base) => {
1121
- try {
1122
- 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;
1123
- const pkgPath = req.resolve(cssId);
1124
- return { content: readFileSync(pkgPath, "utf-8"), base: dirname(pkgPath) };
1125
- } catch {
1126
- try {
1127
- const absPath = resolve2(base, id);
1128
- if (existsSync3(absPath)) {
1129
- return { content: readFileSync(absPath, "utf-8"), base: dirname(absPath) };
1130
- }
1131
- } catch {
1132
- }
1133
- return { content: "", base };
1134
- }
1135
- };
1136
- const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
1137
- return compiler.build(classes);
1138
- }
1139
1570
  function getThemeConfig() {
1140
1571
  return {
1141
1572
  colors: {
@@ -1232,20 +1663,9 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
1232
1663
  _cacheMisses++;
1233
1664
  let rawCss;
1234
1665
  let usedRustCompiler = false;
1235
- try {
1236
- const theme = getThemeConfig();
1237
- rawCss = await generateCssNative(unique, {
1238
- theme,
1239
- fallbackToJs: true,
1240
- logFallback: process.env.DEBUG?.includes("compiler") === true
1241
- });
1242
- usedRustCompiler = true;
1243
- } catch (error) {
1244
- if (process.env.DEBUG?.includes("compiler")) {
1245
- console.warn("[Compiler] Rust compiler failed, using JavaScript Tailwind:", error);
1246
- }
1247
- rawCss = await generateRawCss(unique, cssEntryContent, root);
1248
- }
1666
+ const theme = getThemeConfig();
1667
+ rawCss = await generateCssNative(unique, { theme });
1668
+ usedRustCompiler = true;
1249
1669
  const finalCss = minify ? postProcessWithLightning(rawCss) : rawCss;
1250
1670
  if (process.env.DEBUG?.includes("compiler")) {
1251
1671
  console.log(
@@ -1277,53 +1697,886 @@ function processTailwindCssWithTargets(css, targets) {
1277
1697
  }
1278
1698
  return result.css;
1279
1699
  }
1280
- var require2, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, _twEngine, _twEngineError;
1700
+ var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
1281
1701
  var init_tailwindEngine = __esm({
1282
- "packages/domain/compiler/src/tailwindEngine.ts"() {
1702
+ "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
1283
1703
  init_nativeBridge();
1284
1704
  init_cssGeneratorNative();
1285
- require2 = createRequire(import.meta.url);
1705
+ createRequire(import.meta.url);
1286
1706
  _cssCache = /* @__PURE__ */ new Map();
1287
1707
  _cacheHits = 0;
1288
1708
  _cacheMisses = 0;
1289
1709
  MAX_CACHE_SIZE = 100;
1290
- _twEngine = null;
1291
- _twEngineError = null;
1292
1710
  }
1293
1711
  });
1294
1712
 
1295
- // packages/domain/compiler/src/cssGeneratorNative.ts
1296
- async function generateCssNative(classes, options) {
1297
- const {
1298
- theme,
1299
- fallbackToJs = true,
1300
- logFallback = false
1301
- } = options;
1302
- try {
1303
- const native = getNativeBridge();
1304
- if (!native?.generateCssNative) {
1305
- throw new Error("generateCssNative not available in native binding");
1306
- }
1307
- const themeJson = JSON.stringify(theme);
1308
- const css = native.generateCssNative(classes, themeJson);
1309
- return css;
1310
- } catch (error) {
1311
- if (!fallbackToJs) {
1312
- throw error;
1313
- }
1314
- if (logFallback) {
1315
- console.warn(
1316
- "[CSS Compiler] Rust CSS generator unavailable, falling back to JavaScript Tailwind",
1317
- error instanceof Error ? error.message : String(error)
1318
- );
1319
- }
1320
- return generateRawCss(classes);
1713
+ // packages/domain/compiler/src/compiler/index.ts
1714
+ var init_compiler = __esm({
1715
+ "packages/domain/compiler/src/compiler/index.ts"() {
1716
+ init_cssGeneratorNative();
1717
+ init_compilationNative();
1718
+ init_cssCompilationNative();
1719
+ init_idRegistryNative();
1720
+ init_streamingNative();
1321
1721
  }
1322
- }
1323
- var init_cssGeneratorNative = __esm({
1324
- "packages/domain/compiler/src/cssGeneratorNative.ts"() {
1722
+ });
1723
+
1724
+ // packages/domain/compiler/src/parser/index.ts
1725
+ var parser_exports = {};
1726
+ __export(parser_exports, {
1727
+ astExtractClasses: () => astExtractClasses,
1728
+ batchExtractClasses: () => batchExtractClasses,
1729
+ checkAgainstSafelist: () => checkAgainstSafelist,
1730
+ diffClassLists: () => diffClassLists,
1731
+ extractAllClasses: () => extractAllClasses,
1732
+ extractClassesFromSource: () => extractClassesFromSource,
1733
+ extractComponentUsage: () => extractComponentUsage,
1734
+ mergeClassesStatic: () => mergeClassesStatic,
1735
+ normalizeAndDedupClasses: () => normalizeAndDedupClasses,
1736
+ normalizeClasses: () => normalizeClasses,
1737
+ parseClasses: () => parseClasses
1738
+ });
1739
+ var parseClasses, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
1740
+ var init_parser = __esm({
1741
+ "packages/domain/compiler/src/parser/index.ts"() {
1742
+ init_nativeBridge();
1743
+ parseClasses = (raw) => {
1744
+ const native = getNativeBridge();
1745
+ if (!native?.parseClasses) {
1746
+ throw new Error("FATAL: Native binding 'parseClasses' is required but not available.");
1747
+ }
1748
+ return native.parseClasses(raw) || [];
1749
+ };
1750
+ extractAllClasses = (source) => {
1751
+ const native = getNativeBridge();
1752
+ if (!native?.extractAllClasses) {
1753
+ throw new Error("FATAL: Native binding 'extractAllClasses' is required but not available.");
1754
+ }
1755
+ return native.extractAllClasses(source) || [];
1756
+ };
1757
+ extractClassesFromSource = (source) => {
1758
+ const native = getNativeBridge();
1759
+ if (!native?.extractClassesFromSource) {
1760
+ throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
1761
+ }
1762
+ const result = native.extractClassesFromSource(source);
1763
+ return Array.isArray(result) ? result.join(" ") : String(result || "");
1764
+ };
1765
+ astExtractClasses = (source, _filename) => {
1766
+ const native = getNativeBridge();
1767
+ if (!native?.extractClassesFromSource) {
1768
+ throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
1769
+ }
1770
+ return native.extractClassesFromSource(source) || [];
1771
+ };
1772
+ normalizeClasses = (raw) => {
1773
+ const result = normalizeAndDedupClasses(raw);
1774
+ return result?.normalized || "";
1775
+ };
1776
+ mergeClassesStatic = (classes) => {
1777
+ const result = normalizeAndDedupClasses(classes);
1778
+ return result?.normalized || "";
1779
+ };
1780
+ normalizeAndDedupClasses = (raw) => {
1781
+ const native = getNativeBridge();
1782
+ if (!native?.normalizeAndDedupClasses) {
1783
+ throw new Error("FATAL: Native binding 'normalizeAndDedupClasses' is required but not available.");
1784
+ }
1785
+ const result = native.normalizeAndDedupClasses(raw);
1786
+ return result || { normalized: "", duplicatesRemoved: 0, uniqueCount: 0 };
1787
+ };
1788
+ extractComponentUsage = (source) => {
1789
+ const native = getNativeBridge();
1790
+ if (!native?.extractComponentUsage) {
1791
+ throw new Error("FATAL: Native binding 'extractComponentUsage' is required but not available.");
1792
+ }
1793
+ return native.extractComponentUsage(source) || [];
1794
+ };
1795
+ batchExtractClasses = (filePaths) => {
1796
+ const native = getNativeBridge();
1797
+ if (!native?.batchExtractClasses) {
1798
+ throw new Error("FATAL: Native binding 'batchExtractClasses' is required but not available.");
1799
+ }
1800
+ return native.batchExtractClasses(filePaths) || [];
1801
+ };
1802
+ checkAgainstSafelist = (classes, safelist) => {
1803
+ const native = getNativeBridge();
1804
+ if (!native?.checkAgainstSafelist) {
1805
+ throw new Error("FATAL: Native binding 'checkAgainstSafelist' is required but not available.");
1806
+ }
1807
+ return native.checkAgainstSafelist(classes, safelist) || { matched: [], unmatched: [], safelistSize: 0 };
1808
+ };
1809
+ diffClassLists = (previous, current) => {
1810
+ const native = getNativeBridge();
1811
+ if (!native?.diffClassLists) {
1812
+ throw new Error("FATAL: Native binding 'diffClassLists' is required but not available.");
1813
+ }
1814
+ return native.diffClassLists(previous, current) || { added: [], removed: [], unchanged: [], hasChanges: false };
1815
+ };
1816
+ }
1817
+ });
1818
+
1819
+ // packages/domain/compiler/src/analyzer/analyzerNative.ts
1820
+ function detectDeadCode(scanResultJson, css) {
1821
+ const native = getNativeBridge();
1822
+ if (!native?.detectDeadCode) throw new Error("detectDeadCode not available");
1823
+ return native.detectDeadCode(scanResultJson, css);
1824
+ }
1825
+ function analyzeClassUsageNative(classes, scanResultJson, css) {
1826
+ const native = getNativeBridge();
1827
+ if (!native?.analyzeClassUsage) throw new Error("analyzeClassUsage not available");
1828
+ return native.analyzeClassUsage(classes, scanResultJson, css);
1829
+ }
1830
+ function analyzeClassesNative(filesJson, cwd, flags) {
1831
+ const native = getNativeBridge();
1832
+ if (!native?.analyzeClasses) throw new Error("analyzeClasses not available");
1833
+ return native.analyzeClasses(filesJson, cwd, flags ?? 0);
1834
+ }
1835
+ function analyzeRscNative(source, filename) {
1836
+ const native = getNativeBridge();
1837
+ if (!native?.analyzeRsc) throw new Error("analyzeRsc not available");
1838
+ return native.analyzeRsc(source, filename);
1839
+ }
1840
+ function optimizeCssNative(css) {
1841
+ const native = getNativeBridge();
1842
+ if (!native?.processTailwindCssLightning) throw new Error("processTailwindCssLightning not available");
1843
+ const result = native.processTailwindCssLightning(css);
1844
+ return {
1845
+ css: result.css,
1846
+ originalSize: css.length,
1847
+ optimizedSize: result.size_bytes,
1848
+ reductionPercentage: (css.length - result.size_bytes) / css.length * 100
1849
+ };
1850
+ }
1851
+ function processTailwindCssLightning(css) {
1852
+ const native = getNativeBridge();
1853
+ if (!native?.processTailwindCssLightning) throw new Error("processTailwindCssLightning not available");
1854
+ return native.processTailwindCssLightning(css);
1855
+ }
1856
+ function eliminateDeadCssNative(css, deadClasses) {
1857
+ const native = getNativeBridge();
1858
+ if (!native?.eliminateDeadCss) throw new Error("eliminateDeadCss not available");
1859
+ return native.eliminateDeadCss(css, deadClasses);
1860
+ }
1861
+ function hoistComponentsNative(source) {
1862
+ const native = getNativeBridge();
1863
+ if (!native?.hoistComponents) throw new Error("hoistComponents not available");
1864
+ return native.hoistComponents(source);
1865
+ }
1866
+ function compileVariantTableNative(configJson) {
1867
+ const native = getNativeBridge();
1868
+ if (!native?.compileVariantTable) throw new Error("compileVariantTable not available");
1869
+ return native.compileVariantTable(configJson);
1870
+ }
1871
+ function classifyAndSortClassesNative(classes) {
1872
+ const native = getNativeBridge();
1873
+ if (!native?.classifyAndSortClasses) throw new Error("classifyAndSortClasses not available");
1874
+ return native.classifyAndSortClasses(classes);
1875
+ }
1876
+ function mergeCssDeclarationsNative(cssChunks) {
1877
+ const native = getNativeBridge();
1878
+ if (!native?.mergeCssDeclarations) throw new Error("mergeCssDeclarations not available");
1879
+ return native.mergeCssDeclarations(cssChunks);
1880
+ }
1881
+ var init_analyzerNative = __esm({
1882
+ "packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
1883
+ init_nativeBridge();
1884
+ }
1885
+ });
1886
+
1887
+ // packages/domain/compiler/src/analyzer/themeResolutionNative.ts
1888
+ function resolveVariants(configJson) {
1889
+ const native = getNativeBridge();
1890
+ if (!native?.resolve_variants) throw new Error("resolve_variants not available");
1891
+ const resultJson = native.resolve_variants(configJson);
1892
+ try {
1893
+ return JSON.parse(resultJson);
1894
+ } catch {
1895
+ return {
1896
+ variants: [],
1897
+ supported: [],
1898
+ deprecated: [],
1899
+ conflicting: []
1900
+ };
1901
+ }
1902
+ }
1903
+ function validateThemeConfig(configJson) {
1904
+ const native = getNativeBridge();
1905
+ if (!native?.validate_variant_config) throw new Error("validate_variant_config not available");
1906
+ const resultJson = native.validate_variant_config(configJson);
1907
+ try {
1908
+ return JSON.parse(resultJson);
1909
+ } catch {
1910
+ return {
1911
+ is_valid: false,
1912
+ errors: ["Unable to parse configuration"],
1913
+ warnings: [],
1914
+ suggestions: []
1915
+ };
1916
+ }
1917
+ }
1918
+ function resolveCascade(baseThemeJson, overridesJson) {
1919
+ const native = getNativeBridge();
1920
+ if (!native?.resolve_cascade) throw new Error("resolve_cascade not available");
1921
+ const resultJson = native.resolve_cascade(baseThemeJson, overridesJson);
1922
+ try {
1923
+ return JSON.parse(resultJson);
1924
+ } catch {
1925
+ return {
1926
+ base_theme: {},
1927
+ user_overrides: {},
1928
+ merged_theme: {},
1929
+ conflict_resolutions: []
1930
+ };
1931
+ }
1932
+ }
1933
+ function resolveClassNames(classNames, themeJson) {
1934
+ const native = getNativeBridge();
1935
+ if (!native?.resolve_class_names) throw new Error("resolve_class_names not available");
1936
+ const resultJson = native.resolve_class_names(classNames, themeJson);
1937
+ try {
1938
+ return JSON.parse(resultJson);
1939
+ } catch {
1940
+ return [];
1941
+ }
1942
+ }
1943
+ function resolveConflictGroup(groupName, themeJson) {
1944
+ const native = getNativeBridge();
1945
+ if (!native?.resolve_conflict_group)
1946
+ throw new Error("resolve_conflict_group not available");
1947
+ const resultJson = native.resolve_conflict_group(groupName, themeJson);
1948
+ try {
1949
+ return JSON.parse(resultJson);
1950
+ } catch {
1951
+ return {
1952
+ group_name: groupName,
1953
+ conflicting_classes: [],
1954
+ description: "",
1955
+ resolution_strategy: "last-wins"
1956
+ };
1957
+ }
1958
+ }
1959
+ function resolveThemeValue(keyPath, themeJson) {
1960
+ const native = getNativeBridge();
1961
+ if (!native?.resolve_theme_value) throw new Error("resolve_theme_value not available");
1962
+ return native.resolve_theme_value(keyPath, themeJson);
1963
+ }
1964
+ function resolveSimpleVariants(configJson) {
1965
+ const native = getNativeBridge();
1966
+ if (!native?.resolve_simple_variants) throw new Error("resolve_simple_variants not available");
1967
+ const resultJson = native.resolve_simple_variants(configJson);
1968
+ try {
1969
+ return JSON.parse(resultJson);
1970
+ } catch {
1971
+ return [];
1972
+ }
1973
+ }
1974
+ var init_themeResolutionNative = __esm({
1975
+ "packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
1976
+ init_nativeBridge();
1977
+ }
1978
+ });
1979
+
1980
+ // packages/domain/compiler/src/analyzer/scannerNative.ts
1981
+ function scanWorkspace(root, extensions) {
1982
+ const native = getNativeBridge();
1983
+ if (!native?.scan_workspace) throw new Error("scan_workspace not available");
1984
+ return native.scan_workspace(root, extensions);
1985
+ }
1986
+ function extractClassesFromSourceNative(source) {
1987
+ const native = getNativeBridge();
1988
+ if (!native?.extract_classes_from_source) throw new Error("extract_classes_from_source not available");
1989
+ return native.extract_classes_from_source(source);
1990
+ }
1991
+ function batchExtractClassesNative(filePaths) {
1992
+ const native = getNativeBridge();
1993
+ if (!native?.batch_extract_classes) throw new Error("batch_extract_classes not available");
1994
+ return native.batch_extract_classes(filePaths);
1995
+ }
1996
+ function checkAgainstSafelistNative(classes, safelist) {
1997
+ const native = getNativeBridge();
1998
+ if (!native?.check_against_safelist) throw new Error("check_against_safelist not available");
1999
+ return native.check_against_safelist(classes, safelist);
2000
+ }
2001
+ function scanFile(filePath) {
2002
+ const native = getNativeBridge();
2003
+ if (!native?.scan_file) throw new Error("scan_file not available");
2004
+ return native.scan_file(filePath);
2005
+ }
2006
+ function collectFiles(root, extensions) {
2007
+ const native = getNativeBridge();
2008
+ if (!native?.collect_files) throw new Error("collect_files not available");
2009
+ return native.collect_files(root, extensions);
2010
+ }
2011
+ function walkAndPrefilterSourceFiles(root, extensions, _parallel) {
2012
+ const native = getNativeBridge();
2013
+ if (!native?.walk_and_prefilter_source_files) throw new Error("walk_and_prefilter_source_files not available");
2014
+ return native.walk_and_prefilter_source_files(root, extensions);
2015
+ }
2016
+ function generateSubComponentTypes(root, outputPath) {
2017
+ const native = getNativeBridge();
2018
+ if (!native?.generate_sub_component_types) throw new Error("generate_sub_component_types not available");
2019
+ return native.generate_sub_component_types(root, outputPath);
2020
+ }
2021
+ var init_scannerNative = __esm({
2022
+ "packages/domain/compiler/src/analyzer/scannerNative.ts"() {
2023
+ init_nativeBridge();
2024
+ }
2025
+ });
2026
+
2027
+ // packages/domain/compiler/src/analyzer/index.ts
2028
+ var init_analyzer = __esm({
2029
+ "packages/domain/compiler/src/analyzer/index.ts"() {
2030
+ init_analyzerNative();
2031
+ init_themeResolutionNative();
2032
+ init_scannerNative();
2033
+ }
2034
+ });
2035
+
2036
+ // packages/domain/compiler/src/cache/cacheNative.ts
2037
+ function getCacheStatistics() {
2038
+ const native = getNativeBridge();
2039
+ if (!native?.get_cache_statistics) throw new Error("get_cache_statistics not available");
2040
+ const statsJson = native.get_cache_statistics();
2041
+ try {
2042
+ return JSON.parse(statsJson);
2043
+ } catch {
2044
+ return {
2045
+ parse_cache: { hits: 0, misses: 0, size: 0 },
2046
+ resolve_cache: { hits: 0, misses: 0, size: 0 },
2047
+ compile_cache: { hits: 0, misses: 0, size: 0 },
2048
+ css_gen_cache: { hits: 0, misses: 0, size: 0 },
2049
+ overall_hit_rate: 0,
2050
+ total_memory_bytes: 0
2051
+ };
2052
+ }
2053
+ }
2054
+ function clearAllCaches() {
2055
+ const native = getNativeBridge();
2056
+ if (!native?.clear_all_caches) return;
2057
+ try {
2058
+ native.clear_all_caches();
2059
+ } catch {
2060
+ }
2061
+ }
2062
+ function clearParseCache() {
2063
+ const native = getNativeBridge();
2064
+ if (!native?.clear_parse_cache) return;
2065
+ try {
2066
+ native.clear_parse_cache();
2067
+ } catch {
2068
+ }
2069
+ }
2070
+ function clearResolveCache() {
2071
+ const native = getNativeBridge();
2072
+ if (!native?.clear_resolve_cache) return;
2073
+ try {
2074
+ native.clear_resolve_cache();
2075
+ } catch {
2076
+ }
2077
+ }
2078
+ function clearCompileCache() {
2079
+ const native = getNativeBridge();
2080
+ if (!native?.clear_compile_cache) return;
2081
+ try {
2082
+ native.clear_compile_cache();
2083
+ } catch {
2084
+ }
2085
+ }
2086
+ function clearCssGenCache() {
2087
+ const native = getNativeBridge();
2088
+ if (!native?.clear_css_gen_cache) return;
2089
+ try {
2090
+ native.clear_css_gen_cache();
2091
+ } catch {
2092
+ }
2093
+ }
2094
+ function getCacheOptimizationHints(hitRatePercent, memoryUsedMb) {
2095
+ const native = getNativeBridge();
2096
+ if (!native?.get_cache_optimization_hints)
2097
+ throw new Error("get_cache_optimization_hints not available");
2098
+ const hintsJson = native.get_cache_optimization_hints(
2099
+ Math.min(100, Math.max(0, hitRatePercent)),
2100
+ Math.max(1, memoryUsedMb)
2101
+ );
2102
+ try {
2103
+ return JSON.parse(hintsJson);
2104
+ } catch {
2105
+ return {
2106
+ current_strategy: "unknown",
2107
+ recommended_strategy: "increase_size",
2108
+ estimated_improvement_percent: 0,
2109
+ suggested_memory_mb: 256,
2110
+ notes: ["Unable to analyze cache statistics"]
2111
+ };
2112
+ }
2113
+ }
2114
+ function estimateOptimalCacheConfig(totalBudgetMb, workloadType) {
2115
+ const native = getNativeBridge();
2116
+ if (!native?.estimate_optimal_cache_config_native)
2117
+ throw new Error("estimate_optimal_cache_config_native not available");
2118
+ const configJson = native.estimate_optimal_cache_config_native(
2119
+ Math.max(64, totalBudgetMb),
2120
+ workloadType
2121
+ );
2122
+ try {
2123
+ return JSON.parse(configJson);
2124
+ } catch {
2125
+ return {
2126
+ parse_cache_size: 128,
2127
+ resolve_cache_size: 64,
2128
+ compile_cache_size: 256,
2129
+ css_gen_cache_size: 128,
2130
+ recommended_eviction_policy: "lru",
2131
+ ttl_seconds: 3600,
2132
+ expected_hit_rate_percent: 75
2133
+ };
2134
+ }
2135
+ }
2136
+ function cacheRead(cachePath) {
2137
+ const native = getNativeBridge();
2138
+ if (!native?.cache_read) throw new Error("cache_read not available");
2139
+ const result = native.cache_read(cachePath);
2140
+ try {
2141
+ return JSON.parse(result.entries_json || "[]");
2142
+ } catch {
2143
+ return [];
2144
+ }
2145
+ }
2146
+ function cacheWrite(cachePath, entries) {
2147
+ const native = getNativeBridge();
2148
+ if (!native?.cache_write) throw new Error("cache_write not available");
2149
+ try {
2150
+ const result = native.cache_write(
2151
+ cachePath,
2152
+ entries.map((e) => ({
2153
+ file: e.file,
2154
+ content_hash: e.contentHash,
2155
+ classes: e.classes,
2156
+ mtime_ms: e.mtimeMs,
2157
+ size_bytes: e.sizeBytes
2158
+ }))
2159
+ );
2160
+ return typeof result === "boolean" ? result : result === true;
2161
+ } catch {
2162
+ return false;
2163
+ }
2164
+ }
2165
+ function cachePriority(mtimeMs, sizeBytes, hitCount) {
2166
+ const native = getNativeBridge();
2167
+ if (!native?.cache_priority) throw new Error("cache_priority not available");
2168
+ return native.cache_priority(mtimeMs, sizeBytes, hitCount);
2169
+ }
2170
+ var init_cacheNative = __esm({
2171
+ "packages/domain/compiler/src/cache/cacheNative.ts"() {
2172
+ init_nativeBridge();
2173
+ }
2174
+ });
2175
+
2176
+ // packages/domain/compiler/src/cache/index.ts
2177
+ var init_cache = __esm({
2178
+ "packages/domain/compiler/src/cache/index.ts"() {
2179
+ init_cacheNative();
2180
+ }
2181
+ });
2182
+
2183
+ // packages/domain/compiler/src/redis/redisNative.ts
2184
+ function redisPing() {
2185
+ const native = getNativeBridge();
2186
+ if (!native?.redis_ping) throw new Error("redis_ping not available");
2187
+ return native.redis_ping();
2188
+ }
2189
+ function redisGet(key) {
2190
+ const native = getNativeBridge();
2191
+ if (!native?.redis_get) throw new Error("redis_get not available");
2192
+ const result = native.redis_get(key);
2193
+ return result === "nil" ? null : result;
2194
+ }
2195
+ function redisSet(key, value, ttl_seconds) {
2196
+ const native = getNativeBridge();
2197
+ if (!native?.redis_set) throw new Error("redis_set not available");
2198
+ return native.redis_set(key, value, ttl_seconds);
2199
+ }
2200
+ function redisDelete(key) {
2201
+ const native = getNativeBridge();
2202
+ if (!native?.redis_delete) throw new Error("redis_delete not available");
2203
+ return native.redis_delete(key);
2204
+ }
2205
+ function redisExists(key) {
2206
+ const native = getNativeBridge();
2207
+ if (!native?.redis_exists) throw new Error("redis_exists not available");
2208
+ return native.redis_exists(key);
2209
+ }
2210
+ function redisMget(keys) {
2211
+ const native = getNativeBridge();
2212
+ if (!native?.redis_mget) throw new Error("redis_mget not available");
2213
+ const result = native.redis_mget(keys);
2214
+ try {
2215
+ return JSON.parse(result);
2216
+ } catch {
2217
+ return keys.map(() => null);
2218
+ }
2219
+ }
2220
+ function redisMset(pairs) {
2221
+ const native = getNativeBridge();
2222
+ if (!native?.redis_mset) throw new Error("redis_mset not available");
2223
+ return native.redis_mset(pairs);
2224
+ }
2225
+ function redisFlushDb() {
2226
+ const native = getNativeBridge();
2227
+ if (!native?.redis_flush_db) throw new Error("redis_flush_db not available");
2228
+ return native.redis_flush_db();
2229
+ }
2230
+ function redisFlushAll() {
2231
+ const native = getNativeBridge();
2232
+ if (!native?.redis_flush_all) throw new Error("redis_flush_all not available");
2233
+ return native.redis_flush_all();
2234
+ }
2235
+ function redisPoolConnect(host, port, pool_size) {
2236
+ const native = getNativeBridge();
2237
+ if (!native?.redis_pool_connect) throw new Error("redis_pool_connect not available");
2238
+ return native.redis_pool_connect(host, port, pool_size);
2239
+ }
2240
+ function redisPoolStats() {
2241
+ const native = getNativeBridge();
2242
+ if (!native?.redis_pool_stats) throw new Error("redis_pool_stats not available");
2243
+ const result = native.redis_pool_stats();
2244
+ try {
2245
+ return JSON.parse(result);
2246
+ } catch {
2247
+ return {
2248
+ connected_count: 0,
2249
+ idle_count: 0,
2250
+ waiting_count: 0,
2251
+ total_requests: 0,
2252
+ total_errors: 0
2253
+ };
2254
+ }
2255
+ }
2256
+ function redisPoolReconnect() {
2257
+ const native = getNativeBridge();
2258
+ if (!native?.redis_pool_reconnect) throw new Error("redis_pool_reconnect not available");
2259
+ return native.redis_pool_reconnect();
2260
+ }
2261
+ function redisEnableCluster(initial_nodes) {
2262
+ const native = getNativeBridge();
2263
+ if (!native?.redis_enable_cluster) throw new Error("redis_enable_cluster not available");
2264
+ const result = native.redis_enable_cluster(initial_nodes);
2265
+ try {
2266
+ return JSON.parse(result);
2267
+ } catch {
2268
+ return {
2269
+ enabled: false,
2270
+ cluster_state: "error",
2271
+ nodes: [],
2272
+ slots_assigned: 0,
2273
+ slots_ok: 0,
2274
+ slots_fail: 0
2275
+ };
2276
+ }
2277
+ }
2278
+ function redisDisableCluster() {
2279
+ const native = getNativeBridge();
2280
+ if (!native?.redis_disable_cluster) throw new Error("redis_disable_cluster not available");
2281
+ return native.redis_disable_cluster();
2282
+ }
2283
+ function redisClusterStatus() {
2284
+ const native = getNativeBridge();
2285
+ if (!native?.redis_cluster_status) throw new Error("redis_cluster_status not available");
2286
+ const result = native.redis_cluster_status();
2287
+ try {
2288
+ return JSON.parse(result);
2289
+ } catch {
2290
+ return {
2291
+ enabled: false,
2292
+ cluster_state: "unknown",
2293
+ nodes: [],
2294
+ slots_assigned: 0,
2295
+ slots_ok: 0,
2296
+ slots_fail: 0
2297
+ };
2298
+ }
2299
+ }
2300
+ function redisSubscribe(channel) {
2301
+ const native = getNativeBridge();
2302
+ if (!native?.redis_subscribe) throw new Error("redis_subscribe not available");
2303
+ return native.redis_subscribe(channel);
2304
+ }
2305
+ function redisPublish(channel, message) {
2306
+ const native = getNativeBridge();
2307
+ if (!native?.redis_publish) throw new Error("redis_publish not available");
2308
+ return native.redis_publish(channel, message);
2309
+ }
2310
+ function redisExpirationSet(key, ttl_seconds) {
2311
+ const native = getNativeBridge();
2312
+ if (!native?.redis_expiration_set) throw new Error("redis_expiration_set not available");
2313
+ return native.redis_expiration_set(key, ttl_seconds);
2314
+ }
2315
+ function redisExpirationGet(key) {
2316
+ const native = getNativeBridge();
2317
+ if (!native?.redis_expiration_get) throw new Error("redis_expiration_get not available");
2318
+ const result = native.redis_expiration_get(key);
2319
+ try {
2320
+ return JSON.parse(result);
2321
+ } catch {
2322
+ return {
2323
+ key,
2324
+ ttl_seconds: -1,
2325
+ expiration_timestamp: 0,
2326
+ is_persistent: true
2327
+ };
2328
+ }
2329
+ }
2330
+ function redisInfo() {
2331
+ const native = getNativeBridge();
2332
+ if (!native?.redis_info) throw new Error("redis_info not available");
2333
+ return native.redis_info();
2334
+ }
2335
+ function redisMonitor() {
2336
+ const native = getNativeBridge();
2337
+ if (!native?.redis_monitor) throw new Error("redis_monitor not available");
2338
+ return native.redis_monitor();
2339
+ }
2340
+ function redisCacheSize() {
2341
+ const native = getNativeBridge();
2342
+ if (!native?.redis_cache_size) throw new Error("redis_cache_size not available");
2343
+ return native.redis_cache_size();
2344
+ }
2345
+ function redisCacheKeyCount() {
2346
+ const native = getNativeBridge();
2347
+ if (!native?.redis_cache_key_count) throw new Error("redis_cache_key_count not available");
2348
+ return native.redis_cache_key_count();
2349
+ }
2350
+ function redisCacheClear() {
2351
+ const native = getNativeBridge();
2352
+ if (!native?.redis_cache_clear) throw new Error("redis_cache_clear not available");
2353
+ return native.redis_cache_clear();
2354
+ }
2355
+ function redisCacheHitRate() {
2356
+ const native = getNativeBridge();
2357
+ if (!native?.redis_cache_hit_rate) throw new Error("redis_cache_hit_rate not available");
2358
+ return native.redis_cache_hit_rate();
2359
+ }
2360
+ function redisEnablePersistence(mode) {
2361
+ const native = getNativeBridge();
2362
+ if (!native?.redis_enable_persistence) throw new Error("redis_enable_persistence not available");
2363
+ return native.redis_enable_persistence(mode);
2364
+ }
2365
+ function redisDisablePersistence() {
2366
+ const native = getNativeBridge();
2367
+ if (!native?.redis_disable_persistence) throw new Error("redis_disable_persistence not available");
2368
+ return native.redis_disable_persistence();
2369
+ }
2370
+ function redisSnapshot() {
2371
+ const native = getNativeBridge();
2372
+ if (!native?.redis_snapshot) throw new Error("redis_snapshot not available");
2373
+ return native.redis_snapshot();
2374
+ }
2375
+ function redisMemoryStats() {
2376
+ const native = getNativeBridge();
2377
+ if (!native?.redis_memory_stats) throw new Error("redis_memory_stats not available");
2378
+ return native.redis_memory_stats();
2379
+ }
2380
+ function redisOptimizeMemory() {
2381
+ const native = getNativeBridge();
2382
+ if (!native?.redis_optimize_memory) throw new Error("redis_optimize_memory not available");
2383
+ return native.redis_optimize_memory();
2384
+ }
2385
+ function redisSetEvictionPolicy(policy) {
2386
+ const native = getNativeBridge();
2387
+ if (!native?.redis_set_eviction_policy) throw new Error("redis_set_eviction_policy not available");
2388
+ return native.redis_set_eviction_policy(policy);
2389
+ }
2390
+ function redisGetEvictionPolicy() {
2391
+ const native = getNativeBridge();
2392
+ if (!native?.redis_get_eviction_policy) throw new Error("redis_get_eviction_policy not available");
2393
+ return native.redis_get_eviction_policy();
2394
+ }
2395
+ function redisReplicate(target_host, target_port) {
2396
+ const native = getNativeBridge();
2397
+ if (!native?.redis_replicate) throw new Error("redis_replicate not available");
2398
+ return native.redis_replicate(target_host, target_port);
2399
+ }
2400
+ function redisReplicationStatus() {
2401
+ const native = getNativeBridge();
2402
+ if (!native?.redis_replication_status) throw new Error("redis_replication_status not available");
2403
+ return native.redis_replication_status();
2404
+ }
2405
+ function redisCacheSync(peers) {
2406
+ const native = getNativeBridge();
2407
+ if (!native?.redis_cache_sync) throw new Error("redis_cache_sync not available");
2408
+ return native.redis_cache_sync(peers);
2409
+ }
2410
+ function redisEnableCacheWarming(key_pattern) {
2411
+ const native = getNativeBridge();
2412
+ if (!native?.redis_enable_cache_warming) throw new Error("redis_enable_cache_warming not available");
2413
+ return native.redis_enable_cache_warming(key_pattern);
2414
+ }
2415
+ function redisDisableCacheWarming() {
2416
+ const native = getNativeBridge();
2417
+ if (!native?.redis_disable_cache_warming) throw new Error("redis_disable_cache_warming not available");
2418
+ return native.redis_disable_cache_warming();
2419
+ }
2420
+ function redisDiagnose() {
2421
+ const native = getNativeBridge();
2422
+ if (!native?.redis_diagnose) throw new Error("redis_diagnose not available");
2423
+ return native.redis_diagnose();
2424
+ }
2425
+ var init_redisNative = __esm({
2426
+ "packages/domain/compiler/src/redis/redisNative.ts"() {
2427
+ init_nativeBridge();
2428
+ }
2429
+ });
2430
+
2431
+ // packages/domain/compiler/src/redis/index.ts
2432
+ var init_redis = __esm({
2433
+ "packages/domain/compiler/src/redis/index.ts"() {
2434
+ init_redisNative();
2435
+ }
2436
+ });
2437
+
2438
+ // packages/domain/compiler/src/watch/watchSystemNative.ts
2439
+ function startWatch(root_path, patterns) {
2440
+ const native = getNativeBridge();
2441
+ if (!native?.start_watch) throw new Error("start_watch not available");
2442
+ return native.start_watch(root_path, patterns);
2443
+ }
2444
+ function pollWatchEvents(handle, timeout_ms) {
2445
+ const native = getNativeBridge();
2446
+ if (!native?.poll_watch_events) throw new Error("poll_watch_events not available");
2447
+ const result = native.poll_watch_events(handle, timeout_ms);
2448
+ try {
2449
+ return JSON.parse(result);
2450
+ } catch {
2451
+ return [];
2452
+ }
2453
+ }
2454
+ function stopWatch(handle) {
2455
+ const native = getNativeBridge();
2456
+ if (!native?.stop_watch) throw new Error("stop_watch not available");
2457
+ return native.stop_watch(handle);
2458
+ }
2459
+ function watchAddPattern(handle, pattern) {
2460
+ const native = getNativeBridge();
2461
+ if (!native?.watch_add_pattern) throw new Error("watch_add_pattern not available");
2462
+ return native.watch_add_pattern(handle, pattern);
2463
+ }
2464
+ function watchRemovePattern(handle, pattern) {
2465
+ const native = getNativeBridge();
2466
+ if (!native?.watch_remove_pattern) throw new Error("watch_remove_pattern not available");
2467
+ return native.watch_remove_pattern(handle, pattern);
2468
+ }
2469
+ function watchGetActiveHandles() {
2470
+ const native = getNativeBridge();
2471
+ if (!native?.watch_get_active_handles) throw new Error("watch_get_active_handles not available");
2472
+ const result = native.watch_get_active_handles();
2473
+ try {
2474
+ return JSON.parse(result);
2475
+ } catch {
2476
+ return [];
2477
+ }
2478
+ }
2479
+ function watchClearAll() {
2480
+ const native = getNativeBridge();
2481
+ if (!native?.watch_clear_all) throw new Error("watch_clear_all not available");
2482
+ return native.watch_clear_all();
2483
+ }
2484
+ function watchEventTypeToString(event_type_code) {
2485
+ const native = getNativeBridge();
2486
+ if (!native?.watch_event_type_to_string) throw new Error("watch_event_type_to_string not available");
2487
+ return native.watch_event_type_to_string(event_type_code);
2488
+ }
2489
+ function isWatchRunning(handle) {
2490
+ const native = getNativeBridge();
2491
+ if (!native?.is_watch_running) throw new Error("is_watch_running not available");
2492
+ return native.is_watch_running(handle);
2493
+ }
2494
+ function getWatchStats() {
2495
+ const native = getNativeBridge();
2496
+ if (!native?.get_watch_stats) throw new Error("get_watch_stats not available");
2497
+ const result = native.get_watch_stats();
2498
+ try {
2499
+ return JSON.parse(result);
2500
+ } catch {
2501
+ return {
2502
+ active_watchers: 0,
2503
+ total_events: 0,
2504
+ events_this_second: 0,
2505
+ average_latency_ms: 0,
2506
+ largest_batch_size: 0
2507
+ };
2508
+ }
2509
+ }
2510
+ function watchPause(handle) {
2511
+ const native = getNativeBridge();
2512
+ if (!native?.watch_pause) throw new Error("watch_pause not available");
2513
+ return native.watch_pause(handle);
2514
+ }
2515
+ function watchResume(handle) {
2516
+ const native = getNativeBridge();
2517
+ if (!native?.watch_resume) throw new Error("watch_resume not available");
2518
+ return native.watch_resume(handle);
2519
+ }
2520
+ function scanCacheOptimizations() {
2521
+ const native = getNativeBridge();
2522
+ if (!native?.scan_cache_optimizations) throw new Error("scan_cache_optimizations not available");
2523
+ return native.scan_cache_optimizations();
2524
+ }
2525
+ function getPluginHooks() {
2526
+ const native = getNativeBridge();
2527
+ if (!native?.get_plugin_hooks) throw new Error("get_plugin_hooks not available");
2528
+ const result = native.get_plugin_hooks();
2529
+ try {
2530
+ return JSON.parse(result);
2531
+ } catch {
2532
+ return [];
2533
+ }
2534
+ }
2535
+ function registerPluginHook(hook_name, handler_id) {
2536
+ const native = getNativeBridge();
2537
+ if (!native?.register_plugin_hook) throw new Error("register_plugin_hook not available");
2538
+ return native.register_plugin_hook(hook_name, handler_id);
2539
+ }
2540
+ function unregisterPluginHook(hook_name, handler_id) {
2541
+ const native = getNativeBridge();
2542
+ if (!native?.unregister_plugin_hook) throw new Error("unregister_plugin_hook not available");
2543
+ return native.unregister_plugin_hook(hook_name, handler_id);
2544
+ }
2545
+ function emitPluginHook(hook_name, data_json) {
2546
+ const native = getNativeBridge();
2547
+ if (!native?.emit_plugin_hook) throw new Error("emit_plugin_hook not available");
2548
+ return native.emit_plugin_hook(hook_name, data_json);
2549
+ }
2550
+ function getCompilationMetrics() {
2551
+ const native = getNativeBridge();
2552
+ if (!native?.get_compilation_metrics) throw new Error("get_compilation_metrics not available");
2553
+ return native.get_compilation_metrics();
2554
+ }
2555
+ function resetCompilationMetrics() {
2556
+ const native = getNativeBridge();
2557
+ if (!native?.reset_compilation_metrics) throw new Error("reset_compilation_metrics not available");
2558
+ return native.reset_compilation_metrics();
2559
+ }
2560
+ function validateCssOutput(css) {
2561
+ const native = getNativeBridge();
2562
+ if (!native?.validate_css_output) throw new Error("validate_css_output not available");
2563
+ return native.validate_css_output(css);
2564
+ }
2565
+ function getCompilerDiagnostics() {
2566
+ const native = getNativeBridge();
2567
+ if (!native?.get_compiler_diagnostics) throw new Error("get_compiler_diagnostics not available");
2568
+ return native.get_compiler_diagnostics();
2569
+ }
2570
+ var init_watchSystemNative = __esm({
2571
+ "packages/domain/compiler/src/watch/watchSystemNative.ts"() {
1325
2572
  init_nativeBridge();
1326
- init_tailwindEngine();
2573
+ }
2574
+ });
2575
+
2576
+ // packages/domain/compiler/src/watch/index.ts
2577
+ var init_watch = __esm({
2578
+ "packages/domain/compiler/src/watch/index.ts"() {
2579
+ init_watchSystemNative();
1327
2580
  }
1328
2581
  });
1329
2582
  function _layoutClassesToCss(classes) {
@@ -1360,10 +2613,16 @@ function extractContainerCssFromSource(source) {
1360
2613
  }
1361
2614
  return rules.join("\n");
1362
2615
  }
1363
- var transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, compileCssNative, generateCssForClasses, extractAllClasses, extractClassesFromSource, astExtractClasses, parseClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, eliminateDeadCss, findDeadVariants, runElimination, optimizeCss, scanProjectUsage, extractComponentUsage, diffClassLists, batchExtractClasses, checkAgainstSafelist, hoistComponents, compileVariantTable, compileVariants, classifyAndSortClasses, mergeCssDeclarations, analyzeClassUsage, analyzeRsc, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, getRouteClasses, registerFileClasses, registerGlobalClasses, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
2616
+ 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;
1364
2617
  var init_src = __esm({
1365
2618
  "packages/domain/compiler/src/index.ts"() {
1366
2619
  init_nativeBridge();
2620
+ init_compiler();
2621
+ init_parser();
2622
+ init_analyzer();
2623
+ init_cache();
2624
+ init_redis();
2625
+ init_watch();
1367
2626
  transformSource = (source, opts) => {
1368
2627
  const native = getNativeBridge();
1369
2628
  if (!native?.transformSource) {
@@ -1407,58 +2666,19 @@ var init_src = __esm({
1407
2666
  const result = compileCssFromClasses(classes);
1408
2667
  return result?.code ? `<style data-tailwind-styled>${result.code}</style>` : "";
1409
2668
  };
1410
- compileCssNative = (classes, prefix = null) => {
1411
- return compileCssFromClasses(classes, prefix);
1412
- };
1413
2669
  generateCssForClasses = async (classes, _tailwindConfig, root, cssEntryContent, minify = false) => {
1414
- const { runCssPipeline: runCssPipeline2 } = await Promise.resolve().then(() => (init_tailwindEngine(), tailwindEngine_exports));
1415
- const result = await runCssPipeline2(classes, cssEntryContent, root, minify);
1416
- return result.css;
1417
- };
1418
- extractAllClasses = (source) => {
1419
- const native = getNativeBridge();
1420
- if (!native?.extractAllClasses) {
1421
- throw new Error("FATAL: Native binding 'extractAllClasses' is required but not available.");
1422
- }
1423
- return native.extractAllClasses(source) || [];
1424
- };
1425
- extractClassesFromSource = (source) => {
1426
- const native = getNativeBridge();
1427
- if (!native?.extractClassesFromSource) {
1428
- throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
1429
- }
1430
- const result = native.extractClassesFromSource(source);
1431
- return Array.isArray(result) ? result.join(" ") : String(result || "");
1432
- };
1433
- astExtractClasses = (source, _filename) => {
1434
- const native = getNativeBridge();
1435
- if (!native?.extractClassesFromSource) {
1436
- throw new Error("FATAL: Native binding 'extractClassesFromSource' is required but not available.");
1437
- }
1438
- return native.extractClassesFromSource(source) || [];
1439
- };
1440
- parseClasses = (raw) => {
1441
- const native = getNativeBridge();
1442
- if (!native?.parseClasses) {
1443
- throw new Error("FATAL: Native binding 'parseClasses' is required but not available.");
1444
- }
1445
- return native.parseClasses(raw) || [];
1446
- };
1447
- normalizeClasses = (raw) => {
1448
- const result = normalizeAndDedupClasses(raw);
1449
- return result?.normalized || "";
1450
- };
1451
- mergeClassesStatic = (classes) => {
1452
- const result = normalizeAndDedupClasses(classes);
1453
- return result?.normalized || "";
1454
- };
1455
- normalizeAndDedupClasses = (raw) => {
1456
- const native = getNativeBridge();
1457
- if (!native?.normalizeAndDedupClasses) {
1458
- throw new Error("FATAL: Native binding 'normalizeAndDedupClasses' is required but not available.");
2670
+ try {
2671
+ const { runCssPipeline: runCssPipeline2 } = await Promise.resolve().then(() => (init_tailwindEngine(), tailwindEngine_exports));
2672
+ const result = await runCssPipeline2(classes, cssEntryContent, root, minify);
2673
+ return result.css;
2674
+ } catch {
2675
+ const native = getNativeBridge();
2676
+ if (!native?.transformSource) {
2677
+ throw new Error("FATAL: Native binding 'transformSource' is required but not available.");
2678
+ }
2679
+ const result = native.transformSource(classes.join(" "), {});
2680
+ return result?.code || "";
1459
2681
  }
1460
- const result = native.normalizeAndDedupClasses(raw);
1461
- return result || { normalized: "", duplicatesRemoved: 0, uniqueCount: 0 };
1462
2682
  };
1463
2683
  eliminateDeadCss = (css, deadClasses) => {
1464
2684
  const native = getNativeBridge();
@@ -1491,16 +2711,10 @@ var init_src = __esm({
1491
2711
  const dead = native.detectDeadCode(JSON.stringify(scanResult), css);
1492
2712
  return eliminateDeadCss(css, new Set(dead.deadInCss ?? []));
1493
2713
  };
1494
- optimizeCss = (css) => {
1495
- const native = getNativeBridge();
1496
- if (!native?.optimizeCss) {
1497
- throw new Error("FATAL: Native binding 'optimizeCss' is required but not available.");
1498
- }
1499
- return native.optimizeCss(css);
1500
- };
1501
2714
  scanProjectUsage = (dirs, cwd) => {
2715
+ const { batchExtractClasses: batchExtractClasses2 } = (init_parser(), __toCommonJS(parser_exports));
1502
2716
  const files = dirs.map((dir) => path__default.resolve(cwd, dir));
1503
- const results = batchExtractClasses(files) || [];
2717
+ const results = batchExtractClasses2(files) || [];
1504
2718
  const combined = {};
1505
2719
  for (const result of results) {
1506
2720
  if (result.ok && result.classes) {
@@ -1512,109 +2726,6 @@ var init_src = __esm({
1512
2726
  }
1513
2727
  return combined;
1514
2728
  };
1515
- extractComponentUsage = (source) => {
1516
- const native = getNativeBridge();
1517
- if (!native?.extractComponentUsage) {
1518
- throw new Error("FATAL: Native binding 'extractComponentUsage' is required but not available.");
1519
- }
1520
- return native.extractComponentUsage(source) || [];
1521
- };
1522
- diffClassLists = (previous, current) => {
1523
- const native = getNativeBridge();
1524
- if (!native?.diffClassLists) {
1525
- throw new Error("FATAL: Native binding 'diffClassLists' is required but not available.");
1526
- }
1527
- return native.diffClassLists(previous, current) || { added: [], removed: [], unchanged: [], hasChanges: false };
1528
- };
1529
- batchExtractClasses = (filePaths) => {
1530
- const native = getNativeBridge();
1531
- if (!native?.batchExtractClasses) {
1532
- throw new Error("FATAL: Native binding 'batchExtractClasses' is required but not available.");
1533
- }
1534
- return native.batchExtractClasses(filePaths) || [];
1535
- };
1536
- checkAgainstSafelist = (classes, safelist) => {
1537
- const native = getNativeBridge();
1538
- if (!native?.checkAgainstSafelist) {
1539
- throw new Error("FATAL: Native binding 'checkAgainstSafelist' is required but not available.");
1540
- }
1541
- return native.checkAgainstSafelist(classes, safelist) || { matched: [], unmatched: [], safelistSize: 0 };
1542
- };
1543
- hoistComponents = (source) => {
1544
- const native = getNativeBridge();
1545
- if (!native?.hoistComponents) {
1546
- throw new Error("FATAL: Native binding 'hoistComponents' is required but not available.");
1547
- }
1548
- return native.hoistComponents(source) || { code: source, hoisted: [], warnings: [] };
1549
- };
1550
- compileVariantTable = (configJson) => {
1551
- const native = getNativeBridge();
1552
- if (!native?.compileVariantTable) {
1553
- throw new Error("FATAL: Native binding 'compileVariantTable' is required but not available.");
1554
- }
1555
- return native.compileVariantTable(configJson) || { id: "", tableJson: "{}", keys: [], defaultKey: "", combinations: 0 };
1556
- };
1557
- compileVariants = (componentId, config) => {
1558
- return compileVariantTable(JSON.stringify({ componentId, ...config }));
1559
- };
1560
- classifyAndSortClasses = (classes) => {
1561
- const native = getNativeBridge();
1562
- if (!native?.classifyAndSortClasses) {
1563
- throw new Error("FATAL: Native binding 'classifyAndSortClasses' is required but not available.");
1564
- }
1565
- return native.classifyAndSortClasses(classes) || [];
1566
- };
1567
- mergeCssDeclarations = (cssChunks) => {
1568
- const native = getNativeBridge();
1569
- if (!native?.mergeCssDeclarations) {
1570
- throw new Error("FATAL: Native binding 'mergeCssDeclarations' is required but not available.");
1571
- }
1572
- return native.mergeCssDeclarations(cssChunks) || { declarationsJson: "{}", declarationString: "", count: 0 };
1573
- };
1574
- analyzeClassUsage = (classes, scanResultJson, css) => {
1575
- const native = getNativeBridge();
1576
- if (!native?.analyzeClassUsage) {
1577
- throw new Error("FATAL: Native binding 'analyzeClassUsage' is required but not available.");
1578
- }
1579
- return native.analyzeClassUsage(classes, scanResultJson, css) || [];
1580
- };
1581
- analyzeRsc = (source, filename) => {
1582
- const native = getNativeBridge();
1583
- if (!native?.analyzeRsc) {
1584
- throw new Error("FATAL: Native binding 'analyzeRsc' is required but not available.");
1585
- }
1586
- return native.analyzeRsc(source, filename) || { isServer: true, needsClientDirective: false, clientReasons: [] };
1587
- };
1588
- analyzeFile = (source, filename) => {
1589
- const rsc = analyzeRsc(source, filename);
1590
- return {
1591
- isServer: rsc?.isServer ?? true,
1592
- needsClientDirective: rsc?.needsClientDirective ?? false,
1593
- clientReasons: rsc?.clientReasons ?? [],
1594
- interactiveClasses: [],
1595
- canStaticResolveVariants: true
1596
- };
1597
- };
1598
- analyzeVariantUsage = (_source, _componentName, _variantKeys) => {
1599
- return { resolved: {}, dynamic: [] };
1600
- };
1601
- injectClientDirective = (source) => {
1602
- if (!source.includes('"use client"') && !source.includes("'use client'")) {
1603
- return '"use client";\n' + source;
1604
- }
1605
- return source;
1606
- };
1607
- injectServerOnlyComment = (source) => {
1608
- return `/* @server-only */
1609
- ${source}`;
1610
- };
1611
- analyzeClasses = (filesJson, cwd, flags) => {
1612
- const native = getNativeBridge();
1613
- if (!native?.analyzeClasses) {
1614
- throw new Error("FATAL: Native binding 'analyzeClasses' is required but not available.");
1615
- }
1616
- return native.analyzeClasses(filesJson, cwd, flags);
1617
- };
1618
2729
  generateSafelist = (scanDirs, outputPath, cwd) => {
1619
2730
  const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
1620
2731
  const allClasses = Object.keys(classes).sort();
@@ -1678,7 +2789,8 @@ ${source}`;
1678
2789
  if (containerCss) cssChunks.push(containerCss);
1679
2790
  const combined = cssChunks.join("\n").trim();
1680
2791
  if (combined) staticCss = combined;
1681
- } catch {
2792
+ } catch (err) {
2793
+ console.debug("Static CSS extraction warning:", err);
1682
2794
  }
1683
2795
  return {
1684
2796
  code: result?.code || "",
@@ -1763,7 +2875,46 @@ ${source}`;
1763
2875
  return [];
1764
2876
  };
1765
2877
  bucketSort = (classes) => {
1766
- return classifyAndSortClasses(classes).map((c) => c.raw ?? c);
2878
+ const native = getNativeBridge();
2879
+ if (!native?.classifyAndSortClasses) {
2880
+ throw new Error("FATAL: Native binding 'classifyAndSortClasses' is required but not available.");
2881
+ }
2882
+ const sorted = native.classifyAndSortClasses(classes);
2883
+ return sorted.map((c) => c.raw ?? c);
2884
+ };
2885
+ analyzeFile = (source, filename) => {
2886
+ const native = getNativeBridge();
2887
+ if (!native?.analyzeRsc) {
2888
+ throw new Error("FATAL: Native binding 'analyzeRsc' is required but not available.");
2889
+ }
2890
+ const rsc = native.analyzeRsc(source, filename);
2891
+ return {
2892
+ isServer: rsc?.isServer ?? true,
2893
+ needsClientDirective: rsc?.needsClientDirective ?? false,
2894
+ clientReasons: rsc?.clientReasons ?? [],
2895
+ interactiveClasses: [],
2896
+ canStaticResolveVariants: true
2897
+ };
2898
+ };
2899
+ analyzeVariantUsage = (_source, _componentName, _variantKeys) => {
2900
+ return { resolved: {}, dynamic: [] };
2901
+ };
2902
+ injectClientDirective = (source) => {
2903
+ if (!source.includes('"use client"') && !source.includes("'use client'")) {
2904
+ return '"use client";\n' + source;
2905
+ }
2906
+ return source;
2907
+ };
2908
+ injectServerOnlyComment = (source) => {
2909
+ return `/* @server-only */
2910
+ ${source}`;
2911
+ };
2912
+ analyzeClasses = (filesJson, cwd, flags) => {
2913
+ const native = getNativeBridge();
2914
+ if (!native?.analyzeClasses) {
2915
+ throw new Error("FATAL: Native binding 'analyzeClasses' is required but not available.");
2916
+ }
2917
+ return native.analyzeClasses(filesJson, cwd, flags);
1767
2918
  };
1768
2919
  extractTwStateConfigs = (source, filename) => {
1769
2920
  const native = getNativeBridge();
@@ -1772,23 +2923,25 @@ ${source}`;
1772
2923
  }
1773
2924
  return native.extractTwStateConfigs(source, filename);
1774
2925
  };
1775
- generateStaticStateCss = (inputs, resolvedCss = null) => {
1776
- const native = getNativeBridge();
1777
- if (!native?.generateStaticStateCss) {
1778
- throw new Error("FATAL: Native binding 'generateStaticStateCss' is required but not available.");
2926
+ generateStaticStateCss = (entries, _themeConfig) => {
2927
+ const rules = [];
2928
+ for (const entry of entries) {
2929
+ const stateConfig = JSON.parse(entry.statesJson);
2930
+ for (const [stateName, classes] of Object.entries(stateConfig)) {
2931
+ rules.push({
2932
+ selector: `.${entry.componentName}[data-state="${stateName}"]`,
2933
+ declarations: classes,
2934
+ cssRule: `.${entry.componentName}[data-state="${stateName}"]{${classes}}`,
2935
+ componentName: entry.componentName,
2936
+ stateName
2937
+ });
2938
+ }
1779
2939
  }
1780
- return native.generateStaticStateCss(inputs, resolvedCss);
2940
+ return rules;
1781
2941
  };
1782
2942
  extractAndGenerateStateCss = (source, filename) => {
1783
- const native = getNativeBridge();
1784
- if (!native?.extractAndGenerateStateCss) {
1785
- const configs = extractTwStateConfigs(source, filename);
1786
- if (configs.length === 0) return [];
1787
- return generateStaticStateCss(
1788
- configs.map((c) => ({ tag: c.tag, componentName: c.componentName, statesJson: c.statesJson }))
1789
- );
1790
- }
1791
- return native.extractAndGenerateStateCss(source, filename);
2943
+ const entries = extractTwStateConfigs(source, filename);
2944
+ return generateStaticStateCss(entries);
1792
2945
  };
1793
2946
  }
1794
2947
  });
@@ -1797,75 +2950,219 @@ ${source}`;
1797
2950
  var internal_exports = {};
1798
2951
  __export(internal_exports, {
1799
2952
  adaptNativeResult: () => adaptNativeResult,
1800
- analyzeClassUsage: () => analyzeClassUsage,
2953
+ analyzeClassUsageNative: () => analyzeClassUsageNative,
1801
2954
  analyzeClasses: () => analyzeClasses,
2955
+ analyzeClassesNative: () => analyzeClassesNative,
1802
2956
  analyzeFile: () => analyzeFile,
1803
- analyzeRsc: () => analyzeRsc,
2957
+ analyzeRscNative: () => analyzeRscNative,
1804
2958
  analyzeVariantUsage: () => analyzeVariantUsage,
1805
2959
  astExtractClasses: () => astExtractClasses,
2960
+ atomicRegistrySize: () => atomicRegistrySize,
1806
2961
  batchExtractClasses: () => batchExtractClasses,
2962
+ batchExtractClassesNative: () => batchExtractClassesNative,
1807
2963
  bucketSort: () => bucketSort,
1808
2964
  buildStyleTag: () => buildStyleTag,
2965
+ cachePriority: () => cachePriority,
2966
+ cacheRead: () => cacheRead,
2967
+ cacheWrite: () => cacheWrite,
1809
2968
  checkAgainstSafelist: () => checkAgainstSafelist,
1810
- classifyAndSortClasses: () => classifyAndSortClasses,
2969
+ checkAgainstSafelistNative: () => checkAgainstSafelistNative,
2970
+ classifyAndSortClassesNative: () => classifyAndSortClassesNative,
1811
2971
  classifyNode: () => classifyNode,
2972
+ clearAllCaches: () => clearAllCaches,
2973
+ clearAtomicRegistry: () => clearAtomicRegistry,
1812
2974
  clearCache: () => clearCache,
2975
+ clearCompileCache: () => clearCompileCache,
2976
+ clearCssGenCache: () => clearCssGenCache,
2977
+ clearParseCache: () => clearParseCache,
2978
+ clearResolveCache: () => clearResolveCache,
2979
+ clearThemeCache: () => clearThemeCache,
2980
+ collectFiles: () => collectFiles,
2981
+ compileAnimation: () => compileAnimation,
2982
+ compileClass: () => compileClass,
2983
+ compileClasses: () => compileClasses,
1813
2984
  compileCssFromClasses: () => compileCssFromClasses,
1814
- compileCssNative: () => compileCssNative,
1815
- compileVariantTable: () => compileVariantTable,
1816
- compileVariants: () => compileVariants,
2985
+ compileCssLightning: () => compileCssLightning,
2986
+ compileCssNative2: () => compileCssNative2,
2987
+ compileKeyframes: () => compileKeyframes,
2988
+ compileTheme: () => compileTheme,
2989
+ compileToCss: () => compileToCss,
2990
+ compileToCssBatch: () => compileToCssBatch,
2991
+ compileVariantTableNative: () => compileVariantTableNative,
2992
+ computeIncrementalDiff: () => computeIncrementalDiff,
2993
+ createFingerprint: () => createFingerprint,
1817
2994
  detectConflicts: () => detectConflicts,
2995
+ detectDeadCode: () => detectDeadCode,
1818
2996
  diffClassLists: () => diffClassLists,
1819
2997
  eliminateDeadCss: () => eliminateDeadCss,
2998
+ eliminateDeadCssNative: () => eliminateDeadCssNative,
2999
+ emitPluginHook: () => emitPluginHook,
3000
+ estimateOptimalCacheConfig: () => estimateOptimalCacheConfig,
1820
3001
  extractAllClasses: () => extractAllClasses,
1821
3002
  extractAndGenerateStateCss: () => extractAndGenerateStateCss,
3003
+ extractAndGenerateStateCssNative: () => extractAndGenerateStateCssNative,
1822
3004
  extractClassesFromSource: () => extractClassesFromSource,
3005
+ extractClassesFromSourceNative: () => extractClassesFromSourceNative,
1823
3006
  extractComponentUsage: () => extractComponentUsage,
1824
3007
  extractContainerCssFromSource: () => extractContainerCssFromSource,
3008
+ extractTwContainerConfigs: () => extractTwContainerConfigs,
1825
3009
  extractTwStateConfigs: () => extractTwStateConfigs,
3010
+ extractTwStateConfigsNative: () => extractTwStateConfigsNative,
1826
3011
  fileToRoute: () => fileToRoute,
1827
3012
  findDeadVariants: () => findDeadVariants,
3013
+ generateAtomicCss: () => generateAtomicCss,
1828
3014
  generateCssForClasses: () => generateCssForClasses,
1829
- generateRawCss: () => generateRawCss,
3015
+ generateCssNative: () => generateCssNative,
1830
3016
  generateSafelist: () => generateSafelist,
1831
3017
  generateStaticStateCss: () => generateStaticStateCss,
3018
+ generateStaticStateCssNative: () => generateStaticStateCssNative,
3019
+ generateSubComponentTypes: () => generateSubComponentTypes,
1832
3020
  getAllRoutes: () => getAllRoutes,
1833
3021
  getBucketEngine: () => getBucketEngine,
3022
+ getCacheOptimizationHints: () => getCacheOptimizationHints,
3023
+ getCacheStatistics: () => getCacheStatistics,
1834
3024
  getCacheStats: () => getCacheStats,
3025
+ getCompilationMetrics: () => getCompilationMetrics,
3026
+ getCompilerDiagnostics: () => getCompilerDiagnostics,
1835
3027
  getContentPaths: () => getContentPaths,
1836
3028
  getIncrementalEngine: () => getIncrementalEngine,
1837
3029
  getNativeBridge: () => getNativeBridge,
3030
+ getPluginHooks: () => getPluginHooks,
1838
3031
  getRouteClasses: () => getRouteClasses,
3032
+ getWatchStats: () => getWatchStats,
1839
3033
  hasTwUsage: () => hasTwUsage,
1840
- hoistComponents: () => hoistComponents,
3034
+ hashContent: () => hashContent,
3035
+ hoistComponentsNative: () => hoistComponentsNative,
3036
+ idRegistryActiveCount: () => idRegistryActiveCount,
3037
+ idRegistryCreate: () => idRegistryCreate,
3038
+ idRegistryDestroy: () => idRegistryDestroy,
3039
+ idRegistryExport: () => idRegistryExport,
3040
+ idRegistryGenerate: () => idRegistryGenerate,
3041
+ idRegistryImport: () => idRegistryImport,
3042
+ idRegistryLookup: () => idRegistryLookup,
3043
+ idRegistryNext: () => idRegistryNext,
3044
+ idRegistryReset: () => idRegistryReset,
3045
+ idRegistrySnapshot: () => idRegistrySnapshot,
1841
3046
  injectClientDirective: () => injectClientDirective,
1842
3047
  injectServerOnlyComment: () => injectServerOnlyComment,
3048
+ injectStateHash: () => injectStateHash,
1843
3049
  isAlreadyTransformed: () => isAlreadyTransformed,
3050
+ isWatchRunning: () => isWatchRunning,
3051
+ layoutClassesToCss: () => layoutClassesToCss,
1844
3052
  loadSafelist: () => loadSafelist,
1845
3053
  loadTailwindConfig: () => loadTailwindConfig,
1846
3054
  mergeClassesStatic: () => mergeClassesStatic,
1847
- mergeCssDeclarations: () => mergeCssDeclarations,
3055
+ mergeCssDeclarationsNative: () => mergeCssDeclarationsNative,
3056
+ minifyCss: () => minifyCss,
1848
3057
  normalizeAndDedupClasses: () => normalizeAndDedupClasses,
1849
3058
  normalizeClasses: () => normalizeClasses,
1850
- optimizeCss: () => optimizeCss,
3059
+ optimizeCssNative: () => optimizeCssNative,
3060
+ parseAtomicClass: () => parseAtomicClass,
1851
3061
  parseClasses: () => parseClasses,
3062
+ pollWatchEvents: () => pollWatchEvents,
3063
+ processFileChange: () => processFileChange,
3064
+ processTailwindCssLightning: () => processTailwindCssLightning,
3065
+ propertyIdToString: () => propertyIdToString,
3066
+ pruneStaleCacheEntries: () => pruneStaleCacheEntries,
3067
+ rebuildWorkspaceResult: () => rebuildWorkspaceResult,
3068
+ redisCacheClear: () => redisCacheClear,
3069
+ redisCacheHitRate: () => redisCacheHitRate,
3070
+ redisCacheKeyCount: () => redisCacheKeyCount,
3071
+ redisCacheSize: () => redisCacheSize,
3072
+ redisCacheSync: () => redisCacheSync,
3073
+ redisClusterStatus: () => redisClusterStatus,
3074
+ redisDelete: () => redisDelete,
3075
+ redisDiagnose: () => redisDiagnose,
3076
+ redisDisableCacheWarming: () => redisDisableCacheWarming,
3077
+ redisDisableCluster: () => redisDisableCluster,
3078
+ redisDisablePersistence: () => redisDisablePersistence,
3079
+ redisEnableCacheWarming: () => redisEnableCacheWarming,
3080
+ redisEnableCluster: () => redisEnableCluster,
3081
+ redisEnablePersistence: () => redisEnablePersistence,
3082
+ redisExists: () => redisExists,
3083
+ redisExpirationGet: () => redisExpirationGet,
3084
+ redisExpirationSet: () => redisExpirationSet,
3085
+ redisFlushAll: () => redisFlushAll,
3086
+ redisFlushDb: () => redisFlushDb,
3087
+ redisGet: () => redisGet,
3088
+ redisGetEvictionPolicy: () => redisGetEvictionPolicy,
3089
+ redisInfo: () => redisInfo,
3090
+ redisMemoryStats: () => redisMemoryStats,
3091
+ redisMget: () => redisMget,
3092
+ redisMonitor: () => redisMonitor,
3093
+ redisMset: () => redisMset,
3094
+ redisOptimizeMemory: () => redisOptimizeMemory,
3095
+ redisPing: () => redisPing,
3096
+ redisPoolConnect: () => redisPoolConnect,
3097
+ redisPoolReconnect: () => redisPoolReconnect,
3098
+ redisPoolStats: () => redisPoolStats,
3099
+ redisPublish: () => redisPublish,
3100
+ redisReplicate: () => redisReplicate,
3101
+ redisReplicationStatus: () => redisReplicationStatus,
3102
+ redisSet: () => redisSet,
3103
+ redisSetEvictionPolicy: () => redisSetEvictionPolicy,
3104
+ redisSnapshot: () => redisSnapshot,
3105
+ redisSubscribe: () => redisSubscribe,
1852
3106
  registerFileClasses: () => registerFileClasses,
1853
3107
  registerGlobalClasses: () => registerGlobalClasses,
3108
+ registerPluginHook: () => registerPluginHook,
3109
+ registerPropertyName: () => registerPropertyName,
3110
+ registerValueName: () => registerValueName,
1854
3111
  resetBucketEngine: () => resetBucketEngine,
3112
+ resetCompilationMetrics: () => resetCompilationMetrics,
1855
3113
  resetIncrementalEngine: () => resetIncrementalEngine,
3114
+ resolveCascade: () => resolveCascade,
3115
+ resolveClassNames: () => resolveClassNames,
3116
+ resolveConflictGroup: () => resolveConflictGroup,
3117
+ resolveSimpleVariants: () => resolveSimpleVariants,
3118
+ resolveThemeValue: () => resolveThemeValue,
3119
+ resolveVariants: () => resolveVariants,
3120
+ reverseLookupProperty: () => reverseLookupProperty,
3121
+ reverseLookupValue: () => reverseLookupValue,
1856
3122
  runCssPipeline: () => runCssPipeline,
1857
3123
  runCssPipelineSync: () => runCssPipelineSync,
1858
3124
  runElimination: () => runElimination,
1859
3125
  runLoaderTransform: () => runLoaderTransform,
3126
+ scanCacheOptimizations: () => scanCacheOptimizations,
3127
+ scanFile: () => scanFile,
3128
+ scanFileNative: () => scanFileNative,
3129
+ scanFilesBatchNative: () => scanFilesBatchNative,
1860
3130
  scanProjectUsage: () => scanProjectUsage,
3131
+ scanWorkspace: () => scanWorkspace,
1861
3132
  shouldProcess: () => shouldProcess,
1862
3133
  shouldSkipFile: () => shouldSkipFile,
1863
- transformSource: () => transformSource
3134
+ startWatch: () => startWatch,
3135
+ stopWatch: () => stopWatch,
3136
+ toAtomicClasses: () => toAtomicClasses,
3137
+ transformSource: () => transformSource,
3138
+ twMerge: () => twMerge,
3139
+ twMergeMany: () => twMergeMany,
3140
+ twMergeManyWithSeparator: () => twMergeManyWithSeparator,
3141
+ twMergeRaw: () => twMergeRaw,
3142
+ twMergeWithSeparator: () => twMergeWithSeparator,
3143
+ unregisterPluginHook: () => unregisterPluginHook,
3144
+ validateCssOutput: () => validateCssOutput,
3145
+ validateThemeConfig: () => validateThemeConfig,
3146
+ valueIdToString: () => valueIdToString,
3147
+ walkAndPrefilterSourceFiles: () => walkAndPrefilterSourceFiles,
3148
+ watchAddPattern: () => watchAddPattern,
3149
+ watchClearAll: () => watchClearAll,
3150
+ watchEventTypeToString: () => watchEventTypeToString,
3151
+ watchGetActiveHandles: () => watchGetActiveHandles,
3152
+ watchPause: () => watchPause,
3153
+ watchRemovePattern: () => watchRemovePattern,
3154
+ watchResume: () => watchResume
1864
3155
  });
1865
3156
  var init_internal = __esm({
1866
3157
  "packages/domain/compiler/src/internal.ts"() {
1867
3158
  init_src();
1868
3159
  init_tailwindEngine();
3160
+ init_compiler();
3161
+ init_parser();
3162
+ init_analyzer();
3163
+ init_cache();
3164
+ init_redis();
3165
+ init_watch();
1869
3166
  }
1870
3167
  });
1871
3168
  function getNative() {
@@ -2269,7 +3566,7 @@ function resolveRuntimeDir(dir, importMetaUrl) {
2269
3566
  return process.cwd();
2270
3567
  }
2271
3568
  }
2272
- function hashContent(content, algorithm = "md5", length) {
3569
+ function hashContent2(content, algorithm = "md5", length) {
2273
3570
  const hash = createHash(algorithm).update(content).digest("hex");
2274
3571
  return length ? hash.slice(0, length) : hash;
2275
3572
  }
@@ -2394,6 +3691,6 @@ var init_src2 = __esm({
2394
3691
  // src/umbrella/shared.ts
2395
3692
  init_src2();
2396
3693
 
2397
- export { ERROR_CODES, LRUCache, NativeAnalyzerReportSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema, NativeCssCompileResultSchema, NativeScanFileSchema, NativeScanResultSchema, NativeTransformResultSchema, NativeWatchResultSchema, PackageJsonSchema, RegistryFileSchema, RegistryPluginEntrySchema, ScanCacheClassEntrySchema, ScanCacheSchema, TW_STATE_STATIC_FILENAME, TailwindConfigSchema, TelemetryCollector, TwError, appendStaticStateCssToSafelist, assertTailwindV4, calculateHealth, createBuildTimer, createDebugLogger, createEsmRequire, createLogger2 as createLogger, createObservabilityClient, createTraceSnapshot, detectTailwind, extractStaticStateCss, formatDuration, formatErrorCode, formatErrorMessage, formatMemory, formatNativeNotFoundError, generateBarrelFile, generateClassRenameCodemod, generateComponentCode, generateStorybookStory, getBuildTimeColor, getDirname, getFilename, getGlobalTelemetry, getHealthColor, getMemoryColor, getModeColor, getPipelinePercentages, getSuggestion, getTailwindVersion, hashContent, isTailwindV4, isTwError, loadNativeBinding, parseJsonFileWithSchema, parseJsonWithSchema, parseNative, resetGlobalTelemetry, resolveFromRoot, resolveLoaderPath, resolveNativeBinary, resolveNativeBindingCandidates, resolveNativeNodePath, resolveRuntimeDir, resolveWorkerPath, safeParseNative, setGlobalLogFile, tryRequire, wrapUnknownError };
3694
+ export { ERROR_CODES, LRUCache, NativeAnalyzerReportSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema, NativeCssCompileResultSchema, NativeScanFileSchema, NativeScanResultSchema, NativeTransformResultSchema, NativeWatchResultSchema, PackageJsonSchema, RegistryFileSchema, RegistryPluginEntrySchema, ScanCacheClassEntrySchema, ScanCacheSchema, TW_STATE_STATIC_FILENAME, TailwindConfigSchema, TelemetryCollector, TwError, appendStaticStateCssToSafelist, assertTailwindV4, calculateHealth, createBuildTimer, createDebugLogger, createEsmRequire, createLogger2 as createLogger, createObservabilityClient, createTraceSnapshot, detectTailwind, extractStaticStateCss, formatDuration, formatErrorCode, formatErrorMessage, formatMemory, formatNativeNotFoundError, generateBarrelFile, generateClassRenameCodemod, generateComponentCode, generateStorybookStory, getBuildTimeColor, getDirname, getFilename, getGlobalTelemetry, getHealthColor, getMemoryColor, getModeColor, getPipelinePercentages, getSuggestion, getTailwindVersion, hashContent2 as hashContent, isTailwindV4, isTwError, loadNativeBinding, parseJsonFileWithSchema, parseJsonWithSchema, parseNative, resetGlobalTelemetry, resolveFromRoot, resolveLoaderPath, resolveNativeBinary, resolveNativeBindingCandidates, resolveNativeNodePath, resolveRuntimeDir, resolveWorkerPath, safeParseNative, setGlobalLogFile, tryRequire, wrapUnknownError };
2398
3695
  //# sourceMappingURL=shared.mjs.map
2399
3696
  //# sourceMappingURL=shared.mjs.map