tailwind-styled-v4 5.0.10 → 5.0.11
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 +245 -373
- package/dist/analyzer.js +75 -22
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +74 -21
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +4 -2
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +4 -2
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +20 -5
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +20 -5
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +174 -67
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +171 -64
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +7 -1
- package/dist/compiler.d.ts +7 -1
- package/dist/compiler.js +53 -27
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +53 -27
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.js +159 -61
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +159 -61
- package/dist/engine.mjs.map +1 -1
- package/dist/index.browser.mjs +1512 -0
- package/dist/index.browser.mjs.map +1 -0
- package/dist/index.d.mts +94 -12
- package/dist/index.d.ts +94 -12
- package/dist/index.js +436 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +436 -106
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +1946 -47
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +1929 -44
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +23 -10
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +23 -11
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs.map +1 -1
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs.map +1 -1
- package/dist/scanner.js +72 -19
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +71 -18
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.js +32 -15
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +32 -15
- package/dist/shared.mjs.map +1 -1
- package/dist/svelte.js +38 -12
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +38 -12
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +17 -5
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +17 -5
- package/dist/syntax.mjs.map +1 -1
- package/dist/theme.js +4 -2
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +4 -2
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +87 -33
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +87 -33
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +174 -67
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +171 -64
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +145 -63
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +145 -63
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +38 -12
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +38 -12
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +20 -5
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +20 -5
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +29 -24
package/dist/scanner.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'crypto';
|
|
2
|
-
import
|
|
2
|
+
import fs4 from 'fs';
|
|
3
3
|
import path5 from 'path';
|
|
4
4
|
import { fileURLToPath } 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 (!fs4.existsSync(candidatePath) && !fs4.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 (fs4.existsSync(runtimeDir)) {
|
|
105
105
|
try {
|
|
106
|
-
for (const entry of
|
|
106
|
+
for (const entry of fs4.readdirSync(runtimeDir)) {
|
|
107
107
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
108
108
|
}
|
|
109
109
|
} catch {
|
|
@@ -114,11 +114,13 @@ function resolveNativeBindingCandidates(options) {
|
|
|
114
114
|
for (const bin of BINARY_NAMES) {
|
|
115
115
|
candidates.push(path5.resolve(runtimeDir, `${bin}.node`));
|
|
116
116
|
candidates.push(path5.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
117
|
+
candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
118
|
+
candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
119
|
+
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.node`));
|
|
120
|
+
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
117
121
|
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
118
122
|
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
119
123
|
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
120
|
-
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.node`));
|
|
121
|
-
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
122
124
|
}
|
|
123
125
|
return Array.from(new Set(candidates));
|
|
124
126
|
}
|
|
@@ -193,8 +195,10 @@ __export(native_bridge_exports, {
|
|
|
193
195
|
extractClassesNative: () => extractClassesNative,
|
|
194
196
|
generateSubComponentTypesNative: () => generateSubComponentTypesNative,
|
|
195
197
|
hasNativeScannerBinding: () => hasNativeScannerBinding,
|
|
198
|
+
hasNativeWatchBinding: () => hasNativeWatchBinding,
|
|
196
199
|
hashContentNative: () => hashContentNative,
|
|
197
200
|
isRustCacheAvailable: () => isRustCacheAvailable,
|
|
201
|
+
pollWatchEventsNative: () => pollWatchEventsNative,
|
|
198
202
|
pruneStaleEntriesNative: () => pruneStaleEntriesNative,
|
|
199
203
|
rebuildWorkspaceResultNative: () => rebuildWorkspaceResultNative,
|
|
200
204
|
resetScannerBridgeCache: () => resetScannerBridgeCache,
|
|
@@ -204,7 +208,9 @@ __export(native_bridge_exports, {
|
|
|
204
208
|
scanCacheStats: () => scanCacheStats,
|
|
205
209
|
scanFileNative: () => scanFileNative,
|
|
206
210
|
scanFilesBatchNative: () => scanFilesBatchNative,
|
|
207
|
-
scanWorkspaceNative: () => scanWorkspaceNative
|
|
211
|
+
scanWorkspaceNative: () => scanWorkspaceNative,
|
|
212
|
+
startWatchNative: () => startWatchNative,
|
|
213
|
+
stopWatchNative: () => stopWatchNative
|
|
208
214
|
});
|
|
209
215
|
function getDirname() {
|
|
210
216
|
if (typeof __dirname !== "undefined") {
|
|
@@ -381,6 +387,41 @@ function computeCacheStatsNative(filesClasses, sizes, top) {
|
|
|
381
387
|
if (!binding.computeCacheStats) return null;
|
|
382
388
|
return binding.computeCacheStats(filesClasses, sizes, top ?? null);
|
|
383
389
|
}
|
|
390
|
+
function startWatchNative(rootDir) {
|
|
391
|
+
try {
|
|
392
|
+
const binding = scannerGetBinding();
|
|
393
|
+
if (!binding.startWatch) return null;
|
|
394
|
+
return binding.startWatch(rootDir);
|
|
395
|
+
} catch {
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function pollWatchEventsNative(handleId) {
|
|
400
|
+
try {
|
|
401
|
+
const binding = scannerGetBinding();
|
|
402
|
+
if (!binding.pollWatchEvents) return [];
|
|
403
|
+
return binding.pollWatchEvents(handleId);
|
|
404
|
+
} catch {
|
|
405
|
+
return [];
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
function stopWatchNative(handleId) {
|
|
409
|
+
try {
|
|
410
|
+
const binding = scannerGetBinding();
|
|
411
|
+
if (!binding.stopWatch) return false;
|
|
412
|
+
return binding.stopWatch(handleId);
|
|
413
|
+
} catch {
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function hasNativeWatchBinding() {
|
|
418
|
+
try {
|
|
419
|
+
const binding = scannerGetBinding();
|
|
420
|
+
return !!(binding.startWatch && binding.pollWatchEvents && binding.stopWatch);
|
|
421
|
+
} catch {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
384
425
|
var log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
|
|
385
426
|
var init_native_bridge = __esm({
|
|
386
427
|
"packages/domain/scanner/src/native-bridge.ts"() {
|
|
@@ -476,6 +517,7 @@ function defaultCachePath(rootDir, cacheDir) {
|
|
|
476
517
|
}
|
|
477
518
|
function readCache(rootDir, cacheDir) {
|
|
478
519
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
520
|
+
fs4.mkdirSync(path5.dirname(cachePath), { recursive: true });
|
|
479
521
|
const result = cacheReadNative(cachePath);
|
|
480
522
|
if (!result) return [];
|
|
481
523
|
return result.entries.map((e) => ({
|
|
@@ -490,6 +532,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
490
532
|
}
|
|
491
533
|
function writeCache(rootDir, entries, cacheDir) {
|
|
492
534
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
535
|
+
fs4.mkdirSync(path5.dirname(cachePath), { recursive: true });
|
|
493
536
|
const success = cacheWriteNative(cachePath, entries);
|
|
494
537
|
if (!success) {
|
|
495
538
|
throw new Error(
|
|
@@ -521,7 +564,7 @@ function collectFiles(rootDir, extensions, ignoreDirs) {
|
|
|
521
564
|
function walk(dir) {
|
|
522
565
|
let entries;
|
|
523
566
|
try {
|
|
524
|
-
entries =
|
|
567
|
+
entries = fs4.readdirSync(dir, { withFileTypes: true });
|
|
525
568
|
} catch {
|
|
526
569
|
return;
|
|
527
570
|
}
|
|
@@ -693,21 +736,31 @@ var createNativeParserLoader = () => {
|
|
|
693
736
|
if (_state.binding !== void 0) return _state.binding;
|
|
694
737
|
const runtimeDir = getRuntimeDir();
|
|
695
738
|
const req = createRequire(path5.join(runtimeDir, "noop.cjs"));
|
|
739
|
+
const _platform = process.platform;
|
|
740
|
+
const _arch = process.arch;
|
|
741
|
+
const _platformArch = `${_platform}-${_arch}`;
|
|
742
|
+
const _platformArchGnu = _platformArch === "linux-x64" ? "linux-x64-gnu" : _platformArch === "linux-arm64" ? "linux-arm64-gnu" : _platformArch;
|
|
696
743
|
const candidates = [
|
|
697
744
|
// ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
|
|
698
745
|
// cwd = repo root saat run dari root, atau package dir saat workspaces
|
|
699
746
|
path5.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
|
|
700
|
-
path5.resolve(process.cwd(), "native", `tailwind-styled-native.${
|
|
701
|
-
path5.resolve(process.cwd(), "native", `tailwind-styled-native.${
|
|
702
|
-
// runtimeDir = dist/ → naik
|
|
747
|
+
path5.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
748
|
+
path5.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
749
|
+
// runtimeDir = dist/ → naik 1 level ke package root (npm install case)
|
|
750
|
+
// e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
|
|
751
|
+
path5.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
|
|
752
|
+
path5.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
753
|
+
path5.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
754
|
+
// runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
|
|
703
755
|
path5.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
704
|
-
path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${
|
|
756
|
+
path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
705
757
|
// 3 level fallback (jika package di-nest lebih dangkal)
|
|
706
758
|
path5.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
707
|
-
path5.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${
|
|
759
|
+
path5.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
708
760
|
// ── binaryName lama: tailwind_styled_parser (backward compat) ──
|
|
709
761
|
path5.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
|
|
710
762
|
path5.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
|
|
763
|
+
path5.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
|
|
711
764
|
path5.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
712
765
|
path5.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
713
766
|
path5.resolve(
|
|
@@ -722,7 +775,7 @@ var createNativeParserLoader = () => {
|
|
|
722
775
|
)
|
|
723
776
|
];
|
|
724
777
|
for (const fullPath of candidates) {
|
|
725
|
-
if (!
|
|
778
|
+
if (!fs4.existsSync(fullPath)) continue;
|
|
726
779
|
try {
|
|
727
780
|
const required = req(fullPath);
|
|
728
781
|
if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
|
|
@@ -768,7 +821,7 @@ function resolveScannerWorkerModulePath() {
|
|
|
768
821
|
path5.resolve(runtimeDir, "worker.ts")
|
|
769
822
|
];
|
|
770
823
|
for (const candidate of candidates) {
|
|
771
|
-
if (
|
|
824
|
+
if (fs4.existsSync(candidate)) return candidate;
|
|
772
825
|
}
|
|
773
826
|
return null;
|
|
774
827
|
}
|
|
@@ -825,7 +878,7 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
825
878
|
if (!currentDir) continue;
|
|
826
879
|
const entries = (() => {
|
|
827
880
|
try {
|
|
828
|
-
return
|
|
881
|
+
return fs4.readdirSync(currentDir, { withFileTypes: true });
|
|
829
882
|
} catch {
|
|
830
883
|
return [];
|
|
831
884
|
}
|
|
@@ -924,7 +977,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
924
977
|
for (const filePath of candidates) {
|
|
925
978
|
const stat = (() => {
|
|
926
979
|
try {
|
|
927
|
-
return
|
|
980
|
+
return fs4.statSync(filePath);
|
|
928
981
|
} catch {
|
|
929
982
|
return null;
|
|
930
983
|
}
|
|
@@ -950,7 +1003,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
950
1003
|
for (const { filePath, stat, size, cached } of ranked) {
|
|
951
1004
|
const content = (() => {
|
|
952
1005
|
try {
|
|
953
|
-
return
|
|
1006
|
+
return fs4.readFileSync(filePath, "utf8");
|
|
954
1007
|
} catch {
|
|
955
1008
|
return null;
|
|
956
1009
|
}
|