tailwind-styled-v4 5.0.10 → 5.0.11
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/README.md +245 -373
- package/dist/analyzer.js +75 -22
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +74 -21
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +4 -2
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +4 -2
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +20 -5
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +20 -5
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +174 -67
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +171 -64
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +7 -1
- package/dist/compiler.d.ts +7 -1
- package/dist/compiler.js +53 -27
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +53 -27
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.js +159 -61
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +159 -61
- package/dist/engine.mjs.map +1 -1
- package/dist/index.browser.mjs +1512 -0
- package/dist/index.browser.mjs.map +1 -0
- package/dist/index.d.mts +94 -12
- package/dist/index.d.ts +94 -12
- package/dist/index.js +436 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +436 -106
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +1946 -47
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +1929 -44
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +23 -10
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +23 -11
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs.map +1 -1
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs.map +1 -1
- package/dist/scanner.js +72 -19
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +71 -18
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.js +32 -15
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +32 -15
- package/dist/shared.mjs.map +1 -1
- package/dist/svelte.js +38 -12
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +38 -12
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +17 -5
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +17 -5
- package/dist/syntax.mjs.map +1 -1
- package/dist/theme.js +4 -2
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +4 -2
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +87 -33
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +87 -33
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +174 -67
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +171 -64
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +145 -63
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +145 -63
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +38 -12
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +38 -12
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +20 -5
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +20 -5
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +29 -24
package/dist/shared.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from 'crypto';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import fs__default from 'fs';
|
|
4
4
|
import * as path from 'path';
|
|
5
5
|
import path__default from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
@@ -777,12 +777,12 @@ function generateBarrelFile(exports$1, dir, opts = {}) {
|
|
|
777
777
|
var isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
778
778
|
var _require = typeof __require !== "undefined" ? __require : createRequire(import.meta.url);
|
|
779
779
|
var PLATFORM_MAP = {
|
|
780
|
-
"linux-x64": ["@tailwind-styled/native-linux-x64"],
|
|
781
|
-
"linux-arm64": ["@tailwind-styled/native-linux-arm64"],
|
|
780
|
+
"linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
|
|
781
|
+
"linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
|
|
782
782
|
"darwin-x64": ["@tailwind-styled/native-darwin-x64"],
|
|
783
783
|
"darwin-arm64": ["@tailwind-styled/native-darwin-arm64"],
|
|
784
|
-
"win32-x64": ["@tailwind-styled/native-win32-x64"],
|
|
785
|
-
"win32-arm64": ["@tailwind-styled/native-win32-arm64"]
|
|
784
|
+
"win32-x64": ["@tailwind-styled/native-win32-x64-msvc", "@tailwind-styled/native-win32-x64"],
|
|
785
|
+
"win32-arm64": ["@tailwind-styled/native-win32-arm64-msvc", "@tailwind-styled/native-win32-arm64"]
|
|
786
786
|
};
|
|
787
787
|
function platformKey() {
|
|
788
788
|
if (isBrowser3) return "browser";
|
|
@@ -799,7 +799,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
799
799
|
}
|
|
800
800
|
const envPath = process.env.TW_NATIVE_PATH?.trim();
|
|
801
801
|
if (envPath) {
|
|
802
|
-
if (
|
|
802
|
+
if (fs.existsSync(envPath)) {
|
|
803
803
|
return { path: envPath, source: "env", platform, tried };
|
|
804
804
|
}
|
|
805
805
|
tried.push(`env:${envPath} (not found)`);
|
|
@@ -808,7 +808,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
808
808
|
for (const pkg of prebuiltPkgs) {
|
|
809
809
|
try {
|
|
810
810
|
const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
|
|
811
|
-
if (
|
|
811
|
+
if (fs.existsSync(candidate)) {
|
|
812
812
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
813
813
|
}
|
|
814
814
|
tried.push(`prebuilt:${pkg} (resolved but missing)`);
|
|
@@ -816,9 +816,24 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
816
816
|
tried.push(`prebuilt:${pkg} (not installed)`);
|
|
817
817
|
}
|
|
818
818
|
}
|
|
819
|
+
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
820
|
+
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
821
|
+
if (runtimeDir) {
|
|
822
|
+
for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
|
|
823
|
+
const pkgRoot = path.resolve(runtimeDir, depth);
|
|
824
|
+
for (const bin of BINARY_NAMES_SELF) {
|
|
825
|
+
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
826
|
+
const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
827
|
+
tried.push(`self-bundled:${candidate}`);
|
|
828
|
+
if (fs.existsSync(candidate)) {
|
|
829
|
+
return { path: candidate, source: "prebuilt", platform, tried };
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
819
835
|
const cwd = process.cwd();
|
|
820
836
|
const base = runtimeDir ?? cwd;
|
|
821
|
-
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
822
837
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
823
838
|
const localCandidates = [];
|
|
824
839
|
for (const bin of BINARY_NAMES) {
|
|
@@ -844,7 +859,7 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
844
859
|
}
|
|
845
860
|
for (const candidate of localCandidates) {
|
|
846
861
|
tried.push(`local:${candidate}`);
|
|
847
|
-
if (
|
|
862
|
+
if (fs.existsSync(candidate)) {
|
|
848
863
|
return { path: candidate, source: "local", platform, tried };
|
|
849
864
|
}
|
|
850
865
|
}
|
|
@@ -998,7 +1013,7 @@ function loadNativeBinding(options) {
|
|
|
998
1013
|
for (const candidate of candidates) {
|
|
999
1014
|
const candidatePath = path__default.resolve(runtimeDir, candidate);
|
|
1000
1015
|
try {
|
|
1001
|
-
if (!
|
|
1016
|
+
if (!fs__default.existsSync(candidatePath) && !fs__default.existsSync(candidatePath + ".node")) {
|
|
1002
1017
|
continue;
|
|
1003
1018
|
}
|
|
1004
1019
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -1031,9 +1046,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
1031
1046
|
}
|
|
1032
1047
|
}
|
|
1033
1048
|
if (!includeDefaultCandidates) return candidates;
|
|
1034
|
-
if (
|
|
1049
|
+
if (fs__default.existsSync(runtimeDir)) {
|
|
1035
1050
|
try {
|
|
1036
|
-
for (const entry of
|
|
1051
|
+
for (const entry of fs__default.readdirSync(runtimeDir)) {
|
|
1037
1052
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
1038
1053
|
}
|
|
1039
1054
|
} catch {
|
|
@@ -1044,11 +1059,13 @@ function resolveNativeBindingCandidates(options) {
|
|
|
1044
1059
|
for (const bin of BINARY_NAMES) {
|
|
1045
1060
|
candidates.push(path__default.resolve(runtimeDir, `${bin}.node`));
|
|
1046
1061
|
candidates.push(path__default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
1062
|
+
candidates.push(path__default.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
1063
|
+
candidates.push(path__default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
1064
|
+
candidates.push(path__default.resolve(process.cwd(), "native", `${bin}.node`));
|
|
1065
|
+
candidates.push(path__default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
1047
1066
|
candidates.push(path__default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
1048
1067
|
candidates.push(path__default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
1049
1068
|
candidates.push(path__default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
1050
|
-
candidates.push(path__default.resolve(process.cwd(), "native", `${bin}.node`));
|
|
1051
|
-
candidates.push(path__default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
1052
1069
|
}
|
|
1053
1070
|
return Array.from(new Set(candidates));
|
|
1054
1071
|
}
|