tailwind-styled-v4 5.0.37 → 5.0.39
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/analyzer.js +213 -161
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +121 -83
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +131 -87
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +31 -15
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +107 -67
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +47 -14
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +601 -428
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +504 -313
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.js +833 -508
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +298 -30
- package/dist/compiler.mjs.map +1 -1
- package/dist/dashboard.js +72 -41
- package/dist/dashboard.js.map +1 -1
- package/dist/dashboard.mjs +12 -6
- package/dist/dashboard.mjs.map +1 -1
- package/dist/devtools.js +335 -289
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +28 -11
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.js +719 -506
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +520 -318
- package/dist/engine.mjs.map +1 -1
- package/dist/index.d.mts +145 -319
- package/dist/index.d.ts +145 -319
- package/dist/index.js +1337 -7442
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1275 -7386
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +327 -242
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +272 -184
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.js +94 -49
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs +26 -6
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +68 -40
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +14 -10
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.js +102 -53
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +30 -6
- package/dist/plugin.mjs.map +1 -1
- package/dist/preset.js +48 -15
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +13 -5
- package/dist/preset.mjs.map +1 -1
- package/dist/rspack.js +108 -53
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +50 -18
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.js +63 -24
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +15 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/runtime.js +98 -44
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +31 -8
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.js +164 -120
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +70 -40
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +0 -12
- package/dist/shared.d.ts +0 -12
- package/dist/shared.js +481 -299
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +304 -133
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.js +40 -10
- package/dist/storybook-addon.js.map +1 -1
- package/dist/storybook-addon.mjs +8 -3
- package/dist/storybook-addon.mjs.map +1 -1
- package/dist/svelte.js +95 -64
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +37 -14
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +69 -37
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +8 -7
- package/dist/syntax.mjs.map +1 -1
- package/dist/testing.js +56 -18
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +16 -3
- package/dist/testing.mjs.map +1 -1
- package/dist/theme.js +133 -74
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +45 -14
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +156 -115
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +135 -82
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +584 -423
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +498 -311
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +599 -450
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +484 -332
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +102 -70
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +39 -15
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +112 -77
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +52 -18
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +3 -1
package/dist/scanner.mjs
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import 'crypto';
|
|
2
|
-
import fs3 from 'fs';
|
|
3
|
-
import path5 from 'path';
|
|
4
|
-
import { fileURLToPath } from 'url';
|
|
5
|
-
import { createRequire } from 'module';
|
|
6
|
-
import { isMainThread, parentPort, workerData, Worker } from 'worker_threads';
|
|
7
|
-
import { availableParallelism } from 'os';
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
|
|
10
1
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
11
2
|
var __defProp = Object.defineProperty;
|
|
12
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -28,6 +19,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
28
19
|
return to;
|
|
29
20
|
};
|
|
30
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
|
|
23
|
+
// packages/domain/shared/src/index.ts
|
|
24
|
+
import { createHash } from "crypto";
|
|
25
|
+
import fs from "fs";
|
|
26
|
+
import path from "path";
|
|
27
|
+
import { fileURLToPath } from "url";
|
|
28
|
+
import { createRequire } from "module";
|
|
31
29
|
function createLogger(namespace) {
|
|
32
30
|
const prefix = `[${namespace}]`;
|
|
33
31
|
return {
|
|
@@ -50,7 +48,7 @@ function createLogger(namespace) {
|
|
|
50
48
|
};
|
|
51
49
|
}
|
|
52
50
|
function createDebugLogger(namespace, label) {
|
|
53
|
-
const prefix = `[${namespace}]`;
|
|
51
|
+
const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`;
|
|
54
52
|
return (msg) => {
|
|
55
53
|
if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {
|
|
56
54
|
console.debug(prefix, msg);
|
|
@@ -67,9 +65,9 @@ function loadNativeBinding(options) {
|
|
|
67
65
|
const { runtimeDir, candidates, isValid } = options;
|
|
68
66
|
const loadErrors = [];
|
|
69
67
|
for (const candidate of candidates) {
|
|
70
|
-
const candidatePath =
|
|
68
|
+
const candidatePath = path.resolve(runtimeDir, candidate);
|
|
71
69
|
try {
|
|
72
|
-
if (!
|
|
70
|
+
if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + ".node")) {
|
|
73
71
|
continue;
|
|
74
72
|
}
|
|
75
73
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -101,9 +99,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
if (!includeDefaultCandidates) return candidates;
|
|
104
|
-
if (
|
|
102
|
+
if (fs.existsSync(runtimeDir)) {
|
|
105
103
|
try {
|
|
106
|
-
for (const entry of
|
|
104
|
+
for (const entry of fs.readdirSync(runtimeDir)) {
|
|
107
105
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
108
106
|
}
|
|
109
107
|
} catch {
|
|
@@ -112,21 +110,22 @@ function resolveNativeBindingCandidates(options) {
|
|
|
112
110
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
113
111
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
114
112
|
for (const bin of BINARY_NAMES) {
|
|
115
|
-
candidates.push(
|
|
116
|
-
candidates.push(
|
|
117
|
-
candidates.push(
|
|
118
|
-
candidates.push(
|
|
119
|
-
candidates.push(
|
|
120
|
-
candidates.push(
|
|
121
|
-
candidates.push(
|
|
122
|
-
candidates.push(
|
|
123
|
-
candidates.push(
|
|
113
|
+
candidates.push(path.resolve(runtimeDir, `${bin}.node`));
|
|
114
|
+
candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
115
|
+
candidates.push(path.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
116
|
+
candidates.push(path.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
117
|
+
candidates.push(path.resolve(process.cwd(), "native", `${bin}.node`));
|
|
118
|
+
candidates.push(path.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
119
|
+
candidates.push(path.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
120
|
+
candidates.push(path.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
121
|
+
candidates.push(path.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
124
122
|
}
|
|
125
123
|
return Array.from(new Set(candidates));
|
|
126
124
|
}
|
|
127
125
|
var TwError, _require;
|
|
128
126
|
var init_src = __esm({
|
|
129
127
|
"packages/domain/shared/src/index.ts"() {
|
|
128
|
+
"use strict";
|
|
130
129
|
TwError = class _TwError extends Error {
|
|
131
130
|
/** @deprecated Gunakan source */
|
|
132
131
|
domain;
|
|
@@ -179,7 +178,9 @@ var init_src = __esm({
|
|
|
179
178
|
return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
|
|
180
179
|
}
|
|
181
180
|
};
|
|
182
|
-
_require = createRequire(
|
|
181
|
+
_require = createRequire(
|
|
182
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : import.meta.url ?? "file://unknown"
|
|
183
|
+
);
|
|
183
184
|
}
|
|
184
185
|
});
|
|
185
186
|
|
|
@@ -212,12 +213,14 @@ __export(native_bridge_exports, {
|
|
|
212
213
|
startWatchNative: () => startWatchNative,
|
|
213
214
|
stopWatchNative: () => stopWatchNative
|
|
214
215
|
});
|
|
216
|
+
import path2 from "path";
|
|
217
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
215
218
|
function getDirname() {
|
|
216
219
|
if (typeof __dirname !== "undefined") {
|
|
217
220
|
return __dirname;
|
|
218
221
|
}
|
|
219
222
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
220
|
-
return
|
|
223
|
+
return path2.dirname(fileURLToPath2(import.meta.url));
|
|
221
224
|
}
|
|
222
225
|
return process.cwd();
|
|
223
226
|
}
|
|
@@ -425,6 +428,7 @@ function hasNativeWatchBinding() {
|
|
|
425
428
|
var log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
|
|
426
429
|
var init_native_bridge = __esm({
|
|
427
430
|
"packages/domain/scanner/src/native-bridge.ts"() {
|
|
431
|
+
"use strict";
|
|
428
432
|
init_src();
|
|
429
433
|
log = createDebugLogger("scanner:native");
|
|
430
434
|
isValidScannerBinding = (module) => {
|
|
@@ -508,16 +512,24 @@ var init_native_bridge = __esm({
|
|
|
508
512
|
|
|
509
513
|
// packages/domain/scanner/src/index.ts
|
|
510
514
|
init_src();
|
|
515
|
+
import fs3 from "fs";
|
|
516
|
+
import { createRequire as createRequire2 } from "module";
|
|
517
|
+
import path5 from "path";
|
|
518
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
519
|
+
import { Worker as Worker2 } from "worker_threads";
|
|
511
520
|
|
|
512
521
|
// packages/domain/scanner/src/cache-native.ts
|
|
513
522
|
init_native_bridge();
|
|
523
|
+
import fs2 from "fs";
|
|
524
|
+
import path3 from "path";
|
|
514
525
|
function defaultCachePath(rootDir, cacheDir) {
|
|
515
|
-
const dir = cacheDir ?
|
|
516
|
-
return
|
|
526
|
+
const dir = cacheDir ? path3.resolve(rootDir, cacheDir) : path3.join(process.cwd(), ".cache", "tailwind-styled");
|
|
527
|
+
return path3.join(dir, "scanner-cache.json");
|
|
517
528
|
}
|
|
529
|
+
var STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
518
530
|
function readCache(rootDir, cacheDir) {
|
|
519
531
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
520
|
-
|
|
532
|
+
fs2.mkdirSync(path3.dirname(cachePath), { recursive: true });
|
|
521
533
|
const result = cacheReadNative(cachePath);
|
|
522
534
|
if (!result) return [];
|
|
523
535
|
return result.entries.map((e) => ({
|
|
@@ -532,7 +544,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
532
544
|
}
|
|
533
545
|
function writeCache(rootDir, entries, cacheDir) {
|
|
534
546
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
535
|
-
|
|
547
|
+
fs2.mkdirSync(path3.dirname(cachePath), { recursive: true });
|
|
536
548
|
const success = cacheWriteNative(cachePath, entries);
|
|
537
549
|
if (!success) {
|
|
538
550
|
throw new Error(
|
|
@@ -554,6 +566,12 @@ function filePriority(mtimeMs, size, cached, nowMs = Date.now()) {
|
|
|
554
566
|
|
|
555
567
|
// packages/domain/scanner/src/index.ts
|
|
556
568
|
init_native_bridge();
|
|
569
|
+
|
|
570
|
+
// packages/domain/scanner/src/parallel-scanner.ts
|
|
571
|
+
import { Worker, isMainThread, parentPort, workerData } from "worker_threads";
|
|
572
|
+
import path4 from "path";
|
|
573
|
+
import { availableParallelism } from "os";
|
|
574
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
557
575
|
init_native_bridge();
|
|
558
576
|
var PARALLEL_THRESHOLD = 50;
|
|
559
577
|
var DEFAULT_CHUNK_SIZE = 150;
|
|
@@ -586,7 +604,7 @@ if (!isMainThread && parentPort) {
|
|
|
586
604
|
parentPort.postMessage(msg);
|
|
587
605
|
}
|
|
588
606
|
}
|
|
589
|
-
var _workerFilename = typeof __filename !== "undefined" ? __filename :
|
|
607
|
+
var _workerFilename = typeof __filename !== "undefined" ? __filename : fileURLToPath3(import.meta.url);
|
|
590
608
|
function runChunkInWorker(filePaths) {
|
|
591
609
|
return new Promise((resolve, reject) => {
|
|
592
610
|
const worker = new Worker(_workerFilename, {
|
|
@@ -612,7 +630,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
612
630
|
maxWorkers = Math.max(1, availableParallelism() - 1),
|
|
613
631
|
chunkSize = DEFAULT_CHUNK_SIZE
|
|
614
632
|
} = options;
|
|
615
|
-
const files = collectFiles(
|
|
633
|
+
const files = collectFiles(path4.resolve(rootDir), extensions, ignoreDirs);
|
|
616
634
|
if (files.length < PARALLEL_THRESHOLD) {
|
|
617
635
|
return mergeResults(batchExtractClassesNative(files));
|
|
618
636
|
}
|
|
@@ -631,6 +649,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
631
649
|
|
|
632
650
|
// packages/domain/scanner/src/schemas.ts
|
|
633
651
|
init_src();
|
|
652
|
+
import { z } from "zod";
|
|
634
653
|
var formatIssuePath2 = (path6) => path6.length > 0 ? path6.map(
|
|
635
654
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
636
655
|
).join(".") : "<root>";
|
|
@@ -670,7 +689,7 @@ var ScanWorkspaceResultSchema = z.object({
|
|
|
670
689
|
message: "scan result totalFiles must match files.length",
|
|
671
690
|
path: ["totalFiles"]
|
|
672
691
|
});
|
|
673
|
-
z.object({
|
|
692
|
+
var ScannerWorkerRequestSchema = z.object({
|
|
674
693
|
rootDir: z.string().min(1),
|
|
675
694
|
options: ScanWorkspaceOptionsSchema.optional()
|
|
676
695
|
});
|
|
@@ -699,7 +718,7 @@ function getRuntimeDir() {
|
|
|
699
718
|
return __dirname;
|
|
700
719
|
}
|
|
701
720
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
702
|
-
return path5.dirname(
|
|
721
|
+
return path5.dirname(fileURLToPath4(import.meta.url));
|
|
703
722
|
}
|
|
704
723
|
return process.cwd();
|
|
705
724
|
}
|
|
@@ -714,7 +733,7 @@ var createNativeParserLoader = () => {
|
|
|
714
733
|
const loadNativeParserBinding = () => {
|
|
715
734
|
if (_state.binding !== void 0) return _state.binding;
|
|
716
735
|
const runtimeDir = getRuntimeDir();
|
|
717
|
-
const req =
|
|
736
|
+
const req = createRequire2(path5.join(runtimeDir, "noop.cjs"));
|
|
718
737
|
const _platform = process.platform;
|
|
719
738
|
const _arch = process.arch;
|
|
720
739
|
const _platformArch = `${_platform}-${_arch}`;
|
|
@@ -790,7 +809,7 @@ function resolveScannerWorkerModulePath() {
|
|
|
790
809
|
return __dirname;
|
|
791
810
|
}
|
|
792
811
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
793
|
-
return path5.dirname(
|
|
812
|
+
return path5.dirname(fileURLToPath4(import.meta.url));
|
|
794
813
|
}
|
|
795
814
|
return process.cwd();
|
|
796
815
|
})();
|
|
@@ -812,7 +831,7 @@ function scanWorkspaceInWorker(rootDir, options) {
|
|
|
812
831
|
}
|
|
813
832
|
return new Promise((resolve, reject) => {
|
|
814
833
|
const settleState = { settled: false };
|
|
815
|
-
const worker = new
|
|
834
|
+
const worker = new Worker2(modulePath, { workerData: { rootDir, options: normalizedOptions } });
|
|
816
835
|
const timeout = setTimeout(() => {
|
|
817
836
|
if (!settleState.settled) {
|
|
818
837
|
settleState.settled = true;
|
|
@@ -916,7 +935,7 @@ function scanWorkspace(rootDir, options = {}) {
|
|
|
916
935
|
const extensionSet = buildExtensionSet(includeExtensions);
|
|
917
936
|
const ignoreDirectories = new Set(normalizedOptions.ignoreDirectories ?? DEFAULT_IGNORES);
|
|
918
937
|
const useCache = normalizedOptions.useCache ?? true;
|
|
919
|
-
normalizedOptions.smartInvalidation ?? true;
|
|
938
|
+
const _smartInvalidation = normalizedOptions.smartInvalidation ?? true;
|
|
920
939
|
const files = [];
|
|
921
940
|
const unique = /* @__PURE__ */ new Set();
|
|
922
941
|
const candidates = collectCandidates(rootDir, ignoreDirectories, extensionSet);
|
|
@@ -1063,7 +1082,18 @@ async function scanWorkspaceAsync(rootDir, options = {}) {
|
|
|
1063
1082
|
return scanWorkspace(rootDir, normalizedOptions);
|
|
1064
1083
|
}
|
|
1065
1084
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1085
|
+
export {
|
|
1086
|
+
DEFAULT_EXTENSIONS,
|
|
1087
|
+
DEFAULT_IGNORES,
|
|
1088
|
+
batchExtractClassesNative,
|
|
1089
|
+
extractClassesNative,
|
|
1090
|
+
isScannableFile2 as isScannableFile,
|
|
1091
|
+
parseScanWorkspaceOptions,
|
|
1092
|
+
parseScanWorkspaceResult,
|
|
1093
|
+
parseScannerWorkerMessage,
|
|
1094
|
+
scanFile,
|
|
1095
|
+
scanSource,
|
|
1096
|
+
scanWorkspace,
|
|
1097
|
+
scanWorkspaceAsync
|
|
1098
|
+
};
|
|
1069
1099
|
//# sourceMappingURL=scanner.mjs.map
|