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