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