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