tailwind-styled-v4 5.0.12 → 5.0.14

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 (69) hide show
  1. package/README.md +100 -4
  2. package/dist/animate.d.mts +4 -0
  3. package/dist/animate.d.ts +4 -0
  4. package/dist/animate.js +22 -0
  5. package/dist/animate.js.map +1 -1
  6. package/dist/animate.mjs +22 -0
  7. package/dist/animate.mjs.map +1 -1
  8. package/dist/atomic.js +56 -14
  9. package/dist/atomic.js.map +1 -1
  10. package/dist/atomic.mjs +56 -14
  11. package/dist/atomic.mjs.map +1 -1
  12. package/dist/cli.js +156 -14
  13. package/dist/cli.js.map +1 -1
  14. package/dist/cli.mjs +156 -14
  15. package/dist/cli.mjs.map +1 -1
  16. package/dist/compiler.d.mts +1045 -991
  17. package/dist/compiler.d.ts +1045 -991
  18. package/dist/compiler.js +891 -925
  19. package/dist/compiler.js.map +1 -1
  20. package/dist/compiler.mjs +890 -925
  21. package/dist/compiler.mjs.map +1 -1
  22. package/dist/engine.js +1651 -354
  23. package/dist/engine.js.map +1 -1
  24. package/dist/engine.mjs +1650 -353
  25. package/dist/engine.mjs.map +1 -1
  26. package/dist/index.browser.mjs +3 -1
  27. package/dist/index.browser.mjs.map +1 -1
  28. package/dist/index.js +1682 -365
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +1682 -365
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/next.js +1076 -986
  33. package/dist/next.js.map +1 -1
  34. package/dist/next.mjs +1076 -986
  35. package/dist/next.mjs.map +1 -1
  36. package/dist/shared.d.mts +3 -2
  37. package/dist/shared.d.ts +3 -2
  38. package/dist/shared.js +1595 -298
  39. package/dist/shared.js.map +1 -1
  40. package/dist/shared.mjs +1595 -298
  41. package/dist/shared.mjs.map +1 -1
  42. package/dist/svelte.js +42 -24
  43. package/dist/svelte.js.map +1 -1
  44. package/dist/svelte.mjs +42 -24
  45. package/dist/svelte.mjs.map +1 -1
  46. package/dist/turbopackLoader.js +1606 -309
  47. package/dist/turbopackLoader.js.map +1 -1
  48. package/dist/turbopackLoader.mjs +1606 -309
  49. package/dist/turbopackLoader.mjs.map +1 -1
  50. package/dist/tw.js +156 -14
  51. package/dist/tw.js.map +1 -1
  52. package/dist/tw.mjs +156 -14
  53. package/dist/tw.mjs.map +1 -1
  54. package/dist/vite.js +1636 -339
  55. package/dist/vite.js.map +1 -1
  56. package/dist/vite.mjs +1636 -339
  57. package/dist/vite.mjs.map +1 -1
  58. package/dist/vue.js +42 -24
  59. package/dist/vue.js.map +1 -1
  60. package/dist/vue.mjs +42 -24
  61. package/dist/vue.mjs.map +1 -1
  62. package/dist/webpackLoader.js +80 -29
  63. package/dist/webpackLoader.js.map +1 -1
  64. package/dist/webpackLoader.mjs +80 -29
  65. package/dist/webpackLoader.mjs.map +1 -1
  66. package/native/tailwind-styled-native.node +0 -0
  67. package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
  68. package/package.json +3 -2
  69. package/native/index.node +0 -0
package/dist/cli.mjs CHANGED
@@ -3176,27 +3176,15 @@ function resolveNativeBinary(runtimeDir) {
3176
3176
  }
3177
3177
  tried.push(`env:${envPath} (not found)`);
3178
3178
  }
