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.
Files changed (123) hide show
  1. package/dist/analyzer.js +213 -161
  2. package/dist/analyzer.js.map +1 -1
  3. package/dist/analyzer.mjs +121 -83
  4. package/dist/analyzer.mjs.map +1 -1
  5. package/dist/animate.js +131 -87
  6. package/dist/animate.js.map +1 -1
  7. package/dist/animate.mjs +31 -15
  8. package/dist/animate.mjs.map +1 -1
  9. package/dist/atomic.js +107 -67
  10. package/dist/atomic.js.map +1 -1
  11. package/dist/atomic.mjs +47 -14
  12. package/dist/atomic.mjs.map +1 -1
  13. package/dist/cli.js +601 -428
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cli.mjs +504 -313
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/compiler.js +833 -508
  18. package/dist/compiler.js.map +1 -1
  19. package/dist/compiler.mjs +298 -30
  20. package/dist/compiler.mjs.map +1 -1
  21. package/dist/dashboard.js +72 -41
  22. package/dist/dashboard.js.map +1 -1
  23. package/dist/dashboard.mjs +12 -6
  24. package/dist/dashboard.mjs.map +1 -1
  25. package/dist/devtools.js +335 -289
  26. package/dist/devtools.js.map +1 -1
  27. package/dist/devtools.mjs +28 -11
  28. package/dist/devtools.mjs.map +1 -1
  29. package/dist/engine.js +719 -506
  30. package/dist/engine.js.map +1 -1
  31. package/dist/engine.mjs +520 -318
  32. package/dist/engine.mjs.map +1 -1
  33. package/dist/index.d.mts +145 -319
  34. package/dist/index.d.ts +145 -319
  35. package/dist/index.js +1337 -7442
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +1275 -7386
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/next.js +327 -242
  40. package/dist/next.js.map +1 -1
  41. package/dist/next.mjs +272 -184
  42. package/dist/next.mjs.map +1 -1
  43. package/dist/plugin-api.js +94 -49
  44. package/dist/plugin-api.js.map +1 -1
  45. package/dist/plugin-api.mjs +26 -6
  46. package/dist/plugin-api.mjs.map +1 -1
  47. package/dist/plugin-registry.js +68 -40
  48. package/dist/plugin-registry.js.map +1 -1
  49. package/dist/plugin-registry.mjs +14 -10
  50. package/dist/plugin-registry.mjs.map +1 -1
  51. package/dist/plugin.js +102 -53
  52. package/dist/plugin.js.map +1 -1
  53. package/dist/plugin.mjs +30 -6
  54. package/dist/plugin.mjs.map +1 -1
  55. package/dist/preset.js +48 -15
  56. package/dist/preset.js.map +1 -1
  57. package/dist/preset.mjs +13 -5
  58. package/dist/preset.mjs.map +1 -1
  59. package/dist/rspack.js +108 -53
  60. package/dist/rspack.js.map +1 -1
  61. package/dist/rspack.mjs +50 -18
  62. package/dist/rspack.mjs.map +1 -1
  63. package/dist/runtime-css.js +63 -24
  64. package/dist/runtime-css.js.map +1 -1
  65. package/dist/runtime-css.mjs +15 -7
  66. package/dist/runtime-css.mjs.map +1 -1
  67. package/dist/runtime.js +98 -44
  68. package/dist/runtime.js.map +1 -1
  69. package/dist/runtime.mjs +31 -8
  70. package/dist/runtime.mjs.map +1 -1
  71. package/dist/scanner.js +164 -120
  72. package/dist/scanner.js.map +1 -1
  73. package/dist/scanner.mjs +70 -40
  74. package/dist/scanner.mjs.map +1 -1
  75. package/dist/shared.d.mts +0 -12
  76. package/dist/shared.d.ts +0 -12
  77. package/dist/shared.js +481 -299
  78. package/dist/shared.js.map +1 -1
  79. package/dist/shared.mjs +304 -133
  80. package/dist/shared.mjs.map +1 -1
  81. package/dist/storybook-addon.js +40 -10
  82. package/dist/storybook-addon.js.map +1 -1
  83. package/dist/storybook-addon.mjs +8 -3
  84. package/dist/storybook-addon.mjs.map +1 -1
  85. package/dist/svelte.js +95 -64
  86. package/dist/svelte.js.map +1 -1
  87. package/dist/svelte.mjs +37 -14
  88. package/dist/svelte.mjs.map +1 -1
  89. package/dist/syntax.js +69 -37
  90. package/dist/syntax.js.map +1 -1
  91. package/dist/syntax.mjs +8 -7
  92. package/dist/syntax.mjs.map +1 -1
  93. package/dist/testing.js +56 -18
  94. package/dist/testing.js.map +1 -1
  95. package/dist/testing.mjs +16 -3
  96. package/dist/testing.mjs.map +1 -1
  97. package/dist/theme.js +133 -74
  98. package/dist/theme.js.map +1 -1
  99. package/dist/theme.mjs +45 -14
  100. package/dist/theme.mjs.map +1 -1
  101. package/dist/turbopackLoader.js +156 -115
  102. package/dist/turbopackLoader.js.map +1 -1
  103. package/dist/turbopackLoader.mjs +135 -82
  104. package/dist/turbopackLoader.mjs.map +1 -1
  105. package/dist/tw.js +584 -423
  106. package/dist/tw.js.map +1 -1
  107. package/dist/tw.mjs +498 -311
  108. package/dist/tw.mjs.map +1 -1
  109. package/dist/vite.js +599 -450
  110. package/dist/vite.js.map +1 -1
  111. package/dist/vite.mjs +484 -332
  112. package/dist/vite.mjs.map +1 -1
  113. package/dist/vue.js +102 -70
  114. package/dist/vue.js.map +1 -1
  115. package/dist/vue.mjs +39 -15
  116. package/dist/vue.mjs.map +1 -1
  117. package/dist/webpackLoader.js +112 -77
  118. package/dist/webpackLoader.js.map +1 -1
  119. package/dist/webpackLoader.mjs +52 -18
  120. package/dist/webpackLoader.mjs.map +1 -1
  121. package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
  122. package/native/tailwind-styled-native.node +0 -0
  123. package/package.json +3 -1
