tailwind-styled-v4 5.0.7 → 5.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tw.mjs CHANGED
@@ -5932,6 +5932,67 @@ var init_createApp = __esm({
5932
5932
  };
5933
5933
  }
5934
5934
  });
5935
+ var log3, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge;
5936
+ var init_nativeBridge = __esm({
5937
+ "packages/domain/compiler/src/nativeBridge.ts"() {
5938
+ init_src();
5939
+ log3 = (...args) => {
5940
+ if (process.env.DEBUG?.includes("compiler:native")) {
5941
+ console.log("[compiler:native]", ...args);
5942
+ }
5943
+ };
5944
+ NATIVE_UNAVAILABLE_MESSAGE = "[tailwind-styled/compiler v5] Native binding is required but not available.\nThis package requires native Rust bindings. There is no JavaScript fallback.\nPlease ensure:\n 1. The native module is properly installed\n 2. You have run: npm run build:rust (or use prebuilt binary)\n\nFor help, see: https://tailwind-styled.dev/docs/install";
5945
+ nativeBridge = null;
5946
+ bridgeLoadAttempted = false;
5947
+ bridgeLoadError = null;
5948
+ isValidNativeBridge = (mod) => {
5949
+ const m = mod;
5950
+ return !!(typeof m.transformSource === "function" || typeof m.extractAllClasses === "function" || typeof m.hasTwUsage === "function");
5951
+ };
5952
+ getNativeBridge = () => {
5953
+ if (nativeBridge) {
5954
+ return nativeBridge;
5955
+ }
5956
+ if (bridgeLoadAttempted) {
5957
+ if (bridgeLoadError) {
5958
+ throw bridgeLoadError;
5959
+ }
5960
+ throw new Error(NATIVE_UNAVAILABLE_MESSAGE);
5961
+ }
5962
+ bridgeLoadAttempted = true;
5963
+ try {
5964
+ const runtimeDir = resolveRuntimeDir(void 0, import.meta.url);
5965
+ const require2 = createRequire(import.meta.url);
5966
+ const result = resolveNativeBinary(runtimeDir);
5967
+ if (result.path && result.path.endsWith(".node")) {
5968
+ try {
5969
+ const binding = require2(result.path);
5970
+ if (isValidNativeBridge(binding)) {
5971
+ nativeBridge = binding;
5972
+ log3("Native bridge loaded successfully from:", result.path);
5973
+ return nativeBridge;
5974
+ }
5975
+ } catch (e) {
5976
+ log3("Failed to require native binding:", e);
5977
+ }
5978
+ }
5979
+ throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}
5980
+
5981
+ Tried paths: ${result.tried.join("\n")}`);
5982
+ } catch (err) {
5983
+ bridgeLoadError = err instanceof Error ? err : new Error(String(err));
5984
+ log3("Failed to load native bridge:", bridgeLoadError.message);
5985
+ throw bridgeLoadError;
5986
+ }
5987
+ };
5988
+ if (typeof process !== "undefined" && !bridgeLoadAttempted) {
5989
+ try {
5990
+ getNativeBridge();
5991
+ } catch {
5992
+ }
5993
+ }
5994
+ }
5995
+ });
5935
5996
 
5936
5997
  // packages/infrastructure/cli/src/commands/program.ts
5937
5998
  init_esm();
@@ -9062,59 +9123,8 @@ var syncCommand = {
9062
9123
  var import_picocolors5 = __toESM(require_picocolors());
9063
9124
  init_errors();
9064
9125
 
9065
- // packages/domain/compiler/src/nativeBridge.ts
9066
- init_src();
9067
- var log3 = (...args) => {
9068
- if (process.env.DEBUG?.includes("compiler:native")) {
9069
- console.log("[compiler:native]", ...args);
9070
- }
9071
- };
9072
- var NATIVE_UNAVAILABLE_MESSAGE = "[tailwind-styled/compiler v5] Native binding is required but not available.\nThis package requires native Rust bindings. There is no JavaScript fallback.\nPlease ensure:\n 1. The native module is properly installed\n 2. You have run: npm run build:rust (or use prebuilt binary)\n\nFor help, see: https://tailwind-styled.dev/docs/install";
9073
- var nativeBridge = null;
9074
- var bridgeLoadAttempted = false;
9075
- var bridgeLoadError = null;
9076
- var isValidNativeBridge = (mod) => {
9077
- const m = mod;
9078
- return !!(typeof m.transformSource === "function" || typeof m.extractAllClasses === "function" || typeof m.hasTwUsage === "function");
9079
- };
9080
- var getNativeBridge = () => {
9081
- if (nativeBridge) {
9082
- return nativeBridge;
9083
- }
9084
- if (bridgeLoadAttempted) {
9085
- if (bridgeLoadError) {
9086
- throw bridgeLoadError;
9087
- }
9088
- throw new Error(NATIVE_UNAVAILABLE_MESSAGE);
9089
- }
9090
- bridgeLoadAttempted = true;
9091
- try {
9092
- const runtimeDir = resolveRuntimeDir(void 0, import.meta.url);
9093
- const require2 = createRequire(import.meta.url);
9094
- const result = resolveNativeBinary(runtimeDir);
9095
- if (result.path && result.path.endsWith(".node")) {
9096
- try {
9097
- const binding = require2(result.path);
9098
- if (isValidNativeBridge(binding)) {
9099
- nativeBridge = binding;
9100
- log3("Native bridge loaded successfully from:", result.path);
9101
- return nativeBridge;
9102
- }
9103
- } catch (e) {
9104
- log3("Failed to require native binding:", e);
9105
- }
9106
- }
9107
- throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}
9108
-
9109
- Tried paths: ${result.tried.join("\n")}`);
9110
- } catch (err) {
9111
- bridgeLoadError = err instanceof Error ? err : new Error(String(err));
9112
- log3("Failed to load native bridge:", bridgeLoadError.message);
9113
- throw bridgeLoadError;
9114
- }
9115
- };
9116
-
9117
9126
  // packages/domain/compiler/src/index.ts
9127
+ init_nativeBridge();
9118
9128
  var compileCssFromClasses = (classes, prefix) => {
9119
9129
  const native = getNativeBridge();
9120
9130
  if (!native?.transformSource) {