tailwind-styled-v4 5.0.36 → 5.0.38

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.
Files changed (163) hide show
  1. package/dist/analyzer.d.mts +152 -5
  2. package/dist/analyzer.d.ts +152 -5
  3. package/dist/analyzer.js +213 -161
  4. package/dist/analyzer.js.map +1 -1
  5. package/dist/analyzer.mjs +118 -82
  6. package/dist/analyzer.mjs.map +1 -1
  7. package/dist/animate.d.mts +30 -3
  8. package/dist/animate.d.ts +30 -3
  9. package/dist/animate.js +131 -87
  10. package/dist/animate.js.map +1 -1
  11. package/dist/animate.mjs +28 -14
  12. package/dist/animate.mjs.map +1 -1
  13. package/dist/atomic.js +105 -68
  14. package/dist/atomic.js.map +1 -1
  15. package/dist/atomic.mjs +40 -13
  16. package/dist/atomic.mjs.map +1 -1
  17. package/dist/cli.js +577 -426
  18. package/dist/cli.js.map +1 -1
  19. package/dist/cli.mjs +466 -304
  20. package/dist/cli.mjs.map +1 -1
  21. package/dist/compiler.d.mts +5 -0
  22. package/dist/compiler.d.ts +5 -0
  23. package/dist/compiler.js +826 -508
  24. package/dist/compiler.js.map +1 -1
  25. package/dist/compiler.mjs +287 -29
  26. package/dist/compiler.mjs.map +1 -1
  27. package/dist/dashboard.js +71 -41
  28. package/dist/dashboard.js.map +1 -1
  29. package/dist/dashboard.mjs +12 -6
  30. package/dist/dashboard.mjs.map +1 -1
  31. package/dist/devtools.d.mts +88 -2
  32. package/dist/devtools.d.ts +88 -2
  33. package/dist/devtools.js +333 -289
  34. package/dist/devtools.js.map +1 -1
  35. package/dist/devtools.mjs +26 -11
  36. package/dist/devtools.mjs.map +1 -1
  37. package/dist/engine.d.mts +557 -6
  38. package/dist/engine.d.ts +557 -6
  39. package/dist/engine.js +679 -502
  40. package/dist/engine.js.map +1 -1
  41. package/dist/engine.mjs +467 -307
  42. package/dist/engine.mjs.map +1 -1
  43. package/dist/index.d.mts +180 -127
  44. package/dist/index.d.ts +180 -127
  45. package/dist/index.js +1329 -7441
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +1266 -7385
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/next.js +318 -243
  50. package/dist/next.js.map +1 -1
  51. package/dist/next.mjs +256 -181
  52. package/dist/next.mjs.map +1 -1
  53. package/dist/plugin-api.d.mts +4 -2
  54. package/dist/plugin-api.d.ts +4 -2
  55. package/dist/plugin-api.js +93 -49
  56. package/dist/plugin-api.js.map +1 -1
  57. package/dist/plugin-api.mjs +26 -6
  58. package/dist/plugin-api.mjs.map +1 -1
  59. package/dist/plugin-registry.js +103 -62
  60. package/dist/plugin-registry.js.map +1 -1
  61. package/dist/plugin-registry.mjs +53 -35
  62. package/dist/plugin-registry.mjs.map +1 -1
  63. package/dist/plugin.d.mts +165 -5
  64. package/dist/plugin.d.ts +165 -5
  65. package/dist/plugin.js +115 -50
  66. package/dist/plugin.js.map +1 -1
  67. package/dist/plugin.mjs +44 -6
  68. package/dist/plugin.mjs.map +1 -1
  69. package/dist/preset.js +47 -15
  70. package/dist/preset.js.map +1 -1
  71. package/dist/preset.mjs +13 -5
  72. package/dist/preset.mjs.map +1 -1
  73. package/dist/rspack.js +82 -50
  74. package/dist/rspack.js.map +1 -1
  75. package/dist/rspack.mjs +20 -12
  76. package/dist/rspack.mjs.map +1 -1
  77. package/dist/runtime-css.js +62 -24
  78. package/dist/runtime-css.js.map +1 -1
  79. package/dist/runtime-css.mjs +15 -7
  80. package/dist/runtime-css.mjs.map +1 -1
  81. package/dist/runtime.d.mts +38 -3
  82. package/dist/runtime.d.ts +38 -3
  83. package/dist/runtime.js +97 -44
  84. package/dist/runtime.js.map +1 -1
  85. package/dist/runtime.mjs +31 -8
  86. package/dist/runtime.mjs.map +1 -1
  87. package/dist/scanner.d.mts +58 -4
  88. package/dist/scanner.d.ts +58 -4
  89. package/dist/scanner.js +163 -120
  90. package/dist/scanner.js.map +1 -1
  91. package/dist/scanner.mjs +67 -39
  92. package/dist/scanner.mjs.map +1 -1
  93. package/dist/shared.d.mts +185 -3
  94. package/dist/shared.d.ts +185 -3
  95. package/dist/shared.js +441 -295
  96. package/dist/shared.js.map +1 -1
  97. package/dist/shared.mjs +253 -122
  98. package/dist/shared.mjs.map +1 -1
  99. package/dist/storybook-addon.d.mts +2 -2
  100. package/dist/storybook-addon.d.ts +2 -2
  101. package/dist/storybook-addon.js +39 -10
  102. package/dist/storybook-addon.js.map +1 -1
  103. package/dist/storybook-addon.mjs +8 -3
  104. package/dist/storybook-addon.mjs.map +1 -1
  105. package/dist/svelte.d.mts +2 -1
  106. package/dist/svelte.d.ts +2 -1
  107. package/dist/svelte.js +88 -64
  108. package/dist/svelte.js.map +1 -1
  109. package/dist/svelte.mjs +28 -13
  110. package/dist/svelte.mjs.map +1 -1
  111. package/dist/syntax.js +68 -37
  112. package/dist/syntax.js.map +1 -1
  113. package/dist/syntax.mjs +8 -7
  114. package/dist/syntax.mjs.map +1 -1
  115. package/dist/testing.js +55 -18
  116. package/dist/testing.js.map +1 -1
  117. package/dist/testing.mjs +16 -3
  118. package/dist/testing.mjs.map +1 -1
  119. package/dist/theme.d.mts +38 -3
  120. package/dist/theme.d.ts +38 -3
  121. package/dist/theme.js +131 -74
  122. package/dist/theme.js.map +1 -1
  123. package/dist/theme.mjs +42 -13
  124. package/dist/theme.mjs.map +1 -1
  125. package/dist/turbopackLoader.js +150 -116
  126. package/dist/turbopackLoader.js.map +1 -1
  127. package/dist/turbopackLoader.mjs +124 -81
  128. package/dist/turbopackLoader.mjs.map +1 -1
  129. package/dist/tw.js +560 -421
  130. package/dist/tw.js.map +1 -1
  131. package/dist/tw.mjs +460 -302
  132. package/dist/tw.mjs.map +1 -1
  133. package/dist/vite.js +561 -446
  134. package/dist/vite.js.map +1 -1
  135. package/dist/vite.mjs +433 -321
  136. package/dist/vite.mjs.map +1 -1
  137. package/dist/vue.d.mts +4 -1
  138. package/dist/vue.d.ts +4 -1
  139. package/dist/vue.js +95 -70
  140. package/dist/vue.js.map +1 -1
  141. package/dist/vue.mjs +30 -14
  142. package/dist/vue.mjs.map +1 -1
  143. package/dist/webpackLoader.js +110 -78
  144. package/dist/webpackLoader.js.map +1 -1
  145. package/dist/webpackLoader.mjs +45 -17
  146. package/dist/webpackLoader.mjs.map +1 -1
  147. package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
  148. package/native/tailwind-styled-native.node +0 -0
  149. package/package.json +3 -1
  150. package/dist/analyzeWorkspace-B1_XRfdl.d.ts +0 -134
  151. package/dist/analyzeWorkspace-hYfu4Hg3.d.mts +0 -134
  152. package/dist/index-DQI6O24n.d.mts +0 -464
  153. package/dist/index-NDINUhLN.d.mts +0 -90
  154. package/dist/index-NDINUhLN.d.ts +0 -90
  155. package/dist/index-UkYbyBkR.d.ts +0 -464
  156. package/dist/liveTokenEngine-CN9ian1R.d.ts +0 -38
  157. package/dist/liveTokenEngine-DKoWRtqH.d.mts +0 -38
  158. package/dist/schemas-DR-SLxZZ.d.mts +0 -59
  159. package/dist/schemas-DR-SLxZZ.d.ts +0 -59
  160. package/dist/trace-Dz4vmZdy.d.mts +0 -96
  161. package/dist/trace-Dz4vmZdy.d.ts +0 -96
  162. package/dist/types-DXr2PmGP.d.mts +0 -31
  163. package/dist/types-DXr2PmGP.d.ts +0 -31
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 = path5.resolve(runtimeDir, candidate);
68
+ const candidatePath = path.resolve(runtimeDir, candidate);
71
69
  try {
72
- if (!fs3.existsSync(candidatePath) && !fs3.existsSync(candidatePath + ".node")) {
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 (fs3.existsSync(runtimeDir)) {
102
+ if (fs.existsSync(runtimeDir)) {
105
103
  try {
106
- for (const entry of fs3.readdirSync(runtimeDir)) {
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(path5.resolve(runtimeDir, `${bin}.node`));
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`));
121
- candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
122
- candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
123
- candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
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;
@@ -212,12 +211,14 @@ __export(native_bridge_exports, {
212
211
  startWatchNative: () => startWatchNative,
213
212
  stopWatchNative: () => stopWatchNative
214
213
  });
214
+ import path2 from "path";
215
+ import { fileURLToPath as fileURLToPath2 } from "url";
215
216
  function getDirname() {
216
217
  if (typeof __dirname !== "undefined") {
217
218
  return __dirname;
218
219
  }
219
220
  if (typeof import.meta !== "undefined" && import.meta.url) {
220
- return path5.dirname(fileURLToPath(import.meta.url));
221
+ return path2.dirname(fileURLToPath2(import.meta.url));
221
222
  }
222
223
  return process.cwd();
223
224
  }
@@ -425,6 +426,7 @@ function hasNativeWatchBinding() {
425
426
  var log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
426
427
  var init_native_bridge = __esm({
427
428
  "packages/domain/scanner/src/native-bridge.ts"() {
429
+ "use strict";
428
430
  init_src();
429
431
  log = createDebugLogger("scanner:native");
430
432
  isValidScannerBinding = (module) => {
@@ -508,16 +510,24 @@ var init_native_bridge = __esm({
508
510
 
509
511
  // packages/domain/scanner/src/index.ts
510
512
  init_src();
513
+ import fs3 from "fs";
514
+ import { createRequire as createRequire2 } from "module";
515
+ import path5 from "path";
516
+ import { fileURLToPath as fileURLToPath4 } from "url";
517
+ import { Worker as Worker2 } from "worker_threads";
511
518
 
512
519
  // packages/domain/scanner/src/cache-native.ts
513
520
  init_native_bridge();
521
+ import fs2 from "fs";
522
+ import path3 from "path";
514
523
  function defaultCachePath(rootDir, cacheDir) {
515
- const dir = cacheDir ? path5.resolve(rootDir, cacheDir) : path5.join(process.cwd(), ".cache", "tailwind-styled");
516
- return path5.join(dir, "scanner-cache.json");
524
+ const dir = cacheDir ? path3.resolve(rootDir, cacheDir) : path3.join(process.cwd(), ".cache", "tailwind-styled");
525
+ return path3.join(dir, "scanner-cache.json");
517
526
  }
527
+ var STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
518
528
  function readCache(rootDir, cacheDir) {
519
529
  const cachePath = defaultCachePath(rootDir, cacheDir);
520
- fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
530
+ fs2.mkdirSync(path3.dirname(cachePath), { recursive: true });
521
531
  const result = cacheReadNative(cachePath);
522
532
  if (!result) return [];
523
533
  return result.entries.map((e) => ({
@@ -532,7 +542,7 @@ function readCache(rootDir, cacheDir) {
532
542
  }
533
543
  function writeCache(rootDir, entries, cacheDir) {
534
544
  const cachePath = defaultCachePath(rootDir, cacheDir);
535
- fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
545
+ fs2.mkdirSync(path3.dirname(cachePath), { recursive: true });
536
546
  const success = cacheWriteNative(cachePath, entries);
537
547
  if (!success) {
538
548
  throw new Error(
@@ -554,6 +564,12 @@ function filePriority(mtimeMs, size, cached, nowMs = Date.now()) {
554
564
 
555
565
  // packages/domain/scanner/src/index.ts
556
566
  init_native_bridge();
567
+
568
+ // packages/domain/scanner/src/parallel-scanner.ts
569
+ import { Worker, isMainThread, parentPort, workerData } from "worker_threads";
570
+ import path4 from "path";
571
+ import { availableParallelism } from "os";
572
+ import { fileURLToPath as fileURLToPath3 } from "url";
557
573
  init_native_bridge();
558
574
  var PARALLEL_THRESHOLD = 50;
559
575
  var DEFAULT_CHUNK_SIZE = 150;
@@ -586,7 +602,7 @@ if (!isMainThread && parentPort) {
586
602
  parentPort.postMessage(msg);
587
603
  }
588
604
  }
589
- var _workerFilename = typeof __filename !== "undefined" ? __filename : fileURLToPath(import.meta.url);
605
+ var _workerFilename = typeof __filename !== "undefined" ? __filename : fileURLToPath3(import.meta.url);
590
606
  function runChunkInWorker(filePaths) {
591
607
  return new Promise((resolve, reject) => {
592
608
  const worker = new Worker(_workerFilename, {
@@ -612,7 +628,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
612
628
  maxWorkers = Math.max(1, availableParallelism() - 1),
613
629
  chunkSize = DEFAULT_CHUNK_SIZE
614
630
  } = options;
615
- const files = collectFiles(path5.resolve(rootDir), extensions, ignoreDirs);
631
+ const files = collectFiles(path4.resolve(rootDir), extensions, ignoreDirs);
616
632
  if (files.length < PARALLEL_THRESHOLD) {
617
633
  return mergeResults(batchExtractClassesNative(files));
618
634
  }
@@ -631,6 +647,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
631
647
 
632
648
  // packages/domain/scanner/src/schemas.ts
633
649
  init_src();
650
+ import { z } from "zod";
634
651
  var formatIssuePath2 = (path6) => path6.length > 0 ? path6.map(
635
652
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
636
653
  ).join(".") : "<root>";
@@ -670,7 +687,7 @@ var ScanWorkspaceResultSchema = z.object({
670
687
  message: "scan result totalFiles must match files.length",
671
688
  path: ["totalFiles"]
672
689
  });
673
- z.object({
690
+ var ScannerWorkerRequestSchema = z.object({
674
691
  rootDir: z.string().min(1),
675
692
  options: ScanWorkspaceOptionsSchema.optional()
676
693
  });
@@ -699,7 +716,7 @@ function getRuntimeDir() {
699
716
  return __dirname;
700
717
  }
701
718
  if (typeof import.meta !== "undefined" && import.meta.url) {
702
- return path5.dirname(fileURLToPath(import.meta.url));
719
+ return path5.dirname(fileURLToPath4(import.meta.url));
703
720
  }
704
721
  return process.cwd();
705
722
  }
@@ -714,7 +731,7 @@ var createNativeParserLoader = () => {
714
731
  const loadNativeParserBinding = () => {
715
732
  if (_state.binding !== void 0) return _state.binding;
716
733
  const runtimeDir = getRuntimeDir();
717
- const req = createRequire(path5.join(runtimeDir, "noop.cjs"));
734
+ const req = createRequire2(path5.join(runtimeDir, "noop.cjs"));
718
735
  const _platform = process.platform;
719
736
  const _arch = process.arch;
720
737
  const _platformArch = `${_platform}-${_arch}`;
@@ -790,7 +807,7 @@ function resolveScannerWorkerModulePath() {
790
807
  return __dirname;
791
808
  }
792
809
  if (typeof import.meta !== "undefined" && import.meta.url) {
793
- return path5.dirname(fileURLToPath(import.meta.url));
810
+ return path5.dirname(fileURLToPath4(import.meta.url));
794
811
  }
795
812
  return process.cwd();
796
813
  })();
@@ -812,7 +829,7 @@ function scanWorkspaceInWorker(rootDir, options) {
812
829
  }
813
830
  return new Promise((resolve, reject) => {
814
831
  const settleState = { settled: false };
815
- const worker = new Worker(modulePath, { workerData: { rootDir, options: normalizedOptions } });
832
+ const worker = new Worker2(modulePath, { workerData: { rootDir, options: normalizedOptions } });
816
833
  const timeout = setTimeout(() => {
817
834
  if (!settleState.settled) {
818
835
  settleState.settled = true;
@@ -916,7 +933,7 @@ function scanWorkspace(rootDir, options = {}) {
916
933
  const extensionSet = buildExtensionSet(includeExtensions);
917
934
  const ignoreDirectories = new Set(normalizedOptions.ignoreDirectories ?? DEFAULT_IGNORES);
918
935
  const useCache = normalizedOptions.useCache ?? true;
919
- normalizedOptions.smartInvalidation ?? true;
936
+ const _smartInvalidation = normalizedOptions.smartInvalidation ?? true;
920
937
  const files = [];
921
938
  const unique = /* @__PURE__ */ new Set();
922
939
  const candidates = collectCandidates(rootDir, ignoreDirectories, extensionSet);
@@ -1063,7 +1080,18 @@ async function scanWorkspaceAsync(rootDir, options = {}) {
1063
1080
  return scanWorkspace(rootDir, normalizedOptions);
1064
1081
  }
1065
1082
  }
1066
-
1067
- export { DEFAULT_EXTENSIONS, DEFAULT_IGNORES, batchExtractClassesNative, extractClassesNative, isScannableFile2 as isScannableFile, parseScanWorkspaceOptions, parseScanWorkspaceResult, parseScannerWorkerMessage, scanFile, scanSource, scanWorkspace, scanWorkspaceAsync };
1068
- //# sourceMappingURL=scanner.mjs.map
1083
+ export {
1084
+ DEFAULT_EXTENSIONS,
1085
+ DEFAULT_IGNORES,
1086
+ batchExtractClassesNative,
1087
+ extractClassesNative,
1088
+ isScannableFile2 as isScannableFile,
1089
+ parseScanWorkspaceOptions,
1090
+ parseScanWorkspaceResult,
1091
+ parseScannerWorkerMessage,
1092
+ scanFile,
1093
+ scanSource,
1094
+ scanWorkspace,
1095
+ scanWorkspaceAsync
1096
+ };
1069
1097
  //# sourceMappingURL=scanner.mjs.map