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