@@ -1,11 +1,3 @@
1
- import { createRequire } from 'module';
2
- import * as fs4 from 'fs';
3
- import fs4__default from 'fs';
4
- import * as path4 from 'path';
5
- import path4__default from 'path';
6
- import 'crypto';
7
- import { fileURLToPath } from 'url';
8
-
9
1
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
10
2
  var __defProp = Object.defineProperty;
11
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -33,6 +25,11 @@ var __copyProps = (to, from, except, desc) => {
33
25
  return to;
34
26
  };
35
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // packages/domain/shared/src/native-resolution.ts
30
+ import { createRequire } from "module";
31
+ import * as fs from "fs";
32
+ import * as path from "path";
36
33
  function platformKey() {
37
34
  if (isBrowser) return "browser";
38
35
  return `${process.platform}-${process.arch}`;
@@ -48,7 +45,7 @@ function resolveNativeBinary(runtimeDir) {
48
45
  }
49
46
  const envPath = process.env.TW_NATIVE_PATH?.trim();
50
47
  if (envPath) {
51
- if (fs4.existsSync(envPath)) {
48
+ if (fs.existsSync(envPath)) {
52
49
  return { path: envPath, source: "env", platform, tried };
53
50
  }
54
51
  tried.push(`env:${envPath} (not found)`);
@@ -57,7 +54,7 @@ function resolveNativeBinary(runtimeDir) {
57
54
  for (const pkg of prebuiltPkgs) {
58
55
  try {
59
56
  const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
60
- if (fs4.existsSync(candidate)) {
57
+ if (fs.existsSync(candidate)) {
61
58
  return { path: candidate, source: "prebuilt", platform, tried };
62
59
  }
63
60
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -68,13 +65,13 @@ function resolveNativeBinary(runtimeDir) {
68
65
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
69
66
  const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
70
67
  if (runtimeDir) {
71
- for (const depth of ["..", path4.join("..", ".."), path4.join("..", "..", "..")]) {
72
- const pkgRoot = path4.resolve(runtimeDir, depth);
68
+ for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
69
+ const pkgRoot = path.resolve(runtimeDir, depth);
73
70
  for (const bin of BINARY_NAMES_SELF) {
74
71
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
75
- const candidate = path4.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
72
+ const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
76
73
  tried.push(`self-bundled:${candidate}`);
77
- if (fs4.existsSync(candidate)) {
74
+ if (fs.existsSync(candidate)) {
78
75
  return { path: candidate, source: "prebuilt", platform, tried };
79
76
  }
80
77
  }
@@ -86,29 +83,29 @@ function resolveNativeBinary(runtimeDir) {
86
83
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
87
84
  const localCandidates = [];
88
85
  for (const bin of BINARY_NAMES) {
89
- localCandidates.push(path4.resolve(base, `${bin}.node`));
90
- localCandidates.push(path4.resolve(base, "..", `${bin}.node`));
91
- localCandidates.push(path4.resolve(base, `${bin}.${platform}.node`));
92
- localCandidates.push(path4.resolve(base, `${bin}.${napiPlatform}.node`));
86
+ localCandidates.push(path.resolve(base, `${bin}.node`));
87
+ localCandidates.push(path.resolve(base, "..", `${bin}.node`));
88
+ localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
89
+ localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
93
90
  }
94
91
  for (const startDir of [cwd, base]) {
95
92
  let dir = startDir;
96
93
  for (let i = 0; i < 6; i++) {
97
- const nativeDir = path4.resolve(dir, "native");
94
+ const nativeDir = path.resolve(dir, "native");
98
95
  for (const bin of BINARY_NAMES) {
99
- localCandidates.push(path4.resolve(nativeDir, `${bin}.node`));
100
- localCandidates.push(path4.resolve(nativeDir, `${bin}.${platform}.node`));
101
- localCandidates.push(path4.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
102
- localCandidates.push(path4.resolve(nativeDir, "target", "release", `${bin}.node`));
96
+ localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
97
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
98
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
99
+ localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
103
100
  }
104
- const parent = path4.resolve(dir, "..");
101
+ const parent = path.resolve(dir, "..");
105
102
  if (parent === dir) break;
106
103
  dir = parent;
107
104
  }
108
105
  }
109
106
  for (const candidate of localCandidates) {
110
107
  tried.push(`local:${candidate}`);
111
- if (fs4.existsSync(candidate)) {
108
+ if (fs.existsSync(candidate)) {
112
109
  return { path: candidate, source: "local", platform, tried };
113
110
  }
114
111
  }
@@ -117,8 +114,11 @@ function resolveNativeBinary(runtimeDir) {
117
114
  var isBrowser, _require, PLATFORM_MAP;
118
115
  var init_native_resolution = __esm({
119
116
  "packages/domain/shared/src/native-resolution.ts"() {
117
+ "use strict";
120
118
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
121
- _require = typeof __require !== "undefined" ? __require : createRequire(import.meta.url);
119
+ _require = createRequire(
120
+ typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
121
+ );
122
122
  PLATFORM_MAP = {
123
123
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
124
124
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -129,17 +129,29 @@ var init_native_resolution = __esm({
129
129
  };
130
130
  }
131
131
  });
132
+
133
+ // packages/domain/shared/src/index.ts
134
+ import { createHash } from "crypto";
135
+ import fs2 from "fs";
136
+ import path2 from "path";
137
+ import { fileURLToPath } from "url";
138
+ import { createRequire as createRequire2 } from "module";
132
139
  function resolveRuntimeDir(dir, importMetaUrl) {
140
+ if (dir) return path2.resolve(dir);
133
141
  try {
134
- return path4__default.dirname(fileURLToPath(importMetaUrl));
142
+ return path2.dirname(fileURLToPath(importMetaUrl));
135
143
  } catch {
136
144
  return process.cwd();
137
145
  }
138
146
  }
147
+ var _require2;
139
148
  var init_src = __esm({
140
149
  "packages/domain/shared/src/index.ts"() {
150
+ "use strict";
141
151
  init_native_resolution();
142
- createRequire(import.meta.url);
152
+ _require2 = createRequire2(
153
+ typeof __filename !== "undefined" ? `file://${__filename}` : import.meta.url ?? "file://unknown"
154
+ );
143
155
  }
144
156
  });
145
157
 
@@ -147,6 +159,7 @@ var init_src = __esm({
147
159
  var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
148
160
  var init_nativeBridge = __esm({
149
161
  "packages/domain/compiler/src/nativeBridge.ts"() {
162
+ "use strict";
150
163
  init_src();
151
164
  _loadNative = (path5) => __require(path5);
152
165
  log = (...args) => {
@@ -286,6 +299,7 @@ function resetCacheStats() {
286
299
  }
287
300
  var init_cssGeneratorNative = __esm({
288
301
  "packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
302
+ "use strict";
289
303
  init_nativeBridge();
290
304
  }
291
305
  });
@@ -358,6 +372,7 @@ function atomicRegistrySize() {
358
372
  }
359
373
  var init_compilationNative = __esm({
360
374
  "packages/domain/compiler/src/compiler/compilationNative.ts"() {
375
+ "use strict";
361
376
  init_nativeBridge();
362
377
  }
363
378
  });
@@ -501,6 +516,7 @@ function twMergeRaw(classLists) {
501
516
  }
502
517
  var init_cssCompilationNative = __esm({
503
518
  "packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
519
+ "use strict";
504
520
  init_nativeBridge();
505
521
  }
506
522
  });
@@ -600,6 +616,7 @@ function idRegistryImport(importedData) {
600
616
  }
601
617
  var init_idRegistryNative = __esm({
602
618
  "packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
619
+ "use strict";
603
620
  init_nativeBridge();
604
621
  }
605
622
  });
@@ -741,9 +758,13 @@ function scanFilesBatchNative(filesJson) {
741
758
  }
742
759
  var init_streamingNative = __esm({
743
760
  "packages/domain/compiler/src/compiler/streamingNative.ts"() {
761
+ "use strict";
744
762
  init_nativeBridge();
745
763
  }
746
764
  });
765
+
766
+ // packages/domain/compiler/src/tailwindEngine.ts
767
+ import { createRequire as createRequire3 } from "module";
747
768
  function loadTailwindEngine() {
748
769
  if (_twEngine) return _twEngine;
749
770
  if (_twEngineError) throw _twEngineError;
@@ -763,10 +784,10 @@ async function generateRawCss(classes, cssEntryContent, root) {
763
784
  if (classes.length === 0) return "";
764
785
  const tw = loadTailwindEngine();
765
786
  const input = cssEntryContent ?? "@import 'tailwindcss';";
766
- const { readFileSync, existsSync: existsSync2 } = await import('fs');
767
- const { dirname, resolve: resolve2 } = await import('path');
787
+ const { readFileSync, existsSync: existsSync2 } = await import("fs");
788
+ const { dirname, resolve: resolve2 } = await import("path");
768
789
  const projectRoot = root ?? process.cwd();
769
- const req = createRequire(resolve2(projectRoot, "package.json"));
790
+ const req = createRequire3(resolve2(projectRoot, "package.json"));
770
791
  const loadStylesheet = async (id, base) => {
771
792
  try {
772
793
  const cssId = id === "tailwindcss" ? "tailwindcss/index.css" : id === "tailwindcss/preflight" ? "tailwindcss/preflight.css" : id === "tailwindcss/utilities" ? "tailwindcss/utilities.css" : id === "tailwindcss/theme" ? "tailwindcss/theme.css" : id;
@@ -786,10 +807,14 @@ async function generateRawCss(classes, cssEntryContent, root) {
786
807
  const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
787
808
  return compiler.build(classes);
788
809
  }
789
- var require2, _twEngine, _twEngineError;
810
+ var require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
790
811
  var init_tailwindEngine = __esm({
791
812
  "packages/domain/compiler/src/tailwindEngine.ts"() {
792
- require2 = createRequire(import.meta.url);
813
+ "use strict";
814
+ require2 = createRequire3(
815
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
816
+ );
817
+ MAX_CACHE_MEMORY = 256 * 1024;
793
818
  _twEngine = null;
794
819
  _twEngineError = null;
795
820
  }
@@ -804,6 +829,7 @@ __export(tailwindEngine_exports, {
804
829
  runCssPipeline: () => runCssPipeline,
805
830
  runCssPipelineSync: () => runCssPipelineSync
806
831
  });
832
+ import { createRequire as createRequire4 } from "module";
807
833
  function _getCacheKey(classes, minify, cssEntry, root) {
808
834
  const sorted = [...classes].sort().join(",");
809
835
  const flags = `${minify ? "1" : "0"}${cssEntry ? "1" : "0"}${root ? "1" : "0"}`;
@@ -970,24 +996,29 @@ function processTailwindCssWithTargets(css, targets) {
970
996
  }
971
997
  return result.css;
972
998
  }
973
- var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
999
+ var require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
974
1000
  var init_tailwindEngine2 = __esm({
975
1001
  "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
1002
+ "use strict";
976
1003
  init_nativeBridge();
977
1004
  init_cssGeneratorNative();
978
1005
  init_cssCompilationNative();
979
1006
  init_tailwindEngine();
980
- createRequire(import.meta.url);
1007
+ require3 = createRequire4(
1008
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
1009
+ );
981
1010
  _cssCache = /* @__PURE__ */ new Map();
982
1011
  _cacheHits = 0;
983
1012
  _cacheMisses = 0;
984
1013
  MAX_CACHE_SIZE = 100;
1014
+ MAX_CACHE_MEMORY2 = 256 * 1024;
985
1015
  }
986
1016
  });
987
1017
 
988
1018
  // packages/domain/compiler/src/compiler/index.ts
989
1019
  var init_compiler = __esm({
990
1020
  "packages/domain/compiler/src/compiler/index.ts"() {
1021
+ "use strict";
991
1022
  init_cssGeneratorNative();
992
1023
  init_compilationNative();
993
1024
  init_cssCompilationNative();
@@ -1000,6 +1031,7 @@ var init_compiler = __esm({
1000
1031
  var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
1001
1032
  var init_parser = __esm({
1002
1033
  "packages/domain/compiler/src/parser/index.ts"() {
1034
+ "use strict";
1003
1035
  init_nativeBridge();
1004
1036
  parseClasses = (raw) => {
1005
1037
  const native = getNativeBridge();
@@ -1178,6 +1210,7 @@ function resetMemoryStats() {
1178
1210
  }
1179
1211
  var init_analyzerNative = __esm({
1180
1212
  "packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
1213
+ "use strict";
1181
1214
  init_nativeBridge();
1182
1215
  }
1183
1216
  });
@@ -1271,6 +1304,7 @@ function resolveSimpleVariants(configJson) {
1271
1304
  }
1272
1305
  var init_themeResolutionNative = __esm({
1273
1306
  "packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
1307
+ "use strict";
1274
1308
  init_nativeBridge();
1275
1309
  }
1276
1310
  });
@@ -1318,6 +1352,7 @@ function generateSubComponentTypes(root, outputPath) {
1318
1352
  }
1319
1353
  var init_scannerNative = __esm({
1320
1354
  "packages/domain/compiler/src/analyzer/scannerNative.ts"() {
1355
+ "use strict";
1321
1356
  init_nativeBridge();
1322
1357
  }
1323
1358
  });
@@ -1325,6 +1360,7 @@ var init_scannerNative = __esm({
1325
1360
  // packages/domain/compiler/src/analyzer/index.ts
1326
1361
  var init_analyzer = __esm({
1327
1362
  "packages/domain/compiler/src/analyzer/index.ts"() {
1363
+ "use strict";
1328
1364
  init_analyzerNative();
1329
1365
  init_themeResolutionNative();
1330
1366
  init_scannerNative();
@@ -1513,6 +1549,7 @@ function resetResolverPoolStats() {
1513
1549
  }
1514
1550
  var init_cacheNative = __esm({
1515
1551
  "packages/domain/compiler/src/cache/cacheNative.ts"() {
1552
+ "use strict";
1516
1553
  init_nativeBridge();
1517
1554
  }
1518
1555
  });
@@ -1520,6 +1557,7 @@ var init_cacheNative = __esm({
1520
1557
  // packages/domain/compiler/src/cache/index.ts
1521
1558
  var init_cache = __esm({
1522
1559
  "packages/domain/compiler/src/cache/index.ts"() {
1560
+ "use strict";
1523
1561
  init_cacheNative();
1524
1562
  }
1525
1563
  });
@@ -1768,6 +1806,7 @@ function redisDiagnose() {
1768
1806
  }
1769
1807
  var init_redisNative = __esm({
1770
1808
  "packages/domain/compiler/src/redis/redisNative.ts"() {
1809
+ "use strict";
1771
1810
  init_nativeBridge();
1772
1811
  }
1773
1812
  });
@@ -1775,6 +1814,7 @@ var init_redisNative = __esm({
1775
1814
  // packages/domain/compiler/src/redis/index.ts
1776
1815
  var init_redis = __esm({
1777
1816
  "packages/domain/compiler/src/redis/index.ts"() {
1817
+ "use strict";
1778
1818
  init_redisNative();
1779
1819
  }
1780
1820
  });
@@ -1913,6 +1953,7 @@ function getCompilerDiagnostics() {
1913
1953
  }
1914
1954
  var init_watchSystemNative = __esm({
1915
1955
  "packages/domain/compiler/src/watch/watchSystemNative.ts"() {
1956
+ "use strict";
1916
1957
  init_nativeBridge();
1917
1958
  }
1918
1959
  });
@@ -1920,9 +1961,15 @@ var init_watchSystemNative = __esm({
1920
1961
  // packages/domain/compiler/src/watch/index.ts
1921
1962
  var init_watch = __esm({
1922
1963
  "packages/domain/compiler/src/watch/index.ts"() {
1964
+ "use strict";
1923
1965
  init_watchSystemNative();
1924
1966
  }
1925
1967
  });
1968
+
1969
+ // packages/domain/compiler/src/index.ts
1970
+ import fs3 from "fs";
1971
+ import path3 from "path";
1972
+ import { createRequire as createRequire5 } from "module";
1926
1973
  function _layoutClassesToCss(classes) {
1927
1974
  const native = getNativeBridge();
1928
1975
  if (!native?.layoutClassesToCss) {
@@ -1960,6 +2007,7 @@ function extractContainerCssFromSource(source) {
1960
2007
  var _require3, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, getRouteClasses, registerFileClasses, registerGlobalClasses, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
1961
2008
  var init_src2 = __esm({
1962
2009
  "packages/domain/compiler/src/index.ts"() {
2010
+ "use strict";
1963
2011
  init_nativeBridge();
1964
2012
  init_compiler();
1965
2013
  init_parser();
@@ -1967,7 +2015,9 @@ var init_src2 = __esm({
1967
2015
  init_cache();
1968
2016
  init_redis();
1969
2017
  init_watch();
1970
- _require3 = createRequire(import.meta.url);
2018
+ _require3 = createRequire5(
2019
+ typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
2020
+ );
1971
2021
  transformSource = (source, opts) => {
1972
2022
  const native = getNativeBridge();
1973
2023
  if (!native?.transformSource) {
@@ -2059,7 +2109,7 @@ var init_src2 = __esm({
2059
2109
  };
2060
2110
  scanProjectUsage = (dirs, cwd) => {
2061
2111
  const { batchExtractClasses: batchExtractClasses2 } = _require3("./parser");
2062
- const files = dirs.map((dir) => path4__default.resolve(cwd, dir));
2112
+ const files = dirs.map((dir) => path3.resolve(cwd, dir));
2063
2113
  const results = batchExtractClasses2(files) || [];
2064
2114
  const combined = {};
2065
2115
  for (const result of results) {
@@ -2076,13 +2126,13 @@ var init_src2 = __esm({
2076
2126
  const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
2077
2127
  const allClasses = Object.keys(classes).sort();
2078
2128
  if (outputPath) {
2079
- fs4__default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
2129
+ fs3.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
2080
2130
  }
2081
2131
  return allClasses;
2082
2132
  };
2083
2133
  loadSafelist = (safelistPath) => {
2084
2134
  try {
2085
- const content = fs4__default.readFileSync(safelistPath, "utf-8");
2135
+ const content = fs3.readFileSync(safelistPath, "utf-8");
2086
2136
  return JSON.parse(content);
2087
2137
  } catch {
2088
2138
  return [];
@@ -2096,8 +2146,8 @@ var init_src2 = __esm({
2096
2146
  "tailwind.config.cjs"
2097
2147
  ];
2098
2148
  for (const file of configFiles) {
2099
- const fullPath = path4__default.join(cwd, file);
2100
- if (fs4__default.existsSync(fullPath)) {
2149
+ const fullPath = path3.join(cwd, file);
2150
+ if (fs3.existsSync(fullPath)) {
2101
2151
  const mod = __require(fullPath);
2102
2152
  return mod.default || mod;
2103
2153
  }
@@ -2107,9 +2157,9 @@ var init_src2 = __esm({
2107
2157
  getContentPaths = (cwd = process.cwd()) => {
2108
2158
  return {
2109
2159
  content: [
2110
- path4__default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2111
- path4__default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2112
- path4__default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2160
+ path3.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2161
+ path3.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2162
+ path3.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2113
2163
  ]
2114
2164
  };
2115
2165
  };
@@ -2523,6 +2573,7 @@ __export(internal_exports, {
2523
2573
  });
2524
2574
  var init_internal = __esm({
2525
2575
  "packages/domain/compiler/src/internal.ts"() {
2576
+ "use strict";
2526
2577
  init_src2();
2527
2578
  init_tailwindEngine2();
2528
2579
  init_compiler();
@@ -2536,10 +2587,12 @@ var init_internal = __esm({
2536
2587
 
2537
2588
  // packages/presentation/next/src/turbopackLoader.ts
2538
2589
  init_internal();
2590
+ import fs4 from "fs";
2591
+ import path4 from "path";
2539
2592
  var _writtenRules = /* @__PURE__ */ new Set();
2540
2593
  function appendStaticCssToFile(staticCss, safelistPath) {
2541
2594
  if (!staticCss.trim() || !safelistPath) return;
2542
- const stateFilePath = path4__default.join(path4__default.dirname(safelistPath), "_tw-state-static.css");
2595
+ const stateFilePath = path4.join(path4.dirname(safelistPath), "_tw-state-static.css");
2543
2596
  const newRules = [];
2544
2597
  for (const chunk of staticCss.split(/(?<=\})\s*/)) {
2545
2598
  const rule = chunk.trim();
@@ -2550,9 +2603,9 @@ function appendStaticCssToFile(staticCss, safelistPath) {
2550
2603
  }
2551
2604
  if (newRules.length === 0) return;
2552
2605
  try {
2553
- fs4__default.mkdirSync(path4__default.dirname(stateFilePath), { recursive: true });
2554
- if (!fs4__default.existsSync(stateFilePath)) {
2555
- fs4__default.writeFileSync(
2606
+ fs4.mkdirSync(path4.dirname(stateFilePath), { recursive: true });
2607
+ if (!fs4.existsSync(stateFilePath)) {
2608
+ fs4.writeFileSync(
2556
2609
  stateFilePath,
2557
2610
  `/* _tw-state-static.css \u2014 Auto-generated by tailwind-styled-v4. DO NOT EDIT.
2558
2611
  * Import di globals.css: @import "./_tw-state-static.css";
@@ -2563,7 +2616,7 @@ function appendStaticCssToFile(staticCss, safelistPath) {
2563
2616
  "utf-8"
2564
2617
  );
2565
2618
  }
2566
- fs4__default.appendFileSync(stateFilePath, newRules.join("\n") + "\n", "utf-8");
2619
+ fs4.appendFileSync(stateFilePath, newRules.join("\n") + "\n", "utf-8");
2567
2620
  } catch {
2568
2621
  }
2569
2622
  }
@@ -2602,11 +2655,11 @@ var CYCLE_SENTINEL = "_cycle.txt";
2602
2655
  var START_SENTINEL = "_start.txt";
2603
2656
  var _workerCache = /* @__PURE__ */ new Map();
2604
2657
  function getTwClassesDir(safelistPath) {
2605
- return path4__default.join(path4__default.dirname(safelistPath), "tw-classes");
2658
+ return path4.join(path4.dirname(safelistPath), "tw-classes");
2606
2659
  }
2607
2660
  function readSentinel(filePath) {
2608
2661
  try {
2609
- return fs4__default.readFileSync(filePath, "utf-8").trim();
2662
+ return fs4.readFileSync(filePath, "utf-8").trim();
2610
2663
  } catch {
2611
2664
  return "";
2612
2665
  }
@@ -2616,36 +2669,36 @@ function clearAndMarkCycle(twClassesDir, startId) {
2616
2669
  if (_clearLock) return;
2617
2670
  _clearLock = true;
2618
2671
  try {
2619
- if (fs4__default.existsSync(twClassesDir)) {
2672
+ if (fs4.existsSync(twClassesDir)) {
2620
2673
  const tempDir = `${twClassesDir}_clearing_${Date.now()}`;
2621
2674
  try {
2622
- fs4__default.renameSync(twClassesDir, tempDir);
2623
- fs4__default.mkdirSync(twClassesDir, { recursive: true });
2624
- const startFile = path4__default.join(tempDir, START_SENTINEL);
2625
- if (fs4__default.existsSync(startFile)) {
2626
- fs4__default.copyFileSync(startFile, path4__default.join(twClassesDir, START_SENTINEL));
2675
+ fs4.renameSync(twClassesDir, tempDir);
2676
+ fs4.mkdirSync(twClassesDir, { recursive: true });
2677
+ const startFile = path4.join(tempDir, START_SENTINEL);
2678
+ if (fs4.existsSync(startFile)) {
2679
+ fs4.copyFileSync(startFile, path4.join(twClassesDir, START_SENTINEL));
2627
2680
  }
2628
- const mergedFile = path4__default.join(tempDir, "_webpack-merged.css");
2629
- if (fs4__default.existsSync(mergedFile)) {
2630
- fs4__default.copyFileSync(mergedFile, path4__default.join(twClassesDir, "_webpack-merged.css"));
2681
+ const mergedFile = path4.join(tempDir, "_webpack-merged.css");
2682
+ if (fs4.existsSync(mergedFile)) {
2683
+ fs4.copyFileSync(mergedFile, path4.join(twClassesDir, "_webpack-merged.css"));
2631
2684
  }
2632
- fs4__default.writeFileSync(path4__default.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2685
+ fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2633
2686
  _workerCache.set(twClassesDir, startId);
2634
- fs4__default.rmSync(tempDir, { recursive: true, force: true });
2687
+ fs4.rmSync(tempDir, { recursive: true, force: true });
2635
2688
  } catch {
2636
- for (const file of fs4__default.readdirSync(twClassesDir)) {
2689
+ for (const file of fs4.readdirSync(twClassesDir)) {
2637
2690
  if (file === START_SENTINEL || file === "_webpack-merged.css") continue;
2638
2691
  try {
2639
- fs4__default.unlinkSync(path4__default.join(twClassesDir, file));
2692
+ fs4.unlinkSync(path4.join(twClassesDir, file));
2640
2693
  } catch {
2641
2694
  }
2642
2695
  }
2643
- fs4__default.writeFileSync(path4__default.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2696
+ fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2644
2697
  _workerCache.set(twClassesDir, startId);
2645
2698
  }
2646
2699
  } else {
2647
- fs4__default.mkdirSync(twClassesDir, { recursive: true });
2648
- fs4__default.writeFileSync(path4__default.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2700
+ fs4.mkdirSync(twClassesDir, { recursive: true });
2701
+ fs4.writeFileSync(path4.join(twClassesDir, CYCLE_SENTINEL), startId, "utf-8");
2649
2702
  _workerCache.set(twClassesDir, startId);
2650
2703
  }
2651
2704
  } catch {
@@ -2656,41 +2709,41 @@ function clearAndMarkCycle(twClassesDir, startId) {
2656
2709
  function getPerFileSafelistPath(safelistDir, resourcePath) {
2657
2710
  const normalized = resourcePath.replace(/\\/g, "/");
2658
2711
  const slug = normalized.replace(/^.*\/src\//, "").replace(/\.[tj]sx?$/, "").replace(/[^a-zA-Z0-9]/g, "_").slice(0, 80);
2659
- return path4__default.join(safelistDir, `${slug}.css`);
2712
+ return path4.join(safelistDir, `${slug}.css`);
2660
2713
  }
2661
2714
  function writePerFileSafelist(safelistPath, resourcePath, classes) {
2662
2715
  if (!safelistPath || classes.length === 0) return;
2663
2716
  try {
2664
2717
  const twClassesDir = getTwClassesDir(safelistPath);
2665
- const startId = readSentinel(path4__default.join(twClassesDir, START_SENTINEL));
2666
- const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(path4__default.join(twClassesDir, CYCLE_SENTINEL));
2718
+ const startId = readSentinel(path4.join(twClassesDir, START_SENTINEL));
2719
+ const cachedCycle = _workerCache.get(twClassesDir) ?? readSentinel(path4.join(twClassesDir, CYCLE_SENTINEL));
2667
2720
  if (startId && cachedCycle !== startId) {
2668
2721
  clearAndMarkCycle(twClassesDir, startId);
2669
- } else if (!fs4__default.existsSync(twClassesDir)) {
2670
- fs4__default.mkdirSync(twClassesDir, { recursive: true });
2722
+ } else if (!fs4.existsSync(twClassesDir)) {
2723
+ fs4.mkdirSync(twClassesDir, { recursive: true });
2671
2724
  }
2672
2725
  const outPath = getPerFileSafelistPath(twClassesDir, resourcePath);
2673
2726
  const sorted = [...new Set(classes)].sort();
2674
2727
  const css = [
2675
- `/* tw-safelist: ${path4__default.basename(resourcePath)} \u2014 auto-generated */`,
2728
+ `/* tw-safelist: ${path4.basename(resourcePath)} \u2014 auto-generated */`,
2676
2729
  "@layer utilities {",
2677
2730
  sorted.map((cls) => `.${cls.replace(/([^a-zA-Z0-9_-])/g, "\\$1")} {}`).join("\n"),
2678
2731
  "}"
2679
2732
  ].join("\n");
2680
2733
  try {
2681
- if (fs4__default.readFileSync(outPath, "utf-8") === css) return;
2734
+ if (fs4.readFileSync(outPath, "utf-8") === css) return;
2682
2735
  } catch {
2683
2736
  }
2684
2737
  const tmpPath = `${outPath}.tmp`;
2685
2738
  try {
2686
- fs4__default.writeFileSync(tmpPath, css, "utf-8");
2687
- fs4__default.renameSync(tmpPath, outPath);
2739
+ fs4.writeFileSync(tmpPath, css, "utf-8");
2740
+ fs4.renameSync(tmpPath, outPath);
2688
2741
  } catch {
2689
2742
  try {
2690
- fs4__default.unlinkSync(tmpPath);
2743
+ fs4.unlinkSync(tmpPath);
2691
2744
  } catch {
2692
2745
  }
2693
- fs4__default.writeFileSync(outPath, css, "utf-8");
2746
+ fs4.writeFileSync(outPath, css, "utf-8");
2694
2747
  }
2695
2748
  } catch {
2696
2749
  }
@@ -2704,7 +2757,7 @@ function turbopackLoader(source, options = {}) {
2704
2757
  const router = detectRouter(this.resourcePath);
2705
2758
  const nextMajor = parseNum(options.nextMajor);
2706
2759
  const debug = parseBool(options.debug);
2707
- const filename = path4__default.basename(this.resourcePath);
2760
+ const filename = path4.basename(this.resourcePath);
2708
2761
  const effective = {
2709
2762
  addDataAttr: parseBool(options.addDataAttr),
2710
2763
  // App Router: selalu auto-detect client boundary
@@ -2766,7 +2819,7 @@ function turbopackLoader(source, options = {}) {
2766
2819
  return source;
2767
2820
  }
2768
2821
  }
2769
-
2770
- export { turbopackLoader as default };
2771
- //# sourceMappingURL=turbopackLoader.mjs.map
2822
+ export {
2823
+ turbopackLoader as default
2824
+ };
2772
2825
  //# sourceMappingURL=turbopackLoader.mjs.map