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.js
CHANGED
|
@@ -3202,27 +3202,15 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
3202
3202
|
}
|
|
3203
3203
|
tried.push(`env:${envPath} (not found)`);
|
|
3204
3204
|
}
|
|
3205
|
-
const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
|
|
3206
|
-
for (const pkg of prebuiltPkgs) {
|
|
3207
|
-
try {
|
|
3208
|
-
const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
|
|
3209
|
-
if (fs11__namespace.existsSync(candidate)) {
|
|
3210
|
-
return { path: candidate, source: "prebuilt", platform, tried };
|
|
3211
|
-
}
|
|
3212
|
-
tried.push(`prebuilt:${pkg} (resolved but missing)`);
|
|
3213
|
-
} catch {
|
|
3214
|
-
tried.push(`prebuilt:${pkg} (not installed)`);
|
|
3215
|
-
}
|
|
3216
|
-
}
|
|
3217
3205
|
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
3218
|
-
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3206
|
+
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser", "index"];
|
|
3219
3207
|
if (runtimeDir) {
|
|
3220
3208
|
for (const depth of ["..", path6__namespace.join("..", ".."), path6__namespace.join("..", "..", "..")]) {
|
|
3221
3209
|
const pkgRoot = path6__namespace.resolve(runtimeDir, depth);
|
|
3222
3210
|
for (const bin of BINARY_NAMES_SELF) {
|
|
3223
3211
|
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
3224
3212
|
const candidate = path6__namespace.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
3225
|
-
tried.push(`
|
|
3213
|
+
tried.push(`native:${candidate}`);
|
|
3226
3214
|
if (fs11__namespace.existsSync(candidate)) {
|
|
3227
3215
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
3228
3216
|
}
|
|
@@ -3230,6 +3218,18 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
3230
3218
|
}
|
|
3231
3219
|
}
|
|
3232
3220
|
}
|
|
3221
|
+
const prebuiltPkgs = PLATFORM_MAP[platform] ?? [];
|
|
3222
|
+
for (const pkg of prebuiltPkgs) {
|
|
3223
|
+
try {
|
|
3224
|
+
const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
|
|
3225
|
+
if (fs11__namespace.existsSync(candidate)) {
|
|
3226
|
+
return { path: candidate, source: "prebuilt", platform, tried };
|
|
3227
|
+
}
|
|
3228
|
+
tried.push(`prebuilt:${pkg} (resolved but missing)`);
|
|
3229
|
+
} catch {
|
|
3230
|
+
tried.push(`prebuilt:${pkg} (not installed)`);
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
3233
|
const cwd2 = process.cwd();
|
|
3234
3234
|
const base = runtimeDir ?? cwd2;
|
|
3235
3235
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
@@ -6119,10 +6119,52 @@ Tried paths: ${result.tried.join("\n")}`);
|
|
|
6119
6119
|
}
|
|
6120
6120
|
}
|
|
6121
6121
|
});
|
|
6122
|
+
|
|
6123
|
+
// packages/domain/compiler/src/compiler/index.ts
|
|
6124
|
+
var init_compiler = __esm({
|
|
6125
|
+
"packages/domain/compiler/src/compiler/index.ts"() {
|
|
6126
|
+
}
|
|
6127
|
+
});
|
|
6128
|
+
|
|
6129
|
+
// packages/domain/compiler/src/parser/index.ts
|
|
6130
|
+
var init_parser = __esm({
|
|
6131
|
+
"packages/domain/compiler/src/parser/index.ts"() {
|
|
6132
|
+
}
|
|
6133
|
+
});
|
|
6134
|
+
|
|
6135
|
+
// packages/domain/compiler/src/analyzer/index.ts
|
|
6136
|
+
var init_analyzer = __esm({
|
|
6137
|
+
"packages/domain/compiler/src/analyzer/index.ts"() {
|
|
6138
|
+
}
|
|
6139
|
+
});
|
|
6140
|
+
|
|
6141
|
+
// packages/domain/compiler/src/cache/index.ts
|
|
6142
|
+
var init_cache = __esm({
|
|
6143
|
+
"packages/domain/compiler/src/cache/index.ts"() {
|
|
6144
|
+
}
|
|
6145
|
+
});
|
|
6146
|
+
|
|
6147
|
+
// packages/domain/compiler/src/redis/index.ts
|
|
6148
|
+
var init_redis = __esm({
|
|
6149
|
+
"packages/domain/compiler/src/redis/index.ts"() {
|
|
6150
|
+
}
|
|
6151
|
+
});
|
|
6152
|
+
|
|
6153
|
+
// packages/domain/compiler/src/watch/index.ts
|
|
6154
|
+
var init_watch = __esm({
|
|
6155
|
+
"packages/domain/compiler/src/watch/index.ts"() {
|
|
6156
|
+
}
|
|
6157
|
+
});
|
|
6122
6158
|
var compileCssFromClasses;
|
|
6123
6159
|
var init_src4 = __esm({
|
|
6124
6160
|
"packages/domain/compiler/src/index.ts"() {
|
|
6125
6161
|
init_nativeBridge();
|
|
6162
|
+
init_compiler();
|
|
6163
|
+
init_parser();
|
|
6164
|
+
init_analyzer();
|
|
6165
|
+
init_cache();
|
|
6166
|
+
init_redis();
|
|
6167
|
+
init_watch();
|
|
6126
6168
|
compileCssFromClasses = (classes, prefix) => {
|
|
6127
6169
|
const native = getNativeBridge();
|
|
6128
6170
|
if (!native?.transformSource) {
|
|
@@ -6141,6 +6183,12 @@ var init_src4 = __esm({
|
|
|
6141
6183
|
var init_internal = __esm({
|
|
6142
6184
|
"packages/domain/compiler/src/internal.ts"() {
|
|
6143
6185
|
init_src4();
|
|
6186
|
+
init_compiler();
|
|
6187
|
+
init_parser();
|
|
6188
|
+
init_analyzer();
|
|
6189
|
+
init_cache();
|
|
6190
|
+
init_redis();
|
|
6191
|
+
init_watch();
|
|
6144
6192
|
}
|
|
6145
6193
|
});
|
|
6146
6194
|
|
|
@@ -8718,6 +8766,7 @@ init_args();
|
|
|
8718
8766
|
init_errors();
|
|
8719
8767
|
init_fs();
|
|
8720
8768
|
init_json();
|
|
8769
|
+
init_src4();
|
|
8721
8770
|
var DEFAULT_TAILWIND_CSS2 = '@import "tailwindcss";\n';
|
|
8722
8771
|
var DEFAULT_TW_CONFIG = `${JSON.stringify(
|
|
8723
8772
|
{
|
|
@@ -8732,6 +8781,89 @@ var DEFAULT_TW_CONFIG = `${JSON.stringify(
|
|
|
8732
8781
|
function pkgHasDep(pkg, name) {
|
|
8733
8782
|
return Boolean(pkg.dependencies?.[name] || pkg.devDependencies?.[name]);
|
|
8734
8783
|
}
|
|
8784
|
+
async function validateThemeConfig(cwd2) {
|
|
8785
|
+
const results = [];
|
|
8786
|
+
try {
|
|
8787
|
+
const native = getNativeBridge();
|
|
8788
|
+
if (!native) {
|
|
8789
|
+
results.push({ type: "theme", valid: false, message: "Native binding not available" });
|
|
8790
|
+
return results;
|
|
8791
|
+
}
|
|
8792
|
+
const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
|
|
8793
|
+
let configPath = null;
|
|
8794
|
+
for (const file of twConfigFiles) {
|
|
8795
|
+
if (await pathExists2(path6__namespace.default.join(cwd2, file))) {
|
|
8796
|
+
configPath = path6__namespace.default.join(cwd2, file);
|
|
8797
|
+
break;
|
|
8798
|
+
}
|
|
8799
|
+
}
|
|
8800
|
+
if (!configPath) {
|
|
8801
|
+
results.push({ type: "theme-config-missing", valid: false, message: "No tailwind.config found" });
|
|
8802
|
+
return results;
|
|
8803
|
+
}
|
|
8804
|
+
try {
|
|
8805
|
+
const configUrl = url.pathToFileURL(configPath);
|
|
8806
|
+
const configModule = await import(configUrl.href);
|
|
8807
|
+
const config = configModule.default || configModule;
|
|
8808
|
+
const theme = config.theme || {};
|
|
8809
|
+
if (theme.colors && native.validateColorsNapi) {
|
|
8810
|
+
try {
|
|
8811
|
+
const colorsJson = JSON.stringify(theme.colors);
|
|
8812
|
+
const isValid = native.validateColorsNapi(colorsJson);
|
|
8813
|
+
results.push({
|
|
8814
|
+
type: "theme-colors",
|
|
8815
|
+
valid: isValid,
|
|
8816
|
+
message: isValid ? "Colors theme validated OK" : "Invalid colors in theme"
|
|
8817
|
+
});
|
|
8818
|
+
} catch (err) {
|
|
8819
|
+
results.push({
|
|
8820
|
+
type: "theme-colors",
|
|
8821
|
+
valid: false,
|
|
8822
|
+
message: `Color validation error: ${err instanceof Error ? err.message : String(err)}`
|
|
8823
|
+
});
|
|
8824
|
+
}
|
|
8825
|
+
}
|
|
8826
|
+
if (theme.screens && native.validateBreakpointsNapi) {
|
|
8827
|
+
try {
|
|
8828
|
+
const screensJson = JSON.stringify(theme.screens);
|
|
8829
|
+
const isValid = native.validateBreakpointsNapi(screensJson);
|
|
8830
|
+
results.push({
|
|
8831
|
+
type: "theme-breakpoints",
|
|
8832
|
+
valid: isValid,
|
|
8833
|
+
message: isValid ? "Breakpoints validated OK" : "Invalid breakpoints in theme"
|
|
8834
|
+
});
|
|
8835
|
+
} catch (err) {
|
|
8836
|
+
results.push({
|
|
8837
|
+
type: "theme-breakpoints",
|
|
8838
|
+
valid: false,
|
|
8839
|
+
message: `Breakpoints validation error: ${err instanceof Error ? err.message : String(err)}`
|
|
8840
|
+
});
|
|
8841
|
+
}
|
|
8842
|
+
}
|
|
8843
|
+
if (native.runHealthCheck) {
|
|
8844
|
+
try {
|
|
8845
|
+
native.runHealthCheck();
|
|
8846
|
+
results.push({ type: "theme-integrity", valid: true, message: "Theme integrity check passed" });
|
|
8847
|
+
} catch {
|
|
8848
|
+
results.push({ type: "theme-integrity", valid: false, message: "Theme integrity check failed" });
|
|
8849
|
+
}
|
|
8850
|
+
}
|
|
8851
|
+
} catch (err) {
|
|
8852
|
+
results.push({
|
|
8853
|
+
type: "theme-load",
|
|
8854
|
+
valid: false,
|
|
8855
|
+
message: `Failed to load theme config: ${err instanceof Error ? err.message : String(err)}`
|
|
8856
|
+
});
|
|
8857
|
+
}
|
|
8858
|
+
} catch (err) {
|
|
8859
|
+
results.push({
|
|
8860
|
+
type: "theme-validation",
|
|
8861
|
+
valid: false,
|
|
8862
|
+
message: `Theme validation failed: ${err instanceof Error ? err.message : String(err)}`
|
|
8863
|
+
});
|
|
8864
|
+
}
|
|
8865
|
+
return results;
|
|
8866
|
+
}
|
|
8735
8867
|
function nodeVersion() {
|
|
8736
8868
|
const full = process.version.replace("v", "");
|
|
8737
8869
|
const major = parseInt(full.split(".")[0], 10);
|
|
@@ -8856,6 +8988,16 @@ async function runPreflightCli(rawArgs) {
|
|
|
8856
8988
|
"Run: tw migrate --dry-run to see migration steps"
|
|
8857
8989
|
);
|
|
8858
8990
|
}
|
|
8991
|
+
const themeValidation = await validateThemeConfig(cwd2);
|
|
8992
|
+
for (const validation of themeValidation) {
|
|
8993
|
+
check(
|
|
8994
|
+
results,
|
|
8995
|
+
`theme-${validation.type}`,
|
|
8996
|
+
`Theme ${validation.type}`,
|
|
8997
|
+
validation.valid,
|
|
8998
|
+
validation.message
|
|
8999
|
+
);
|
|
9000
|
+
}
|
|
8859
9001
|
const hasTsConfig = await pathExists2(path6__namespace.default.join(cwd2, "tsconfig.json"));
|
|
8860
9002
|
check(
|
|
8861
9003
|
results,
|