3179
- const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
3180
- for (const pkg of prebuiltPkgs) {
3181
- try {
3182
- const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
3183
- if (fs11.existsSync(candidate)) {
3184
- return { path: candidate, source: "prebuilt", platform, tried };
3185
- }
3186
- tried.push(`prebuilt:${pkg} (resolved but missing)`);
3187
- } catch {
3188
- tried.push(`prebuilt:${pkg} (not installed)`);
3189
- }
3190
- }
3191
3179
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
3192
- const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
3180
+ const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser", "index"];
3193
3181
  if (runtimeDir) {
3194
3182
  for (const depth of ["..", path6.join("..", ".."), path6.join("..", "..", "..")]) {
3195
3183
  const pkgRoot = path6.resolve(runtimeDir, depth);
3196
3184
  for (const bin of BINARY_NAMES_SELF) {
3197
3185
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
3198
3186
  const candidate = path6.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
3199
- tried.push(`self-bundled:${candidate}`);
3187
+ tried.push(`native:${candidate}`);
3200
3188
  if (fs11.existsSync(candidate)) {
3201
3189
  return { path: candidate, source: "prebuilt", platform, tried };
3202
3190
  }
@@ -3204,6 +3192,18 @@ function resolveNativeBinary(runtimeDir) {
3204
3192
  }
3205
3193
  }
3206
3194
  }
3195
+ const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
3196
+ for (const pkg of prebuiltPkgs) {
3197
+ try {
3198
+ const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
3199
+ if (fs11.existsSync(candidate)) {
3200
+ return { path: candidate, source: "prebuilt", platform, tried };
3201
+ }
3202
+ tried.push(`prebuilt:${pkg} (resolved but missing)`);
3203
+ } catch {
3204
+ tried.push(`prebuilt:${pkg} (not installed)`);
3205
+ }
3206
+ }
3207
3207
  const cwd2 = process.cwd();
3208
3208
  const base = runtimeDir ?? cwd2;
3209
3209
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
@@ -6093,10 +6093,52 @@ Tried paths: ${result.tried.join("\n")}`);
6093
6093
  }
6094
6094
  }
6095
6095
  });
6096
+
6097
+ // packages/domain/compiler/src/compiler/index.ts
6098
+ var init_compiler = __esm({
6099
+ "packages/domain/compiler/src/compiler/index.ts"() {
6100
+ }
6101
+ });
6102
+
6103
+ // packages/domain/compiler/src/parser/index.ts
6104
+ var init_parser = __esm({
6105
+ "packages/domain/compiler/src/parser/index.ts"() {
6106
+ }
6107
+ });
6108
+
6109
+ // packages/domain/compiler/src/analyzer/index.ts
6110
+ var init_analyzer = __esm({
6111
+ "packages/domain/compiler/src/analyzer/index.ts"() {
6112
+ }
6113
+ });
6114
+
6115
+ // packages/domain/compiler/src/cache/index.ts
6116
+ var init_cache = __esm({
6117
+ "packages/domain/compiler/src/cache/index.ts"() {
6118
+ }
6119
+ });
6120
+
6121
+ // packages/domain/compiler/src/redis/index.ts
6122
+ var init_redis = __esm({
6123
+ "packages/domain/compiler/src/redis/index.ts"() {
6124
+ }
6125
+ });
6126
+
6127
+ // packages/domain/compiler/src/watch/index.ts
6128
+ var init_watch = __esm({
6129
+ "packages/domain/compiler/src/watch/index.ts"() {
6130
+ }
6131
+ });
6096
6132
  var compileCssFromClasses;
6097
6133
  var init_src4 = __esm({
6098
6134
  "packages/domain/compiler/src/index.ts"() {
6099
6135
  init_nativeBridge();
6136
+ init_compiler();
6137
+ init_parser();
6138
+ init_analyzer();
6139
+ init_cache();
6140
+ init_redis();
6141
+ init_watch();
6100
6142
  compileCssFromClasses = (classes, prefix) => {
6101
6143
  const native = getNativeBridge();
6102
6144
  if (!native?.transformSource) {
@@ -6115,6 +6157,12 @@ var init_src4 = __esm({
6115
6157
  var init_internal = __esm({
6116
6158
  "packages/domain/compiler/src/internal.ts"() {
6117
6159
  init_src4();
6160
+ init_compiler();
6161
+ init_parser();
6162
+ init_analyzer();
6163
+ init_cache();
6164
+ init_redis();
6165
+ init_watch();
6118
6166
  }
6119
6167
  });
6120
6168
 
@@ -8692,6 +8740,7 @@ init_args();
8692
8740
  init_errors();
8693
8741
  init_fs();
8694
8742
  init_json();
8743
+ init_src4();
8695
8744
  var DEFAULT_TAILWIND_CSS2 = '@import "tailwindcss";\n';
8696
8745
  var DEFAULT_TW_CONFIG = `${JSON.stringify(
8697
8746
  {
@@ -8706,6 +8755,89 @@ var DEFAULT_TW_CONFIG = `${JSON.stringify(
8706
8755
  function pkgHasDep(pkg, name) {
8707
8756
  return Boolean(pkg.dependencies?.[name] || pkg.devDependencies?.[name]);
8708
8757
  }
8758
+ async function validateThemeConfig(cwd2) {
8759
+ const results = [];
8760
+ try {
8761
+ const native = getNativeBridge();
8762
+ if (!native) {
8763
+ results.push({ type: "theme", valid: false, message: "Native binding not available" });
8764
+ return results;
8765
+ }
8766
+ const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
8767
+ let configPath = null;
8768
+ for (const file of twConfigFiles) {
8769
+ if (await pathExists2(path6__default.join(cwd2, file))) {
8770
+ configPath = path6__default.join(cwd2, file);
8771
+ break;
8772
+ }
8773
+ }
8774
+ if (!configPath) {
8775
+ results.push({ type: "theme-config-missing", valid: false, message: "No tailwind.config found" });
8776
+ return results;
8777
+ }
8778
+ try {
8779
+ const configUrl = pathToFileURL(configPath);
8780
+ const configModule = await import(configUrl.href);
8781
+ const config = configModule.default || configModule;
8782
+ const theme = config.theme || {};
8783
+ if (theme.colors && native.validateColorsNapi) {
8784
+ try {
8785
+ const colorsJson = JSON.stringify(theme.colors);
8786
+ const isValid = native.validateColorsNapi(colorsJson);
8787
+ results.push({
8788
+ type: "theme-colors",
8789
+ valid: isValid,
8790
+ message: isValid ? "Colors theme validated OK" : "Invalid colors in theme"
8791
+ });
8792
+ } catch (err) {
8793
+ results.push({
8794
+ type: "theme-colors",
8795
+ valid: false,
8796
+ message: `Color validation error: ${err instanceof Error ? err.message : String(err)}`
8797
+ });
8798
+ }
8799
+ }
8800
+ if (theme.screens && native.validateBreakpointsNapi) {
8801
+ try {
8802
+ const screensJson = JSON.stringify(theme.screens);
8803
+ const isValid = native.validateBreakpointsNapi(screensJson);
8804
+ results.push({
8805
+ type: "theme-breakpoints",
8806
+ valid: isValid,
8807
+ message: isValid ? "Breakpoints validated OK" : "Invalid breakpoints in theme"
8808
+ });
8809
+ } catch (err) {
8810
+ results.push({
8811
+ type: "theme-breakpoints",
8812
+ valid: false,
8813
+ message: `Breakpoints validation error: ${err instanceof Error ? err.message : String(err)}`
8814
+ });
8815
+ }
8816
+ }
8817
+ if (native.runHealthCheck) {
8818
+ try {
8819
+ native.runHealthCheck();
8820
+ results.push({ type: "theme-integrity", valid: true, message: "Theme integrity check passed" });
8821
+ } catch {
8822
+ results.push({ type: "theme-integrity", valid: false, message: "Theme integrity check failed" });
8823
+ }
8824
+ }
8825
+ } catch (err) {
8826
+ results.push({
8827
+ type: "theme-load",
8828
+ valid: false,
8829
+ message: `Failed to load theme config: ${err instanceof Error ? err.message : String(err)}`
8830
+ });
8831
+ }
8832
+ } catch (err) {
8833
+ results.push({
8834
+ type: "theme-validation",
8835
+ valid: false,
8836
+ message: `Theme validation failed: ${err instanceof Error ? err.message : String(err)}`
8837
+ });
8838
+ }
8839
+ return results;
8840
+ }
8709
8841
  function nodeVersion() {
8710
8842
  const full = process.version.replace("v", "");
8711
8843
  const major = parseInt(full.split(".")[0], 10);
@@ -8830,6 +8962,16 @@ async function runPreflightCli(rawArgs) {
8830
8962
  "Run: tw migrate --dry-run to see migration steps"
8831
8963
  );
8832
8964
  }
8965
+ const themeValidation = await validateThemeConfig(cwd2);
8966
+ for (const validation of themeValidation) {
8967
+ check(
8968
+ results,
8969
+ `theme-${validation.type}`,
8970
+ `Theme ${validation.type}`,
8971
+ validation.valid,
8972
+ validation.message
8973
+ );
8974
+ }
8833
8975
  const hasTsConfig = await pathExists2(path6__default.join(cwd2, "tsconfig.json"));
8834
8976
  check(
8835
8977
  results,