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
package/dist/analyzer.js CHANGED
@@ -1,24 +1,11 @@
1
- 'use strict';
2
-
3
- require('crypto');
4
- var fs3 = require('fs');
5
- var path5 = require('path');
6
- var url = require('url');
7
- var module$1 = require('module');
8
- var worker_threads = require('worker_threads');
9
- var os = require('os');
10
- var zod = require('zod');
11
-
12
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
13
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
14
-
15
- var fs3__default = /*#__PURE__*/_interopDefault(fs3);
16
- var path5__default = /*#__PURE__*/_interopDefault(path5);
17
-
1
+ const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
18
2
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
3
+ "use strict";
4
+ var __create = Object.create;
19
5
  var __defProp = Object.defineProperty;
20
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
21
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
22
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
23
10
  var __esm = (fn, res) => function __init() {
24
11
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
@@ -35,7 +22,17 @@ var __copyProps = (to, from, except, desc) => {
35
22
  }
36
23
  return to;
37
24
  };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
38
33
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
+
35
+ // packages/domain/shared/src/index.ts
39
36
  function createLogger(namespace) {
40
37
  const prefix = `[${namespace}]`;
41
38
  return {
@@ -75,9 +72,9 @@ function loadNativeBinding(options) {
75
72
  const { runtimeDir, candidates, isValid } = options;
76
73
  const loadErrors = [];
77
74
  for (const candidate of candidates) {
78
- const candidatePath = path5__default.default.resolve(runtimeDir, candidate);
75
+ const candidatePath = import_node_path.default.resolve(runtimeDir, candidate);
79
76
  try {
80
- if (!fs3__default.default.existsSync(candidatePath) && !fs3__default.default.existsSync(candidatePath + ".node")) {
77
+ if (!import_node_fs.default.existsSync(candidatePath) && !import_node_fs.default.existsSync(candidatePath + ".node")) {
81
78
  continue;
82
79
  }
83
80
  const mod = requireNativeModule(candidatePath);
@@ -109,9 +106,9 @@ function resolveNativeBindingCandidates(options) {
109
106
  }
110
107
  }
111
108
  if (!includeDefaultCandidates) return candidates;
112
- if (fs3__default.default.existsSync(runtimeDir)) {
109
+ if (import_node_fs.default.existsSync(runtimeDir)) {
113
110
  try {
114
- for (const entry of fs3__default.default.readdirSync(runtimeDir)) {
111
+ for (const entry of import_node_fs.default.readdirSync(runtimeDir)) {
115
112
  if (entry.endsWith(".node")) candidates.push(entry);
116
113
  }
117
114
  } catch {
@@ -120,29 +117,35 @@ function resolveNativeBindingCandidates(options) {
120
117
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
121
118
  const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
122
119
  for (const bin of BINARY_NAMES) {
123
- candidates.push(path5__default.default.resolve(runtimeDir, `${bin}.node`));
124
- candidates.push(path5__default.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
125
- candidates.push(path5__default.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
126
- candidates.push(path5__default.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
127
- candidates.push(path5__default.default.resolve(process.cwd(), "native", `${bin}.node`));
128
- candidates.push(path5__default.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
129
- candidates.push(path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
130
- candidates.push(path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
131
- candidates.push(path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
120
+ candidates.push(import_node_path.default.resolve(runtimeDir, `${bin}.node`));
121
+ candidates.push(import_node_path.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
122
+ candidates.push(import_node_path.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
123
+ candidates.push(import_node_path.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
124
+ candidates.push(import_node_path.default.resolve(process.cwd(), "native", `${bin}.node`));
125
+ candidates.push(import_node_path.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
126
+ candidates.push(import_node_path.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
127
+ candidates.push(import_node_path.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
128
+ candidates.push(import_node_path.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
132
129
  }
133
130
  return Array.from(new Set(candidates));
134
131
  }
135
132
  function resolveRuntimeDir(dir, importMetaUrl) {
136
- if (dir) return path5__default.default.resolve(dir);
133
+ if (dir) return import_node_path.default.resolve(dir);
137
134
  try {
138
- return path5__default.default.dirname(url.fileURLToPath(importMetaUrl));
135
+ return import_node_path.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
139
136
  } catch {
140
137
  return process.cwd();
141
138
  }
142
139
  }
143
- var TwError, _require;
140
+ var import_node_crypto, import_node_fs, import_node_path, import_node_url, import_node_module, TwError, _require;
144
141
  var init_src = __esm({
145
142
  "packages/domain/shared/src/index.ts"() {
143
+ "use strict";
144
+ import_node_crypto = require("crypto");
145
+ import_node_fs = __toESM(require("fs"));
146
+ import_node_path = __toESM(require("path"));
147
+ import_node_url = require("url");
148
+ import_node_module = require("module");
146
149
  TwError = class _TwError extends Error {
147
150
  /** @deprecated Gunakan source */
148
151
  domain;
@@ -195,7 +198,9 @@ var init_src = __esm({
195
198
  return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
196
199
  }
197
200
  };
198
- _require = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href)));
201
+ _require = (0, import_node_module.createRequire)(
202
+ typeof __filename !== "undefined" ? `file://${__filename}` : __importMetaUrl ?? "file://unknown"
203
+ );
199
204
  }
200
205
  });
201
206
 
@@ -232,8 +237,8 @@ function getDirname() {
232
237
  if (typeof __dirname !== "undefined") {
233
238
  return __dirname;
234
239
  }
235
- if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))) {
236
- return path5__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))));
240
+ if (typeof import_meta !== "undefined" && __importMetaUrl) {
241
+ return import_node_path2.default.dirname((0, import_node_url2.fileURLToPath)(__importMetaUrl));
237
242
  }
238
243
  return process.cwd();
239
244
  }
@@ -438,13 +443,17 @@ function hasNativeWatchBinding() {
438
443
  return false;
439
444
  }
440
445
  }
441
- var log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
446
+ var import_node_path2, import_node_url2, import_meta, log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
442
447
  var init_native_bridge = __esm({
443
448
  "packages/domain/scanner/src/native-bridge.ts"() {
449
+ "use strict";
450
+ import_node_path2 = __toESM(require("path"), 1);
451
+ import_node_url2 = require("url");
444
452
  init_src();
453
+ import_meta = {};
445
454
  log = createDebugLogger("scanner:native");
446
- isValidScannerBinding = (module) => {
447
- const candidate = module;
455
+ isValidScannerBinding = (module2) => {
456
+ const candidate = module2;
448
457
  return !!(candidate && (candidate.scanWorkspace || candidate.extractClassesFromSource || candidate.hashFileContent || candidate.cacheRead || candidate.cacheWrite));
449
458
  };
450
459
  createScannerBridgeLoader = () => {
@@ -521,13 +530,15 @@ var init_native_bridge = __esm({
521
530
  resetScannerBridgeCache = scannerBridgeLoader.reset;
522
531
  }
523
532
  });
533
+
534
+ // packages/domain/scanner/src/cache-native.ts
524
535
  function defaultCachePath(rootDir, cacheDir) {
525
- const dir = cacheDir ? path5__default.default.resolve(rootDir, cacheDir) : path5__default.default.join(process.cwd(), ".cache", "tailwind-styled");
526
- return path5__default.default.join(dir, "scanner-cache.json");
536
+ const dir = cacheDir ? import_node_path3.default.resolve(rootDir, cacheDir) : import_node_path3.default.join(process.cwd(), ".cache", "tailwind-styled");
537
+ return import_node_path3.default.join(dir, "scanner-cache.json");
527
538
  }
528
539
  function readCache(rootDir, cacheDir) {
529
540
  const cachePath = defaultCachePath(rootDir, cacheDir);
530
- fs3__default.default.mkdirSync(path5__default.default.dirname(cachePath), { recursive: true });
541
+ import_node_fs2.default.mkdirSync(import_node_path3.default.dirname(cachePath), { recursive: true });
531
542
  const result = cacheReadNative(cachePath);
532
543
  if (!result) return [];
533
544
  return result.entries.map((e) => ({
@@ -542,7 +553,7 @@ function readCache(rootDir, cacheDir) {
542
553
  }
543
554
  function writeCache(rootDir, entries, cacheDir) {
544
555
  const cachePath = defaultCachePath(rootDir, cacheDir);
545
- fs3__default.default.mkdirSync(path5__default.default.dirname(cachePath), { recursive: true });
556
+ import_node_fs2.default.mkdirSync(import_node_path3.default.dirname(cachePath), { recursive: true });
546
557
  const success = cacheWriteNative(cachePath, entries);
547
558
  if (!success) {
548
559
  throw new Error(
@@ -561,11 +572,18 @@ function filePriority(mtimeMs, size, cached, nowMs = Date.now()) {
561
572
  nowMs
562
573
  );
563
574
  }
575
+ var import_node_fs2, import_node_path3, STALE_THRESHOLD_MS;
564
576
  var init_cache_native = __esm({
565
577
  "packages/domain/scanner/src/cache-native.ts"() {
578
+ "use strict";
579
+ import_node_fs2 = __toESM(require("fs"), 1);
580
+ import_node_path3 = __toESM(require("path"), 1);
566
581
  init_native_bridge();
582
+ STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
567
583
  }
568
584
  });
585
+
586
+ // packages/domain/scanner/src/parallel-scanner.ts
569
587
  function collectFiles(rootDir, extensions, ignoreDirs) {
570
588
  const native = collectFilesNative(rootDir, extensions, ignoreDirs);
571
589
  if (native !== null) return native;
@@ -583,7 +601,7 @@ function mergeResults(batchResults) {
583
601
  }
584
602
  function runChunkInWorker(filePaths) {
585
603
  return new Promise((resolve, reject) => {
586
- const worker = new worker_threads.Worker(_workerFilename, {
604
+ const worker = new import_node_worker_threads.Worker(_workerFilename, {
587
605
  workerData: { filePaths }
588
606
  });
589
607
  worker.once("message", (payload) => {
@@ -603,10 +621,10 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
603
621
  const {
604
622
  extensions = DEFAULT_EXTENSIONS,
605
623
  ignoreDirs = DEFAULT_IGNORES,
606
- maxWorkers = Math.max(1, os.availableParallelism() - 1),
624
+ maxWorkers = Math.max(1, (0, import_node_os.availableParallelism)() - 1),
607
625
  chunkSize = DEFAULT_CHUNK_SIZE
608
626
  } = options;
609
- const files = collectFiles(path5__default.default.resolve(rootDir), extensions, ignoreDirs);
627
+ const files = collectFiles(import_node_path4.default.resolve(rootDir), extensions, ignoreDirs);
610
628
  if (files.length < PARALLEL_THRESHOLD) {
611
629
  return mergeResults(batchExtractClassesNative(files));
612
630
  }
@@ -622,33 +640,42 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
622
640
  }
623
641
  return mergeResults(allResults);
624
642
  }
625
- var PARALLEL_THRESHOLD, DEFAULT_CHUNK_SIZE, _workerFilename;
643
+ var import_node_worker_threads, import_node_path4, import_node_os, import_node_url3, PARALLEL_THRESHOLD, DEFAULT_CHUNK_SIZE, _workerFilename;
626
644
  var init_parallel_scanner = __esm({
627
645
  "packages/domain/scanner/src/parallel-scanner.ts"() {
646
+ "use strict";
647
+ import_node_worker_threads = require("worker_threads");
648
+ import_node_path4 = __toESM(require("path"), 1);
649
+ import_node_os = require("os");
650
+ import_node_url3 = require("url");
628
651
  init_src2();
629
652
  init_native_bridge();
630
653
  PARALLEL_THRESHOLD = 50;
631
654
  DEFAULT_CHUNK_SIZE = 150;
632
- if (!worker_threads.isMainThread && worker_threads.parentPort) {
633
- const { filePaths } = worker_threads.workerData;
655
+ if (!import_node_worker_threads.isMainThread && import_node_worker_threads.parentPort) {
656
+ const { filePaths } = import_node_worker_threads.workerData;
634
657
  try {
635
658
  const results = batchExtractClassesNative(filePaths);
636
659
  const msg = { ok: true, results };
637
- worker_threads.parentPort.postMessage(msg);
660
+ import_node_worker_threads.parentPort.postMessage(msg);
638
661
  } catch (error) {
639
662
  const msg = {
640
663
  ok: false,
641
664
  error: error instanceof Error ? error.message : String(error)
642
665
  };
643
- worker_threads.parentPort.postMessage(msg);
666
+ import_node_worker_threads.parentPort.postMessage(msg);
644
667
  }
645
668
  }
646
- _workerFilename = typeof __filename !== "undefined" ? __filename : url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href)));
669
+ _workerFilename = typeof __filename !== "undefined" ? __filename : (0, import_node_url3.fileURLToPath)(__importMetaUrl);
647
670
  }
648
671
  });
649
- var formatIssuePath2, formatIssues, parseWithSchema, NonNegativeIntegerSchema, ScanWorkspaceOptionsSchema, ScanFileResultSchema, ScanWorkspaceResultSchema, ScannerWorkerSuccessMessageSchema, ScannerWorkerErrorMessageSchema, ScannerWorkerMessageSchema, parseScanWorkspaceOptions, parseScanWorkspaceResult, parseScannerWorkerMessage;
672
+
673
+ // packages/domain/scanner/src/schemas.ts
674
+ var import_zod, formatIssuePath2, formatIssues, parseWithSchema, NonNegativeIntegerSchema, ScanWorkspaceOptionsSchema, ScanFileResultSchema, ScanWorkspaceResultSchema, ScannerWorkerRequestSchema, ScannerWorkerSuccessMessageSchema, ScannerWorkerErrorMessageSchema, ScannerWorkerMessageSchema, parseScanWorkspaceOptions, parseScanWorkspaceResult, parseScannerWorkerMessage;
650
675
  var init_schemas = __esm({
651
676
  "packages/domain/scanner/src/schemas.ts"() {
677
+ "use strict";
678
+ import_zod = require("zod");
652
679
  init_src();
653
680
  formatIssuePath2 = (path8) => path8.length > 0 ? path8.map(
654
681
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
@@ -668,40 +695,40 @@ var init_schemas = __esm({
668
695
  parsed.error
669
696
  );
670
697
  };
671
- NonNegativeIntegerSchema = zod.z.number().int().min(0);
672
- ScanWorkspaceOptionsSchema = zod.z.object({
673
- includeExtensions: zod.z.array(zod.z.string()).optional(),
674
- ignoreDirectories: zod.z.array(zod.z.string()).optional(),
675
- useCache: zod.z.boolean().optional(),
676
- cacheDir: zod.z.string().min(1).optional(),
677
- smartInvalidation: zod.z.boolean().optional()
698
+ NonNegativeIntegerSchema = import_zod.z.number().int().min(0);
699
+ ScanWorkspaceOptionsSchema = import_zod.z.object({
700
+ includeExtensions: import_zod.z.array(import_zod.z.string()).optional(),
701
+ ignoreDirectories: import_zod.z.array(import_zod.z.string()).optional(),
702
+ useCache: import_zod.z.boolean().optional(),
703
+ cacheDir: import_zod.z.string().min(1).optional(),
704
+ smartInvalidation: import_zod.z.boolean().optional()
678
705
  });
679
- ScanFileResultSchema = zod.z.object({
680
- file: zod.z.string(),
681
- classes: zod.z.array(zod.z.string()),
682
- hash: zod.z.string().optional()
706
+ ScanFileResultSchema = import_zod.z.object({
707
+ file: import_zod.z.string(),
708
+ classes: import_zod.z.array(import_zod.z.string()),
709
+ hash: import_zod.z.string().optional()
683
710
  });
684
- ScanWorkspaceResultSchema = zod.z.object({
685
- files: zod.z.array(ScanFileResultSchema),
711
+ ScanWorkspaceResultSchema = import_zod.z.object({
712
+ files: import_zod.z.array(ScanFileResultSchema),
686
713
  totalFiles: NonNegativeIntegerSchema,
687
- uniqueClasses: zod.z.array(zod.z.string())
714
+ uniqueClasses: import_zod.z.array(import_zod.z.string())
688
715
  }).refine((value) => value.totalFiles === value.files.length, {
689
716
  message: "scan result totalFiles must match files.length",
690
717
  path: ["totalFiles"]
691
718
  });
692
- zod.z.object({
693
- rootDir: zod.z.string().min(1),
719
+ ScannerWorkerRequestSchema = import_zod.z.object({
720
+ rootDir: import_zod.z.string().min(1),
694
721
  options: ScanWorkspaceOptionsSchema.optional()
695
722
  });
696
- ScannerWorkerSuccessMessageSchema = zod.z.object({
697
- ok: zod.z.literal(true),
723
+ ScannerWorkerSuccessMessageSchema = import_zod.z.object({
724
+ ok: import_zod.z.literal(true),
698
725
  result: ScanWorkspaceResultSchema
699
726
  });
700
- ScannerWorkerErrorMessageSchema = zod.z.object({
701
- ok: zod.z.literal(false),
702
- error: zod.z.string().optional()
727
+ ScannerWorkerErrorMessageSchema = import_zod.z.object({
728
+ ok: import_zod.z.literal(false),
729
+ error: import_zod.z.string().optional()
703
730
  });
704
- ScannerWorkerMessageSchema = zod.z.union([
731
+ ScannerWorkerMessageSchema = import_zod.z.union([
705
732
  ScannerWorkerSuccessMessageSchema,
706
733
  ScannerWorkerErrorMessageSchema
707
734
  ]);
@@ -731,8 +758,8 @@ function getRuntimeDir() {
731
758
  if (typeof __dirname !== "undefined" && __dirname.length > 0) {
732
759
  return __dirname;
733
760
  }
734
- if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))) {
735
- return path5__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))));
761
+ if (typeof import_meta2 !== "undefined" && __importMetaUrl) {
762
+ return import_node_path5.default.dirname((0, import_node_url4.fileURLToPath)(__importMetaUrl));
736
763
  }
737
764
  return process.cwd();
738
765
  }
@@ -741,18 +768,18 @@ function resolveScannerWorkerModulePath() {
741
768
  if (typeof __dirname !== "undefined" && __dirname.length > 0) {
742
769
  return __dirname;
743
770
  }
744
- if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))) {
745
- return path5__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))));
771
+ if (typeof import_meta2 !== "undefined" && __importMetaUrl) {
772
+ return import_node_path5.default.dirname((0, import_node_url4.fileURLToPath)(__importMetaUrl));
746
773
  }
747
774
  return process.cwd();
748
775
  })();
749
776
  const candidates = [
750
- path5__default.default.resolve(runtimeDir, "worker.cjs"),
751
- path5__default.default.resolve(runtimeDir, "worker.js"),
752
- path5__default.default.resolve(runtimeDir, "worker.ts")
777
+ import_node_path5.default.resolve(runtimeDir, "worker.cjs"),
778
+ import_node_path5.default.resolve(runtimeDir, "worker.js"),
779
+ import_node_path5.default.resolve(runtimeDir, "worker.ts")
753
780
  ];
754
781
  for (const candidate of candidates) {
755
- if (fs3__default.default.existsSync(candidate)) return candidate;
782
+ if (import_node_fs3.default.existsSync(candidate)) return candidate;
756
783
  }
757
784
  return null;
758
785
  }
@@ -764,7 +791,7 @@ function scanWorkspaceInWorker(rootDir, options) {
764
791
  }
765
792
  return new Promise((resolve, reject) => {
766
793
  const settleState = { settled: false };
767
- const worker = new worker_threads.Worker(modulePath, { workerData: { rootDir, options: normalizedOptions } });
794
+ const worker = new import_node_worker_threads2.Worker(modulePath, { workerData: { rootDir, options: normalizedOptions } });
768
795
  const timeout = setTimeout(() => {
769
796
  if (!settleState.settled) {
770
797
  settleState.settled = true;
@@ -809,19 +836,19 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
809
836
  if (!currentDir) continue;
810
837
  const entries = (() => {
811
838
  try {
812
- return fs3__default.default.readdirSync(currentDir, { withFileTypes: true });
839
+ return import_node_fs3.default.readdirSync(currentDir, { withFileTypes: true });
813
840
  } catch {
814
841
  return [];
815
842
  }
816
843
  })();
817
844
  for (const entry of entries) {
818
- const fullPath = path5__default.default.join(currentDir, entry.name);
845
+ const fullPath = import_node_path5.default.join(currentDir, entry.name);
819
846
  if (entry.isDirectory()) {
820
847
  if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
821
848
  continue;
822
849
  }
823
850
  if (!entry.isFile()) continue;
824
- if (!extensionSet.has(path5__default.default.extname(entry.name))) continue;
851
+ if (!extensionSet.has(import_node_path5.default.extname(entry.name))) continue;
825
852
  candidates.push(fullPath);
826
853
  }
827
854
  }
@@ -848,7 +875,7 @@ function scanSource(source) {
848
875
  );
849
876
  }
850
877
  function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
851
- return includeExtensions.includes(path5__default.default.extname(filePath));
878
+ return includeExtensions.includes(import_node_path5.default.extname(filePath));
852
879
  }
853
880
  function scanFile(filePath) {
854
881
  const { scanFileNative: scanFileNative2 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
@@ -868,7 +895,7 @@ function scanWorkspace(rootDir, options = {}) {
868
895
  const extensionSet = buildExtensionSet(includeExtensions);
869
896
  const ignoreDirectories = new Set(normalizedOptions.ignoreDirectories ?? DEFAULT_IGNORES);
870
897
  const useCache = normalizedOptions.useCache ?? true;
871
- normalizedOptions.smartInvalidation ?? true;
898
+ const _smartInvalidation = normalizedOptions.smartInvalidation ?? true;
872
899
  const files = [];
873
900
  const unique = /* @__PURE__ */ new Set();
874
901
  const candidates = collectCandidates(rootDir, ignoreDirectories, extensionSet);
@@ -908,7 +935,7 @@ function scanWorkspace(rootDir, options = {}) {
908
935
  for (const filePath of candidates) {
909
936
  const stat = (() => {
910
937
  try {
911
- return fs3__default.default.statSync(filePath);
938
+ return import_node_fs3.default.statSync(filePath);
912
939
  } catch {
913
940
  return null;
914
941
  }
@@ -934,7 +961,7 @@ function scanWorkspace(rootDir, options = {}) {
934
961
  for (const { filePath, stat, size, cached } of ranked) {
935
962
  const content = (() => {
936
963
  try {
937
- return fs3__default.default.readFileSync(filePath, "utf8");
964
+ return import_node_fs3.default.readFileSync(filePath, "utf8");
938
965
  } catch {
939
966
  return null;
940
967
  }
@@ -1015,9 +1042,15 @@ async function scanWorkspaceAsync(rootDir, options = {}) {
1015
1042
  return scanWorkspace(rootDir, normalizedOptions);
1016
1043
  }
1017
1044
  }
1018
- var log2, SCAN_WORKER_TIMEOUT_MS, createNativeParserLoader, nativeParserLoader, DEFAULT_EXTENSIONS, DEFAULT_IGNORES;
1045
+ var import_node_fs3, import_node_module2, import_node_path5, import_node_url4, import_node_worker_threads2, import_meta2, log2, SCAN_WORKER_TIMEOUT_MS, createNativeParserLoader, nativeParserLoader, DEFAULT_EXTENSIONS, DEFAULT_IGNORES;
1019
1046
  var init_src2 = __esm({
1020
1047
  "packages/domain/scanner/src/index.ts"() {
1048
+ "use strict";
1049
+ import_node_fs3 = __toESM(require("fs"), 1);
1050
+ import_node_module2 = require("module");
1051
+ import_node_path5 = __toESM(require("path"), 1);
1052
+ import_node_url4 = require("url");
1053
+ import_node_worker_threads2 = require("worker_threads");
1021
1054
  init_src();
1022
1055
  init_cache_native();
1023
1056
  init_native_bridge();
@@ -1025,6 +1058,7 @@ var init_src2 = __esm({
1025
1058
  init_schemas();
1026
1059
  init_schemas();
1027
1060
  init_native_bridge();
1061
+ import_meta2 = {};
1028
1062
  log2 = createLogger("scanner");
1029
1063
  SCAN_WORKER_TIMEOUT_MS = 12e4;
1030
1064
  createNativeParserLoader = () => {
@@ -1038,7 +1072,7 @@ var init_src2 = __esm({
1038
1072
  const loadNativeParserBinding = () => {
1039
1073
  if (_state.binding !== void 0) return _state.binding;
1040
1074
  const runtimeDir = getRuntimeDir();
1041
- const req = module$1.createRequire(path5__default.default.join(runtimeDir, "noop.cjs"));
1075
+ const req = (0, import_node_module2.createRequire)(import_node_path5.default.join(runtimeDir, "noop.cjs"));
1042
1076
  const _platform = process.platform;
1043
1077
  const _arch = process.arch;
1044
1078
  const _platformArch = `${_platform}-${_arch}`;
@@ -1046,27 +1080,27 @@ var init_src2 = __esm({
1046
1080
  const candidates = [
1047
1081
  // ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
1048
1082
  // cwd = repo root saat run dari root, atau package dir saat workspaces
1049
- path5__default.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
1050
- path5__default.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
1051
- path5__default.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1083
+ import_node_path5.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
1084
+ import_node_path5.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
1085
+ import_node_path5.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1052
1086
  // runtimeDir = dist/ → naik 1 level ke package root (npm install case)
1053
1087
  // e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
1054
- path5__default.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
1055
- path5__default.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
1056
- path5__default.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1088
+ import_node_path5.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
1089
+ import_node_path5.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
1090
+ import_node_path5.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1057
1091
  // runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
1058
- path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
1059
- path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1092
+ import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
1093
+ import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1060
1094
  // 3 level fallback (jika package di-nest lebih dangkal)
1061
- path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
1062
- path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1095
+ import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
1096
+ import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
1063
1097
  // ── binaryName lama: tailwind_styled_parser (backward compat) ──
1064
- path5__default.default.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
1065
- path5__default.default.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
1066
- path5__default.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
1067
- path5__default.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
1068
- path5__default.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
1069
- path5__default.default.resolve(
1098
+ import_node_path5.default.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
1099
+ import_node_path5.default.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
1100
+ import_node_path5.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
1101
+ import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
1102
+ import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
1103
+ import_node_path5.default.resolve(
1070
1104
  runtimeDir,
1071
1105
  "..",
1072
1106
  "..",
@@ -1078,7 +1112,7 @@ var init_src2 = __esm({
1078
1112
  )
1079
1113
  ];
1080
1114
  for (const fullPath of candidates) {
1081
- if (!fs3__default.default.existsSync(fullPath)) continue;
1115
+ if (!import_node_fs3.default.existsSync(fullPath)) continue;
1082
1116
  try {
1083
1117
  const required = req(fullPath);
1084
1118
  if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
@@ -1111,13 +1145,24 @@ var init_src2 = __esm({
1111
1145
  }
1112
1146
  });
1113
1147
 
1148
+ // src/umbrella/analyzer.ts
1149
+ var analyzer_exports = {};
1150
+ __export(analyzer_exports, {
1151
+ __internal: () => __internal,
1152
+ analyzeWorkspace: () => analyzeWorkspace,
1153
+ classToCss: () => classToCss
1154
+ });
1155
+ module.exports = __toCommonJS(analyzer_exports);
1156
+
1114
1157
  // packages/domain/analyzer/src/analyzeWorkspace.ts
1158
+ var import_node_path7 = __toESM(require("path"), 1);
1115
1159
  init_src2();
1116
1160
 
1117
1161
  // packages/domain/analyzer/src/binding.ts
1118
1162
  init_src();
1119
1163
 
1120
1164
  // packages/domain/analyzer/src/utils.ts
1165
+ var import_node_fs4 = __toESM(require("fs"), 1);
1121
1166
  init_src();
1122
1167
  var DEFAULT_TOP_LIMIT = 10;
1123
1168
  var DEFAULT_FREQUENT_THRESHOLD = 2;
@@ -1132,7 +1177,7 @@ function isRecord(value) {
1132
1177
  }
1133
1178
  async function pathExists(filePath) {
1134
1179
  try {
1135
- await fs3__default.default.promises.access(filePath, fs3__default.default.constants.F_OK);
1180
+ await import_node_fs4.default.promises.access(filePath, import_node_fs4.default.constants.F_OK);
1136
1181
  return true;
1137
1182
  } catch {
1138
1183
  return false;
@@ -1149,8 +1194,8 @@ function sanitizeFrequentThreshold(value) {
1149
1194
  }
1150
1195
 
1151
1196
  // packages/domain/analyzer/src/binding.ts
1152
- var isAnalyzerModule = (module) => {
1153
- const candidate = module;
1197
+ var isAnalyzerModule = (module2) => {
1198
+ const candidate = module2;
1154
1199
  return typeof candidate?.analyzeClasses === "function" || typeof candidate?.analyzeClassesWorkspace === "function";
1155
1200
  };
1156
1201
  var createAnalyzerBindingLoader = () => {
@@ -1160,7 +1205,7 @@ var createAnalyzerBindingLoader = () => {
1160
1205
  _state.bindingPromise = (async () => {
1161
1206
  const runtimeDir = resolveRuntimeDir(
1162
1207
  typeof __dirname === "string" ? __dirname : void 0,
1163
- (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))
1208
+ __importMetaUrl
1164
1209
  );
1165
1210
  const candidates = resolveNativeBindingCandidates({
1166
1211
  runtimeDir,
@@ -1203,7 +1248,7 @@ async function requireNativeBinding() {
1203
1248
  if (binding?.analyzeClasses) return binding;
1204
1249
  const runtimeDir = resolveRuntimeDir(
1205
1250
  typeof __dirname === "string" ? __dirname : void 0,
1206
- (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('analyzer.js', document.baseURI).href))
1251
+ __importMetaUrl
1207
1252
  );
1208
1253
  const candidates = resolveNativeBindingCandidates({
1209
1254
  runtimeDir,
@@ -1236,6 +1281,7 @@ async function requireNativeCssCompiler() {
1236
1281
 
1237
1282
  // packages/domain/analyzer/src/schemas.ts
1238
1283
  init_src();
1284
+ var import_zod2 = require("zod");
1239
1285
  var formatIssuePath3 = (path8) => path8.length > 0 ? path8.map(
1240
1286
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
1241
1287
  ).join(".") : "<root>";
@@ -1259,76 +1305,76 @@ var parseWithSchema2 = (schema, data, label) => {
1259
1305
  parsed.error
1260
1306
  );
1261
1307
  };
1262
- var CountSchema = zod.z.number().int().min(0);
1263
- zod.z.object({
1264
- name: zod.z.string(),
1308
+ var CountSchema = import_zod2.z.number().int().min(0);
1309
+ var ClassUsageSchema = import_zod2.z.object({
1310
+ name: import_zod2.z.string(),
1265
1311
  count: CountSchema,
1266
- isUnused: zod.z.boolean().optional(),
1267
- isConflict: zod.z.boolean().optional()
1312
+ isUnused: import_zod2.z.boolean().optional(),
1313
+ isConflict: import_zod2.z.boolean().optional()
1268
1314
  });
1269
- zod.z.object({
1270
- className: zod.z.string(),
1271
- variants: zod.z.array(zod.z.string()),
1272
- classes: zod.z.array(zod.z.string()),
1273
- message: zod.z.string()
1315
+ var ClassConflictSchema = import_zod2.z.object({
1316
+ className: import_zod2.z.string(),
1317
+ variants: import_zod2.z.array(import_zod2.z.string()),
1318
+ classes: import_zod2.z.array(import_zod2.z.string()),
1319
+ message: import_zod2.z.string()
1274
1320
  });
1275
- var ClassCountSchema = zod.z.object({
1276
- name: zod.z.string(),
1321
+ var ClassCountSchema = import_zod2.z.object({
1322
+ name: import_zod2.z.string(),
1277
1323
  count: CountSchema
1278
1324
  });
1279
- var NativeReportSchema = zod.z.object({
1280
- root: zod.z.string(),
1325
+ var NativeReportSchema = import_zod2.z.object({
1326
+ root: import_zod2.z.string(),
1281
1327
  totalFiles: CountSchema,
1282
1328
  uniqueClassCount: CountSchema,
1283
1329
  totalClassOccurrences: CountSchema,
1284
- topClasses: zod.z.array(ClassCountSchema),
1285
- duplicateCandidates: zod.z.array(ClassCountSchema),
1286
- safelist: zod.z.array(zod.z.string())
1330
+ topClasses: import_zod2.z.array(ClassCountSchema),
1331
+ duplicateCandidates: import_zod2.z.array(ClassCountSchema),
1332
+ safelist: import_zod2.z.array(import_zod2.z.string())
1287
1333
  });
1288
- var NativeCssCompileResultSchema = zod.z.object({
1289
- css: zod.z.string(),
1290
- resolvedClasses: zod.z.array(zod.z.string()),
1291
- unknownClasses: zod.z.array(zod.z.string()),
1334
+ var NativeCssCompileResultSchema = import_zod2.z.object({
1335
+ css: import_zod2.z.string(),
1336
+ resolvedClasses: import_zod2.z.array(import_zod2.z.string()),
1337
+ unknownClasses: import_zod2.z.array(import_zod2.z.string()),
1292
1338
  sizeBytes: CountSchema
1293
1339
  });
1294
- var AnalyzerClassStatsSchema = zod.z.object({
1295
- top: zod.z.number({
1340
+ var AnalyzerClassStatsSchema = import_zod2.z.object({
1341
+ top: import_zod2.z.number({
1296
1342
  error: "analyzeWorkspace options.classStats.top must be a number when provided."
1297
1343
  }).finite().optional(),
1298
- frequentThreshold: zod.z.number({
1344
+ frequentThreshold: import_zod2.z.number({
1299
1345
  error: "analyzeWorkspace options.classStats.frequentThreshold must be a number when provided."
1300
1346
  }).finite().optional()
1301
1347
  });
1302
- var AnalyzerSemanticOptionsSchema = zod.z.object({
1303
- tailwindConfigPath: zod.z.string({
1348
+ var AnalyzerSemanticOptionsSchema = import_zod2.z.object({
1349
+ tailwindConfigPath: import_zod2.z.string({
1304
1350
  error: "analyzeWorkspace options.semantic.tailwindConfigPath must be a non-empty string when provided."
1305
1351
  }).min(
1306
1352
  1,
1307
1353
  "analyzeWorkspace options.semantic.tailwindConfigPath must be a non-empty string when provided."
1308
1354
  ).optional()
1309
1355
  });
1310
- var AnalyzerOptionsSchema = zod.z.object({
1311
- scanner: zod.z.custom(
1356
+ var AnalyzerOptionsSchema = import_zod2.z.object({
1357
+ scanner: import_zod2.z.custom(
1312
1358
  (value) => isPlainObject(value),
1313
1359
  "analyzeWorkspace options.scanner must be an object when provided."
1314
1360
  ).optional(),
1315
1361
  classStats: AnalyzerClassStatsSchema.optional(),
1316
- semantic: zod.z.union([
1317
- zod.z.boolean({
1362
+ semantic: import_zod2.z.union([
1363
+ import_zod2.z.boolean({
1318
1364
  error: "analyzeWorkspace options.semantic must be a boolean or an object when provided."
1319
1365
  }),
1320
1366
  AnalyzerSemanticOptionsSchema
1321
1367
  ]).optional(),
1322
- includeClass: zod.z.custom(
1368
+ includeClass: import_zod2.z.custom(
1323
1369
  (value) => typeof value === "function",
1324
1370
  "analyzeWorkspace options.includeClass must be a function when provided."
1325
1371
  ).optional()
1326
1372
  });
1327
- var ClassToCssOptionsSchema = zod.z.object({
1328
- prefix: zod.z.union([zod.z.string(), zod.z.null()], {
1373
+ var ClassToCssOptionsSchema = import_zod2.z.object({
1374
+ prefix: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.null()], {
1329
1375
  error: "classToCss options.prefix must be a string or null when provided."
1330
1376
  }).optional(),
1331
- strict: zod.z.boolean({
1377
+ strict: import_zod2.z.boolean({
1332
1378
  error: "classToCss options.strict must be a boolean when provided."
1333
1379
  }).optional()
1334
1380
  });
@@ -1340,6 +1386,11 @@ var parseNativeCssCompileResult = (result, className) => parseWithSchema2(
1340
1386
  className ? `Native CSS compile result is invalid for class "${className}"` : "Native CSS compile result is invalid"
1341
1387
  );
1342
1388
  var parseClassToCssOptions = (options) => parseWithSchema2(ClassToCssOptionsSchema, options ?? {}, "classToCss options are invalid");
1389
+
1390
+ // packages/domain/analyzer/src/semantic.ts
1391
+ var import_node_fs5 = __toESM(require("fs"), 1);
1392
+ var import_node_path6 = __toESM(require("path"), 1);
1393
+ var import_node_url5 = require("url");
1343
1394
  var SUPPORTED_TAILWIND_CONFIG_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".js", ".cjs", ".mjs"]);
1344
1395
  var tailwindConfigCache = /* @__PURE__ */ new Map();
1345
1396
  var splitVariantAndBase = (className) => {
@@ -1373,11 +1424,11 @@ var detectConflicts = async (usages) => {
1373
1424
  };
1374
1425
  };
1375
1426
  var isSupportedTailwindConfigPath = (configPath) => {
1376
- return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(path5__default.default.extname(configPath).toLowerCase());
1427
+ return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(import_node_path6.default.extname(configPath).toLowerCase());
1377
1428
  };
1378
1429
  var resolveTailwindConfigPath = async (root, explicitPath) => {
1379
1430
  if (explicitPath) {
1380
- const resolved = path5__default.default.resolve(root, explicitPath);
1431
+ const resolved = import_node_path6.default.resolve(root, explicitPath);
1381
1432
  if (!await pathExists(resolved)) return null;
1382
1433
  return resolved;
1383
1434
  }
@@ -1388,7 +1439,7 @@ var resolveTailwindConfigPath = async (root, explicitPath) => {
1388
1439
  "tailwind.config.mjs"
1389
1440
  ];
1390
1441
  for (const candidate of candidates) {
1391
- const fullPath = path5__default.default.resolve(root, candidate);
1442
+ const fullPath = import_node_path6.default.resolve(root, candidate);
1392
1443
  if (await pathExists(fullPath)) return fullPath;
1393
1444
  }
1394
1445
  return null;
@@ -1442,7 +1493,7 @@ var collectCustomUtilities = (config) => {
1442
1493
  return out;
1443
1494
  };
1444
1495
  var collectSafelistFromSource = async (configPath) => {
1445
- const source = await fs3__default.default.promises.readFile(configPath, "utf8");
1496
+ const source = await import_node_fs5.default.promises.readFile(configPath, "utf8");
1446
1497
  const { extractClassesNative: extractClassesNative2 } = await Promise.resolve().then(() => (init_src2(), src_exports));
1447
1498
  const allTokens = extractClassesNative2(source);
1448
1499
  const hasSafelist = source.includes("safelist");
@@ -1469,7 +1520,7 @@ var loadTailwindConfig = async (root, semanticOption) => {
1469
1520
  customUtilities: /* @__PURE__ */ new Set()
1470
1521
  };
1471
1522
  }
1472
- const configStat = await fs3__default.default.promises.stat(configPath).catch(() => null);
1523
+ const configStat = await import_node_fs5.default.promises.stat(configPath).catch(() => null);
1473
1524
  if (configStat) {
1474
1525
  const cached = tailwindConfigCache.get(configPath);
1475
1526
  if (cached && cached.mtimeMs === configStat.mtimeMs && cached.size === configStat.size) {
@@ -1482,7 +1533,7 @@ var loadTailwindConfig = async (root, semanticOption) => {
1482
1533
  const result = await (async () => {
1483
1534
  try {
1484
1535
  const cacheBustToken = Math.trunc(configStat?.mtimeMs ?? Date.now());
1485
- const imported = await import(`${url.pathToFileURL(configPath).href}?tws_mtime=${cacheBustToken}`);
1536
+ const imported = await import(`${(0, import_node_url5.pathToFileURL)(configPath).href}?tws_mtime=${cacheBustToken}`);
1486
1537
  const candidate = imported.default ?? imported;
1487
1538
  if (isRecord(candidate)) {
1488
1539
  return { config: candidate, warning: void 0 };
@@ -1647,7 +1698,7 @@ async function buildDistribution(usages, native) {
1647
1698
  }
1648
1699
  async function analyzeWorkspace(root, options = {}) {
1649
1700
  const startedAtMs = Date.now();
1650
- const resolvedRoot = path5__default.default.resolve(root);
1701
+ const resolvedRoot = import_node_path7.default.resolve(root);
1651
1702
  const normalizedOptions = parseAnalyzerOptions(options);
1652
1703
  const scan = await (async () => {
1653
1704
  const scanStartedAtMs = Date.now();
@@ -1869,9 +1920,10 @@ var __internal = {
1869
1920
  parseNativeReport,
1870
1921
  parseNativeCssCompileResult
1871
1922
  };
1872
-
1873
- exports.__internal = __internal;
1874
- exports.analyzeWorkspace = analyzeWorkspace;
1875
- exports.classToCss = classToCss;
1876
- //# sourceMappingURL=analyzer.js.map
1923
+ // Annotate the CommonJS export names for ESM import in node:
1924
+ 0 && (module.exports = {
1925
+ __internal,
1926
+ analyzeWorkspace,
1927
+ classToCss
1928
+ });
1877
1929
  //# sourceMappingURL=analyzer.js.map