tailwind-styled-v4 5.0.18 → 5.0.21
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/dist/{analyzeWorkspace-CopJNGmi.d.ts → analyzeWorkspace-B1_XRfdl.d.ts} +1 -0
- package/dist/{analyzeWorkspace-DpVPccjz.d.mts → analyzeWorkspace-hYfu4Hg3.d.mts} +1 -0
- package/dist/analyzer.d.mts +2 -2
- package/dist/analyzer.d.ts +2 -2
- package/dist/analyzer.js +5 -4
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +5 -4
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +3 -3
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +3 -3
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +38 -2
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +38 -2
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +43 -6
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +43 -6
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +177 -2
- package/dist/compiler.d.ts +177 -2
- package/dist/compiler.js +172 -10
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +159 -11
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.d.mts +3 -3
- package/dist/engine.d.ts +3 -3
- package/dist/engine.js +182 -14
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +182 -14
- package/dist/engine.mjs.map +1 -1
- package/dist/index-BFqmBxl9.d.mts +102 -0
- package/dist/{index-DJv28Uzq.d.mts → index-DQI6O24n.d.mts} +1 -1
- package/dist/index-DwNErRJ_.d.ts +102 -0
- package/dist/{index-BDQw13kn.d.ts → index-UkYbyBkR.d.ts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +182 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +182 -14
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +193 -11
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +193 -11
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.d.mts +3 -101
- package/dist/plugin-api.d.ts +3 -101
- package/dist/plugin.d.mts +3 -5
- package/dist/plugin.d.ts +3 -5
- package/dist/plugin.js +0 -97
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +1 -77
- package/dist/plugin.mjs.map +1 -1
- package/dist/shared.js +177 -10
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +177 -10
- package/dist/shared.mjs.map +1 -1
- package/dist/turbopackLoader.js +179 -12
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +179 -12
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +43 -6
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +43 -6
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +315 -147
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +315 -147
- package/dist/vite.mjs.map +1 -1
- package/dist/webpackLoader.js +38 -2
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +38 -2
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +1 -1
package/dist/engine.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-
|
|
2
|
-
export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-
|
|
1
|
+
import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-DQI6O24n.mjs';
|
|
2
|
+
export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-DQI6O24n.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.mjs';
|
|
5
5
|
export { S as ScanFileResult } from './schemas-DR-SLxZZ.mjs';
|
|
6
|
-
import './analyzeWorkspace-
|
|
6
|
+
import './analyzeWorkspace-hYfu4Hg3.mjs';
|
|
7
7
|
|
|
8
8
|
interface ClassBundleInfo {
|
|
9
9
|
className: string;
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-
|
|
2
|
-
export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-
|
|
1
|
+
import { S as SourceLocation, R as RuleIR, a as RuleId, E as EnginePlugin } from './index-UkYbyBkR.js';
|
|
2
|
+
export { B as BuildResult, C as CascadeResolutionIR, b as CascadeResolutionId, c as CascadeResolver, d as CascadeStage, e as ConditionIR, f as ConditionId, g as ConditionResult, h as ConflictTrace, i as EngineMetricsCollector, j as EngineMetricsSnapshot, k as EngineOptions, l as EnginePluginContext, m as EngineWatchContext, n as EngineWatchEvent, o as EngineWatchOptions, F as FinalComputedStyleIR, p as FinalStyleProperty, I as Importance, q as InspectionReport, L as LayerId, O as Origin, P as PropertyBucketIR, r as PropertyId, s as ResolutionCause, t as ResolutionReason, u as RuleTrace, v as SelectorIR, w as SelectorId, x as StyleGraphIR, T as TailwindStyledEngine, y as TraceResult, V as ValueId, z as VariantChainIR, A as VariantChainId, D as VariantTrace, G as analyzeWorkspace, H as build, J as buildProvenanceChain, K as createEngine, M as createFingerprint, N as createResolutionReason, Q as generateSafelist, U as inspectClass, W as runAfterBuild, X as runAfterScan, Y as runAfterWatch, Z as runBeforeBuild, _ as runBeforeScan, $ as runBeforeWatch, a0 as runOnError, a1 as runTransformClasses, a2 as scanWorkspace, a3 as trace, a4 as traceClass, a5 as traceClasses } from './index-UkYbyBkR.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.js';
|
|
5
5
|
export { S as ScanFileResult } from './schemas-DR-SLxZZ.js';
|
|
6
|
-
import './analyzeWorkspace-
|
|
6
|
+
import './analyzeWorkspace-B1_XRfdl.js';
|
|
7
7
|
|
|
8
8
|
interface ClassBundleInfo {
|
|
9
9
|
className: string;
|
package/dist/engine.js
CHANGED
|
@@ -1046,8 +1046,44 @@ var init_nativeBridge = __esm({
|
|
|
1046
1046
|
try {
|
|
1047
1047
|
const binding = _loadNative(result.path);
|
|
1048
1048
|
if (isValidNativeBridge(binding)) {
|
|
1049
|
-
|
|
1050
|
-
|
|
1049
|
+
const toCamelCase = (str) => {
|
|
1050
|
+
return str.replace(/_([a-z0-9])/g, (_, g) => g.toUpperCase());
|
|
1051
|
+
};
|
|
1052
|
+
nativeBridge = new Proxy(binding, {
|
|
1053
|
+
get(target, prop) {
|
|
1054
|
+
if (typeof prop === "string") {
|
|
1055
|
+
if (prop in target) {
|
|
1056
|
+
return target[prop];
|
|
1057
|
+
}
|
|
1058
|
+
const camelKey = toCamelCase(prop);
|
|
1059
|
+
if (camelKey in target) {
|
|
1060
|
+
const val = target[camelKey];
|
|
1061
|
+
if (typeof val === "function") {
|
|
1062
|
+
return val.bind(target);
|
|
1063
|
+
}
|
|
1064
|
+
return val;
|
|
1065
|
+
}
|
|
1066
|
+
const napiKey = `${camelKey}Napi`;
|
|
1067
|
+
if (napiKey in target) {
|
|
1068
|
+
const val = target[napiKey];
|
|
1069
|
+
if (typeof val === "function") {
|
|
1070
|
+
return val.bind(target);
|
|
1071
|
+
}
|
|
1072
|
+
return val;
|
|
1073
|
+
}
|
|
1074
|
+
const napiInnerKey = `${camelKey}NapiInner`;
|
|
1075
|
+
if (napiInnerKey in target) {
|
|
1076
|
+
const val = target[napiInnerKey];
|
|
1077
|
+
if (typeof val === "function") {
|
|
1078
|
+
return val.bind(target);
|
|
1079
|
+
}
|
|
1080
|
+
return val;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
return target[prop];
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
log("Native bridge loaded successfully and proxy-wrapped from:", result.path);
|
|
1051
1087
|
return nativeBridge;
|
|
1052
1088
|
}
|
|
1053
1089
|
} catch (e) {
|
|
@@ -1095,8 +1131,8 @@ async function generateCssNative(classes, options) {
|
|
|
1095
1131
|
return css;
|
|
1096
1132
|
}
|
|
1097
1133
|
function clearThemeCache() {
|
|
1134
|
+
const native = getNativeBridge();
|
|
1098
1135
|
try {
|
|
1099
|
-
const native = getNativeBridge();
|
|
1100
1136
|
if (!native?.clearThemeCache) {
|
|
1101
1137
|
return;
|
|
1102
1138
|
}
|
|
@@ -1104,6 +1140,16 @@ function clearThemeCache() {
|
|
|
1104
1140
|
} catch {
|
|
1105
1141
|
}
|
|
1106
1142
|
}
|
|
1143
|
+
function resetCacheStats() {
|
|
1144
|
+
const native = getNativeBridge();
|
|
1145
|
+
try {
|
|
1146
|
+
if (!native?.resetCacheStats) {
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
native.resetCacheStats();
|
|
1150
|
+
} catch {
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1107
1153
|
var init_cssGeneratorNative = __esm({
|
|
1108
1154
|
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
1109
1155
|
init_nativeBridge();
|
|
@@ -1229,6 +1275,16 @@ function minifyCss(css) {
|
|
|
1229
1275
|
if (!native?.minify_css) throw new Error("minify_css not available");
|
|
1230
1276
|
return native.minify_css(css);
|
|
1231
1277
|
}
|
|
1278
|
+
function generateCss(ruleJson, minify) {
|
|
1279
|
+
const native = getNativeBridge();
|
|
1280
|
+
if (!native?.generate_css) throw new Error("generate_css not available");
|
|
1281
|
+
return native.generate_css(ruleJson, minify);
|
|
1282
|
+
}
|
|
1283
|
+
function generateCssBatch(rulesJson, minify) {
|
|
1284
|
+
const native = getNativeBridge();
|
|
1285
|
+
if (!native?.generate_css_batch) throw new Error("generate_css_batch not available");
|
|
1286
|
+
return native.generate_css_batch(rulesJson, minify);
|
|
1287
|
+
}
|
|
1232
1288
|
function compileAnimation(animationName, from, to) {
|
|
1233
1289
|
const native = getNativeBridge();
|
|
1234
1290
|
if (!native?.compile_animation) throw new Error("compile_animation not available");
|
|
@@ -1666,7 +1722,7 @@ function postProcessWithLightning(rawCss) {
|
|
|
1666
1722
|
}
|
|
1667
1723
|
return result.css;
|
|
1668
1724
|
}
|
|
1669
|
-
async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
1725
|
+
async function runCssPipeline(classes, cssEntryContent, root, minify = true, minifier = "lightning") {
|
|
1670
1726
|
const filtered = classes.filter(Boolean);
|
|
1671
1727
|
const uniqueMap = /* @__PURE__ */ new Map();
|
|
1672
1728
|
filtered.forEach((cls) => uniqueMap.set(cls, cls));
|
|
@@ -1674,7 +1730,7 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
|
1674
1730
|
if (unique.length === 0) {
|
|
1675
1731
|
return { css: "", classes: [], sizeBytes: 0, optimized: false };
|
|
1676
1732
|
}
|
|
1677
|
-
const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root)
|
|
1733
|
+
const cacheKey = _getCacheKey(unique, minify, cssEntryContent, root) + `|${minifier}`;
|
|
1678
1734
|
const cached = _cssCache.get(cacheKey);
|
|
1679
1735
|
if (cached) {
|
|
1680
1736
|
_cacheHits++;
|
|
@@ -1691,7 +1747,14 @@ async function runCssPipeline(classes, cssEntryContent, root, minify = true) {
|
|
|
1691
1747
|
const theme = getThemeConfig();
|
|
1692
1748
|
rawCss = await generateCssNative(unique, { theme });
|
|
1693
1749
|
usedRustCompiler = true;
|
|
1694
|
-
|
|
1750
|
+
let finalCss = rawCss;
|
|
1751
|
+
if (minify) {
|
|
1752
|
+
if (minifier === "fast") {
|
|
1753
|
+
finalCss = minifyCss(rawCss);
|
|
1754
|
+
} else {
|
|
1755
|
+
finalCss = postProcessWithLightning(rawCss);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1695
1758
|
if (process.env.DEBUG?.includes("compiler")) {
|
|
1696
1759
|
console.log(
|
|
1697
1760
|
`[Compiler] Generated CSS from ${unique.length} classes (${usedRustCompiler ? "Rust" : "JavaScript"})`,
|
|
@@ -1727,6 +1790,7 @@ var init_tailwindEngine = __esm({
|
|
|
1727
1790
|
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
1728
1791
|
init_nativeBridge();
|
|
1729
1792
|
init_cssGeneratorNative();
|
|
1793
|
+
init_cssCompilationNative();
|
|
1730
1794
|
module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
|
|
1731
1795
|
_cssCache = /* @__PURE__ */ new Map();
|
|
1732
1796
|
_cacheHits = 0;
|
|
@@ -1759,9 +1823,10 @@ __export(parser_exports, {
|
|
|
1759
1823
|
mergeClassesStatic: () => mergeClassesStatic,
|
|
1760
1824
|
normalizeAndDedupClasses: () => normalizeAndDedupClasses,
|
|
1761
1825
|
normalizeClasses: () => normalizeClasses,
|
|
1826
|
+
parseClass: () => parseClass,
|
|
1762
1827
|
parseClasses: () => parseClasses
|
|
1763
1828
|
});
|
|
1764
|
-
var parseClasses, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1829
|
+
var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
|
|
1765
1830
|
var init_parser = __esm({
|
|
1766
1831
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
1767
1832
|
init_nativeBridge();
|
|
@@ -1772,6 +1837,14 @@ var init_parser = __esm({
|
|
|
1772
1837
|
}
|
|
1773
1838
|
return native.parseClasses(raw) || [];
|
|
1774
1839
|
};
|
|
1840
|
+
parseClass = (input) => {
|
|
1841
|
+
const native = getNativeBridge();
|
|
1842
|
+
if (!native?.parseClass) {
|
|
1843
|
+
throw new Error("FATAL: Native binding 'parseClass' is required but not available.");
|
|
1844
|
+
}
|
|
1845
|
+
const result = native.parseClass(input);
|
|
1846
|
+
return typeof result === "string" ? JSON.parse(result) : result;
|
|
1847
|
+
};
|
|
1775
1848
|
extractAllClasses = (source) => {
|
|
1776
1849
|
const native = getNativeBridge();
|
|
1777
1850
|
if (!native?.extractAllClasses) {
|
|
@@ -1903,6 +1976,35 @@ function mergeCssDeclarationsNative(cssChunks) {
|
|
|
1903
1976
|
if (!native?.mergeCssDeclarations) throw new Error("mergeCssDeclarations not available");
|
|
1904
1977
|
return native.mergeCssDeclarations(cssChunks);
|
|
1905
1978
|
}
|
|
1979
|
+
function getWeek6FeaturesStatus() {
|
|
1980
|
+
const native = getNativeBridge();
|
|
1981
|
+
if (!native?.getWeek6FeaturesStatus) throw new Error("getWeek6FeaturesStatus not available");
|
|
1982
|
+
const resultJson = native.getWeek6FeaturesStatus();
|
|
1983
|
+
return JSON.parse(resultJson);
|
|
1984
|
+
}
|
|
1985
|
+
function getMemoryStatsNative() {
|
|
1986
|
+
const native = getNativeBridge();
|
|
1987
|
+
if (!native?.getMemoryStatsNative) throw new Error("getMemoryStatsNative not available");
|
|
1988
|
+
const resultJson = native.getMemoryStatsNative();
|
|
1989
|
+
return JSON.parse(resultJson);
|
|
1990
|
+
}
|
|
1991
|
+
function getMemoryRecommendationsNative() {
|
|
1992
|
+
const native = getNativeBridge();
|
|
1993
|
+
if (!native?.getMemoryRecommendationsNative) throw new Error("getMemoryRecommendationsNative not available");
|
|
1994
|
+
const resultJson = native.getMemoryRecommendationsNative();
|
|
1995
|
+
return JSON.parse(resultJson);
|
|
1996
|
+
}
|
|
1997
|
+
function estimateOptimalCacheConfigNative(workloadType, expectedEntries) {
|
|
1998
|
+
const native = getNativeBridge();
|
|
1999
|
+
if (!native?.estimateOptimalCacheConfigNative) throw new Error("estimateOptimalCacheConfigNative not available");
|
|
2000
|
+
const resultJson = native.estimateOptimalCacheConfigNative(workloadType, expectedEntries);
|
|
2001
|
+
return JSON.parse(resultJson);
|
|
2002
|
+
}
|
|
2003
|
+
function resetMemoryStats() {
|
|
2004
|
+
const native = getNativeBridge();
|
|
2005
|
+
if (!native?.resetMemoryStats) throw new Error("resetMemoryStats not available");
|
|
2006
|
+
native.resetMemoryStats();
|
|
2007
|
+
}
|
|
1906
2008
|
var init_analyzerNative = __esm({
|
|
1907
2009
|
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
1908
2010
|
init_nativeBridge();
|
|
@@ -2192,6 +2294,52 @@ function cachePriority(mtimeMs, sizeBytes, hitCount) {
|
|
|
2192
2294
|
if (!native?.cache_priority) throw new Error("cache_priority not available");
|
|
2193
2295
|
return native.cache_priority(mtimeMs, sizeBytes, hitCount);
|
|
2194
2296
|
}
|
|
2297
|
+
function getResolverPoolStats() {
|
|
2298
|
+
const native = getNativeBridge();
|
|
2299
|
+
if (!native?.getResolverPoolStats) throw new Error("getResolverPoolStats not available");
|
|
2300
|
+
const statsJson = native.getResolverPoolStats();
|
|
2301
|
+
try {
|
|
2302
|
+
return JSON.parse(statsJson);
|
|
2303
|
+
} catch {
|
|
2304
|
+
return {
|
|
2305
|
+
hits: 0,
|
|
2306
|
+
misses: 0,
|
|
2307
|
+
total: 0,
|
|
2308
|
+
hit_rate: 0,
|
|
2309
|
+
cached_resolvers: 0
|
|
2310
|
+
};
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
function clearResolverPool() {
|
|
2314
|
+
const native = getNativeBridge();
|
|
2315
|
+
if (!native?.clearResolverPool) throw new Error("clearResolverPool not available");
|
|
2316
|
+
const resultJson = native.clearResolverPool();
|
|
2317
|
+
try {
|
|
2318
|
+
return JSON.parse(resultJson);
|
|
2319
|
+
} catch {
|
|
2320
|
+
return { status: "error" };
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
function resolveColorCached(themeId, color, configJson) {
|
|
2324
|
+
const native = getNativeBridge();
|
|
2325
|
+
if (!native?.resolveColorCached) throw new Error("resolveColorCached not available");
|
|
2326
|
+
return native.resolveColorCached(themeId, color, configJson);
|
|
2327
|
+
}
|
|
2328
|
+
function resolveSpacingCached(themeId, spacing, configJson) {
|
|
2329
|
+
const native = getNativeBridge();
|
|
2330
|
+
if (!native?.resolveSpacingCached) throw new Error("resolveSpacingCached not available");
|
|
2331
|
+
return native.resolveSpacingCached(themeId, spacing, configJson);
|
|
2332
|
+
}
|
|
2333
|
+
function resolveFontSizeCached(themeId, size, configJson) {
|
|
2334
|
+
const native = getNativeBridge();
|
|
2335
|
+
if (!native?.resolveFontSizeCached) throw new Error("resolveFontSizeCached not available");
|
|
2336
|
+
return native.resolveFontSizeCached(themeId, size, configJson);
|
|
2337
|
+
}
|
|
2338
|
+
function resetResolverPoolStats() {
|
|
2339
|
+
const native = getNativeBridge();
|
|
2340
|
+
if (!native?.resetResolverPoolStats) throw new Error("resetResolverPoolStats not available");
|
|
2341
|
+
native.resetResolverPoolStats();
|
|
2342
|
+
}
|
|
2195
2343
|
var init_cacheNative = __esm({
|
|
2196
2344
|
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
2197
2345
|
init_nativeBridge();
|
|
@@ -2840,9 +2988,9 @@ var init_src = __esm({
|
|
|
2840
2988
|
if (normalized.includes("/layout.") || normalized.includes("/loading.") || normalized.includes("/error.")) {
|
|
2841
2989
|
return "__global";
|
|
2842
2990
|
}
|
|
2843
|
-
const pageMatch = normalized.match(
|
|
2991
|
+
const pageMatch = normalized.match(/(?:^|\/)app\/(.+?)\/page\.[tj]sx?$/);
|
|
2844
2992
|
if (pageMatch) return `/${pageMatch[1]}`;
|
|
2845
|
-
const rootPage = normalized.match(
|
|
2993
|
+
const rootPage = normalized.match(/(?:^|\/)app\/page\.[tj]sx?$/);
|
|
2846
2994
|
if (rootPage) return "/";
|
|
2847
2995
|
return null;
|
|
2848
2996
|
};
|
|
@@ -3001,6 +3149,7 @@ __export(internal_exports, {
|
|
|
3001
3149
|
clearCssGenCache: () => clearCssGenCache,
|
|
3002
3150
|
clearParseCache: () => clearParseCache,
|
|
3003
3151
|
clearResolveCache: () => clearResolveCache,
|
|
3152
|
+
clearResolverPool: () => clearResolverPool,
|
|
3004
3153
|
clearThemeCache: () => clearThemeCache,
|
|
3005
3154
|
collectFiles: () => collectFiles,
|
|
3006
3155
|
compileAnimation: () => compileAnimation,
|
|
@@ -3023,6 +3172,7 @@ __export(internal_exports, {
|
|
|
3023
3172
|
eliminateDeadCssNative: () => eliminateDeadCssNative,
|
|
3024
3173
|
emitPluginHook: () => emitPluginHook,
|
|
3025
3174
|
estimateOptimalCacheConfig: () => estimateOptimalCacheConfig,
|
|
3175
|
+
estimateOptimalCacheConfigNative: () => estimateOptimalCacheConfigNative,
|
|
3026
3176
|
extractAllClasses: () => extractAllClasses,
|
|
3027
3177
|
extractAndGenerateStateCss: () => extractAndGenerateStateCss,
|
|
3028
3178
|
extractAndGenerateStateCssNative: () => extractAndGenerateStateCssNative,
|
|
@@ -3036,6 +3186,8 @@ __export(internal_exports, {
|
|
|
3036
3186
|
fileToRoute: () => fileToRoute,
|
|
3037
3187
|
findDeadVariants: () => findDeadVariants,
|
|
3038
3188
|
generateAtomicCss: () => generateAtomicCss,
|
|
3189
|
+
generateCss: () => generateCss,
|
|
3190
|
+
generateCssBatch: () => generateCssBatch,
|
|
3039
3191
|
generateCssForClasses: () => generateCssForClasses,
|
|
3040
3192
|
generateCssNative: () => generateCssNative,
|
|
3041
3193
|
generateSafelist: () => generateSafelist,
|
|
@@ -3051,10 +3203,14 @@ __export(internal_exports, {
|
|
|
3051
3203
|
getCompilerDiagnostics: () => getCompilerDiagnostics,
|
|
3052
3204
|
getContentPaths: () => getContentPaths,
|
|
3053
3205
|
getIncrementalEngine: () => getIncrementalEngine,
|
|
3206
|
+
getMemoryRecommendationsNative: () => getMemoryRecommendationsNative,
|
|
3207
|
+
getMemoryStatsNative: () => getMemoryStatsNative,
|
|
3054
3208
|
getNativeBridge: () => getNativeBridge,
|
|
3055
3209
|
getPluginHooks: () => getPluginHooks,
|
|
3210
|
+
getResolverPoolStats: () => getResolverPoolStats,
|
|
3056
3211
|
getRouteClasses: () => getRouteClasses,
|
|
3057
3212
|
getWatchStats: () => getWatchStats,
|
|
3213
|
+
getWeek6FeaturesStatus: () => getWeek6FeaturesStatus,
|
|
3058
3214
|
hasTwUsage: () => hasTwUsage,
|
|
3059
3215
|
hashContent: () => hashContent,
|
|
3060
3216
|
hoistComponentsNative: () => hoistComponentsNative,
|
|
@@ -3083,6 +3239,7 @@ __export(internal_exports, {
|
|
|
3083
3239
|
normalizeClasses: () => normalizeClasses,
|
|
3084
3240
|
optimizeCssNative: () => optimizeCssNative,
|
|
3085
3241
|
parseAtomicClass: () => parseAtomicClass,
|
|
3242
|
+
parseClass: () => parseClass,
|
|
3086
3243
|
parseClasses: () => parseClasses,
|
|
3087
3244
|
pollWatchEvents: () => pollWatchEvents,
|
|
3088
3245
|
processFileChange: () => processFileChange,
|
|
@@ -3134,12 +3291,18 @@ __export(internal_exports, {
|
|
|
3134
3291
|
registerPropertyName: () => registerPropertyName,
|
|
3135
3292
|
registerValueName: () => registerValueName,
|
|
3136
3293
|
resetBucketEngine: () => resetBucketEngine,
|
|
3294
|
+
resetCacheStats: () => resetCacheStats,
|
|
3137
3295
|
resetCompilationMetrics: () => resetCompilationMetrics,
|
|
3138
3296
|
resetIncrementalEngine: () => resetIncrementalEngine,
|
|
3297
|
+
resetMemoryStats: () => resetMemoryStats,
|
|
3298
|
+
resetResolverPoolStats: () => resetResolverPoolStats,
|
|
3139
3299
|
resolveCascade: () => resolveCascade,
|
|
3140
3300
|
resolveClassNames: () => resolveClassNames,
|
|
3301
|
+
resolveColorCached: () => resolveColorCached,
|
|
3141
3302
|
resolveConflictGroup: () => resolveConflictGroup,
|
|
3303
|
+
resolveFontSizeCached: () => resolveFontSizeCached,
|
|
3142
3304
|
resolveSimpleVariants: () => resolveSimpleVariants,
|
|
3305
|
+
resolveSpacingCached: () => resolveSpacingCached,
|
|
3143
3306
|
resolveThemeValue: () => resolveThemeValue,
|
|
3144
3307
|
resolveVariants: () => resolveVariants,
|
|
3145
3308
|
reverseLookupProperty: () => reverseLookupProperty,
|
|
@@ -3385,7 +3548,11 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3385
3548
|
return result;
|
|
3386
3549
|
}
|
|
3387
3550
|
function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
3388
|
-
const result = extractStaticStateCss(srcDir,
|
|
3551
|
+
const result = extractStaticStateCss(srcDir, {
|
|
3552
|
+
verbose: options.verbose,
|
|
3553
|
+
resolvedCss: options.resolvedCss || ""
|
|
3554
|
+
// ← ensure always passed
|
|
3555
|
+
});
|
|
3389
3556
|
const twClassesDir = path9__namespace.default.join(path9__namespace.default.dirname(safelistPath), "tw-classes");
|
|
3390
3557
|
fs3__namespace.default.mkdirSync(twClassesDir, { recursive: true });
|
|
3391
3558
|
const stateFilePath = path9__namespace.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
@@ -5415,7 +5582,7 @@ function sanitizeFrequentThreshold(value) {
|
|
|
5415
5582
|
// packages/domain/analyzer/src/binding.ts
|
|
5416
5583
|
var isAnalyzerModule = (module) => {
|
|
5417
5584
|
const candidate = module;
|
|
5418
|
-
return typeof candidate?.analyzeClasses === "function";
|
|
5585
|
+
return typeof candidate?.analyzeClasses === "function" || typeof candidate?.analyzeClassesWorkspace === "function";
|
|
5419
5586
|
};
|
|
5420
5587
|
var createAnalyzerBindingLoader = () => {
|
|
5421
5588
|
const _state = { bindingPromise: null };
|
|
@@ -5434,7 +5601,7 @@ var createAnalyzerBindingLoader = () => {
|
|
|
5434
5601
|
runtimeDir,
|
|
5435
5602
|
candidates,
|
|
5436
5603
|
isValid: isAnalyzerModule,
|
|
5437
|
-
invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
|
|
5604
|
+
invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
|
|
5438
5605
|
});
|
|
5439
5606
|
if (binding) {
|
|
5440
5607
|
debugLog(`native binding loaded from: ${loadedPath}`);
|
|
@@ -5477,7 +5644,7 @@ async function requireNativeBinding() {
|
|
|
5477
5644
|
runtimeDir,
|
|
5478
5645
|
candidates,
|
|
5479
5646
|
isValid: isAnalyzerModule,
|
|
5480
|
-
invalidExportMessage: "Module loaded but missing `analyzeClasses` export."
|
|
5647
|
+
invalidExportMessage: "Module loaded but missing `analyzeClasses` or `analyzeClassesWorkspace` export."
|
|
5481
5648
|
});
|
|
5482
5649
|
const lines = [
|
|
5483
5650
|
"Native analyzer binding not found. Ensure `tailwind_styled_parser.node` is built."
|
|
@@ -5897,7 +6064,8 @@ async function analyzeWorkspace(root, options = {}) {
|
|
|
5897
6064
|
);
|
|
5898
6065
|
const nativeReport = (() => {
|
|
5899
6066
|
try {
|
|
5900
|
-
const
|
|
6067
|
+
const fn = binding.analyzeClassesWorkspace || binding.analyzeClasses;
|
|
6068
|
+
const report = fn(filesJson, resolvedRoot, topLimit);
|
|
5901
6069
|
if (!report) {
|
|
5902
6070
|
throw new Error(`Native analyzer returned no report for "${resolvedRoot}".`);
|
|
5903
6071
|
}
|