tailwind-styled-v4 5.0.7 → 5.0.9

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 (46) hide show
  1. package/CHANGELOG.md +184 -410
  2. package/README.md +45 -15
  3. package/dist/cli.js +62 -52
  4. package/dist/cli.js.map +1 -1
  5. package/dist/cli.mjs +62 -52
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/compiler.d.mts +8 -3
  8. package/dist/compiler.d.ts +8 -3
  9. package/dist/compiler.js +214 -127
  10. package/dist/compiler.js.map +1 -1
  11. package/dist/compiler.mjs +195 -103
  12. package/dist/compiler.mjs.map +1 -1
  13. package/dist/engine.js +146 -66
  14. package/dist/engine.js.map +1 -1
  15. package/dist/engine.mjs +146 -66
  16. package/dist/engine.mjs.map +1 -1
  17. package/dist/index.d.mts +26 -8
  18. package/dist/index.d.ts +26 -8
  19. package/dist/index.js +72 -19
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +72 -19
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/next.d.mts +12 -40
  24. package/dist/next.d.ts +12 -40
  25. package/dist/next.js +27 -320
  26. package/dist/next.js.map +1 -1
  27. package/dist/next.mjs +27 -320
  28. package/dist/next.mjs.map +1 -1
  29. package/dist/turbopackLoader.js +137 -88
  30. package/dist/turbopackLoader.js.map +1 -1
  31. package/dist/turbopackLoader.mjs +137 -88
  32. package/dist/turbopackLoader.mjs.map +1 -1
  33. package/dist/tw.js +62 -52
  34. package/dist/tw.js.map +1 -1
  35. package/dist/tw.mjs +62 -52
  36. package/dist/tw.mjs.map +1 -1
  37. package/dist/vite.js +146 -66
  38. package/dist/vite.js.map +1 -1
  39. package/dist/vite.mjs +146 -66
  40. package/dist/vite.mjs.map +1 -1
  41. package/dist/webpackLoader.js +92 -83
  42. package/dist/webpackLoader.js.map +1 -1
  43. package/dist/webpackLoader.mjs +92 -83
  44. package/dist/webpackLoader.mjs.map +1 -1
  45. package/native/tailwind-styled-native.node +0 -0
  46. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -5931,6 +5931,67 @@ var init_createApp = __esm({
5931
5931
  };
5932
5932
  }
5933
5933
  });
5934
+ var log3, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge;
5935
+ var init_nativeBridge = __esm({
5936
+ "packages/domain/compiler/src/nativeBridge.ts"() {
5937
+ init_src();
5938
+ log3 = (...args) => {
5939
+ if (process.env.DEBUG?.includes("compiler:native")) {
5940
+ console.log("[compiler:native]", ...args);
5941
+ }
5942
+ };
5943
+ 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";
5944
+ nativeBridge = null;
5945
+ bridgeLoadAttempted = false;
5946
+ bridgeLoadError = null;
5947
+ isValidNativeBridge = (mod) => {
5948
+ const m = mod;
5949
+ return !!(typeof m.transformSource === "function" || typeof m.extractAllClasses === "function" || typeof m.hasTwUsage === "function");
5950
+ };
5951
+ getNativeBridge = () => {
5952
+ if (nativeBridge) {
5953
+ return nativeBridge;
5954
+ }
5955
+ if (bridgeLoadAttempted) {
5956
+ if (bridgeLoadError) {
5957
+ throw bridgeLoadError;
5958
+ }
5959
+ throw new Error(NATIVE_UNAVAILABLE_MESSAGE);
5960
+ }
5961
+ bridgeLoadAttempted = true;
5962
+ try {
5963
+ const runtimeDir = resolveRuntimeDir(void 0, import.meta.url);
5964
+ const require2 = createRequire(import.meta.url);
5965
+ const result = resolveNativeBinary(runtimeDir);
5966
+ if (result.path && result.path.endsWith(".node")) {
5967
+ try {
5968
+ const binding = require2(result.path);
5969
+ if (isValidNativeBridge(binding)) {
5970
+ nativeBridge = binding;
5971
+ log3("Native bridge loaded successfully from:", result.path);
5972
+ return nativeBridge;
5973
+ }
5974
+ } catch (e) {
5975
+ log3("Failed to require native binding:", e);
5976
+ }
5977
+ }
5978
+ throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}
5979
+
5980
+ Tried paths: ${result.tried.join("\n")}`);
5981
+ } catch (err) {
5982
+ bridgeLoadError = err instanceof Error ? err : new Error(String(err));
5983
+ log3("Failed to load native bridge:", bridgeLoadError.message);
5984
+ throw bridgeLoadError;
5985
+ }
5986
+ };
5987
+ if (typeof process !== "undefined" && !bridgeLoadAttempted) {
5988
+ try {
5989
+ getNativeBridge();
5990
+ } catch {
5991
+ }
5992
+ }
5993
+ }
5994
+ });
5934
5995
 
5935
5996
  // packages/infrastructure/cli/src/commands/program.ts
5936
5997
  init_esm();
@@ -9061,59 +9122,8 @@ var syncCommand = {
9061
9122
  var import_picocolors5 = __toESM(require_picocolors());
9062
9123
  init_errors();
9063
9124
 
9064
- // packages/domain/compiler/src/nativeBridge.ts
9065
- init_src();
9066
- var log3 = (...args) => {
9067
- if (process.env.DEBUG?.includes("compiler:native")) {
9068
- console.log("[compiler:native]", ...args);
9069
- }
9070
- };
9071
- 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";
9072
- var nativeBridge = null;
9073
- var bridgeLoadAttempted = false;
9074
- var bridgeLoadError = null;
9075
- var isValidNativeBridge = (mod) => {
9076
- const m = mod;
9077
- return !!(typeof m.transformSource === "function" || typeof m.extractAllClasses === "function" || typeof m.hasTwUsage === "function");
9078
- };
9079
- var getNativeBridge = () => {
9080
- if (nativeBridge) {
9081
- return nativeBridge;
9082
- }
9083
- if (bridgeLoadAttempted) {
9084
- if (bridgeLoadError) {
9085
- throw bridgeLoadError;
9086
- }
9087
- throw new Error(NATIVE_UNAVAILABLE_MESSAGE);
9088
- }
9089
- bridgeLoadAttempted = true;
9090
- try {
9091
- const runtimeDir = resolveRuntimeDir(void 0, import.meta.url);
9092
- const require2 = createRequire(import.meta.url);
9093
- const result = resolveNativeBinary(runtimeDir);
9094
- if (result.path && result.path.endsWith(".node")) {
9095
- try {
9096
- const binding = require2(result.path);
9097
- if (isValidNativeBridge(binding)) {
9098
- nativeBridge = binding;
9099
- log3("Native bridge loaded successfully from:", result.path);
9100
- return nativeBridge;
9101
- }
9102
- } catch (e) {
9103
- log3("Failed to require native binding:", e);
9104
- }
9105
- }
9106
- throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}
9107
-
9108
- Tried paths: ${result.tried.join("\n")}`);
9109
- } catch (err) {
9110
- bridgeLoadError = err instanceof Error ? err : new Error(String(err));
9111
- log3("Failed to load native bridge:", bridgeLoadError.message);
9112
- throw bridgeLoadError;
9113
- }
9114
- };
9115
-
9116
9125
  // packages/domain/compiler/src/index.ts
9126
+ init_nativeBridge();
9117
9127
  var compileCssFromClasses = (classes, prefix) => {
9118
9128
  const native = getNativeBridge();
9119
9129
  if (!native?.transformSource) {