tailwind-styled-v4 5.1.16 → 5.1.17
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/dist/atomic.js +16 -4
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +13 -2
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +80 -68
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +77 -66
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +84 -4
- package/dist/compiler.d.ts +84 -4
- package/dist/compiler.js +245 -15
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +240 -14
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.js +209 -167
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +200 -159
- package/dist/engine.mjs.map +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +16 -0
- package/dist/next.d.ts +16 -0
- package/dist/next.js +458 -158
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +454 -154
- package/dist/next.mjs.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +1 -1
- package/dist/runtime.mjs.map +1 -1
- package/dist/shared.js +106 -64
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +101 -60
- package/dist/shared.mjs.map +1 -1
- package/dist/theme.js +1 -1
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +1 -1
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +94 -52
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +92 -51
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +80 -68
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +77 -66
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +172 -130
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +166 -125
- package/dist/vite.mjs.map +1 -1
- package/dist/webpackLoader.js +28 -10
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +26 -9
- package/dist/webpackLoader.mjs.map +1 -1
- package/package.json +1 -1
package/dist/tw.mjs
CHANGED
|
@@ -998,8 +998,8 @@ var require_command = __commonJS({
|
|
|
998
998
|
init_esm_shims();
|
|
999
999
|
var EventEmitter = __require("events").EventEmitter;
|
|
1000
1000
|
var childProcess = __require("child_process");
|
|
1001
|
-
var
|
|
1002
|
-
var
|
|
1001
|
+
var path32 = __require("path");
|
|
1002
|
+
var fs17 = __require("fs");
|
|
1003
1003
|
var process2 = __require("process");
|
|
1004
1004
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1005
1005
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -1931,11 +1931,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1931
1931
|
let launchWithNode = false;
|
|
1932
1932
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1933
1933
|
function findFile(baseDir, baseName) {
|
|
1934
|
-
const localBin =
|
|
1935
|
-
if (
|
|
1936
|
-
if (sourceExt.includes(
|
|
1934
|
+
const localBin = path32.resolve(baseDir, baseName);
|
|
1935
|
+
if (fs17.existsSync(localBin)) return localBin;
|
|
1936
|
+
if (sourceExt.includes(path32.extname(baseName))) return void 0;
|
|
1937
1937
|
const foundExt = sourceExt.find(
|
|
1938
|
-
(ext) =>
|
|
1938
|
+
(ext) => fs17.existsSync(`${localBin}${ext}`)
|
|
1939
1939
|
);
|
|
1940
1940
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
1941
1941
|
return void 0;
|
|
@@ -1947,21 +1947,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1947
1947
|
if (this._scriptPath) {
|
|
1948
1948
|
let resolvedScriptPath;
|
|
1949
1949
|
try {
|
|
1950
|
-
resolvedScriptPath =
|
|
1950
|
+
resolvedScriptPath = fs17.realpathSync(this._scriptPath);
|
|
1951
1951
|
} catch (err) {
|
|
1952
1952
|
resolvedScriptPath = this._scriptPath;
|
|
1953
1953
|
}
|
|
1954
|
-
executableDir =
|
|
1955
|
-
|
|
1954
|
+
executableDir = path32.resolve(
|
|
1955
|
+
path32.dirname(resolvedScriptPath),
|
|
1956
1956
|
executableDir
|
|
1957
1957
|
);
|
|
1958
1958
|
}
|
|
1959
1959
|
if (executableDir) {
|
|
1960
1960
|
let localFile = findFile(executableDir, executableFile);
|
|
1961
1961
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1962
|
-
const legacyName =
|
|
1962
|
+
const legacyName = path32.basename(
|
|
1963
1963
|
this._scriptPath,
|
|
1964
|
-
|
|
1964
|
+
path32.extname(this._scriptPath)
|
|
1965
1965
|
);
|
|
1966
1966
|
if (legacyName !== this._name) {
|
|
1967
1967
|
localFile = findFile(
|
|
@@ -1972,7 +1972,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1972
1972
|
}
|
|
1973
1973
|
executableFile = localFile || executableFile;
|
|
1974
1974
|
}
|
|
1975
|
-
launchWithNode = sourceExt.includes(
|
|
1975
|
+
launchWithNode = sourceExt.includes(path32.extname(executableFile));
|
|
1976
1976
|
let proc;
|
|
1977
1977
|
if (process2.platform !== "win32") {
|
|
1978
1978
|
if (launchWithNode) {
|
|
@@ -2812,7 +2812,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2812
2812
|
* @return {Command}
|
|
2813
2813
|
*/
|
|
2814
2814
|
nameFromFilename(filename) {
|
|
2815
|
-
this._name =
|
|
2815
|
+
this._name = path32.basename(filename, path32.extname(filename));
|
|
2816
2816
|
return this;
|
|
2817
2817
|
}
|
|
2818
2818
|
/**
|
|
@@ -2826,9 +2826,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2826
2826
|
* @param {string} [path]
|
|
2827
2827
|
* @return {(string|null|Command)}
|
|
2828
2828
|
*/
|
|
2829
|
-
executableDir(
|
|
2830
|
-
if (
|
|
2831
|
-
this._executableDir =
|
|
2829
|
+
executableDir(path33) {
|
|
2830
|
+
if (path33 === void 0) return this._executableDir;
|
|
2831
|
+
this._executableDir = path33;
|
|
2832
2832
|
return this;
|
|
2833
2833
|
}
|
|
2834
2834
|
/**
|
|
@@ -3346,9 +3346,9 @@ function createDebugLogger(namespace, label) {
|
|
|
3346
3346
|
}
|
|
3347
3347
|
};
|
|
3348
3348
|
}
|
|
3349
|
-
function formatIssuePath(
|
|
3350
|
-
if (!
|
|
3351
|
-
return
|
|
3349
|
+
function formatIssuePath(path32) {
|
|
3350
|
+
if (!path32 || path32.length === 0) return "(root)";
|
|
3351
|
+
return path32.map(
|
|
3352
3352
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3353
3353
|
).join(".");
|
|
3354
3354
|
}
|
|
@@ -3464,8 +3464,8 @@ var init_src = __esm({
|
|
|
3464
3464
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
3465
3465
|
static fromZod(err) {
|
|
3466
3466
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
3467
|
-
const
|
|
3468
|
-
const message = first ? `${
|
|
3467
|
+
const path32 = formatIssuePath(first?.path);
|
|
3468
|
+
const message = first ? `${path32}: ${first.message}` : "Schema validation failed";
|
|
3469
3469
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
3470
3470
|
}
|
|
3471
3471
|
static wrap(source, code, err) {
|
|
@@ -4021,12 +4021,12 @@ var init_schemas = __esm({
|
|
|
4021
4021
|
"use strict";
|
|
4022
4022
|
init_esm_shims();
|
|
4023
4023
|
init_src();
|
|
4024
|
-
formatIssuePath2 = (
|
|
4024
|
+
formatIssuePath2 = (path32) => path32.length > 0 ? path32.map(
|
|
4025
4025
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
4026
4026
|
).join(".") : "<root>";
|
|
4027
4027
|
formatIssues = (error) => error.issues.map((issue) => {
|
|
4028
|
-
const
|
|
4029
|
-
return `${
|
|
4028
|
+
const path32 = formatIssuePath2(issue.path);
|
|
4029
|
+
return `${path32}: ${issue.message}`;
|
|
4030
4030
|
}).join("; ");
|
|
4031
4031
|
parseWithSchema = (schema, data, label) => {
|
|
4032
4032
|
const parsed = schema.safeParse(data);
|
|
@@ -4631,7 +4631,7 @@ var init_schemas2 = __esm({
|
|
|
4631
4631
|
"use strict";
|
|
4632
4632
|
init_esm_shims();
|
|
4633
4633
|
init_src();
|
|
4634
|
-
formatIssuePath3 = (
|
|
4634
|
+
formatIssuePath3 = (path32) => path32.length > 0 ? path32.map(
|
|
4635
4635
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
4636
4636
|
).join(".") : "<root>";
|
|
4637
4637
|
isPlainObject = (value) => {
|
|
@@ -4640,8 +4640,8 @@ var init_schemas2 = __esm({
|
|
|
4640
4640
|
return proto === Object.prototype || proto === null;
|
|
4641
4641
|
};
|
|
4642
4642
|
formatIssues2 = (error) => error.issues.map((issue) => {
|
|
4643
|
-
const
|
|
4644
|
-
return `${
|
|
4643
|
+
const path32 = formatIssuePath3(issue.path);
|
|
4644
|
+
return `${path32}: ${issue.message}`;
|
|
4645
4645
|
}).join("; ");
|
|
4646
4646
|
parseWithSchema2 = (schema, data, label) => {
|
|
4647
4647
|
const parsed = schema.safeParse(data);
|
|
@@ -6262,7 +6262,7 @@ var init_nativeBridge = __esm({
|
|
|
6262
6262
|
"use strict";
|
|
6263
6263
|
init_esm_shims();
|
|
6264
6264
|
init_src();
|
|
6265
|
-
_loadNative = (
|
|
6265
|
+
_loadNative = (path32) => __require(path32);
|
|
6266
6266
|
log3 = (...args) => {
|
|
6267
6267
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
6268
6268
|
console.log("[compiler:native]", ...args);
|
|
@@ -6404,9 +6404,19 @@ var init_watch = __esm({
|
|
|
6404
6404
|
}
|
|
6405
6405
|
});
|
|
6406
6406
|
|
|
6407
|
-
// packages/domain/compiler/src/
|
|
6407
|
+
// packages/domain/compiler/src/routeGraph.ts
|
|
6408
6408
|
import fs12 from "fs";
|
|
6409
6409
|
import path25 from "path";
|
|
6410
|
+
var init_routeGraph = __esm({
|
|
6411
|
+
"packages/domain/compiler/src/routeGraph.ts"() {
|
|
6412
|
+
"use strict";
|
|
6413
|
+
init_esm_shims();
|
|
6414
|
+
}
|
|
6415
|
+
});
|
|
6416
|
+
|
|
6417
|
+
// packages/domain/compiler/src/index.ts
|
|
6418
|
+
import fs13 from "fs";
|
|
6419
|
+
import path26 from "path";
|
|
6410
6420
|
import { createRequire as createRequire4 } from "module";
|
|
6411
6421
|
var _require3, compileCssFromClasses;
|
|
6412
6422
|
var init_src4 = __esm({
|
|
@@ -6420,6 +6430,7 @@ var init_src4 = __esm({
|
|
|
6420
6430
|
init_cache();
|
|
6421
6431
|
init_redis();
|
|
6422
6432
|
init_watch();
|
|
6433
|
+
init_routeGraph();
|
|
6423
6434
|
_require3 = createRequire4(
|
|
6424
6435
|
typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
|
|
6425
6436
|
);
|
|
@@ -9102,7 +9113,7 @@ init_errors();
|
|
|
9102
9113
|
init_fs();
|
|
9103
9114
|
init_json();
|
|
9104
9115
|
init_src4();
|
|
9105
|
-
import
|
|
9116
|
+
import path27 from "path";
|
|
9106
9117
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
9107
9118
|
var DEFAULT_TAILWIND_CSS2 = '@import "tailwindcss";\n';
|
|
9108
9119
|
var DEFAULT_TW_CONFIG = `${JSON.stringify(
|
|
@@ -9129,8 +9140,8 @@ async function validateThemeConfig(cwd2) {
|
|
|
9129
9140
|
const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
|
|
9130
9141
|
let configPath = null;
|
|
9131
9142
|
for (const file of twConfigFiles) {
|
|
9132
|
-
if (await pathExists2(
|
|
9133
|
-
configPath =
|
|
9143
|
+
if (await pathExists2(path27.join(cwd2, file))) {
|
|
9144
|
+
configPath = path27.join(cwd2, file);
|
|
9134
9145
|
break;
|
|
9135
9146
|
}
|
|
9136
9147
|
}
|
|
@@ -9221,7 +9232,7 @@ function resolveCliEntry(scriptPath) {
|
|
|
9221
9232
|
async function hasTailwindCssImport(cwd2) {
|
|
9222
9233
|
const cssFiles = ["src/app/globals.css", "src/index.css", "src/style.css", "app/globals.css"];
|
|
9223
9234
|
for (const file of cssFiles) {
|
|
9224
|
-
const raw = await readFileSafe(
|
|
9235
|
+
const raw = await readFileSafe(path27.join(cwd2, file));
|
|
9225
9236
|
if (raw?.includes("tailwindcss")) return true;
|
|
9226
9237
|
}
|
|
9227
9238
|
return false;
|
|
@@ -9237,7 +9248,7 @@ async function hasSafelistSource(cwd2) {
|
|
|
9237
9248
|
"app/globals.css"
|
|
9238
9249
|
];
|
|
9239
9250
|
for (const file of cssFiles) {
|
|
9240
|
-
const raw = await readFileSafe(
|
|
9251
|
+
const raw = await readFileSafe(path27.join(cwd2, file));
|
|
9241
9252
|
if (raw === null) continue;
|
|
9242
9253
|
if (raw.includes("tw-classes")) return { found: true, cssFile: file };
|
|
9243
9254
|
if (raw.includes("tailwindcss")) return { found: false, cssFile: file };
|
|
@@ -9245,8 +9256,8 @@ async function hasSafelistSource(cwd2) {
|
|
|
9245
9256
|
return { found: false, cssFile: null };
|
|
9246
9257
|
}
|
|
9247
9258
|
async function applyTailwindInit(cwd2) {
|
|
9248
|
-
await ensureFileSafe(
|
|
9249
|
-
await ensureFileSafe(
|
|
9259
|
+
await ensureFileSafe(path27.join(cwd2, "src", "tailwind.css"), DEFAULT_TAILWIND_CSS2);
|
|
9260
|
+
await ensureFileSafe(path27.join(cwd2, "tailwind-styled.config.json"), DEFAULT_TW_CONFIG);
|
|
9250
9261
|
}
|
|
9251
9262
|
function check(results, id, label, pass, message, fix) {
|
|
9252
9263
|
results.push({ id, label, pass, message, fix });
|
|
@@ -9268,7 +9279,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9268
9279
|
node.major >= 20 ? `Node ${node.full} OK` : `Node ${node.full} - requires >=20. Download: https://nodejs.org`,
|
|
9269
9280
|
node.major < 20 ? "Install Node.js 20 LTS or newer from https://nodejs.org" : void 0
|
|
9270
9281
|
);
|
|
9271
|
-
const pkg = await readJsonSafe(
|
|
9282
|
+
const pkg = await readJsonSafe(path27.join(cwd2, "package.json"));
|
|
9272
9283
|
check(
|
|
9273
9284
|
results,
|
|
9274
9285
|
"package-json",
|
|
@@ -9302,7 +9313,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9302
9313
|
}
|
|
9303
9314
|
const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
|
|
9304
9315
|
const twConfigChecks = await Promise.all(
|
|
9305
|
-
twConfigFiles.map(async (file) => ({ file, exists: await pathExists2(
|
|
9316
|
+
twConfigFiles.map(async (file) => ({ file, exists: await pathExists2(path27.join(cwd2, file)) }))
|
|
9306
9317
|
);
|
|
9307
9318
|
const foundTwConfig = twConfigChecks.find((item) => item.exists)?.file ?? null;
|
|
9308
9319
|
const hasCssConfig = await hasTailwindCssImport(cwd2);
|
|
@@ -9314,7 +9325,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9314
9325
|
foundTwConfig ? `${foundTwConfig} found OK` : hasCssConfig ? "@import tailwindcss found in CSS OK" : "No Tailwind config found - run: tw init",
|
|
9315
9326
|
"tw init"
|
|
9316
9327
|
);
|
|
9317
|
-
const oldConfig = await readJsonSafe(
|
|
9328
|
+
const oldConfig = await readJsonSafe(path27.join(cwd2, "tailwind.config.js")) ?? await readJsonSafe(path27.join(cwd2, "tailwind.config.ts"));
|
|
9318
9329
|
if (oldConfig) {
|
|
9319
9330
|
const hasOldJit = oldConfig.mode === "jit";
|
|
9320
9331
|
const hasOldPurge = "purge" in oldConfig;
|
|
@@ -9338,7 +9349,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9338
9349
|
validation.message
|
|
9339
9350
|
);
|
|
9340
9351
|
}
|
|
9341
|
-
const hasTsConfig = await pathExists2(
|
|
9352
|
+
const hasTsConfig = await pathExists2(path27.join(cwd2, "tsconfig.json"));
|
|
9342
9353
|
check(
|
|
9343
9354
|
results,
|
|
9344
9355
|
"typescript",
|
|
@@ -9700,7 +9711,7 @@ init_esm_shims();
|
|
|
9700
9711
|
init_errors();
|
|
9701
9712
|
init_fs();
|
|
9702
9713
|
init_json();
|
|
9703
|
-
import
|
|
9714
|
+
import path28 from "path";
|
|
9704
9715
|
import { parseArgs as parseNodeArgs11 } from "util";
|
|
9705
9716
|
var storybookCommand = {
|
|
9706
9717
|
name: "storybook",
|
|
@@ -9739,7 +9750,7 @@ var storybookCommand = {
|
|
|
9739
9750
|
context.output.writeText(
|
|
9740
9751
|
`[tw storybook] Tip: use --variants='{"size":["sm","lg"]}' to enumerate variant combinations`
|
|
9741
9752
|
);
|
|
9742
|
-
const localBin =
|
|
9753
|
+
const localBin = path28.join(
|
|
9743
9754
|
process.cwd(),
|
|
9744
9755
|
"node_modules",
|
|
9745
9756
|
".bin",
|
|
@@ -10926,10 +10937,10 @@ async function traceClass(className, options) {
|
|
|
10926
10937
|
init_esm_shims();
|
|
10927
10938
|
init_internal();
|
|
10928
10939
|
init_src2();
|
|
10929
|
-
import
|
|
10930
|
-
import
|
|
10940
|
+
import fs14 from "fs";
|
|
10941
|
+
import path29 from "path";
|
|
10931
10942
|
function toRelativePath(root, value) {
|
|
10932
|
-
const relative =
|
|
10943
|
+
const relative = path29.relative(root, value);
|
|
10933
10944
|
return relative.length > 0 ? relative : ".";
|
|
10934
10945
|
}
|
|
10935
10946
|
function uniqueSorted(values) {
|
|
@@ -10998,7 +11009,7 @@ function tryCompileClasses(classes) {
|
|
|
10998
11009
|
}
|
|
10999
11010
|
}
|
|
11000
11011
|
function traceSingleFile(filePath, root) {
|
|
11001
|
-
const source =
|
|
11012
|
+
const source = fs14.readFileSync(filePath, "utf8");
|
|
11002
11013
|
const classes = uniqueSorted(scanSource(source));
|
|
11003
11014
|
const imports = extractImports(source);
|
|
11004
11015
|
const compiled = tryCompileClasses(classes);
|
|
@@ -11029,7 +11040,7 @@ function traceDirectory(targetDir, root) {
|
|
|
11029
11040
|
const imports = [];
|
|
11030
11041
|
const importKeys = /* @__PURE__ */ new Set();
|
|
11031
11042
|
const files = scanResult.files.filter((entry) => isScannableFile2(entry.file, DEFAULT_EXTENSIONS)).map((entry) => {
|
|
11032
|
-
const source =
|
|
11043
|
+
const source = fs14.readFileSync(entry.file, "utf8");
|
|
11033
11044
|
const fileImports = extractImports(source);
|
|
11034
11045
|
for (const fileImport of fileImports) {
|
|
11035
11046
|
const key = `${fileImport.kind}:${fileImport.source}`;
|
|
@@ -11060,12 +11071,12 @@ function traceDirectory(targetDir, root) {
|
|
|
11060
11071
|
};
|
|
11061
11072
|
}
|
|
11062
11073
|
async function traceTarget(target, options = {}) {
|
|
11063
|
-
const root =
|
|
11064
|
-
const resolvedTarget =
|
|
11065
|
-
if (!
|
|
11074
|
+
const root = path29.resolve(options.root ?? process.cwd());
|
|
11075
|
+
const resolvedTarget = path29.resolve(root, target);
|
|
11076
|
+
if (!fs14.existsSync(resolvedTarget)) {
|
|
11066
11077
|
throw new Error(`Trace target not found: ${resolvedTarget}`);
|
|
11067
11078
|
}
|
|
11068
|
-
const stat =
|
|
11079
|
+
const stat = fs14.statSync(resolvedTarget);
|
|
11069
11080
|
if (stat.isDirectory()) {
|
|
11070
11081
|
return traceDirectory(resolvedTarget, root);
|
|
11071
11082
|
}
|
|
@@ -11230,14 +11241,14 @@ function printClassTraceOutput(result, output) {
|
|
|
11230
11241
|
init_esm_shims();
|
|
11231
11242
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
11232
11243
|
init_output();
|
|
11233
|
-
import
|
|
11234
|
-
import
|
|
11244
|
+
import fs15 from "fs";
|
|
11245
|
+
import path30 from "path";
|
|
11235
11246
|
async function runGenerateTypesCli(rawArgs) {
|
|
11236
11247
|
const output = createCliOutput({ json: rawArgs.includes("--json") });
|
|
11237
11248
|
const logger = createCliLogger({ output });
|
|
11238
11249
|
const cwd2 = process.cwd();
|
|
11239
11250
|
const outFile = rawArgs.find((a) => a.startsWith("--out="))?.slice(6) ?? "src/types/tailwind-styled.d.ts";
|
|
11240
|
-
const outPath =
|
|
11251
|
+
const outPath = path30.resolve(cwd2, outFile);
|
|
11241
11252
|
output.writeText("");
|
|
11242
11253
|
output.writeText(import_picocolors6.default.bold(import_picocolors6.default.cyan(" \u25C6 tw generate-types")));
|
|
11243
11254
|
output.writeText(import_picocolors6.default.dim(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
@@ -11273,12 +11284,12 @@ async function runGenerateTypesCli(rawArgs) {
|
|
|
11273
11284
|
}
|
|
11274
11285
|
output.writeText("");
|
|
11275
11286
|
output.writeText(import_picocolors6.default.bold(" [2/2]") + import_picocolors6.default.cyan(" generate .d.ts"));
|
|
11276
|
-
const outDir =
|
|
11277
|
-
if (!
|
|
11278
|
-
|
|
11287
|
+
const outDir = path30.dirname(outPath);
|
|
11288
|
+
if (!fs15.existsSync(outDir)) {
|
|
11289
|
+
fs15.mkdirSync(outDir, { recursive: true });
|
|
11279
11290
|
}
|
|
11280
|
-
|
|
11281
|
-
logger.ok(
|
|
11291
|
+
fs15.writeFileSync(outPath, result.dtsContent, "utf-8");
|
|
11292
|
+
logger.ok(path30.relative(cwd2, outPath));
|
|
11282
11293
|
output.writeText("");
|
|
11283
11294
|
output.writeText(import_picocolors6.default.dim(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
11284
11295
|
output.writeText(import_picocolors6.default.bold(import_picocolors6.default.green(" \u2713 types generated")));
|
|
@@ -11289,11 +11300,11 @@ async function runGenerateTypesCli(rawArgs) {
|
|
|
11289
11300
|
}
|
|
11290
11301
|
async function loadNativeBinding2(cwd2) {
|
|
11291
11302
|
const candidates = [
|
|
11292
|
-
|
|
11293
|
-
|
|
11303
|
+
path30.join(cwd2, "native", "tailwind-styled-native.node"),
|
|
11304
|
+
path30.join(cwd2, "node_modules", "tailwind-styled-v4", "native", "tailwind-styled-native.node")
|
|
11294
11305
|
];
|
|
11295
11306
|
for (const candidate of candidates) {
|
|
11296
|
-
if (
|
|
11307
|
+
if (fs15.existsSync(candidate)) {
|
|
11297
11308
|
try {
|
|
11298
11309
|
return __require(candidate);
|
|
11299
11310
|
} catch {
|
|
@@ -11311,8 +11322,8 @@ import { parseArgs as parseNodeArgs14 } from "util";
|
|
|
11311
11322
|
// packages/infrastructure/cli/src/utils/whyService.ts
|
|
11312
11323
|
init_esm_shims();
|
|
11313
11324
|
init_internal();
|
|
11314
|
-
import
|
|
11315
|
-
import
|
|
11325
|
+
import fs16 from "fs";
|
|
11326
|
+
import path31 from "path";
|
|
11316
11327
|
init_src2();
|
|
11317
11328
|
function extractVariantChain(usage) {
|
|
11318
11329
|
const segments = normalizeScannedClass(usage).split(":").filter(Boolean);
|
|
@@ -11360,7 +11371,7 @@ async function whyClass(className, options) {
|
|
|
11360
11371
|
for (const file of scanResult.files) {
|
|
11361
11372
|
const source = (() => {
|
|
11362
11373
|
try {
|
|
11363
|
-
return
|
|
11374
|
+
return fs16.readFileSync(file.file, "utf8");
|
|
11364
11375
|
} catch {
|
|
11365
11376
|
return "";
|
|
11366
11377
|
}
|
|
@@ -11374,7 +11385,7 @@ async function whyClass(className, options) {
|
|
|
11374
11385
|
className
|
|
11375
11386
|
]);
|
|
11376
11387
|
usedIn.push({
|
|
11377
|
-
file:
|
|
11388
|
+
file: path31.relative(root, file.file) || path31.basename(file.file),
|
|
11378
11389
|
line: location.line,
|
|
11379
11390
|
column: location.column,
|
|
11380
11391
|
usage: normalizeScannedClass(fileClass)
|