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/shared.mjs CHANGED
@@ -1,12 +1,3 @@
1
- import { z } from 'zod';
2
- import { createRequire } from 'module';
3
- import * as fs3 from 'fs';
4
- import fs3__default from 'fs';
5
- import * as path from 'path';
6
- import path__default from 'path';
7
- import { createHash } from 'crypto';
8
- import { fileURLToPath } from 'url';
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;
@@ -127,6 +118,7 @@ function getPipelinePercentages(metrics) {
127
118
  }
128
119
  var init_trace = __esm({
129
120
  "packages/domain/shared/src/trace.ts"() {
121
+ "use strict";
130
122
  }
131
123
  });
132
124
 
@@ -141,6 +133,7 @@ function formatErrorCode(code) {
141
133
  var ERROR_CODES, ERROR_SUGGESTIONS;
142
134
  var init_error_codes = __esm({
143
135
  "packages/domain/shared/src/error-codes.ts"() {
136
+ "use strict";
144
137
  ERROR_CODES = {
145
138
  // E0xx — Native binding
146
139
  NATIVE_NOT_FOUND: "E001",
@@ -207,8 +200,12 @@ function isTailwindV4() {
207
200
  }
208
201
  var init_compatibility = __esm({
209
202
  "packages/domain/shared/src/compatibility.ts"() {
203
+ "use strict";
210
204
  }
211
205
  });
206
+
207
+ // packages/domain/shared/src/native-schemas.ts
208
+ import { z } from "zod";
212
209
  function safeParseNative(schema, data, fallback) {
213
210
  const result = schema.safeParse(data);
214
211
  return result.success ? result.data : fallback;
@@ -224,9 +221,10 @@ function parseNative(schema, data, context) {
224
221
  }
225
222
  return result.data;
226
223
  }
227
- var NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, NativeAnalyzerReportSchema, NativeTransformResultSchema, NativeCssCompileResultSchema, NativeWatchResultSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema;
224
+ var NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, NativeAnalyzerReportSchema, NativeTransformResultSchema, NativeCssCompileResultSchema, NativeWatchEventSchema, NativeWatchResultSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema;
228
225
  var init_native_schemas = __esm({
229
226
  "packages/domain/shared/src/native-schemas.ts"() {
227
+ "use strict";
230
228
  NativeScanFileSchema = z.object({
231
229
  file: z.string().min(1, "file path cannot be empty"),
232
230
  classes: z.array(z.string()),
@@ -266,7 +264,7 @@ var init_native_schemas = __esm({
266
264
  resolvedClasses: z.array(z.string()),
267
265
  unresolvedClasses: z.array(z.string()).optional()
268
266
  });
269
- z.object({
267
+ NativeWatchEventSchema = z.object({
270
268
  type: z.enum(["change", "unlink", "create"]),
271
269
  path: z.string()
272
270
  });
@@ -302,48 +300,78 @@ function getNodeModuleRef() {
302
300
  return null;
303
301
  }
304
302
  }
303
+ function getCurrentFileUrl() {
304
+ if (import.meta.url) {
305
+ return import.meta.url;
306
+ }
307
+ if (typeof __filename !== "undefined") {
308
+ return `file://${__filename.replace(/\\/g, "/")}`;
309
+ }
310
+ return "file://unknown";
311
+ }
305
312
  function getNodePath() {
306
313
  if (isBrowser) throw new Error("node:path not available in browser");
307
- const nodeRequire = getNodeModuleRef();
308
- if (!nodeRequire) throw new Error("require not available");
309
- if (!_nodePath) _nodePath = nodeRequire.createRequire(import.meta.url)("node:path");
314
+ if (!_nodePath) {
315
+ if (typeof __require === "function") {
316
+ _nodePath = __require("path");
317
+ } else {
318
+ const nodeRequire = getNodeModuleRef();
319
+ if (!nodeRequire) throw new Error("require not available");
320
+ _nodePath = nodeRequire.createRequire(getCurrentFileUrl())("node:path");
321
+ }
322
+ }
310
323
  return _nodePath;
311
324
  }
312
325
  function getNodeUrl() {
313
326
  if (isBrowser) throw new Error("node:url not available in browser");
314
- const nodeRequire = getNodeModuleRef();
315
- if (!nodeRequire) throw new Error("require not available");
316
- if (!_nodeUrl) _nodeUrl = nodeRequire.createRequire(import.meta.url)("node:url");
327
+ if (!_nodeUrl) {
328
+ if (typeof __require === "function") {
329
+ _nodeUrl = __require("url");
330
+ } else {
331
+ const nodeRequire = getNodeModuleRef();
332
+ if (!nodeRequire) throw new Error("require not available");
333
+ _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())("node:url");
334
+ }
335
+ }
317
336
  return _nodeUrl;
318
337
  }
319
338
  function getNodeFs() {
320
339
  if (isBrowser) throw new Error("node:fs not available in browser");
321
- const nodeRequire = getNodeModuleRef();
322
- if (!nodeRequire) throw new Error("require not available");
323
- if (!_nodeFs) _nodeFs = nodeRequire.createRequire(import.meta.url)("node:fs");
340
+ if (!_nodeFs) {
341
+ if (typeof __require === "function") {
342
+ _nodeFs = __require("fs");
343
+ } else {
344
+ const nodeRequire = getNodeModuleRef();
345
+ if (!nodeRequire) throw new Error("require not available");
346
+ _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())("node:fs");
347
+ }
348
+ }
324
349
  return _nodeFs;
325
350
  }
326
351
  function createEsmRequire(importMetaUrl) {
327
352
  if (isBrowser) throw new Error("require not available in browser");
353
+ if (typeof __require === "function") return __require;
328
354
  const nodeRequire = getNodeModuleRef();
329
355
  if (!nodeRequire) throw new Error("require not available");
330
356
  return nodeRequire.createRequire(importMetaUrl);
331
357
  }
332
358
  function getDirname(importMetaUrl) {
333
359
  if (isBrowser) return "";
360
+ if (typeof __dirname !== "undefined") return __dirname;
334
361
  const nodePath = getNodePath();
335
362
  const nodeUrl = getNodeUrl();
336
363
  return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
337
364
  }
338
365
  function getFilename(importMetaUrl) {
339
366
  if (isBrowser) return "";
367
+ if (typeof __filename !== "undefined") return __filename;
340
368
  return getNodeUrl().fileURLToPath(importMetaUrl);
341
369
  }
342
370
  function resolveFromRoot(...segments) {
343
371
  if (isBrowser) return segments.join("/");
344
372
  const nodePath = getNodePath();
345
373
  const nodeFs = getNodeFs();
346
- let dir = getDirname(import.meta.url);
374
+ let dir = typeof __dirname !== "undefined" ? __dirname : getDirname(getCurrentFileUrl());
347
375
  for (let i = 0; i < 10; i++) {
348
376
  const pkgPath = nodePath.join(dir, "package.json");
349
377
  try {
@@ -372,6 +400,7 @@ function resolveNativeNodePath(importMetaUrl, ...relativeSegments) {
372
400
  var isBrowser, nodeModuleRef, _nodePath, _nodeUrl, _nodeFs;
373
401
  var init_esmHelpers = __esm({
374
402
  "packages/domain/shared/src/esmHelpers.ts"() {
403
+ "use strict";
375
404
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
376
405
  nodeModuleRef = null;
377
406
  _nodePath = null;
@@ -422,6 +451,7 @@ function createBuildTimer() {
422
451
  var RING_BUFFER_SIZE, TelemetryCollector, _globalCollector;
423
452
  var init_telemetry = __esm({
424
453
  "packages/domain/shared/src/telemetry.ts"() {
454
+ "use strict";
425
455
  RING_BUFFER_SIZE = 100;
426
456
  TelemetryCollector = class {
427
457
  data = [];
@@ -488,6 +518,9 @@ var init_telemetry = __esm({
488
518
  _globalCollector = null;
489
519
  }
490
520
  });
521
+
522
+ // packages/domain/shared/src/configSchemas.ts
523
+ import { z as z2 } from "zod";
491
524
  function parseJsonWithSchema(jsonString, schema, sourceName) {
492
525
  let parsed;
493
526
  try {
@@ -521,67 +554,68 @@ function parseJsonFileWithSchema(filePath, schema) {
521
554
  var ScanCacheClassEntrySchema, ScanCacheSchema, TailwindContentItemSchema, TailwindConfigSchema, RegistryPluginEntrySchema, RegistryFileSchema, PackageJsonSchema;
522
555
  var init_configSchemas = __esm({
523
556
  "packages/domain/shared/src/configSchemas.ts"() {
524
- ScanCacheClassEntrySchema = z.object({
525
- name: z.string().min(1),
526
- usedIn: z.array(z.string()),
527
- risk: z.enum(["low", "medium", "high"]).default("low"),
528
- bundleContribution: z.number().nonnegative().default(0),
529
- variants: z.array(z.string()).default([])
557
+ "use strict";
558
+ ScanCacheClassEntrySchema = z2.object({
559
+ name: z2.string().min(1),
560
+ usedIn: z2.array(z2.string()),
561
+ risk: z2.enum(["low", "medium", "high"]).default("low"),
562
+ bundleContribution: z2.number().nonnegative().default(0),
563
+ variants: z2.array(z2.string()).default([])
530
564
  });
531
- ScanCacheSchema = z.object({
532
- version: z.string().default("1"),
533
- generatedAt: z.string(),
534
- root: z.string(),
535
- classNames: z.array(ScanCacheClassEntrySchema),
536
- totalFiles: z.number().int().nonnegative(),
537
- uniqueCount: z.number().int().nonnegative()
565
+ ScanCacheSchema = z2.object({
566
+ version: z2.string().default("1"),
567
+ generatedAt: z2.string(),
568
+ root: z2.string(),
569
+ classNames: z2.array(ScanCacheClassEntrySchema),
570
+ totalFiles: z2.number().int().nonnegative(),
571
+ uniqueCount: z2.number().int().nonnegative()
538
572
  });
539
- TailwindContentItemSchema = z.union([
540
- z.string(),
541
- z.object({
542
- raw: z.string(),
543
- extension: z.string().optional()
573
+ TailwindContentItemSchema = z2.union([
574
+ z2.string(),
575
+ z2.object({
576
+ raw: z2.string(),
577
+ extension: z2.string().optional()
544
578
  }),
545
- z.object({
546
- files: z.array(z.string()),
547
- transform: z.record(z.string(), z.unknown()).optional()
579
+ z2.object({
580
+ files: z2.array(z2.string()),
581
+ transform: z2.record(z2.string(), z2.unknown()).optional()
548
582
  })
549
583
  ]);
550
- TailwindConfigSchema = z.object({
551
- content: z.array(TailwindContentItemSchema).optional(),
552
- theme: z.record(z.string(), z.unknown()).optional(),
553
- plugins: z.array(z.unknown()).optional(),
554
- darkMode: z.union([z.literal("class"), z.literal("media"), z.literal(false)]).optional(),
555
- prefix: z.string().optional(),
556
- safelist: z.array(z.union([z.string(), z.object({ pattern: z.instanceof(RegExp) })])).optional(),
557
- blocklist: z.array(z.string()).optional()
584
+ TailwindConfigSchema = z2.object({
585
+ content: z2.array(TailwindContentItemSchema).optional(),
586
+ theme: z2.record(z2.string(), z2.unknown()).optional(),
587
+ plugins: z2.array(z2.unknown()).optional(),
588
+ darkMode: z2.union([z2.literal("class"), z2.literal("media"), z2.literal(false)]).optional(),
589
+ prefix: z2.string().optional(),
590
+ safelist: z2.array(z2.union([z2.string(), z2.object({ pattern: z2.instanceof(RegExp) })])).optional(),
591
+ blocklist: z2.array(z2.string()).optional()
558
592
  }).passthrough();
559
- RegistryPluginEntrySchema = z.object({
560
- name: z.string().min(1),
561
- description: z.string(),
562
- version: z.string(),
563
- tags: z.array(z.string()).default([]),
564
- official: z.boolean().default(false),
565
- docs: z.string().url().optional(),
566
- install: z.string().optional(),
567
- integrity: z.string().optional()
593
+ RegistryPluginEntrySchema = z2.object({
594
+ name: z2.string().min(1),
595
+ description: z2.string(),
596
+ version: z2.string(),
597
+ tags: z2.array(z2.string()).default([]),
598
+ official: z2.boolean().default(false),
599
+ docs: z2.string().url().optional(),
600
+ install: z2.string().optional(),
601
+ integrity: z2.string().optional()
568
602
  });
569
- RegistryFileSchema = z.object({
570
- version: z.string(),
571
- official: z.array(RegistryPluginEntrySchema).default([]),
572
- community: z.array(RegistryPluginEntrySchema).default([])
603
+ RegistryFileSchema = z2.object({
604
+ version: z2.string(),
605
+ official: z2.array(RegistryPluginEntrySchema).default([]),
606
+ community: z2.array(RegistryPluginEntrySchema).default([])
573
607
  });
574
- PackageJsonSchema = z.object({
575
- name: z.string(),
576
- version: z.string(),
577
- scripts: z.record(z.string(), z.string()).optional(),
578
- dependencies: z.record(z.string(), z.string()).optional(),
579
- devDependencies: z.record(z.string(), z.string()).optional(),
580
- peerDependencies: z.record(z.string(), z.string()).optional(),
581
- main: z.string().optional(),
582
- module: z.string().optional(),
583
- exports: z.unknown().optional(),
584
- type: z.enum(["module", "commonjs"]).optional()
608
+ PackageJsonSchema = z2.object({
609
+ name: z2.string(),
610
+ version: z2.string(),
611
+ scripts: z2.record(z2.string(), z2.string()).optional(),
612
+ dependencies: z2.record(z2.string(), z2.string()).optional(),
613
+ devDependencies: z2.record(z2.string(), z2.string()).optional(),
614
+ peerDependencies: z2.record(z2.string(), z2.string()).optional(),
615
+ main: z2.string().optional(),
616
+ module: z2.string().optional(),
617
+ exports: z2.unknown().optional(),
618
+ type: z2.enum(["module", "commonjs"]).optional()
585
619
  }).passthrough();
586
620
  }
587
621
  });
@@ -669,6 +703,7 @@ function resolveLoaderPath(loaderBasename, importMetaUrl) {
669
703
  var isBrowser2, NODE_URL, NODE_FS, NODE_PATH;
670
704
  var init_workerResolver = __esm({
671
705
  "packages/domain/shared/src/workerResolver.ts"() {
706
+ "use strict";
672
707
  isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
673
708
  NODE_URL = typeof window === "undefined" || typeof document === "undefined" ? "node:url" : null;
674
709
  NODE_FS = typeof window === "undefined" || typeof document === "undefined" ? "node:fs" : null;
@@ -818,13 +853,13 @@ function generateClassRenameCodemod(renames, opts = {}) {
818
853
  }
819
854
  return lines.join("\n");
820
855
  }
821
- function generateBarrelFile(exports$1, dir, opts = {}) {
856
+ function generateBarrelFile(exports, dir, opts = {}) {
822
857
  const { includeTypes = true } = opts;
823
858
  const lines = [];
824
859
  lines.push(`// Auto-generated barrel file for ${dir}`);
825
860
  lines.push(`// Run: npx tsx scripts/generate-barrel.ts to regenerate`);
826
861
  lines.push(``);
827
- for (const name of exports$1) {
862
+ for (const name of exports) {
828
863
  lines.push(`export { default as ${name}, type ${name}Props } from "./${name}"`);
829
864
  if (includeTypes) {
830
865
  lines.push(`export type * from "./${name}"`);
@@ -834,8 +869,14 @@ function generateBarrelFile(exports$1, dir, opts = {}) {
834
869
  }
835
870
  var init_codegen = __esm({
836
871
  "packages/domain/shared/src/codegen.ts"() {
872
+ "use strict";
837
873
  }
838
874
  });
875
+
876
+ // packages/domain/shared/src/native-resolution.ts
877
+ import { createRequire } from "module";
878
+ import * as fs from "fs";
879
+ import * as path from "path";
839
880
  function platformKey() {
840
881
  if (isBrowser3) return "browser";
841
882
  return `${process.platform}-${process.arch}`;
@@ -851,7 +892,7 @@ function resolveNativeBinary(runtimeDir) {
851
892
  }
852
893
  const envPath = process.env.TW_NATIVE_PATH?.trim();
853
894
  if (envPath) {
854
- if (fs3.existsSync(envPath)) {
895
+ if (fs.existsSync(envPath)) {
855
896
  return { path: envPath, source: "env", platform, tried };
856
897
  }
857
898
  tried.push(`env:${envPath} (not found)`);
@@ -860,7 +901,7 @@ function resolveNativeBinary(runtimeDir) {
860
901
  for (const pkg of prebuiltPkgs) {
861
902
  try {
862
903
  const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
863
- if (fs3.existsSync(candidate)) {
904
+ if (fs.existsSync(candidate)) {
864
905
  return { path: candidate, source: "prebuilt", platform, tried };
865
906
  }
866
907
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -877,7 +918,7 @@ function resolveNativeBinary(runtimeDir) {
877
918
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
878
919
  const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
879
920
  tried.push(`self-bundled:${candidate}`);
880
- if (fs3.existsSync(candidate)) {
921
+ if (fs.existsSync(candidate)) {
881
922
  return { path: candidate, source: "prebuilt", platform, tried };
882
923
  }
883
924
  }
@@ -911,7 +952,7 @@ function resolveNativeBinary(runtimeDir) {
911
952
  }
912
953
  for (const candidate of localCandidates) {
913
954
  tried.push(`local:${candidate}`);
914
- if (fs3.existsSync(candidate)) {
955
+ if (fs.existsSync(candidate)) {
915
956
  return { path: candidate, source: "local", platform, tried };
916
957
  }
917
958
  }
@@ -934,8 +975,11 @@ function formatNativeNotFoundError(result) {
934
975
  var isBrowser3, _require, PLATFORM_MAP;
935
976
  var init_native_resolution = __esm({
936
977
  "packages/domain/shared/src/native-resolution.ts"() {
978
+ "use strict";
937
979
  isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
938
- _require = typeof __require !== "undefined" ? __require : createRequire(import.meta.url);
980
+ _require = createRequire(
981
+ typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
982
+ );
939
983
  PLATFORM_MAP = {
940
984
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
941
985
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -981,6 +1025,7 @@ function createObservabilityClient(opts = {}) {
981
1025
  }
982
1026
  var init_observability = __esm({
983
1027
  "packages/domain/shared/src/observability.ts"() {
1028
+ "use strict";
984
1029
  }
985
1030
  });
986
1031
 
@@ -988,6 +1033,7 @@ var init_observability = __esm({
988
1033
  var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
989
1034
  var init_nativeBridge = __esm({
990
1035
  "packages/domain/compiler/src/nativeBridge.ts"() {
1036
+ "use strict";
991
1037
  init_src2();
992
1038
  _loadNative = (path6) => __require(path6);
993
1039
  log = (...args) => {
@@ -1127,6 +1173,7 @@ function resetCacheStats() {
1127
1173
  }
1128
1174
  var init_cssGeneratorNative = __esm({
1129
1175
  "packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
1176
+ "use strict";
1130
1177
  init_nativeBridge();
1131
1178
  }
1132
1179
  });
@@ -1199,6 +1246,7 @@ function atomicRegistrySize() {
1199
1246
  }
1200
1247
  var init_compilationNative = __esm({
1201
1248
  "packages/domain/compiler/src/compiler/compilationNative.ts"() {
1249
+ "use strict";
1202
1250
  init_nativeBridge();
1203
1251
  }
1204
1252
  });
@@ -1342,6 +1390,7 @@ function twMergeRaw(classLists) {
1342
1390
  }
1343
1391
  var init_cssCompilationNative = __esm({
1344
1392
  "packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
1393
+ "use strict";
1345
1394
  init_nativeBridge();
1346
1395
  }
1347
1396
  });
@@ -1441,6 +1490,7 @@ function idRegistryImport(importedData) {
1441
1490
  }
1442
1491
  var init_idRegistryNative = __esm({
1443
1492
  "packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
1493
+ "use strict";
1444
1494
  init_nativeBridge();
1445
1495
  }
1446
1496
  });
@@ -1582,9 +1632,13 @@ function scanFilesBatchNative(filesJson) {
1582
1632
  }
1583
1633
  var init_streamingNative = __esm({
1584
1634
  "packages/domain/compiler/src/compiler/streamingNative.ts"() {
1635
+ "use strict";
1585
1636
  init_nativeBridge();
1586
1637
  }
1587
1638
  });
1639
+
1640
+ // packages/domain/compiler/src/tailwindEngine.ts
1641
+ import { createRequire as createRequire2 } from "module";
1588
1642
  function loadTailwindEngine() {
1589
1643
  if (_twEngine) return _twEngine;
1590
1644
  if (_twEngineError) throw _twEngineError;
@@ -1604,10 +1658,10 @@ async function generateRawCss(classes, cssEntryContent, root) {
1604
1658
  if (classes.length === 0) return "";
1605
1659
  const tw = loadTailwindEngine();
1606
1660
  const input = cssEntryContent ?? "@import 'tailwindcss';";
1607
- const { readFileSync, existsSync: existsSync3 } = await import('fs');
1608
- const { dirname, resolve: resolve2 } = await import('path');
1661
+ const { readFileSync, existsSync: existsSync3 } = await import("fs");
1662
+ const { dirname, resolve: resolve2 } = await import("path");
1609
1663
  const projectRoot = root ?? process.cwd();
1610
- const req = createRequire(resolve2(projectRoot, "package.json"));
1664
+ const req = createRequire2(resolve2(projectRoot, "package.json"));
1611
1665
  const loadStylesheet = async (id, base) => {
1612
1666
  try {
1613
1667
  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;
@@ -1627,10 +1681,14 @@ async function generateRawCss(classes, cssEntryContent, root) {
1627
1681
  const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
1628
1682
  return compiler.build(classes);
1629
1683
  }
1630
- var require2, _twEngine, _twEngineError;
1684
+ var require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
1631
1685
  var init_tailwindEngine = __esm({
1632
1686
  "packages/domain/compiler/src/tailwindEngine.ts"() {
1633
- require2 = createRequire(import.meta.url);
1687
+ "use strict";
1688
+ require2 = createRequire2(
1689
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
1690
+ );
1691
+ MAX_CACHE_MEMORY = 256 * 1024;
1634
1692
  _twEngine = null;
1635
1693
  _twEngineError = null;
1636
1694
  }
@@ -1645,6 +1703,7 @@ __export(tailwindEngine_exports, {
1645
1703
  runCssPipeline: () => runCssPipeline,
1646
1704
  runCssPipelineSync: () => runCssPipelineSync
1647
1705
  });
1706
+ import { createRequire as createRequire3 } from "module";
1648
1707
  function _getCacheKey(classes, minify, cssEntry, root) {
1649
1708
  const sorted = [...classes].sort().join(",");
1650
1709
  const flags = `${minify ? "1" : "0"}${cssEntry ? "1" : "0"}${root ? "1" : "0"}`;
@@ -1811,24 +1870,29 @@ function processTailwindCssWithTargets(css, targets) {
1811
1870
  }
1812
1871
  return result.css;
1813
1872
  }
1814
- var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
1873
+ var require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
1815
1874
  var init_tailwindEngine2 = __esm({
1816
1875
  "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
1876
+ "use strict";
1817
1877
  init_nativeBridge();
1818
1878
  init_cssGeneratorNative();
1819
1879
  init_cssCompilationNative();
1820
1880
  init_tailwindEngine();
1821
- createRequire(import.meta.url);
1881
+ require3 = createRequire3(
1882
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
1883
+ );
1822
1884
  _cssCache = /* @__PURE__ */ new Map();
1823
1885
  _cacheHits = 0;
1824
1886
  _cacheMisses = 0;
1825
1887
  MAX_CACHE_SIZE = 100;
1888
+ MAX_CACHE_MEMORY2 = 256 * 1024;
1826
1889
  }
1827
1890
  });
1828
1891
 
1829
1892
  // packages/domain/compiler/src/compiler/index.ts
1830
1893
  var init_compiler = __esm({
1831
1894
  "packages/domain/compiler/src/compiler/index.ts"() {
1895
+ "use strict";
1832
1896
  init_cssGeneratorNative();
1833
1897
  init_compilationNative();
1834
1898
  init_cssCompilationNative();
@@ -1841,6 +1905,7 @@ var init_compiler = __esm({
1841
1905
  var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
1842
1906
  var init_parser = __esm({
1843
1907
  "packages/domain/compiler/src/parser/index.ts"() {
1908
+ "use strict";
1844
1909
  init_nativeBridge();
1845
1910
  parseClasses = (raw) => {
1846
1911
  const native = getNativeBridge();
@@ -2019,6 +2084,7 @@ function resetMemoryStats() {
2019
2084
  }
2020
2085
  var init_analyzerNative = __esm({
2021
2086
  "packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
2087
+ "use strict";
2022
2088
  init_nativeBridge();
2023
2089
  }
2024
2090
  });
@@ -2112,6 +2178,7 @@ function resolveSimpleVariants(configJson) {
2112
2178
  }
2113
2179
  var init_themeResolutionNative = __esm({
2114
2180
  "packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
2181
+ "use strict";
2115
2182
  init_nativeBridge();
2116
2183
  }
2117
2184
  });
@@ -2159,6 +2226,7 @@ function generateSubComponentTypes(root, outputPath) {
2159
2226
  }
2160
2227
  var init_scannerNative = __esm({
2161
2228
  "packages/domain/compiler/src/analyzer/scannerNative.ts"() {
2229
+ "use strict";
2162
2230
  init_nativeBridge();
2163
2231
  }
2164
2232
  });
@@ -2166,6 +2234,7 @@ var init_scannerNative = __esm({
2166
2234
  // packages/domain/compiler/src/analyzer/index.ts
2167
2235
  var init_analyzer = __esm({
2168
2236
  "packages/domain/compiler/src/analyzer/index.ts"() {
2237
+ "use strict";
2169
2238
  init_analyzerNative();
2170
2239
  init_themeResolutionNative();
2171
2240
  init_scannerNative();
@@ -2354,6 +2423,7 @@ function resetResolverPoolStats() {
2354
2423
  }
2355
2424
  var init_cacheNative = __esm({
2356
2425
  "packages/domain/compiler/src/cache/cacheNative.ts"() {
2426
+ "use strict";
2357
2427
  init_nativeBridge();
2358
2428
  }
2359
2429
  });
@@ -2361,6 +2431,7 @@ var init_cacheNative = __esm({
2361
2431
  // packages/domain/compiler/src/cache/index.ts
2362
2432
  var init_cache = __esm({
2363
2433
  "packages/domain/compiler/src/cache/index.ts"() {
2434
+ "use strict";
2364
2435
  init_cacheNative();
2365
2436
  }
2366
2437
  });
@@ -2609,6 +2680,7 @@ function redisDiagnose() {
2609
2680
  }
2610
2681
  var init_redisNative = __esm({
2611
2682
  "packages/domain/compiler/src/redis/redisNative.ts"() {
2683
+ "use strict";
2612
2684
  init_nativeBridge();
2613
2685
  }
2614
2686
  });
@@ -2616,6 +2688,7 @@ var init_redisNative = __esm({
2616
2688
  // packages/domain/compiler/src/redis/index.ts
2617
2689
  var init_redis = __esm({
2618
2690
  "packages/domain/compiler/src/redis/index.ts"() {
2691
+ "use strict";
2619
2692
  init_redisNative();
2620
2693
  }
2621
2694
  });
@@ -2754,6 +2827,7 @@ function getCompilerDiagnostics() {
2754
2827
  }
2755
2828
  var init_watchSystemNative = __esm({
2756
2829
  "packages/domain/compiler/src/watch/watchSystemNative.ts"() {
2830
+ "use strict";
2757
2831
  init_nativeBridge();
2758
2832
  }
2759
2833
  });
@@ -2761,9 +2835,15 @@ var init_watchSystemNative = __esm({
2761
2835
  // packages/domain/compiler/src/watch/index.ts
2762
2836
  var init_watch = __esm({
2763
2837
  "packages/domain/compiler/src/watch/index.ts"() {
2838
+ "use strict";
2764
2839
  init_watchSystemNative();
2765
2840
  }
2766
2841
  });
2842
+
2843
+ // packages/domain/compiler/src/index.ts
2844
+ import fs2 from "fs";
2845
+ import path2 from "path";
2846
+ import { createRequire as createRequire4 } from "module";
2767
2847
  function _layoutClassesToCss(classes) {
2768
2848
  const native = getNativeBridge();
2769
2849
  if (!native?.layoutClassesToCss) {
@@ -2801,6 +2881,7 @@ function extractContainerCssFromSource(source) {
2801
2881
  var _require2, 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;
2802
2882
  var init_src = __esm({
2803
2883
  "packages/domain/compiler/src/index.ts"() {
2884
+ "use strict";
2804
2885
  init_nativeBridge();
2805
2886
  init_compiler();
2806
2887
  init_parser();
@@ -2808,7 +2889,9 @@ var init_src = __esm({
2808
2889
  init_cache();
2809
2890
  init_redis();
2810
2891
  init_watch();
2811
- _require2 = createRequire(import.meta.url);
2892
+ _require2 = createRequire4(
2893
+ typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
2894
+ );
2812
2895
  transformSource = (source, opts) => {
2813
2896
  const native = getNativeBridge();
2814
2897
  if (!native?.transformSource) {
@@ -2900,7 +2983,7 @@ var init_src = __esm({
2900
2983
  };
2901
2984
  scanProjectUsage = (dirs, cwd) => {
2902
2985
  const { batchExtractClasses: batchExtractClasses2 } = _require2("./parser");
2903
- const files = dirs.map((dir) => path__default.resolve(cwd, dir));
2986
+ const files = dirs.map((dir) => path2.resolve(cwd, dir));
2904
2987
  const results = batchExtractClasses2(files) || [];
2905
2988
  const combined = {};
2906
2989
  for (const result of results) {
@@ -2917,13 +3000,13 @@ var init_src = __esm({
2917
3000
  const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
2918
3001
  const allClasses = Object.keys(classes).sort();
2919
3002
  if (outputPath) {
2920
- fs3__default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
3003
+ fs2.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
2921
3004
  }
2922
3005
  return allClasses;
2923
3006
  };
2924
3007
  loadSafelist = (safelistPath) => {
2925
3008
  try {
2926
- const content = fs3__default.readFileSync(safelistPath, "utf-8");
3009
+ const content = fs2.readFileSync(safelistPath, "utf-8");
2927
3010
  return JSON.parse(content);
2928
3011
  } catch {
2929
3012
  return [];
@@ -2937,8 +3020,8 @@ var init_src = __esm({
2937
3020
  "tailwind.config.cjs"
2938
3021
  ];
2939
3022
  for (const file of configFiles) {
2940
- const fullPath = path__default.join(cwd, file);
2941
- if (fs3__default.existsSync(fullPath)) {
3023
+ const fullPath = path2.join(cwd, file);
3024
+ if (fs2.existsSync(fullPath)) {
2942
3025
  const mod = __require(fullPath);
2943
3026
  return mod.default || mod;
2944
3027
  }
@@ -2948,9 +3031,9 @@ var init_src = __esm({
2948
3031
  getContentPaths = (cwd = process.cwd()) => {
2949
3032
  return {
2950
3033
  content: [
2951
- path__default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2952
- path__default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2953
- path__default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
3034
+ path2.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
3035
+ path2.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
3036
+ path2.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2954
3037
  ]
2955
3038
  };
2956
3039
  };
@@ -3364,6 +3447,7 @@ __export(internal_exports, {
3364
3447
  });
3365
3448
  var init_internal = __esm({
3366
3449
  "packages/domain/compiler/src/internal.ts"() {
3450
+ "use strict";
3367
3451
  init_src();
3368
3452
  init_tailwindEngine2();
3369
3453
  init_compiler();
@@ -3374,6 +3458,10 @@ var init_internal = __esm({
3374
3458
  init_watch();
3375
3459
  }
3376
3460
  });
3461
+
3462
+ // packages/domain/shared/src/staticStateExtractor.ts
3463
+ import fs3 from "fs";
3464
+ import path3 from "path";
3377
3465
  function getNative() {
3378
3466
  if (_native) return _native;
3379
3467
  try {
@@ -3403,17 +3491,17 @@ function getNative() {
3403
3491
  function* walkSourceFiles(dir) {
3404
3492
  let entries;
3405
3493
  try {
3406
- entries = fs3__default.readdirSync(dir, { withFileTypes: true });
3494
+ entries = fs3.readdirSync(dir, { withFileTypes: true });
3407
3495
  } catch {
3408
3496
  return;
3409
3497
  }
3410
3498
  for (const entry of entries) {
3411
- const fullPath = path__default.join(dir, entry.name);
3499
+ const fullPath = path3.join(dir, entry.name);
3412
3500
  if (entry.isDirectory()) {
3413
3501
  if (IGNORE_PATTERNS.some((p) => entry.name === p || entry.name.startsWith(p))) continue;
3414
3502
  yield* walkSourceFiles(fullPath);
3415
3503
  } else if (entry.isFile()) {
3416
- const ext = path__default.extname(entry.name);
3504
+ const ext = path3.extname(entry.name);
3417
3505
  if (SOURCE_EXTENSIONS.has(ext)) yield fullPath;
3418
3506
  }
3419
3507
  }
@@ -3477,7 +3565,7 @@ function extractStaticStateCss(srcDir, options = {}) {
3477
3565
  allConfigs.push(...configs);
3478
3566
  if (verbose) {
3479
3567
  process.stderr.write(
3480
- `[tw:static-state] ${path__default.relative(srcDir, filePath)}: ${configs.length} komponen
3568
+ `[tw:static-state] ${path3.relative(srcDir, filePath)}: ${configs.length} komponen
3481
3569
  `
3482
3570
  );
3483
3571
  }
@@ -3488,7 +3576,7 @@ function extractStaticStateCss(srcDir, options = {}) {
3488
3576
  if (filesScanned >= maxFiles) break;
3489
3577
  let source;
3490
3578
  try {
3491
- source = fs3__default.readFileSync(filePath, "utf-8");
3579
+ source = fs3.readFileSync(filePath, "utf-8");
3492
3580
  } catch {
3493
3581
  continue;
3494
3582
  }
@@ -3501,7 +3589,7 @@ function extractStaticStateCss(srcDir, options = {}) {
3501
3589
  allConfigs.push(...configs);
3502
3590
  if (verbose) {
3503
3591
  process.stderr.write(
3504
- `[tw:static-state] ${path__default.relative(srcDir, filePath)}: ${configs.length} komponen
3592
+ `[tw:static-state] ${path3.relative(srcDir, filePath)}: ${configs.length} komponen
3505
3593
  `
3506
3594
  );
3507
3595
  }
@@ -3595,12 +3683,12 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
3595
3683
  resolvedCss: options.resolvedCss || ""
3596
3684
  // ← ensure always passed
3597
3685
  });
3598
- const twClassesDir = path__default.join(path__default.dirname(safelistPath), "tw-classes");
3599
- fs3__default.mkdirSync(twClassesDir, { recursive: true });
3600
- const stateFilePath = path__default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
3686
+ const twClassesDir = path3.join(path3.dirname(safelistPath), "tw-classes");
3687
+ fs3.mkdirSync(twClassesDir, { recursive: true });
3688
+ const stateFilePath = path3.join(twClassesDir, TW_STATE_STATIC_FILENAME);
3601
3689
  if (result.rulesGenerated === 0) {
3602
3690
  try {
3603
- fs3__default.writeFileSync(
3691
+ fs3.writeFileSync(
3604
3692
  stateFilePath,
3605
3693
  "/* tw-state-static.css \u2014 tidak ada state rules yang di-generate */\n",
3606
3694
  "utf-8"
@@ -3610,7 +3698,7 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
3610
3698
  return `[tw:static-state] tidak ada state rules yang di-generate (${result.filesScanned} files di-scan)`;
3611
3699
  }
3612
3700
  try {
3613
- fs3__default.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
3701
+ fs3.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
3614
3702
  return [
3615
3703
  `[tw:static-state] ${result.rulesGenerated} static state rules di-generate`,
3616
3704
  ` \u2192 ${result.filesScanned} files scanned, ${result.filesWithStates} dengan states`,
@@ -3625,12 +3713,17 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
3625
3713
  var SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
3626
3714
  var init_staticStateExtractor = __esm({
3627
3715
  "packages/domain/shared/src/staticStateExtractor.ts"() {
3716
+ "use strict";
3628
3717
  SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs"]);
3629
3718
  IGNORE_PATTERNS = ["node_modules", ".next", "dist", "build", ".git", "coverage", "__tests__"];
3630
3719
  _native = null;
3631
3720
  TW_STATE_STATIC_FILENAME = "_tw-state-static.css";
3632
3721
  }
3633
3722
  });
3723
+
3724
+ // packages/domain/shared/src/logger.ts
3725
+ import fs4 from "fs";
3726
+ import path4 from "path";
3634
3727
  function getEnvLevel() {
3635
3728
  const env = process.env.TWS_LOG_LEVEL?.toLowerCase();
3636
3729
  if (env && env in LEVELS) return env;
@@ -3640,8 +3733,8 @@ function setGlobalLogFile(filePath) {
3640
3733
  _globalLogFile = filePath;
3641
3734
  _logFileInitialized = false;
3642
3735
  try {
3643
- fs3__default.mkdirSync(path__default.dirname(filePath), { recursive: true });
3644
- fs3__default.writeFileSync(
3736
+ fs4.mkdirSync(path4.dirname(filePath), { recursive: true });
3737
+ fs4.writeFileSync(
3645
3738
  filePath,
3646
3739
  `# tailwind-styled build log \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}
3647
3740
  `,
@@ -3654,13 +3747,13 @@ function setGlobalLogFile(filePath) {
3654
3747
  function writeToFile(line) {
3655
3748
  if (!_globalLogFile || !_logFileInitialized) return;
3656
3749
  try {
3657
- fs3__default.appendFileSync(_globalLogFile, line);
3750
+ fs4.appendFileSync(_globalLogFile, line);
3658
3751
  } catch {
3659
3752
  }
3660
3753
  }
3661
3754
  function createLogger(prefix, level) {
3662
3755
  const loggerState = {
3663
- currentLevel: getEnvLevel(),
3756
+ currentLevel: level ?? getEnvLevel(),
3664
3757
  setLevel(l) {
3665
3758
  this.currentLevel = l;
3666
3759
  }
@@ -3681,15 +3774,23 @@ function createLogger(prefix, level) {
3681
3774
  setLogFile: (filePath) => setGlobalLogFile(filePath)
3682
3775
  };
3683
3776
  }
3684
- var LEVELS, _globalLogFile, _logFileInitialized;
3777
+ var LEVELS, _globalLogFile, _logFileInitialized, logger;
3685
3778
  var init_logger = __esm({
3686
3779
  "packages/domain/shared/src/logger.ts"() {
3780
+ "use strict";
3687
3781
  LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 };
3688
3782
  _globalLogFile = null;
3689
3783
  _logFileInitialized = false;
3690
- createLogger("tailwind-styled");
3784
+ logger = createLogger("tailwind-styled");
3691
3785
  }
3692
3786
  });
3787
+
3788
+ // packages/domain/shared/src/index.ts
3789
+ import { createHash } from "crypto";
3790
+ import fs5 from "fs";
3791
+ import path5 from "path";
3792
+ import { fileURLToPath } from "url";
3793
+ import { createRequire as createRequire5 } from "module";
3693
3794
  function createLogger2(namespace) {
3694
3795
  const prefix = `[${namespace}]`;
3695
3796
  return {
@@ -3735,9 +3836,9 @@ function loadNativeBinding(options) {
3735
3836
  const { runtimeDir, candidates, isValid } = options;
3736
3837
  const loadErrors = [];
3737
3838
  for (const candidate of candidates) {
3738
- const candidatePath = path__default.resolve(runtimeDir, candidate);
3839
+ const candidatePath = path5.resolve(runtimeDir, candidate);
3739
3840
  try {
3740
- if (!fs3__default.existsSync(candidatePath) && !fs3__default.existsSync(candidatePath + ".node")) {
3841
+ if (!fs5.existsSync(candidatePath) && !fs5.existsSync(candidatePath + ".node")) {
3741
3842
  continue;
3742
3843
  }
3743
3844
  const mod = requireNativeModule(candidatePath);
@@ -3769,9 +3870,9 @@ function resolveNativeBindingCandidates(options) {
3769
3870
  }
3770
3871
  }
3771
3872
  if (!includeDefaultCandidates) return candidates;
3772
- if (fs3__default.existsSync(runtimeDir)) {
3873
+ if (fs5.existsSync(runtimeDir)) {
3773
3874
  try {
3774
- for (const entry of fs3__default.readdirSync(runtimeDir)) {
3875
+ for (const entry of fs5.readdirSync(runtimeDir)) {
3775
3876
  if (entry.endsWith(".node")) candidates.push(entry);
3776
3877
  }
3777
3878
  } catch {
@@ -3780,22 +3881,22 @@ function resolveNativeBindingCandidates(options) {
3780
3881
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
3781
3882
  const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
3782
3883
  for (const bin of BINARY_NAMES) {
3783
- candidates.push(path__default.resolve(runtimeDir, `${bin}.node`));
3784
- candidates.push(path__default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
3785
- candidates.push(path__default.resolve(runtimeDir, "..", "native", `${bin}.node`));
3786
- candidates.push(path__default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
3787
- candidates.push(path__default.resolve(process.cwd(), "native", `${bin}.node`));
3788
- candidates.push(path__default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
3789
- candidates.push(path__default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
3790
- candidates.push(path__default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
3791
- candidates.push(path__default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
3884
+ candidates.push(path5.resolve(runtimeDir, `${bin}.node`));
3885
+ candidates.push(path5.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
3886
+ candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.node`));
3887
+ candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
3888
+ candidates.push(path5.resolve(process.cwd(), "native", `${bin}.node`));
3889
+ candidates.push(path5.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
3890
+ candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
3891
+ candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
3892
+ candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
3792
3893
  }
3793
3894
  return Array.from(new Set(candidates));
3794
3895
  }
3795
3896
  function resolveRuntimeDir(dir, importMetaUrl) {
3796
- if (dir) return path__default.resolve(dir);
3897
+ if (dir) return path5.resolve(dir);
3797
3898
  try {
3798
- return path__default.dirname(fileURLToPath(importMetaUrl));
3899
+ return path5.dirname(fileURLToPath(importMetaUrl));
3799
3900
  } catch {
3800
3901
  return process.cwd();
3801
3902
  }
@@ -3812,6 +3913,7 @@ function formatErrorMessage(error) {
3812
3913
  var TwError, _require3, LRUCache;
3813
3914
  var init_src2 = __esm({
3814
3915
  "packages/domain/shared/src/index.ts"() {
3916
+ "use strict";
3815
3917
  init_trace();
3816
3918
  init_error_codes();
3817
3919
  init_compatibility();
@@ -3877,7 +3979,9 @@ var init_src2 = __esm({
3877
3979
  return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
3878
3980
  }
3879
3981
  };
3880
- _require3 = createRequire(import.meta.url);
3982
+ _require3 = createRequire5(
3983
+ typeof __filename !== "undefined" ? `file://${__filename}` : import.meta.url ?? "file://unknown"
3984
+ );
3881
3985
  LRUCache = class {
3882
3986
  capacity;
3883
3987
  cache;
@@ -3924,7 +4028,74 @@ var init_src2 = __esm({
3924
4028
 
3925
4029
  // src/umbrella/shared.ts
3926
4030
  init_src2();
3927
-
3928
- export { ERROR_CODES, LRUCache, NativeAnalyzerReportSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema, NativeCssCompileResultSchema, NativeScanFileSchema, NativeScanResultSchema, NativeTransformResultSchema, NativeWatchResultSchema, PackageJsonSchema, RegistryFileSchema, RegistryPluginEntrySchema, ScanCacheClassEntrySchema, ScanCacheSchema, TW_STATE_STATIC_FILENAME, TailwindConfigSchema, TelemetryCollector, TwError, appendStaticStateCssToSafelist, assertTailwindV4, calculateHealth, createBuildTimer, createDebugLogger, createEsmRequire, createLogger2 as createLogger, createObservabilityClient, createTraceSnapshot, detectTailwind, extractStaticStateCss, formatDuration, formatErrorCode, formatErrorMessage, formatMemory, formatNativeNotFoundError, generateBarrelFile, generateClassRenameCodemod, generateComponentCode, generateStorybookStory, getBuildTimeColor, getDirname, getFilename, getGlobalTelemetry, getHealthColor, getMemoryColor, getModeColor, getPipelinePercentages, getSuggestion, getTailwindVersion, hashContent2 as hashContent, isTailwindV4, isTwError, loadNativeBinding, parseJsonFileWithSchema, parseJsonWithSchema, parseNative, resetGlobalTelemetry, resolveFromRoot, resolveLoaderPath, resolveNativeBinary, resolveNativeBindingCandidates, resolveNativeNodePath, resolveRuntimeDir, resolveWorkerPath, safeParseNative, setGlobalLogFile, tryRequire, wrapUnknownError };
3929
- //# sourceMappingURL=shared.mjs.map
4031
+ export {
4032
+ ERROR_CODES,
4033
+ LRUCache,
4034
+ NativeAnalyzerReportSchema,
4035
+ NativeCacheEntrySchema,
4036
+ NativeCacheReadResultSchema,
4037
+ NativeCssCompileResultSchema,
4038
+ NativeScanFileSchema,
4039
+ NativeScanResultSchema,
4040
+ NativeTransformResultSchema,
4041
+ NativeWatchResultSchema,
4042
+ PackageJsonSchema,
4043
+ RegistryFileSchema,
4044
+ RegistryPluginEntrySchema,
4045
+ ScanCacheClassEntrySchema,
4046
+ ScanCacheSchema,
4047
+ TW_STATE_STATIC_FILENAME,
4048
+ TailwindConfigSchema,
4049
+ TelemetryCollector,
4050
+ TwError,
4051
+ appendStaticStateCssToSafelist,
4052
+ assertTailwindV4,
4053
+ calculateHealth,
4054
+ createBuildTimer,
4055
+ createDebugLogger,
4056
+ createEsmRequire,
4057
+ createLogger2 as createLogger,
4058
+ createObservabilityClient,
4059
+ createTraceSnapshot,
4060
+ detectTailwind,
4061
+ extractStaticStateCss,
4062
+ formatDuration,
4063
+ formatErrorCode,
4064
+ formatErrorMessage,
4065
+ formatMemory,
4066
+ formatNativeNotFoundError,
4067
+ generateBarrelFile,
4068
+ generateClassRenameCodemod,
4069
+ generateComponentCode,
4070
+ generateStorybookStory,
4071
+ getBuildTimeColor,
4072
+ getDirname,
4073
+ getFilename,
4074
+ getGlobalTelemetry,
4075
+ getHealthColor,
4076
+ getMemoryColor,
4077
+ getModeColor,
4078
+ getPipelinePercentages,
4079
+ getSuggestion,
4080
+ getTailwindVersion,
4081
+ hashContent2 as hashContent,
4082
+ isTailwindV4,
4083
+ isTwError,
4084
+ loadNativeBinding,
4085
+ parseJsonFileWithSchema,
4086
+ parseJsonWithSchema,
4087
+ parseNative,
4088
+ resetGlobalTelemetry,
4089
+ resolveFromRoot,
4090
+ resolveLoaderPath,
4091
+ resolveNativeBinary,
4092
+ resolveNativeBindingCandidates,
4093
+ resolveNativeNodePath,
4094
+ resolveRuntimeDir,
4095
+ resolveWorkerPath,
4096
+ safeParseNative,
4097
+ setGlobalLogFile,
4098
+ tryRequire,
4099
+ wrapUnknownError
4100
+ };
3930
4101
  //# sourceMappingURL=shared.mjs.map