tailwind-styled-v4 5.0.11 → 5.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -4
- package/dist/{analyzeWorkspace-DDOQdzzI.d.ts → analyzeWorkspace-CopJNGmi.d.ts} +2 -0
- package/dist/{analyzeWorkspace-BS5O4rhC.d.mts → analyzeWorkspace-DpVPccjz.d.mts} +2 -0
- package/dist/analyzer.d.mts +4 -4
- package/dist/analyzer.d.ts +4 -4
- package/dist/analyzer.js +34 -69
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +33 -68
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.d.mts +4 -0
- package/dist/animate.d.ts +4 -0
- package/dist/animate.js +33 -11
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +33 -11
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +57 -6
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +57 -6
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +404 -190
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +401 -187
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +2700 -212
- package/dist/compiler.d.ts +2700 -212
- package/dist/compiler.js +1996 -503
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +1847 -448
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js +17 -4
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +17 -4
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.d.mts +11 -470
- package/dist/engine.d.ts +11 -470
- package/dist/engine.js +2777 -455
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +2776 -454
- package/dist/engine.mjs.map +1 -1
- package/dist/index-BDQw13kn.d.ts +464 -0
- package/dist/index-DJv28Uzq.d.mts +464 -0
- package/dist/index.browser.mjs +143 -255
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +23 -39
- package/dist/index.d.ts +23 -39
- package/dist/index.js +7234 -1400
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7234 -1400
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +44 -1
- package/dist/next.d.ts +44 -1
- package/dist/next.js +3224 -1065
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +3223 -1066
- package/dist/next.mjs.map +1 -1
- package/dist/rspack.d.mts +9 -0
- package/dist/rspack.d.ts +9 -0
- package/dist/rspack.js +99 -61
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +99 -61
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.d.mts +8 -0
- package/dist/runtime-css.d.ts +8 -0
- package/dist/runtime-css.js +23 -7
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +23 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/scanner.js +16 -37
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +15 -36
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +107 -1
- package/dist/shared.d.ts +107 -1
- package/dist/shared.js +3014 -466
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +3008 -445
- package/dist/shared.mjs.map +1 -1
- package/dist/svelte.js +39 -35
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +38 -34
- package/dist/svelte.mjs.map +1 -1
- package/dist/theme.js +85 -76
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +83 -74
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +2351 -187
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +2351 -187
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +404 -190
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +401 -187
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +2657 -320
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +2657 -320
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +39 -35
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +38 -34
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +190 -33
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +190 -33
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/index.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
- package/package.json +9 -4
- package/CHANGELOG.md +0 -285
package/dist/analyzer.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'crypto';
|
|
2
|
-
import
|
|
2
|
+
import fs3 from 'fs';
|
|
3
3
|
import path5 from 'path';
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
5
5
|
import { createRequire } from 'module';
|
|
@@ -69,7 +69,7 @@ function loadNativeBinding(options) {
|
|
|
69
69
|
for (const candidate of candidates) {
|
|
70
70
|
const candidatePath = path5.resolve(runtimeDir, candidate);
|
|
71
71
|
try {
|
|
72
|
-
if (!
|
|
72
|
+
if (!fs3.existsSync(candidatePath) && !fs3.existsSync(candidatePath + ".node")) {
|
|
73
73
|
continue;
|
|
74
74
|
}
|
|
75
75
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -101,9 +101,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
if (!includeDefaultCandidates) return candidates;
|
|
104
|
-
if (
|
|
104
|
+
if (fs3.existsSync(runtimeDir)) {
|
|
105
105
|
try {
|
|
106
|
-
for (const entry of
|
|
106
|
+
for (const entry of fs3.readdirSync(runtimeDir)) {
|
|
107
107
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
@@ -519,7 +519,7 @@ function defaultCachePath(rootDir, cacheDir) {
|
|
|
519
519
|
}
|
|
520
520
|
function readCache(rootDir, cacheDir) {
|
|
521
521
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
522
|
-
|
|
522
|
+
fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
|
|
523
523
|
const result = cacheReadNative(cachePath);
|
|
524
524
|
if (!result) return [];
|
|
525
525
|
return result.entries.map((e) => ({
|
|
@@ -534,7 +534,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
534
534
|
}
|
|
535
535
|
function writeCache(rootDir, entries, cacheDir) {
|
|
536
536
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
537
|
-
|
|
537
|
+
fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
|
|
538
538
|
const success = cacheWriteNative(cachePath, entries);
|
|
539
539
|
if (!success) {
|
|
540
540
|
throw new Error(
|
|
@@ -561,27 +561,7 @@ var init_cache_native = __esm({
|
|
|
561
561
|
function collectFiles(rootDir, extensions, ignoreDirs) {
|
|
562
562
|
const native = collectFilesNative(rootDir, extensions, ignoreDirs);
|
|
563
563
|
if (native !== null) return native;
|
|
564
|
-
|
|
565
|
-
function walk(dir) {
|
|
566
|
-
let entries;
|
|
567
|
-
try {
|
|
568
|
-
entries = fs4.readdirSync(dir, { withFileTypes: true });
|
|
569
|
-
} catch {
|
|
570
|
-
return;
|
|
571
|
-
}
|
|
572
|
-
for (const entry of entries) {
|
|
573
|
-
const fullPath = path5.join(dir, entry.name);
|
|
574
|
-
const rel = path5.relative(rootDir, fullPath);
|
|
575
|
-
if (entry.isDirectory()) {
|
|
576
|
-
const ignored = ignoreDirs.some((d) => entry.name === d || rel.startsWith(d + path5.sep));
|
|
577
|
-
if (!ignored) walk(fullPath);
|
|
578
|
-
} else if (isScannableFile(entry.name, extensions)) {
|
|
579
|
-
files.push(fullPath);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
walk(rootDir);
|
|
584
|
-
return files;
|
|
564
|
+
throw new Error("FATAL: Native binding 'collectFiles' is required but not available.");
|
|
585
565
|
}
|
|
586
566
|
function mergeResults(batchResults) {
|
|
587
567
|
const files = batchResults.map((r) => ({
|
|
@@ -591,8 +571,7 @@ function mergeResults(batchResults) {
|
|
|
591
571
|
}));
|
|
592
572
|
const native = rebuildWorkspaceResultNative(files);
|
|
593
573
|
if (native) return native;
|
|
594
|
-
|
|
595
|
-
return { files, totalFiles: files.length, uniqueClasses: Array.from(unique).sort() };
|
|
574
|
+
throw new Error("FATAL: Native binding 'rebuildWorkspaceResult' is required but not available.");
|
|
596
575
|
}
|
|
597
576
|
function runChunkInWorker(filePaths) {
|
|
598
577
|
return new Promise((resolve, reject) => {
|
|
@@ -731,7 +710,7 @@ __export(src_exports, {
|
|
|
731
710
|
DEFAULT_IGNORES: () => DEFAULT_IGNORES,
|
|
732
711
|
batchExtractClassesNative: () => batchExtractClassesNative,
|
|
733
712
|
extractClassesNative: () => extractClassesNative,
|
|
734
|
-
isScannableFile: () =>
|
|
713
|
+
isScannableFile: () => isScannableFile2,
|
|
735
714
|
parseScanWorkspaceOptions: () => parseScanWorkspaceOptions,
|
|
736
715
|
parseScanWorkspaceResult: () => parseScanWorkspaceResult,
|
|
737
716
|
parseScannerWorkerMessage: () => parseScannerWorkerMessage,
|
|
@@ -765,7 +744,7 @@ function resolveScannerWorkerModulePath() {
|
|
|
765
744
|
path5.resolve(runtimeDir, "worker.ts")
|
|
766
745
|
];
|
|
767
746
|
for (const candidate of candidates) {
|
|
768
|
-
if (
|
|
747
|
+
if (fs3.existsSync(candidate)) return candidate;
|
|
769
748
|
}
|
|
770
749
|
return null;
|
|
771
750
|
}
|
|
@@ -822,7 +801,7 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
822
801
|
if (!currentDir) continue;
|
|
823
802
|
const entries = (() => {
|
|
824
803
|
try {
|
|
825
|
-
return
|
|
804
|
+
return fs3.readdirSync(currentDir, { withFileTypes: true });
|
|
826
805
|
} catch {
|
|
827
806
|
return [];
|
|
828
807
|
}
|
|
@@ -860,7 +839,7 @@ function scanSource(source) {
|
|
|
860
839
|
"FATAL: Native parser binding is required but not available.\nThis package requires native Rust bindings.\n\nResolution steps:\n1. Build the native Rust module: npm run build:rust"
|
|
861
840
|
);
|
|
862
841
|
}
|
|
863
|
-
function
|
|
842
|
+
function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
|
|
864
843
|
return includeExtensions.includes(path5.extname(filePath));
|
|
865
844
|
}
|
|
866
845
|
function scanFile(filePath) {
|
|
@@ -921,7 +900,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
921
900
|
for (const filePath of candidates) {
|
|
922
901
|
const stat = (() => {
|
|
923
902
|
try {
|
|
924
|
-
return
|
|
903
|
+
return fs3.statSync(filePath);
|
|
925
904
|
} catch {
|
|
926
905
|
return null;
|
|
927
906
|
}
|
|
@@ -947,7 +926,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
947
926
|
for (const { filePath, stat, size, cached } of ranked) {
|
|
948
927
|
const content = (() => {
|
|
949
928
|
try {
|
|
950
|
-
return
|
|
929
|
+
return fs3.readFileSync(filePath, "utf8");
|
|
951
930
|
} catch {
|
|
952
931
|
return null;
|
|
953
932
|
}
|
|
@@ -1091,7 +1070,7 @@ var init_src2 = __esm({
|
|
|
1091
1070
|
)
|
|
1092
1071
|
];
|
|
1093
1072
|
for (const fullPath of candidates) {
|
|
1094
|
-
if (!
|
|
1073
|
+
if (!fs3.existsSync(fullPath)) continue;
|
|
1095
1074
|
try {
|
|
1096
1075
|
const required = req(fullPath);
|
|
1097
1076
|
if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
|
|
@@ -1145,7 +1124,7 @@ function isRecord(value) {
|
|
|
1145
1124
|
}
|
|
1146
1125
|
async function pathExists(filePath) {
|
|
1147
1126
|
try {
|
|
1148
|
-
await
|
|
1127
|
+
await fs3.promises.access(filePath, fs3.constants.F_OK);
|
|
1149
1128
|
return true;
|
|
1150
1129
|
} catch {
|
|
1151
1130
|
return false;
|
|
@@ -1361,27 +1340,13 @@ var splitVariantAndBase = (className) => {
|
|
|
1361
1340
|
const base = parts.pop() ?? className;
|
|
1362
1341
|
return { variantKey: parts.join(":"), base };
|
|
1363
1342
|
};
|
|
1364
|
-
var
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
if (base.startsWith("bg-")) return "bg";
|
|
1372
|
-
if (base.startsWith("text-")) return "text";
|
|
1373
|
-
if (base.startsWith("font-")) return "font";
|
|
1374
|
-
if (base.startsWith("rounded")) return "rounded";
|
|
1375
|
-
if (base.startsWith("shadow")) return "shadow";
|
|
1376
|
-
if (base.startsWith("border-")) return "border";
|
|
1377
|
-
if (base.startsWith("opacity-")) return "opacity";
|
|
1378
|
-
if (base.startsWith("w-") || base.startsWith("min-w-") || base.startsWith("max-w-"))
|
|
1379
|
-
return "width";
|
|
1380
|
-
if (base.startsWith("h-") || base.startsWith("min-h-") || base.startsWith("max-h-"))
|
|
1381
|
-
return "height";
|
|
1382
|
-
if (base.startsWith("p-") || base.startsWith("px-") || base.startsWith("py-")) return "padding";
|
|
1383
|
-
if (base.startsWith("m-") || base.startsWith("mx-") || base.startsWith("my-")) return "margin";
|
|
1384
|
-
return null;
|
|
1343
|
+
var resolveConflictGroup = async (base) => {
|
|
1344
|
+
const native = await getNativeBinding();
|
|
1345
|
+
if (!native?.resolveConflictGroup) {
|
|
1346
|
+
throw new Error("Native binding 'resolveConflictGroup' is required but not available.");
|
|
1347
|
+
}
|
|
1348
|
+
const result = native.resolveConflictGroup(base);
|
|
1349
|
+
return result.length > 0 ? result : null;
|
|
1385
1350
|
};
|
|
1386
1351
|
var detectConflicts = async (usages) => {
|
|
1387
1352
|
const native = await getNativeBinding();
|
|
@@ -1469,7 +1434,7 @@ var collectCustomUtilities = (config) => {
|
|
|
1469
1434
|
return out;
|
|
1470
1435
|
};
|
|
1471
1436
|
var collectSafelistFromSource = async (configPath) => {
|
|
1472
|
-
const source = await
|
|
1437
|
+
const source = await fs3.promises.readFile(configPath, "utf8");
|
|
1473
1438
|
const { extractClassesNative: extractClassesNative2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
|
|
1474
1439
|
const allTokens = extractClassesNative2(source);
|
|
1475
1440
|
const hasSafelist = source.includes("safelist");
|
|
@@ -1496,7 +1461,7 @@ var loadTailwindConfig = async (root, semanticOption) => {
|
|
|
1496
1461
|
customUtilities: /* @__PURE__ */ new Set()
|
|
1497
1462
|
};
|
|
1498
1463
|
}
|
|
1499
|
-
const configStat = await
|
|
1464
|
+
const configStat = await fs3.promises.stat(configPath).catch(() => null);
|
|
1500
1465
|
if (configStat) {
|
|
1501
1466
|
const cached = tailwindConfigCache.get(configPath);
|
|
1502
1467
|
if (cached && cached.mtimeMs === configStat.mtimeMs && cached.size === configStat.size) {
|
|
@@ -1777,12 +1742,12 @@ async function analyzeWorkspace(root, options = {}) {
|
|
|
1777
1742
|
}
|
|
1778
1743
|
|
|
1779
1744
|
// packages/domain/analyzer/src/classToCss.ts
|
|
1780
|
-
var normalizeClassInput = (input,
|
|
1745
|
+
var normalizeClassInput = (input, binding) => {
|
|
1781
1746
|
if (typeof input === "string") {
|
|
1782
|
-
if (
|
|
1783
|
-
|
|
1747
|
+
if (!binding.normalizeClassInput) {
|
|
1748
|
+
throw new Error("FATAL: Native binding 'normalizeClassInput' is required but not available.");
|
|
1784
1749
|
}
|
|
1785
|
-
return
|
|
1750
|
+
return binding.normalizeClassInput(input);
|
|
1786
1751
|
}
|
|
1787
1752
|
if (!Array.isArray(input)) {
|
|
1788
1753
|
throw new TypeError("classToCss input must be a string or an array of strings.");
|
|
@@ -1814,11 +1779,11 @@ var mergeDeclarationMap = (target, css, binding) => {
|
|
|
1814
1779
|
}
|
|
1815
1780
|
};
|
|
1816
1781
|
var declarationMapToString = (declarationMap, binding) => {
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
return binding.declarationMapToString(entries);
|
|
1782
|
+
if (!binding.declarationMapToString) {
|
|
1783
|
+
throw new Error("FATAL: Native binding 'declarationMapToString' is required but not available.");
|
|
1820
1784
|
}
|
|
1821
|
-
|
|
1785
|
+
const entries = Array.from(declarationMap.entries()).map(([property, value]) => ({ property, value }));
|
|
1786
|
+
return binding.declarationMapToString(entries);
|
|
1822
1787
|
};
|
|
1823
1788
|
var classToCss = async (input, options = {}) => {
|
|
1824
1789
|
const binding = await requireNativeCssCompiler();
|