tailwind-styled-v4 5.0.40 → 5.0.411
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/analyzer.js +43 -16
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +104 -72
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +33 -7
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +55 -22
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +39 -10
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +56 -23
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +222 -38
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +321 -203
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.js +57 -14
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +71 -28
- package/dist/compiler.mjs.map +1 -1
- package/dist/dashboard.js +0 -1
- package/dist/dashboard.js.map +1 -1
- package/dist/devtools.js +16 -2
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +21 -2
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.js +141 -51
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +238 -148
- package/dist/engine.mjs.map +1 -1
- package/dist/index.js +50 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -29
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +98 -37
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +177 -115
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.js +0 -1
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-registry.js +6 -2
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +9 -2
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.js +0 -1
- package/dist/plugin.js.map +1 -1
- package/dist/preset.js +0 -1
- package/dist/preset.js.map +1 -1
- package/dist/rspack.js +89 -6
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +39 -18
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.js +0 -1
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime.js +0 -1
- package/dist/runtime.js.map +1 -1
- package/dist/scanner.js +29 -11
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +84 -61
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.js +91 -35
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +122 -64
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.js +0 -1
- package/dist/storybook-addon.js.map +1 -1
- package/dist/svelte.js +40 -8
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +57 -28
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +7 -3
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +30 -23
- package/dist/syntax.mjs.map +1 -1
- package/dist/testing.js +0 -1
- package/dist/testing.js.map +1 -1
- package/dist/theme.js +23 -5
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +41 -17
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +58 -14
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +89 -45
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +224 -38
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +321 -203
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +132 -50
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +226 -143
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +40 -8
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +57 -28
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +40 -10
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +59 -27
- package/dist/webpackLoader.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -39,10 +39,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
39
39
|
));
|
|
40
40
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
41
41
|
|
|
42
|
+
// node_modules/tsup/assets/esm_shims.js
|
|
43
|
+
import path from "path";
|
|
44
|
+
import { fileURLToPath } from "url";
|
|
45
|
+
var getFilename, getDirname, __dirname, __filename;
|
|
46
|
+
var init_esm_shims = __esm({
|
|
47
|
+
"node_modules/tsup/assets/esm_shims.js"() {
|
|
48
|
+
"use strict";
|
|
49
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
50
|
+
getDirname = () => path.dirname(getFilename());
|
|
51
|
+
__dirname = /* @__PURE__ */ getDirname();
|
|
52
|
+
__filename = /* @__PURE__ */ getFilename();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
42
56
|
// packages/infrastructure/cli/node_modules/commander/lib/error.js
|
|
43
57
|
var require_error = __commonJS({
|
|
44
58
|
"packages/infrastructure/cli/node_modules/commander/lib/error.js"(exports) {
|
|
45
59
|
"use strict";
|
|
60
|
+
init_esm_shims();
|
|
46
61
|
var CommanderError2 = class extends Error {
|
|
47
62
|
/**
|
|
48
63
|
* Constructs the CommanderError class
|
|
@@ -79,6 +94,7 @@ var require_error = __commonJS({
|
|
|
79
94
|
var require_argument = __commonJS({
|
|
80
95
|
"packages/infrastructure/cli/node_modules/commander/lib/argument.js"(exports) {
|
|
81
96
|
"use strict";
|
|
97
|
+
init_esm_shims();
|
|
82
98
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
83
99
|
var Argument2 = class {
|
|
84
100
|
/**
|
|
@@ -207,6 +223,7 @@ var require_argument = __commonJS({
|
|
|
207
223
|
var require_help = __commonJS({
|
|
208
224
|
"packages/infrastructure/cli/node_modules/commander/lib/help.js"(exports) {
|
|
209
225
|
"use strict";
|
|
226
|
+
init_esm_shims();
|
|
210
227
|
var { humanReadableArgName } = require_argument();
|
|
211
228
|
var Help2 = class {
|
|
212
229
|
constructor() {
|
|
@@ -622,6 +639,7 @@ var require_help = __commonJS({
|
|
|
622
639
|
var require_option = __commonJS({
|
|
623
640
|
"packages/infrastructure/cli/node_modules/commander/lib/option.js"(exports) {
|
|
624
641
|
"use strict";
|
|
642
|
+
init_esm_shims();
|
|
625
643
|
var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
626
644
|
var Option2 = class {
|
|
627
645
|
/**
|
|
@@ -895,6 +913,7 @@ var require_option = __commonJS({
|
|
|
895
913
|
var require_suggestSimilar = __commonJS({
|
|
896
914
|
"packages/infrastructure/cli/node_modules/commander/lib/suggestSimilar.js"(exports) {
|
|
897
915
|
"use strict";
|
|
916
|
+
init_esm_shims();
|
|
898
917
|
var maxDistance = 3;
|
|
899
918
|
function editDistance(a, b) {
|
|
900
919
|
if (Math.abs(a.length - b.length) > maxDistance)
|
|
@@ -976,9 +995,10 @@ var require_suggestSimilar = __commonJS({
|
|
|
976
995
|
var require_command = __commonJS({
|
|
977
996
|
"packages/infrastructure/cli/node_modules/commander/lib/command.js"(exports) {
|
|
978
997
|
"use strict";
|
|
998
|
+
init_esm_shims();
|
|
979
999
|
var EventEmitter = __require("events").EventEmitter;
|
|
980
1000
|
var childProcess = __require("child_process");
|
|
981
|
-
var
|
|
1001
|
+
var path31 = __require("path");
|
|
982
1002
|
var fs16 = __require("fs");
|
|
983
1003
|
var process2 = __require("process");
|
|
984
1004
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
@@ -1911,9 +1931,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1911
1931
|
let launchWithNode = false;
|
|
1912
1932
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1913
1933
|
function findFile(baseDir, baseName) {
|
|
1914
|
-
const localBin =
|
|
1934
|
+
const localBin = path31.resolve(baseDir, baseName);
|
|
1915
1935
|
if (fs16.existsSync(localBin)) return localBin;
|
|
1916
|
-
if (sourceExt.includes(
|
|
1936
|
+
if (sourceExt.includes(path31.extname(baseName))) return void 0;
|
|
1917
1937
|
const foundExt = sourceExt.find(
|
|
1918
1938
|
(ext) => fs16.existsSync(`${localBin}${ext}`)
|
|
1919
1939
|
);
|
|
@@ -1931,17 +1951,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1931
1951
|
} catch (err) {
|
|
1932
1952
|
resolvedScriptPath = this._scriptPath;
|
|
1933
1953
|
}
|
|
1934
|
-
executableDir =
|
|
1935
|
-
|
|
1954
|
+
executableDir = path31.resolve(
|
|
1955
|
+
path31.dirname(resolvedScriptPath),
|
|
1936
1956
|
executableDir
|
|
1937
1957
|
);
|
|
1938
1958
|
}
|
|
1939
1959
|
if (executableDir) {
|
|
1940
1960
|
let localFile = findFile(executableDir, executableFile);
|
|
1941
1961
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1942
|
-
const legacyName =
|
|
1962
|
+
const legacyName = path31.basename(
|
|
1943
1963
|
this._scriptPath,
|
|
1944
|
-
|
|
1964
|
+
path31.extname(this._scriptPath)
|
|
1945
1965
|
);
|
|
1946
1966
|
if (legacyName !== this._name) {
|
|
1947
1967
|
localFile = findFile(
|
|
@@ -1952,7 +1972,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1952
1972
|
}
|
|
1953
1973
|
executableFile = localFile || executableFile;
|
|
1954
1974
|
}
|
|
1955
|
-
launchWithNode = sourceExt.includes(
|
|
1975
|
+
launchWithNode = sourceExt.includes(path31.extname(executableFile));
|
|
1956
1976
|
let proc;
|
|
1957
1977
|
if (process2.platform !== "win32") {
|
|
1958
1978
|
if (launchWithNode) {
|
|
@@ -2792,7 +2812,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2792
2812
|
* @return {Command}
|
|
2793
2813
|
*/
|
|
2794
2814
|
nameFromFilename(filename) {
|
|
2795
|
-
this._name =
|
|
2815
|
+
this._name = path31.basename(filename, path31.extname(filename));
|
|
2796
2816
|
return this;
|
|
2797
2817
|
}
|
|
2798
2818
|
/**
|
|
@@ -2806,9 +2826,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2806
2826
|
* @param {string} [path]
|
|
2807
2827
|
* @return {(string|null|Command)}
|
|
2808
2828
|
*/
|
|
2809
|
-
executableDir(
|
|
2810
|
-
if (
|
|
2811
|
-
this._executableDir =
|
|
2829
|
+
executableDir(path32) {
|
|
2830
|
+
if (path32 === void 0) return this._executableDir;
|
|
2831
|
+
this._executableDir = path32;
|
|
2812
2832
|
return this;
|
|
2813
2833
|
}
|
|
2814
2834
|
/**
|
|
@@ -3020,6 +3040,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3020
3040
|
var require_commander = __commonJS({
|
|
3021
3041
|
"packages/infrastructure/cli/node_modules/commander/index.js"(exports) {
|
|
3022
3042
|
"use strict";
|
|
3043
|
+
init_esm_shims();
|
|
3023
3044
|
var { Argument: Argument2 } = require_argument();
|
|
3024
3045
|
var { Command: Command2 } = require_command();
|
|
3025
3046
|
var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
|
|
@@ -3044,6 +3065,7 @@ var import_index, program, createCommand, createArgument, createOption, Commande
|
|
|
3044
3065
|
var init_esm = __esm({
|
|
3045
3066
|
"packages/infrastructure/cli/node_modules/commander/esm.mjs"() {
|
|
3046
3067
|
"use strict";
|
|
3068
|
+
init_esm_shims();
|
|
3047
3069
|
import_index = __toESM(require_commander(), 1);
|
|
3048
3070
|
({
|
|
3049
3071
|
program,
|
|
@@ -3090,6 +3112,7 @@ var CliError, CliUsageError;
|
|
|
3090
3112
|
var init_errors = __esm({
|
|
3091
3113
|
"packages/infrastructure/cli/src/utils/errors.ts"() {
|
|
3092
3114
|
"use strict";
|
|
3115
|
+
init_esm_shims();
|
|
3093
3116
|
CliError = class extends Error {
|
|
3094
3117
|
exitCode;
|
|
3095
3118
|
code;
|
|
@@ -3157,7 +3180,7 @@ function getNodeUrl() {
|
|
|
3157
3180
|
}
|
|
3158
3181
|
return _nodeUrl;
|
|
3159
3182
|
}
|
|
3160
|
-
function
|
|
3183
|
+
function getDirname2(importMetaUrl) {
|
|
3161
3184
|
if (isBrowser) return "";
|
|
3162
3185
|
if (typeof __dirname !== "undefined") return __dirname;
|
|
3163
3186
|
const nodePath = getNodePath();
|
|
@@ -3168,6 +3191,7 @@ var isBrowser, nodeModuleRef, _nodePath, _nodeUrl;
|
|
|
3168
3191
|
var init_esmHelpers = __esm({
|
|
3169
3192
|
"packages/domain/shared/src/esmHelpers.ts"() {
|
|
3170
3193
|
"use strict";
|
|
3194
|
+
init_esm_shims();
|
|
3171
3195
|
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
3172
3196
|
nodeModuleRef = null;
|
|
3173
3197
|
_nodePath = null;
|
|
@@ -3178,7 +3202,16 @@ var init_esmHelpers = __esm({
|
|
|
3178
3202
|
// packages/domain/shared/src/native-resolution.ts
|
|
3179
3203
|
import { createRequire } from "module";
|
|
3180
3204
|
import * as fs from "fs";
|
|
3181
|
-
import * as
|
|
3205
|
+
import * as path2 from "path";
|
|
3206
|
+
function _safeCreateRequire() {
|
|
3207
|
+
if (typeof import.meta !== "undefined" && import.meta.url && !import.meta.url.includes("unknown")) {
|
|
3208
|
+
return createRequire(import.meta.url);
|
|
3209
|
+
}
|
|
3210
|
+
if (typeof __filename !== "undefined") {
|
|
3211
|
+
return createRequire(__filename);
|
|
3212
|
+
}
|
|
3213
|
+
return createRequire(new URL(`file://${process.cwd()}/`).href);
|
|
3214
|
+
}
|
|
3182
3215
|
function platformKey() {
|
|
3183
3216
|
if (isBrowser2) return "browser";
|
|
3184
3217
|
return `${process.platform}-${process.arch}`;
|
|
@@ -3214,11 +3247,11 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
3214
3247
|
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
3215
3248
|
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3216
3249
|
if (runtimeDir) {
|
|
3217
|
-
for (const depth of ["..",
|
|
3218
|
-
const pkgRoot =
|
|
3250
|
+
for (const depth of ["..", path2.join("..", ".."), path2.join("..", "..", "..")]) {
|
|
3251
|
+
const pkgRoot = path2.resolve(runtimeDir, depth);
|
|
3219
3252
|
for (const bin of BINARY_NAMES_SELF) {
|
|
3220
3253
|
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
3221
|
-
const candidate =
|
|
3254
|
+
const candidate = path2.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
3222
3255
|
tried.push(`self-bundled:${candidate}`);
|
|
3223
3256
|
if (fs.existsSync(candidate)) {
|
|
3224
3257
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
@@ -3232,22 +3265,22 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
3232
3265
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3233
3266
|
const localCandidates = [];
|
|
3234
3267
|
for (const bin of BINARY_NAMES) {
|
|
3235
|
-
localCandidates.push(
|
|
3236
|
-
localCandidates.push(
|
|
3237
|
-
localCandidates.push(
|
|
3238
|
-
localCandidates.push(
|
|
3268
|
+
localCandidates.push(path2.resolve(base, `${bin}.node`));
|
|
3269
|
+
localCandidates.push(path2.resolve(base, "..", `${bin}.node`));
|
|
3270
|
+
localCandidates.push(path2.resolve(base, `${bin}.${platform}.node`));
|
|
3271
|
+
localCandidates.push(path2.resolve(base, `${bin}.${napiPlatform}.node`));
|
|
3239
3272
|
}
|
|
3240
3273
|
for (const startDir of [cwd2, base]) {
|
|
3241
3274
|
let dir = startDir;
|
|
3242
3275
|
for (let i = 0; i < 6; i++) {
|
|
3243
|
-
const nativeDir =
|
|
3276
|
+
const nativeDir = path2.resolve(dir, "native");
|
|
3244
3277
|
for (const bin of BINARY_NAMES) {
|
|
3245
|
-
localCandidates.push(
|
|
3246
|
-
localCandidates.push(
|
|
3247
|
-
localCandidates.push(
|
|
3248
|
-
localCandidates.push(
|
|
3278
|
+
localCandidates.push(path2.resolve(nativeDir, `${bin}.node`));
|
|
3279
|
+
localCandidates.push(path2.resolve(nativeDir, `${bin}.${platform}.node`));
|
|
3280
|
+
localCandidates.push(path2.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
|
|
3281
|
+
localCandidates.push(path2.resolve(nativeDir, "target", "release", `${bin}.node`));
|
|
3249
3282
|
}
|
|
3250
|
-
const parent =
|
|
3283
|
+
const parent = path2.resolve(dir, "..");
|
|
3251
3284
|
if (parent === dir) break;
|
|
3252
3285
|
dir = parent;
|
|
3253
3286
|
}
|
|
@@ -3264,10 +3297,9 @@ var isBrowser2, _require, PLATFORM_MAP;
|
|
|
3264
3297
|
var init_native_resolution = __esm({
|
|
3265
3298
|
"packages/domain/shared/src/native-resolution.ts"() {
|
|
3266
3299
|
"use strict";
|
|
3300
|
+
init_esm_shims();
|
|
3267
3301
|
isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
3268
|
-
_require =
|
|
3269
|
-
typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
|
|
3270
|
-
);
|
|
3302
|
+
_require = _safeCreateRequire();
|
|
3271
3303
|
PLATFORM_MAP = {
|
|
3272
3304
|
"linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
|
|
3273
3305
|
"linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
|
|
@@ -3282,8 +3314,8 @@ var init_native_resolution = __esm({
|
|
|
3282
3314
|
// packages/domain/shared/src/index.ts
|
|
3283
3315
|
import { createHash } from "crypto";
|
|
3284
3316
|
import fs2 from "fs";
|
|
3285
|
-
import
|
|
3286
|
-
import { fileURLToPath } from "url";
|
|
3317
|
+
import path3 from "path";
|
|
3318
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
3287
3319
|
import { createRequire as createRequire2 } from "module";
|
|
3288
3320
|
function createLogger(namespace) {
|
|
3289
3321
|
const prefix = `[${namespace}]`;
|
|
@@ -3314,9 +3346,9 @@ function createDebugLogger(namespace, label) {
|
|
|
3314
3346
|
}
|
|
3315
3347
|
};
|
|
3316
3348
|
}
|
|
3317
|
-
function formatIssuePath(
|
|
3318
|
-
if (!
|
|
3319
|
-
return
|
|
3349
|
+
function formatIssuePath(path31) {
|
|
3350
|
+
if (!path31 || path31.length === 0) return "(root)";
|
|
3351
|
+
return path31.map(
|
|
3320
3352
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3321
3353
|
).join(".");
|
|
3322
3354
|
}
|
|
@@ -3327,7 +3359,7 @@ function loadNativeBinding(options) {
|
|
|
3327
3359
|
const { runtimeDir, candidates, isValid } = options;
|
|
3328
3360
|
const loadErrors = [];
|
|
3329
3361
|
for (const candidate of candidates) {
|
|
3330
|
-
const candidatePath =
|
|
3362
|
+
const candidatePath = path3.resolve(runtimeDir, candidate);
|
|
3331
3363
|
try {
|
|
3332
3364
|
if (!fs2.existsSync(candidatePath) && !fs2.existsSync(candidatePath + ".node")) {
|
|
3333
3365
|
continue;
|
|
@@ -3372,22 +3404,22 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3372
3404
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3373
3405
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
3374
3406
|
for (const bin of BINARY_NAMES) {
|
|
3375
|
-
candidates.push(
|
|
3376
|
-
candidates.push(
|
|
3377
|
-
candidates.push(
|
|
3378
|
-
candidates.push(
|
|
3379
|
-
candidates.push(
|
|
3380
|
-
candidates.push(
|
|
3381
|
-
candidates.push(
|
|
3382
|
-
candidates.push(
|
|
3383
|
-
candidates.push(
|
|
3407
|
+
candidates.push(path3.resolve(runtimeDir, `${bin}.node`));
|
|
3408
|
+
candidates.push(path3.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
3409
|
+
candidates.push(path3.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
3410
|
+
candidates.push(path3.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3411
|
+
candidates.push(path3.resolve(process.cwd(), "native", `${bin}.node`));
|
|
3412
|
+
candidates.push(path3.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
3413
|
+
candidates.push(path3.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
3414
|
+
candidates.push(path3.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3415
|
+
candidates.push(path3.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
3384
3416
|
}
|
|
3385
3417
|
return Array.from(new Set(candidates));
|
|
3386
3418
|
}
|
|
3387
3419
|
function resolveRuntimeDir(dir, importMetaUrl) {
|
|
3388
|
-
if (dir) return
|
|
3420
|
+
if (dir) return path3.resolve(dir);
|
|
3389
3421
|
try {
|
|
3390
|
-
return
|
|
3422
|
+
return path3.dirname(fileURLToPath2(importMetaUrl));
|
|
3391
3423
|
} catch {
|
|
3392
3424
|
return process.cwd();
|
|
3393
3425
|
}
|
|
@@ -3396,6 +3428,7 @@ var TwError, _require2;
|
|
|
3396
3428
|
var init_src = __esm({
|
|
3397
3429
|
"packages/domain/shared/src/index.ts"() {
|
|
3398
3430
|
"use strict";
|
|
3431
|
+
init_esm_shims();
|
|
3399
3432
|
init_esmHelpers();
|
|
3400
3433
|
init_native_resolution();
|
|
3401
3434
|
TwError = class _TwError extends Error {
|
|
@@ -3431,8 +3464,8 @@ var init_src = __esm({
|
|
|
3431
3464
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
3432
3465
|
static fromZod(err) {
|
|
3433
3466
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
3434
|
-
const
|
|
3435
|
-
const message = first ? `${
|
|
3467
|
+
const path31 = formatIssuePath(first?.path);
|
|
3468
|
+
const message = first ? `${path31}: ${first.message}` : "Schema validation failed";
|
|
3436
3469
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
3437
3470
|
}
|
|
3438
3471
|
static wrap(source, code, err) {
|
|
@@ -3485,14 +3518,14 @@ __export(native_bridge_exports, {
|
|
|
3485
3518
|
startWatchNative: () => startWatchNative,
|
|
3486
3519
|
stopWatchNative: () => stopWatchNative
|
|
3487
3520
|
});
|
|
3488
|
-
import
|
|
3489
|
-
import { fileURLToPath as
|
|
3490
|
-
function
|
|
3521
|
+
import path4 from "path";
|
|
3522
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
3523
|
+
function getDirname3() {
|
|
3491
3524
|
if (typeof __dirname !== "undefined") {
|
|
3492
3525
|
return __dirname;
|
|
3493
3526
|
}
|
|
3494
3527
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
3495
|
-
return
|
|
3528
|
+
return path4.dirname(fileURLToPath3(import.meta.url));
|
|
3496
3529
|
}
|
|
3497
3530
|
return process.cwd();
|
|
3498
3531
|
}
|
|
@@ -3701,6 +3734,7 @@ var log, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader,
|
|
|
3701
3734
|
var init_native_bridge = __esm({
|
|
3702
3735
|
"packages/domain/scanner/src/native-bridge.ts"() {
|
|
3703
3736
|
"use strict";
|
|
3737
|
+
init_esm_shims();
|
|
3704
3738
|
init_src();
|
|
3705
3739
|
log = createDebugLogger("scanner:native");
|
|
3706
3740
|
isValidScannerBinding = (module) => {
|
|
@@ -3743,7 +3777,7 @@ var init_native_bridge = __esm({
|
|
|
3743
3777
|
}
|
|
3744
3778
|
return throwNativeBindingError();
|
|
3745
3779
|
}
|
|
3746
|
-
const runtimeDir =
|
|
3780
|
+
const runtimeDir = getDirname3();
|
|
3747
3781
|
const candidates = resolveNativeBindingCandidates({
|
|
3748
3782
|
runtimeDir,
|
|
3749
3783
|
includeDefaultCandidates: true
|
|
@@ -3784,14 +3818,14 @@ var init_native_bridge = __esm({
|
|
|
3784
3818
|
|
|
3785
3819
|
// packages/domain/scanner/src/cache-native.ts
|
|
3786
3820
|
import fs3 from "fs";
|
|
3787
|
-
import
|
|
3821
|
+
import path5 from "path";
|
|
3788
3822
|
function defaultCachePath(rootDir, cacheDir) {
|
|
3789
|
-
const dir = cacheDir ?
|
|
3790
|
-
return
|
|
3823
|
+
const dir = cacheDir ? path5.resolve(rootDir, cacheDir) : path5.join(process.cwd(), ".cache", "tailwind-styled");
|
|
3824
|
+
return path5.join(dir, "scanner-cache.json");
|
|
3791
3825
|
}
|
|
3792
3826
|
function readCache(rootDir, cacheDir) {
|
|
3793
3827
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
3794
|
-
fs3.mkdirSync(
|
|
3828
|
+
fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
|
|
3795
3829
|
const result = cacheReadNative(cachePath);
|
|
3796
3830
|
if (!result) return [];
|
|
3797
3831
|
return result.entries.map((e) => ({
|
|
@@ -3806,7 +3840,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
3806
3840
|
}
|
|
3807
3841
|
function writeCache(rootDir, entries, cacheDir) {
|
|
3808
3842
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
3809
|
-
fs3.mkdirSync(
|
|
3843
|
+
fs3.mkdirSync(path5.dirname(cachePath), { recursive: true });
|
|
3810
3844
|
const success = cacheWriteNative(cachePath, entries);
|
|
3811
3845
|
if (!success) {
|
|
3812
3846
|
throw new Error(
|
|
@@ -3829,6 +3863,7 @@ var STALE_THRESHOLD_MS;
|
|
|
3829
3863
|
var init_cache_native = __esm({
|
|
3830
3864
|
"packages/domain/scanner/src/cache-native.ts"() {
|
|
3831
3865
|
"use strict";
|
|
3866
|
+
init_esm_shims();
|
|
3832
3867
|
init_native_bridge();
|
|
3833
3868
|
STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
3834
3869
|
}
|
|
@@ -3836,9 +3871,9 @@ var init_cache_native = __esm({
|
|
|
3836
3871
|
|
|
3837
3872
|
// packages/domain/scanner/src/parallel-scanner.ts
|
|
3838
3873
|
import { Worker, isMainThread, parentPort, workerData } from "worker_threads";
|
|
3839
|
-
import
|
|
3874
|
+
import path6 from "path";
|
|
3840
3875
|
import { availableParallelism } from "os";
|
|
3841
|
-
import { fileURLToPath as
|
|
3876
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
3842
3877
|
function collectFiles(rootDir, extensions, ignoreDirs) {
|
|
3843
3878
|
const native = collectFilesNative(rootDir, extensions, ignoreDirs);
|
|
3844
3879
|
if (native !== null) return native;
|
|
@@ -3879,7 +3914,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
3879
3914
|
maxWorkers = Math.max(1, availableParallelism() - 1),
|
|
3880
3915
|
chunkSize = DEFAULT_CHUNK_SIZE
|
|
3881
3916
|
} = options;
|
|
3882
|
-
const files = collectFiles(
|
|
3917
|
+
const files = collectFiles(path6.resolve(rootDir), extensions, ignoreDirs);
|
|
3883
3918
|
if (files.length < PARALLEL_THRESHOLD) {
|
|
3884
3919
|
return mergeResults(batchExtractClassesNative(files));
|
|
3885
3920
|
}
|
|
@@ -3899,6 +3934,7 @@ var PARALLEL_THRESHOLD, DEFAULT_CHUNK_SIZE, _workerFilename;
|
|
|
3899
3934
|
var init_parallel_scanner = __esm({
|
|
3900
3935
|
"packages/domain/scanner/src/parallel-scanner.ts"() {
|
|
3901
3936
|
"use strict";
|
|
3937
|
+
init_esm_shims();
|
|
3902
3938
|
init_src2();
|
|
3903
3939
|
init_native_bridge();
|
|
3904
3940
|
PARALLEL_THRESHOLD = 50;
|
|
@@ -3917,7 +3953,7 @@ var init_parallel_scanner = __esm({
|
|
|
3917
3953
|
parentPort.postMessage(msg);
|
|
3918
3954
|
}
|
|
3919
3955
|
}
|
|
3920
|
-
_workerFilename = typeof __filename !== "undefined" ? __filename :
|
|
3956
|
+
_workerFilename = typeof __filename !== "undefined" ? __filename : fileURLToPath4(import.meta.url);
|
|
3921
3957
|
}
|
|
3922
3958
|
});
|
|
3923
3959
|
|
|
@@ -3927,13 +3963,14 @@ var formatIssuePath2, formatIssues, parseWithSchema, NonNegativeIntegerSchema, S
|
|
|
3927
3963
|
var init_schemas = __esm({
|
|
3928
3964
|
"packages/domain/scanner/src/schemas.ts"() {
|
|
3929
3965
|
"use strict";
|
|
3966
|
+
init_esm_shims();
|
|
3930
3967
|
init_src();
|
|
3931
|
-
formatIssuePath2 = (
|
|
3968
|
+
formatIssuePath2 = (path31) => path31.length > 0 ? path31.map(
|
|
3932
3969
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3933
3970
|
).join(".") : "<root>";
|
|
3934
3971
|
formatIssues = (error) => error.issues.map((issue) => {
|
|
3935
|
-
const
|
|
3936
|
-
return `${
|
|
3972
|
+
const path31 = formatIssuePath2(issue.path);
|
|
3973
|
+
return `${path31}: ${issue.message}`;
|
|
3937
3974
|
}).join("; ");
|
|
3938
3975
|
parseWithSchema = (schema, data, label) => {
|
|
3939
3976
|
const parsed = schema.safeParse(data);
|
|
@@ -4007,15 +4044,15 @@ __export(src_exports, {
|
|
|
4007
4044
|
});
|
|
4008
4045
|
import fs4 from "fs";
|
|
4009
4046
|
import { createRequire as createRequire3 } from "module";
|
|
4010
|
-
import
|
|
4011
|
-
import { fileURLToPath as
|
|
4047
|
+
import path7 from "path";
|
|
4048
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
4012
4049
|
import { Worker as Worker2 } from "worker_threads";
|
|
4013
4050
|
function getRuntimeDir() {
|
|
4014
4051
|
if (typeof __dirname !== "undefined" && __dirname.length > 0) {
|
|
4015
4052
|
return __dirname;
|
|
4016
4053
|
}
|
|
4017
4054
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4018
|
-
return
|
|
4055
|
+
return path7.dirname(fileURLToPath5(import.meta.url));
|
|
4019
4056
|
}
|
|
4020
4057
|
return process.cwd();
|
|
4021
4058
|
}
|
|
@@ -4025,14 +4062,14 @@ function resolveScannerWorkerModulePath() {
|
|
|
4025
4062
|
return __dirname;
|
|
4026
4063
|
}
|
|
4027
4064
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4028
|
-
return
|
|
4065
|
+
return path7.dirname(fileURLToPath5(import.meta.url));
|
|
4029
4066
|
}
|
|
4030
4067
|
return process.cwd();
|
|
4031
4068
|
})();
|
|
4032
4069
|
const candidates = [
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4070
|
+
path7.resolve(runtimeDir, "worker.cjs"),
|
|
4071
|
+
path7.resolve(runtimeDir, "worker.js"),
|
|
4072
|
+
path7.resolve(runtimeDir, "worker.ts")
|
|
4036
4073
|
];
|
|
4037
4074
|
for (const candidate of candidates) {
|
|
4038
4075
|
if (fs4.existsSync(candidate)) return candidate;
|
|
@@ -4098,13 +4135,13 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
4098
4135
|
}
|
|
4099
4136
|
})();
|
|
4100
4137
|
for (const entry of entries) {
|
|
4101
|
-
const fullPath =
|
|
4138
|
+
const fullPath = path7.join(currentDir, entry.name);
|
|
4102
4139
|
if (entry.isDirectory()) {
|
|
4103
4140
|
if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
|
|
4104
4141
|
continue;
|
|
4105
4142
|
}
|
|
4106
4143
|
if (!entry.isFile()) continue;
|
|
4107
|
-
if (!extensionSet.has(
|
|
4144
|
+
if (!extensionSet.has(path7.extname(entry.name))) continue;
|
|
4108
4145
|
candidates.push(fullPath);
|
|
4109
4146
|
}
|
|
4110
4147
|
}
|
|
@@ -4131,7 +4168,7 @@ function scanSource(source) {
|
|
|
4131
4168
|
);
|
|
4132
4169
|
}
|
|
4133
4170
|
function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
|
|
4134
|
-
return includeExtensions.includes(
|
|
4171
|
+
return includeExtensions.includes(path7.extname(filePath));
|
|
4135
4172
|
}
|
|
4136
4173
|
function scanFile(filePath) {
|
|
4137
4174
|
const { scanFileNative: scanFileNative2 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
|
|
@@ -4302,6 +4339,7 @@ var log2, SCAN_WORKER_TIMEOUT_MS, createNativeParserLoader, nativeParserLoader,
|
|
|
4302
4339
|
var init_src2 = __esm({
|
|
4303
4340
|
"packages/domain/scanner/src/index.ts"() {
|
|
4304
4341
|
"use strict";
|
|
4342
|
+
init_esm_shims();
|
|
4305
4343
|
init_src();
|
|
4306
4344
|
init_cache_native();
|
|
4307
4345
|
init_native_bridge();
|
|
@@ -4322,7 +4360,7 @@ var init_src2 = __esm({
|
|
|
4322
4360
|
const loadNativeParserBinding = () => {
|
|
4323
4361
|
if (_state.binding !== void 0) return _state.binding;
|
|
4324
4362
|
const runtimeDir = getRuntimeDir();
|
|
4325
|
-
const req = createRequire3(
|
|
4363
|
+
const req = createRequire3(path7.join(runtimeDir, "noop.cjs"));
|
|
4326
4364
|
const _platform = process.platform;
|
|
4327
4365
|
const _arch = process.arch;
|
|
4328
4366
|
const _platformArch = `${_platform}-${_arch}`;
|
|
@@ -4330,27 +4368,27 @@ var init_src2 = __esm({
|
|
|
4330
4368
|
const candidates = [
|
|
4331
4369
|
// ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
|
|
4332
4370
|
// cwd = repo root saat run dari root, atau package dir saat workspaces
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4371
|
+
path7.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
|
|
4372
|
+
path7.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
4373
|
+
path7.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4336
4374
|
// runtimeDir = dist/ → naik 1 level ke package root (npm install case)
|
|
4337
4375
|
// e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4376
|
+
path7.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
|
|
4377
|
+
path7.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
4378
|
+
path7.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4341
4379
|
// runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
|
|
4342
|
-
|
|
4343
|
-
|
|
4380
|
+
path7.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
4381
|
+
path7.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4344
4382
|
// 3 level fallback (jika package di-nest lebih dangkal)
|
|
4345
|
-
|
|
4346
|
-
|
|
4383
|
+
path7.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
4384
|
+
path7.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4347
4385
|
// ── binaryName lama: tailwind_styled_parser (backward compat) ──
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4386
|
+
path7.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
|
|
4387
|
+
path7.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
|
|
4388
|
+
path7.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
|
|
4389
|
+
path7.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
4390
|
+
path7.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
4391
|
+
path7.resolve(
|
|
4354
4392
|
runtimeDir,
|
|
4355
4393
|
"..",
|
|
4356
4394
|
"..",
|
|
@@ -4425,6 +4463,7 @@ var DEFAULT_TOP_LIMIT, DEFAULT_FREQUENT_THRESHOLD, DEBUG_NAMESPACE, debugLog;
|
|
|
4425
4463
|
var init_utils = __esm({
|
|
4426
4464
|
"packages/domain/analyzer/src/utils.ts"() {
|
|
4427
4465
|
"use strict";
|
|
4466
|
+
init_esm_shims();
|
|
4428
4467
|
init_src();
|
|
4429
4468
|
DEFAULT_TOP_LIMIT = 10;
|
|
4430
4469
|
DEFAULT_FREQUENT_THRESHOLD = 2;
|
|
@@ -4476,6 +4515,7 @@ var isAnalyzerModule, createAnalyzerBindingLoader, analyzerBindingLoader;
|
|
|
4476
4515
|
var init_binding = __esm({
|
|
4477
4516
|
"packages/domain/analyzer/src/binding.ts"() {
|
|
4478
4517
|
"use strict";
|
|
4518
|
+
init_esm_shims();
|
|
4479
4519
|
init_src();
|
|
4480
4520
|
init_utils();
|
|
4481
4521
|
isAnalyzerModule = (module) => {
|
|
@@ -4533,8 +4573,9 @@ var formatIssuePath3, isPlainObject, formatIssues2, parseWithSchema2, CountSchem
|
|
|
4533
4573
|
var init_schemas2 = __esm({
|
|
4534
4574
|
"packages/domain/analyzer/src/schemas.ts"() {
|
|
4535
4575
|
"use strict";
|
|
4576
|
+
init_esm_shims();
|
|
4536
4577
|
init_src();
|
|
4537
|
-
formatIssuePath3 = (
|
|
4578
|
+
formatIssuePath3 = (path31) => path31.length > 0 ? path31.map(
|
|
4538
4579
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
4539
4580
|
).join(".") : "<root>";
|
|
4540
4581
|
isPlainObject = (value) => {
|
|
@@ -4543,8 +4584,8 @@ var init_schemas2 = __esm({
|
|
|
4543
4584
|
return proto === Object.prototype || proto === null;
|
|
4544
4585
|
};
|
|
4545
4586
|
formatIssues2 = (error) => error.issues.map((issue) => {
|
|
4546
|
-
const
|
|
4547
|
-
return `${
|
|
4587
|
+
const path31 = formatIssuePath3(issue.path);
|
|
4588
|
+
return `${path31}: ${issue.message}`;
|
|
4548
4589
|
}).join("; ");
|
|
4549
4590
|
parseWithSchema2 = (schema, data, label) => {
|
|
4550
4591
|
const parsed = schema.safeParse(data);
|
|
@@ -4643,12 +4684,13 @@ var init_schemas2 = __esm({
|
|
|
4643
4684
|
|
|
4644
4685
|
// packages/domain/analyzer/src/semantic.ts
|
|
4645
4686
|
import fs6 from "fs";
|
|
4646
|
-
import
|
|
4687
|
+
import path8 from "path";
|
|
4647
4688
|
import { pathToFileURL } from "url";
|
|
4648
4689
|
var SUPPORTED_TAILWIND_CONFIG_EXTENSIONS, tailwindConfigCache, splitVariantAndBase, resolveConflictGroup, detectConflicts, isSupportedTailwindConfigPath, resolveTailwindConfigPath, collectSafelistFromConfig, collectCustomUtilities, collectSafelistFromSource, loadTailwindConfig, utilityPrefix, buildSemanticReport;
|
|
4649
4690
|
var init_semantic = __esm({
|
|
4650
4691
|
"packages/domain/analyzer/src/semantic.ts"() {
|
|
4651
4692
|
"use strict";
|
|
4693
|
+
init_esm_shims();
|
|
4652
4694
|
init_binding();
|
|
4653
4695
|
init_utils();
|
|
4654
4696
|
SUPPORTED_TAILWIND_CONFIG_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".js", ".cjs", ".mjs"]);
|
|
@@ -4684,11 +4726,11 @@ var init_semantic = __esm({
|
|
|
4684
4726
|
};
|
|
4685
4727
|
};
|
|
4686
4728
|
isSupportedTailwindConfigPath = (configPath) => {
|
|
4687
|
-
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(
|
|
4729
|
+
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(path8.extname(configPath).toLowerCase());
|
|
4688
4730
|
};
|
|
4689
4731
|
resolveTailwindConfigPath = async (root, explicitPath) => {
|
|
4690
4732
|
if (explicitPath) {
|
|
4691
|
-
const resolved =
|
|
4733
|
+
const resolved = path8.resolve(root, explicitPath);
|
|
4692
4734
|
if (!await pathExists(resolved)) return null;
|
|
4693
4735
|
return resolved;
|
|
4694
4736
|
}
|
|
@@ -4699,7 +4741,7 @@ var init_semantic = __esm({
|
|
|
4699
4741
|
"tailwind.config.mjs"
|
|
4700
4742
|
];
|
|
4701
4743
|
for (const candidate of candidates) {
|
|
4702
|
-
const fullPath =
|
|
4744
|
+
const fullPath = path8.resolve(root, candidate);
|
|
4703
4745
|
if (await pathExists(fullPath)) return fullPath;
|
|
4704
4746
|
}
|
|
4705
4747
|
return null;
|
|
@@ -4906,7 +4948,7 @@ var init_semantic = __esm({
|
|
|
4906
4948
|
});
|
|
4907
4949
|
|
|
4908
4950
|
// packages/domain/analyzer/src/analyzeWorkspace.ts
|
|
4909
|
-
import
|
|
4951
|
+
import path9 from "path";
|
|
4910
4952
|
function normalizeScan(scan, includeClass) {
|
|
4911
4953
|
if (!includeClass) return scan;
|
|
4912
4954
|
const filteredFiles = scan.files.map((file) => ({
|
|
@@ -4961,7 +5003,7 @@ async function buildDistribution(usages, native) {
|
|
|
4961
5003
|
}
|
|
4962
5004
|
async function analyzeWorkspace(root, options = {}) {
|
|
4963
5005
|
const startedAtMs = Date.now();
|
|
4964
|
-
const resolvedRoot =
|
|
5006
|
+
const resolvedRoot = path9.resolve(root);
|
|
4965
5007
|
const normalizedOptions = parseAnalyzerOptions(options);
|
|
4966
5008
|
const scan = await (async () => {
|
|
4967
5009
|
const scanStartedAtMs = Date.now();
|
|
@@ -5066,6 +5108,7 @@ async function analyzeWorkspace(root, options = {}) {
|
|
|
5066
5108
|
var init_analyzeWorkspace = __esm({
|
|
5067
5109
|
"packages/domain/analyzer/src/analyzeWorkspace.ts"() {
|
|
5068
5110
|
"use strict";
|
|
5111
|
+
init_esm_shims();
|
|
5069
5112
|
init_src2();
|
|
5070
5113
|
init_binding();
|
|
5071
5114
|
init_schemas2();
|
|
@@ -5079,6 +5122,7 @@ var normalizeClassInput, normalizeClassToCssOptions, mergeDeclarationMap, declar
|
|
|
5079
5122
|
var init_classToCss = __esm({
|
|
5080
5123
|
"packages/domain/analyzer/src/classToCss.ts"() {
|
|
5081
5124
|
"use strict";
|
|
5125
|
+
init_esm_shims();
|
|
5082
5126
|
init_binding();
|
|
5083
5127
|
init_schemas2();
|
|
5084
5128
|
init_utils();
|
|
@@ -5200,6 +5244,7 @@ var __internal;
|
|
|
5200
5244
|
var init_src3 = __esm({
|
|
5201
5245
|
"packages/domain/analyzer/src/index.ts"() {
|
|
5202
5246
|
"use strict";
|
|
5247
|
+
init_esm_shims();
|
|
5203
5248
|
init_analyzeWorkspace();
|
|
5204
5249
|
init_classToCss();
|
|
5205
5250
|
init_schemas2();
|
|
@@ -5221,7 +5266,7 @@ var init_src3 = __esm({
|
|
|
5221
5266
|
|
|
5222
5267
|
// packages/infrastructure/cli/src/utils/fs.ts
|
|
5223
5268
|
import fs7 from "fs/promises";
|
|
5224
|
-
import
|
|
5269
|
+
import path10 from "path";
|
|
5225
5270
|
async function pathExists2(filePath) {
|
|
5226
5271
|
try {
|
|
5227
5272
|
await fs7.access(filePath);
|
|
@@ -5251,7 +5296,7 @@ async function writeFileSafe(filePath, content, options = {}) {
|
|
|
5251
5296
|
options.onDryRun?.(`write ${filePath}`);
|
|
5252
5297
|
return;
|
|
5253
5298
|
}
|
|
5254
|
-
await fs7.mkdir(
|
|
5299
|
+
await fs7.mkdir(path10.dirname(filePath), { recursive: true });
|
|
5255
5300
|
await fs7.writeFile(filePath, content, "utf8");
|
|
5256
5301
|
}
|
|
5257
5302
|
async function ensureFileSafe(filePath, content, options = {}) {
|
|
@@ -5262,6 +5307,7 @@ async function ensureFileSafe(filePath, content, options = {}) {
|
|
|
5262
5307
|
var init_fs = __esm({
|
|
5263
5308
|
"packages/infrastructure/cli/src/utils/fs.ts"() {
|
|
5264
5309
|
"use strict";
|
|
5310
|
+
init_esm_shims();
|
|
5265
5311
|
}
|
|
5266
5312
|
});
|
|
5267
5313
|
|
|
@@ -5269,6 +5315,7 @@ var init_fs = __esm({
|
|
|
5269
5315
|
var require_picocolors = __commonJS({
|
|
5270
5316
|
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
5271
5317
|
"use strict";
|
|
5318
|
+
init_esm_shims();
|
|
5272
5319
|
var p = process || {};
|
|
5273
5320
|
var argv = p.argv || [];
|
|
5274
5321
|
var env = p.env || {};
|
|
@@ -5356,6 +5403,7 @@ function writeJsonSuccess(command, data) {
|
|
|
5356
5403
|
var init_json = __esm({
|
|
5357
5404
|
"packages/infrastructure/cli/src/utils/json.ts"() {
|
|
5358
5405
|
"use strict";
|
|
5406
|
+
init_esm_shims();
|
|
5359
5407
|
}
|
|
5360
5408
|
});
|
|
5361
5409
|
|
|
@@ -5505,6 +5553,7 @@ var import_picocolors;
|
|
|
5505
5553
|
var init_output = __esm({
|
|
5506
5554
|
"packages/infrastructure/cli/src/utils/output.ts"() {
|
|
5507
5555
|
"use strict";
|
|
5556
|
+
init_esm_shims();
|
|
5508
5557
|
import_picocolors = __toESM(require_picocolors(), 1);
|
|
5509
5558
|
init_errors();
|
|
5510
5559
|
init_json();
|
|
@@ -5553,19 +5602,20 @@ function parseCliInput(argv) {
|
|
|
5553
5602
|
var init_args = __esm({
|
|
5554
5603
|
"packages/infrastructure/cli/src/utils/args.ts"() {
|
|
5555
5604
|
"use strict";
|
|
5605
|
+
init_esm_shims();
|
|
5556
5606
|
}
|
|
5557
5607
|
});
|
|
5558
5608
|
|
|
5559
5609
|
// packages/infrastructure/cli/src/utils/paths.ts
|
|
5560
|
-
import
|
|
5561
|
-
import { fileURLToPath as
|
|
5610
|
+
import path19 from "path";
|
|
5611
|
+
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
5562
5612
|
function runtimeDirFromImportMeta(importMetaUrl) {
|
|
5563
|
-
const filename =
|
|
5564
|
-
return
|
|
5613
|
+
const filename = fileURLToPath6(importMetaUrl);
|
|
5614
|
+
return path19.dirname(filename);
|
|
5565
5615
|
}
|
|
5566
5616
|
async function resolveMonorepoPath(runtimeDir, relativeToRepoRoot) {
|
|
5567
|
-
const fromRuntime =
|
|
5568
|
-
const fromCwd =
|
|
5617
|
+
const fromRuntime = path19.resolve(runtimeDir, "..", "..", "..", relativeToRepoRoot);
|
|
5618
|
+
const fromCwd = path19.resolve(process.cwd(), relativeToRepoRoot);
|
|
5569
5619
|
return await pathExists2(fromRuntime) ? fromRuntime : fromCwd;
|
|
5570
5620
|
}
|
|
5571
5621
|
async function firstExistingPath(paths) {
|
|
@@ -5577,6 +5627,7 @@ async function firstExistingPath(paths) {
|
|
|
5577
5627
|
var init_paths = __esm({
|
|
5578
5628
|
"packages/infrastructure/cli/src/utils/paths.ts"() {
|
|
5579
5629
|
"use strict";
|
|
5630
|
+
init_esm_shims();
|
|
5580
5631
|
init_errors();
|
|
5581
5632
|
init_fs();
|
|
5582
5633
|
}
|
|
@@ -5662,6 +5713,7 @@ var isCommanderLikeError, isHelpExit, isVersionExit, normalizeCliError, findComm
|
|
|
5662
5713
|
var init_runtime = __esm({
|
|
5663
5714
|
"packages/infrastructure/cli/src/utils/runtime.ts"() {
|
|
5664
5715
|
"use strict";
|
|
5716
|
+
init_esm_shims();
|
|
5665
5717
|
init_args();
|
|
5666
5718
|
init_errors();
|
|
5667
5719
|
init_output();
|
|
@@ -5719,7 +5771,7 @@ __export(createApp_exports, {
|
|
|
5719
5771
|
buildCreateProgram: () => buildCreateProgram,
|
|
5720
5772
|
main: () => main
|
|
5721
5773
|
});
|
|
5722
|
-
import
|
|
5774
|
+
import path20 from "path";
|
|
5723
5775
|
import { isCancel as isCancel3, select as select2, text } from "@clack/prompts";
|
|
5724
5776
|
function isTemplateName(value) {
|
|
5725
5777
|
return TEMPLATE_NAMES.includes(value);
|
|
@@ -5757,7 +5809,7 @@ async function resolveCreateInput(options) {
|
|
|
5757
5809
|
return { name: resolvedName, template: templateValue };
|
|
5758
5810
|
}
|
|
5759
5811
|
async function writeProjectFile(context, relativePath, content) {
|
|
5760
|
-
const filePath =
|
|
5812
|
+
const filePath = path20.join(context.projectDir, relativePath);
|
|
5761
5813
|
await writeFileSafe(filePath, content, { dryRun: context.dryRun });
|
|
5762
5814
|
context.writtenFiles.push(relativePath.replaceAll("\\", "/"));
|
|
5763
5815
|
}
|
|
@@ -6073,7 +6125,7 @@ async function createSimpleApp(context) {
|
|
|
6073
6125
|
}
|
|
6074
6126
|
async function createProject(options, output) {
|
|
6075
6127
|
const { name, template } = await resolveCreateInput(options);
|
|
6076
|
-
const projectDir =
|
|
6128
|
+
const projectDir = path20.resolve(process.cwd(), name);
|
|
6077
6129
|
if (await pathExists2(projectDir)) {
|
|
6078
6130
|
throw new CliUsageError(`Directory ${name} already exists.`);
|
|
6079
6131
|
}
|
|
@@ -6131,6 +6183,7 @@ var TEMPLATE_NAMES, TEMPLATES;
|
|
|
6131
6183
|
var init_createApp = __esm({
|
|
6132
6184
|
"packages/infrastructure/cli/src/createApp.ts"() {
|
|
6133
6185
|
"use strict";
|
|
6186
|
+
init_esm_shims();
|
|
6134
6187
|
init_esm();
|
|
6135
6188
|
init_errors();
|
|
6136
6189
|
init_fs();
|
|
@@ -6151,8 +6204,9 @@ var _loadNative, log3, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttem
|
|
|
6151
6204
|
var init_nativeBridge = __esm({
|
|
6152
6205
|
"packages/domain/compiler/src/nativeBridge.ts"() {
|
|
6153
6206
|
"use strict";
|
|
6207
|
+
init_esm_shims();
|
|
6154
6208
|
init_src();
|
|
6155
|
-
_loadNative = (
|
|
6209
|
+
_loadNative = (path31) => __require(path31);
|
|
6156
6210
|
log3 = (...args) => {
|
|
6157
6211
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
6158
6212
|
console.log("[compiler:native]", ...args);
|
|
@@ -6250,6 +6304,7 @@ Tried paths: ${result.tried.join("\n")}`);
|
|
|
6250
6304
|
var init_compiler = __esm({
|
|
6251
6305
|
"packages/domain/compiler/src/compiler/index.ts"() {
|
|
6252
6306
|
"use strict";
|
|
6307
|
+
init_esm_shims();
|
|
6253
6308
|
}
|
|
6254
6309
|
});
|
|
6255
6310
|
|
|
@@ -6257,6 +6312,7 @@ var init_compiler = __esm({
|
|
|
6257
6312
|
var init_parser = __esm({
|
|
6258
6313
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
6259
6314
|
"use strict";
|
|
6315
|
+
init_esm_shims();
|
|
6260
6316
|
}
|
|
6261
6317
|
});
|
|
6262
6318
|
|
|
@@ -6264,6 +6320,7 @@ var init_parser = __esm({
|
|
|
6264
6320
|
var init_analyzer = __esm({
|
|
6265
6321
|
"packages/domain/compiler/src/analyzer/index.ts"() {
|
|
6266
6322
|
"use strict";
|
|
6323
|
+
init_esm_shims();
|
|
6267
6324
|
}
|
|
6268
6325
|
});
|
|
6269
6326
|
|
|
@@ -6271,6 +6328,7 @@ var init_analyzer = __esm({
|
|
|
6271
6328
|
var init_cache = __esm({
|
|
6272
6329
|
"packages/domain/compiler/src/cache/index.ts"() {
|
|
6273
6330
|
"use strict";
|
|
6331
|
+
init_esm_shims();
|
|
6274
6332
|
}
|
|
6275
6333
|
});
|
|
6276
6334
|
|
|
@@ -6278,6 +6336,7 @@ var init_cache = __esm({
|
|
|
6278
6336
|
var init_redis = __esm({
|
|
6279
6337
|
"packages/domain/compiler/src/redis/index.ts"() {
|
|
6280
6338
|
"use strict";
|
|
6339
|
+
init_esm_shims();
|
|
6281
6340
|
}
|
|
6282
6341
|
});
|
|
6283
6342
|
|
|
@@ -6285,17 +6344,19 @@ var init_redis = __esm({
|
|
|
6285
6344
|
var init_watch = __esm({
|
|
6286
6345
|
"packages/domain/compiler/src/watch/index.ts"() {
|
|
6287
6346
|
"use strict";
|
|
6347
|
+
init_esm_shims();
|
|
6288
6348
|
}
|
|
6289
6349
|
});
|
|
6290
6350
|
|
|
6291
6351
|
// packages/domain/compiler/src/index.ts
|
|
6292
6352
|
import fs12 from "fs";
|
|
6293
|
-
import
|
|
6353
|
+
import path25 from "path";
|
|
6294
6354
|
import { createRequire as createRequire4 } from "module";
|
|
6295
6355
|
var _require3, compileCssFromClasses;
|
|
6296
6356
|
var init_src4 = __esm({
|
|
6297
6357
|
"packages/domain/compiler/src/index.ts"() {
|
|
6298
6358
|
"use strict";
|
|
6359
|
+
init_esm_shims();
|
|
6299
6360
|
init_nativeBridge();
|
|
6300
6361
|
init_compiler();
|
|
6301
6362
|
init_parser();
|
|
@@ -6324,6 +6385,7 @@ var init_src4 = __esm({
|
|
|
6324
6385
|
var init_internal = __esm({
|
|
6325
6386
|
"packages/domain/compiler/src/internal.ts"() {
|
|
6326
6387
|
"use strict";
|
|
6388
|
+
init_esm_shims();
|
|
6327
6389
|
init_src4();
|
|
6328
6390
|
init_compiler();
|
|
6329
6391
|
init_parser();
|
|
@@ -6334,17 +6396,24 @@ var init_internal = __esm({
|
|
|
6334
6396
|
}
|
|
6335
6397
|
});
|
|
6336
6398
|
|
|
6399
|
+
// src/umbrella/cli.ts
|
|
6400
|
+
init_esm_shims();
|
|
6401
|
+
|
|
6337
6402
|
// packages/infrastructure/cli/src/index.ts
|
|
6338
|
-
|
|
6403
|
+
init_esm_shims();
|
|
6404
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
6339
6405
|
|
|
6340
6406
|
// packages/infrastructure/cli/src/commands/program.ts
|
|
6407
|
+
init_esm_shims();
|
|
6341
6408
|
init_esm();
|
|
6342
6409
|
|
|
6343
6410
|
// packages/infrastructure/cli/src/analyze.ts
|
|
6344
|
-
|
|
6411
|
+
init_esm_shims();
|
|
6412
|
+
import path11 from "path";
|
|
6345
6413
|
import { parseArgs as parseNodeArgs } from "util";
|
|
6346
6414
|
|
|
6347
6415
|
// packages/infrastructure/cli/src/utils/analyzer.ts
|
|
6416
|
+
init_esm_shims();
|
|
6348
6417
|
init_errors();
|
|
6349
6418
|
async function loadAnalyzerModule() {
|
|
6350
6419
|
try {
|
|
@@ -6415,7 +6484,7 @@ async function runAnalyzeCli(args) {
|
|
|
6415
6484
|
verbose: process.env.TWS_VERBOSE === "1" || process.env.VERBOSE === "1"
|
|
6416
6485
|
});
|
|
6417
6486
|
const dirArg = parsed.positionals[0] ?? ".";
|
|
6418
|
-
const dir =
|
|
6487
|
+
const dir = path11.resolve(process.cwd(), dirArg);
|
|
6419
6488
|
if (!await pathExists2(dir)) {
|
|
6420
6489
|
throw new CliUsageError(`Directory not found: ${dir}`);
|
|
6421
6490
|
}
|
|
@@ -6434,7 +6503,8 @@ async function runAnalyzeCli(args) {
|
|
|
6434
6503
|
}
|
|
6435
6504
|
|
|
6436
6505
|
// packages/infrastructure/cli/src/extract.ts
|
|
6437
|
-
|
|
6506
|
+
init_esm_shims();
|
|
6507
|
+
import path12 from "path";
|
|
6438
6508
|
import { parseArgs as parseNodeArgs2 } from "util";
|
|
6439
6509
|
init_errors();
|
|
6440
6510
|
init_fs();
|
|
@@ -6475,7 +6545,7 @@ async function runExtractCli(args) {
|
|
|
6475
6545
|
const parsedMin = parseInt(minRaw, 10);
|
|
6476
6546
|
const minCount = Number.isFinite(parsedMin) && parsedMin > 0 ? parsedMin : 2;
|
|
6477
6547
|
const dirArg = parsed.positionals[0] ?? ".";
|
|
6478
|
-
const dir =
|
|
6548
|
+
const dir = path12.resolve(process.cwd(), dirArg);
|
|
6479
6549
|
if (!await pathExists2(dir)) {
|
|
6480
6550
|
throw new CliUsageError(`Directory not found: ${dir}`);
|
|
6481
6551
|
}
|
|
@@ -6530,9 +6600,10 @@ async function runExtractCli(args) {
|
|
|
6530
6600
|
}
|
|
6531
6601
|
|
|
6532
6602
|
// packages/infrastructure/cli/src/init.ts
|
|
6603
|
+
init_esm_shims();
|
|
6533
6604
|
init_fs();
|
|
6534
6605
|
init_output();
|
|
6535
|
-
import
|
|
6606
|
+
import path13 from "path";
|
|
6536
6607
|
async function ensureFile(filePath, content, report) {
|
|
6537
6608
|
const status = await ensureFileSafe(filePath, content);
|
|
6538
6609
|
if (status === "created") {
|
|
@@ -6549,15 +6620,15 @@ async function runInitCli(rawArgs) {
|
|
|
6549
6620
|
verbose: process.env.TWS_VERBOSE === "1" || process.env.VERBOSE === "1"
|
|
6550
6621
|
});
|
|
6551
6622
|
const target = rawArgs.find((arg) => !arg.startsWith("-")) ?? ".";
|
|
6552
|
-
const root =
|
|
6623
|
+
const root = path13.resolve(process.cwd(), target);
|
|
6553
6624
|
const report = { created: [], skipped: [] };
|
|
6554
6625
|
await ensureFile(
|
|
6555
|
-
|
|
6626
|
+
path13.join(root, "src", "tailwind.css"),
|
|
6556
6627
|
'@import "tailwindcss";\n\n@theme {\n --color-primary: #3b82f6;\n --spacing-section: 3rem;\n}\n',
|
|
6557
6628
|
report
|
|
6558
6629
|
);
|
|
6559
6630
|
await ensureFile(
|
|
6560
|
-
|
|
6631
|
+
path13.join(root, "tailwind-styled.config.json"),
|
|
6561
6632
|
`${JSON.stringify(
|
|
6562
6633
|
{
|
|
6563
6634
|
version: 1,
|
|
@@ -6577,21 +6648,23 @@ async function runInitCli(rawArgs) {
|
|
|
6577
6648
|
output.writeText("\nInit complete");
|
|
6578
6649
|
output.writeText(`Created: ${report.created.length}`);
|
|
6579
6650
|
for (const filePath of report.created) {
|
|
6580
|
-
output.writeText(` + ${
|
|
6651
|
+
output.writeText(` + ${path13.relative(root, filePath)}`);
|
|
6581
6652
|
}
|
|
6582
6653
|
if (report.skipped.length > 0) {
|
|
6583
6654
|
output.writeText(`Skipped: ${report.skipped.length}`);
|
|
6584
6655
|
for (const filePath of report.skipped) {
|
|
6585
|
-
output.writeText(` - ${
|
|
6656
|
+
output.writeText(` - ${path13.relative(root, filePath)} (exists)`);
|
|
6586
6657
|
}
|
|
6587
6658
|
}
|
|
6588
6659
|
}
|
|
6589
6660
|
|
|
6590
6661
|
// packages/infrastructure/cli/src/migrate.ts
|
|
6662
|
+
init_esm_shims();
|
|
6591
6663
|
import fs8 from "fs/promises";
|
|
6592
|
-
import
|
|
6664
|
+
import path14 from "path";
|
|
6593
6665
|
|
|
6594
6666
|
// packages/infrastructure/cli/src/migrateWizard.ts
|
|
6667
|
+
init_esm_shims();
|
|
6595
6668
|
init_errors();
|
|
6596
6669
|
import { confirm, intro, isCancel } from "@clack/prompts";
|
|
6597
6670
|
async function runMigrationWizard() {
|
|
@@ -6650,13 +6723,13 @@ async function findSourceFiles(dir) {
|
|
|
6650
6723
|
if (!await pathExists2(currentDir)) return;
|
|
6651
6724
|
const entries = await fs8.readdir(currentDir, { withFileTypes: true });
|
|
6652
6725
|
for (const entry of entries) {
|
|
6653
|
-
const fullPath =
|
|
6726
|
+
const fullPath = path14.join(currentDir, entry.name);
|
|
6654
6727
|
if (entry.isDirectory()) {
|
|
6655
6728
|
if (IGNORED_DIRS.has(entry.name)) continue;
|
|
6656
6729
|
await walk(fullPath);
|
|
6657
6730
|
continue;
|
|
6658
6731
|
}
|
|
6659
|
-
if (SOURCE_EXTENSIONS.has(
|
|
6732
|
+
if (SOURCE_EXTENSIONS.has(path14.extname(entry.name))) {
|
|
6660
6733
|
out.push(fullPath);
|
|
6661
6734
|
}
|
|
6662
6735
|
}
|
|
@@ -6677,7 +6750,7 @@ function migrateSource(source, options) {
|
|
|
6677
6750
|
return { output, classRenames: 0, importRenames };
|
|
6678
6751
|
}
|
|
6679
6752
|
async function migrateConfig(root, dryRun) {
|
|
6680
|
-
const cssPath =
|
|
6753
|
+
const cssPath = path14.join(root, "src", "tailwind.css");
|
|
6681
6754
|
if (await pathExists2(cssPath)) return 0;
|
|
6682
6755
|
await writeFileSafe(cssPath, DEFAULT_TAILWIND_CSS, { dryRun });
|
|
6683
6756
|
return 1;
|
|
@@ -6690,7 +6763,7 @@ async function runMigrateCli(rawArgs) {
|
|
|
6690
6763
|
verbose: process.env.TWS_VERBOSE === "1" || process.env.VERBOSE === "1"
|
|
6691
6764
|
});
|
|
6692
6765
|
const target = firstPositional(rawArgs) ?? ".";
|
|
6693
|
-
const root =
|
|
6766
|
+
const root = path14.resolve(process.cwd(), target);
|
|
6694
6767
|
const dryRunFlag = hasFlag("dry-run", rawArgs);
|
|
6695
6768
|
const wizardOptions = hasFlag("wizard", rawArgs) ? await runMigrationWizard() : null;
|
|
6696
6769
|
const { dryRun, includeConfig, includeClasses, includeImports } = wizardOptions ? {
|
|
@@ -6739,10 +6812,11 @@ async function runMigrateCli(rawArgs) {
|
|
|
6739
6812
|
}
|
|
6740
6813
|
|
|
6741
6814
|
// packages/infrastructure/cli/src/scan.ts
|
|
6815
|
+
init_esm_shims();
|
|
6742
6816
|
init_src2();
|
|
6743
6817
|
init_output();
|
|
6744
6818
|
import fs9 from "fs";
|
|
6745
|
-
import
|
|
6819
|
+
import path15 from "path";
|
|
6746
6820
|
function buildTopClasses(files) {
|
|
6747
6821
|
const counts = /* @__PURE__ */ new Map();
|
|
6748
6822
|
for (const file of files) {
|
|
@@ -6785,8 +6859,8 @@ function buildClassNames(files, uniqueClasses) {
|
|
|
6785
6859
|
});
|
|
6786
6860
|
}
|
|
6787
6861
|
function writeScanCache(root, cacheData) {
|
|
6788
|
-
const cacheDir =
|
|
6789
|
-
const cachePath =
|
|
6862
|
+
const cacheDir = path15.join(root, ".tailwind-styled");
|
|
6863
|
+
const cachePath = path15.join(cacheDir, "scan-cache.json");
|
|
6790
6864
|
fs9.mkdirSync(cacheDir, { recursive: true });
|
|
6791
6865
|
fs9.writeFileSync(cachePath, JSON.stringify(cacheData, null, 2), "utf-8");
|
|
6792
6866
|
return cachePath;
|
|
@@ -6800,7 +6874,7 @@ async function runScanCli(rawArgs) {
|
|
|
6800
6874
|
debug: process.env.TWS_DEBUG === "1" || process.env.DEBUG === "1",
|
|
6801
6875
|
verbose: process.env.TWS_VERBOSE === "1" || process.env.VERBOSE === "1"
|
|
6802
6876
|
});
|
|
6803
|
-
const root =
|
|
6877
|
+
const root = path15.resolve(process.cwd(), target);
|
|
6804
6878
|
const spinner = output.spinner();
|
|
6805
6879
|
spinner.start(`Scanning ${root}`);
|
|
6806
6880
|
const scanned = await scanWorkspaceAsync(root);
|
|
@@ -6850,10 +6924,12 @@ Scan root : ${result.root}`);
|
|
|
6850
6924
|
}
|
|
6851
6925
|
|
|
6852
6926
|
// packages/infrastructure/cli/src/setup.ts
|
|
6927
|
+
init_esm_shims();
|
|
6853
6928
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
6854
|
-
import
|
|
6929
|
+
import path17 from "path";
|
|
6855
6930
|
|
|
6856
6931
|
// packages/infrastructure/cli/src/commands/setup/patchers.ts
|
|
6932
|
+
init_esm_shims();
|
|
6857
6933
|
function patchNextConfigImpl(src) {
|
|
6858
6934
|
if (src.includes("withTailwindStyled")) return null;
|
|
6859
6935
|
const hasExport = src.includes("export default");
|
|
@@ -7046,6 +7122,7 @@ function patchTsConfigImpl(src) {
|
|
|
7046
7122
|
}
|
|
7047
7123
|
|
|
7048
7124
|
// packages/infrastructure/cli/src/commands/setup/prompt.ts
|
|
7125
|
+
init_esm_shims();
|
|
7049
7126
|
init_errors();
|
|
7050
7127
|
import { isCancel as isCancel2, select } from "@clack/prompts";
|
|
7051
7128
|
async function pickProjectTypeInteractive(detected, flags, projectOptions, options = {}) {
|
|
@@ -7097,10 +7174,12 @@ async function pickProjectTypeInteractive(detected, flags, projectOptions, optio
|
|
|
7097
7174
|
}
|
|
7098
7175
|
|
|
7099
7176
|
// packages/infrastructure/cli/src/commands/setup/workspace.ts
|
|
7177
|
+
init_esm_shims();
|
|
7100
7178
|
init_fs();
|
|
7101
|
-
import
|
|
7179
|
+
import path16 from "path";
|
|
7102
7180
|
|
|
7103
7181
|
// packages/infrastructure/cli/src/utils/process.ts
|
|
7182
|
+
init_esm_shims();
|
|
7104
7183
|
init_errors();
|
|
7105
7184
|
init_json();
|
|
7106
7185
|
import { spawn } from "child_process";
|
|
@@ -7267,12 +7346,12 @@ function configureSetupFlags(rawArgs) {
|
|
|
7267
7346
|
};
|
|
7268
7347
|
}
|
|
7269
7348
|
async function readPackageJson(cwd2) {
|
|
7270
|
-
return readJsonSafe(
|
|
7349
|
+
return readJsonSafe(path16.join(cwd2, "package.json"));
|
|
7271
7350
|
}
|
|
7272
7351
|
async function detectPm(cwd2) {
|
|
7273
|
-
if (await pathExists2(
|
|
7274
|
-
if (await pathExists2(
|
|
7275
|
-
if (await pathExists2(
|
|
7352
|
+
if (await pathExists2(path16.join(cwd2, "bun.lockb"))) return "bun";
|
|
7353
|
+
if (await pathExists2(path16.join(cwd2, "pnpm-lock.yaml"))) return "pnpm";
|
|
7354
|
+
if (await pathExists2(path16.join(cwd2, "yarn.lock"))) return "yarn";
|
|
7276
7355
|
return "npm";
|
|
7277
7356
|
}
|
|
7278
7357
|
async function detectBundler(cwd2) {
|
|
@@ -7293,7 +7372,7 @@ async function alreadyInstalled(cwd2, pkgName) {
|
|
|
7293
7372
|
}
|
|
7294
7373
|
async function findExisting(cwd2, names) {
|
|
7295
7374
|
for (const name of names) {
|
|
7296
|
-
const resolved =
|
|
7375
|
+
const resolved = path16.join(cwd2, name);
|
|
7297
7376
|
if (await pathExists2(resolved)) return resolved;
|
|
7298
7377
|
}
|
|
7299
7378
|
return null;
|
|
@@ -7304,7 +7383,7 @@ async function writeFileWithDryRun(cwd2, filePath, content, label, flags, logger
|
|
|
7304
7383
|
return;
|
|
7305
7384
|
}
|
|
7306
7385
|
await writeFileSafe(filePath, content);
|
|
7307
|
-
logger.ok(
|
|
7386
|
+
logger.ok(path16.relative(cwd2, filePath) || label);
|
|
7308
7387
|
}
|
|
7309
7388
|
async function patchFileWithDryRun(filePath, patcher, label, flags, logger) {
|
|
7310
7389
|
const source = await readFileSafe(filePath);
|
|
@@ -7349,6 +7428,7 @@ async function installPackages(cwd2, pm, pkgs, dev, flags, logger) {
|
|
|
7349
7428
|
}
|
|
7350
7429
|
|
|
7351
7430
|
// packages/infrastructure/cli/src/utils/logger.ts
|
|
7431
|
+
init_esm_shims();
|
|
7352
7432
|
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
7353
7433
|
function createCliLogger(options = {}) {
|
|
7354
7434
|
function emit(level, icon, colorize, message) {
|
|
@@ -7467,7 +7547,7 @@ var runSetupCli = async (rawArgs) => {
|
|
|
7467
7547
|
if (bundlerConfig) {
|
|
7468
7548
|
const cfg = await findExisting(cwd, bundlerConfig.files);
|
|
7469
7549
|
if (cfg)
|
|
7470
|
-
await patchFileWithDryRun(cfg, bundlerConfig.patcher,
|
|
7550
|
+
await patchFileWithDryRun(cfg, bundlerConfig.patcher, path17.basename(cfg), setupFlags, logger);
|
|
7471
7551
|
else logger.warn(bundlerConfig.warnMsg);
|
|
7472
7552
|
} else {
|
|
7473
7553
|
logger.skip("React tanpa bundler - tidak ada bundler config yang di-patch");
|
|
@@ -7486,13 +7566,13 @@ var runSetupCli = async (rawArgs) => {
|
|
|
7486
7566
|
if (cssFile) {
|
|
7487
7567
|
await patchFileWithDryRun(
|
|
7488
7568
|
cssFile,
|
|
7489
|
-
(src) => patchTailwindCss(src, bundler,
|
|
7490
|
-
|
|
7569
|
+
(src) => patchTailwindCss(src, bundler, path17.relative(cwd, cssFile), cwd),
|
|
7570
|
+
path17.relative(cwd, cssFile),
|
|
7491
7571
|
setupFlags,
|
|
7492
7572
|
logger
|
|
7493
7573
|
);
|
|
7494
|
-
const detectedCssEntry =
|
|
7495
|
-
const twConfigPath =
|
|
7574
|
+
const detectedCssEntry = path17.relative(cwd, cssFile).replace(/\\/g, "/");
|
|
7575
|
+
const twConfigPath = path17.join(cwd, "tailwind-styled.config.json");
|
|
7496
7576
|
const twConfig = {
|
|
7497
7577
|
version: 1,
|
|
7498
7578
|
compiler: { engine: "rust" },
|
|
@@ -7510,7 +7590,7 @@ var runSetupCli = async (rawArgs) => {
|
|
|
7510
7590
|
logger.warn('CSS entry tidak ditemukan \u2014 tambahkan @import "tailwindcss" manual ke globals.css');
|
|
7511
7591
|
}
|
|
7512
7592
|
output.writeText("\n" + import_picocolors3.default.bold(" [4/4]") + import_picocolors3.default.cyan(" tsconfig.json"));
|
|
7513
|
-
const tsCfg =
|
|
7593
|
+
const tsCfg = path17.join(cwd, "tsconfig.json");
|
|
7514
7594
|
const hasTsConfig = await findExisting(cwd, ["tsconfig.json"]);
|
|
7515
7595
|
if (hasTsConfig) {
|
|
7516
7596
|
await patchFileWithDryRun(tsCfg, patchTsConfig, "tsconfig.json", setupFlags, logger);
|
|
@@ -7557,7 +7637,8 @@ var runSetupCli = async (rawArgs) => {
|
|
|
7557
7637
|
};
|
|
7558
7638
|
|
|
7559
7639
|
// packages/infrastructure/cli/src/stats.ts
|
|
7560
|
-
|
|
7640
|
+
init_esm_shims();
|
|
7641
|
+
import path18 from "path";
|
|
7561
7642
|
import { parseArgs as parseNodeArgs4 } from "util";
|
|
7562
7643
|
init_errors();
|
|
7563
7644
|
init_fs();
|
|
@@ -7595,7 +7676,7 @@ async function runStatsCli(args) {
|
|
|
7595
7676
|
verbose: process.env.TWS_VERBOSE === "1" || process.env.VERBOSE === "1"
|
|
7596
7677
|
});
|
|
7597
7678
|
const dirArg = parsed.positionals[0] ?? ".";
|
|
7598
|
-
const dir =
|
|
7679
|
+
const dir = path18.resolve(process.cwd(), dirArg);
|
|
7599
7680
|
if (!await pathExists2(dir)) {
|
|
7600
7681
|
throw new CliUsageError(`Directory not found: ${dir}`);
|
|
7601
7682
|
}
|
|
@@ -7649,6 +7730,7 @@ async function runStatsCli(args) {
|
|
|
7649
7730
|
init_runtime();
|
|
7650
7731
|
|
|
7651
7732
|
// packages/infrastructure/cli/src/commands/boundary.ts
|
|
7733
|
+
init_esm_shims();
|
|
7652
7734
|
import { readFileSync, readdirSync } from "fs";
|
|
7653
7735
|
import { join as join2, extname } from "path";
|
|
7654
7736
|
import { parseArgs as parseNodeArgs5 } from "util";
|
|
@@ -7774,6 +7856,7 @@ var boundaryCommand = {
|
|
|
7774
7856
|
};
|
|
7775
7857
|
|
|
7776
7858
|
// packages/infrastructure/cli/src/commands/create.ts
|
|
7859
|
+
init_esm_shims();
|
|
7777
7860
|
init_args();
|
|
7778
7861
|
var createCommand2 = {
|
|
7779
7862
|
name: "create",
|
|
@@ -7785,15 +7868,17 @@ var createCommand2 = {
|
|
|
7785
7868
|
};
|
|
7786
7869
|
|
|
7787
7870
|
// packages/infrastructure/cli/src/commands/dashboard.ts
|
|
7871
|
+
init_esm_shims();
|
|
7788
7872
|
init_errors();
|
|
7789
7873
|
init_fs();
|
|
7790
7874
|
import { parseArgs as parseNodeArgs6 } from "util";
|
|
7791
7875
|
|
|
7792
7876
|
// packages/infrastructure/cli/src/commands/helpers.ts
|
|
7877
|
+
init_esm_shims();
|
|
7793
7878
|
init_errors();
|
|
7794
7879
|
init_paths();
|
|
7795
7880
|
import fs10 from "fs/promises";
|
|
7796
|
-
import
|
|
7881
|
+
import path21 from "path";
|
|
7797
7882
|
function enumerateVariantProps(matrix) {
|
|
7798
7883
|
const keys = Object.keys(matrix);
|
|
7799
7884
|
if (keys.length === 0) return [{}];
|
|
@@ -7815,7 +7900,7 @@ function enumerateVariantProps(matrix) {
|
|
|
7815
7900
|
}
|
|
7816
7901
|
async function resolveScript(context, relativeToRepoRoot) {
|
|
7817
7902
|
const fromRuntime = await resolveMonorepoPath(context.runtimeDir, relativeToRepoRoot);
|
|
7818
|
-
const fromCwd =
|
|
7903
|
+
const fromCwd = path21.resolve(process.cwd(), relativeToRepoRoot);
|
|
7819
7904
|
const resolved = await firstExistingPath([fromRuntime, fromCwd]);
|
|
7820
7905
|
if (!resolved) {
|
|
7821
7906
|
throw new CliUsageError(`Required script not found: ${relativeToRepoRoot}`);
|
|
@@ -7829,7 +7914,7 @@ async function loadRegistry(context) {
|
|
|
7829
7914
|
);
|
|
7830
7915
|
const candidates = [
|
|
7831
7916
|
runtimeRegistryPath,
|
|
7832
|
-
|
|
7917
|
+
path21.resolve(process.cwd(), "packages/domain/plugin-registry/registry.json")
|
|
7833
7918
|
];
|
|
7834
7919
|
const registryPath = await firstExistingPath(candidates);
|
|
7835
7920
|
if (!registryPath) {
|
|
@@ -7879,11 +7964,12 @@ var dashboardCommand = {
|
|
|
7879
7964
|
};
|
|
7880
7965
|
|
|
7881
7966
|
// packages/infrastructure/cli/src/commands/deploy.ts
|
|
7967
|
+
init_esm_shims();
|
|
7882
7968
|
init_errors();
|
|
7883
7969
|
init_fs();
|
|
7884
7970
|
init_json();
|
|
7885
7971
|
import fsp from "fs/promises";
|
|
7886
|
-
import
|
|
7972
|
+
import path22 from "path";
|
|
7887
7973
|
import { parseArgs as parseNodeArgs7 } from "util";
|
|
7888
7974
|
var postJson = async (url, body, token) => {
|
|
7889
7975
|
const { default: https } = await import("https");
|
|
@@ -7937,7 +8023,7 @@ var deployCommand = {
|
|
|
7937
8023
|
const version = typeof parsed.values.version === "string" ? parsed.values.version : "0.1.0";
|
|
7938
8024
|
const tag = typeof parsed.values.tag === "string" ? parsed.values.tag : "latest";
|
|
7939
8025
|
const registryUrl = typeof parsed.values.registry === "string" ? parsed.values.registry : process.env.TW_REGISTRY_URL ?? null;
|
|
7940
|
-
const pkgPath =
|
|
8026
|
+
const pkgPath = path22.join(process.cwd(), "package.json");
|
|
7941
8027
|
if (!await pathExists2(pkgPath)) {
|
|
7942
8028
|
throw new CliUsageError("[tw deploy] No package.json found in current directory");
|
|
7943
8029
|
}
|
|
@@ -7972,10 +8058,10 @@ var deployCommand = {
|
|
|
7972
8058
|
}
|
|
7973
8059
|
return;
|
|
7974
8060
|
}
|
|
7975
|
-
const cacheDir =
|
|
8061
|
+
const cacheDir = path22.join(process.cwd(), ".tw-cache");
|
|
7976
8062
|
await fsp.mkdir(cacheDir, { recursive: true });
|
|
7977
8063
|
await fsp.writeFile(
|
|
7978
|
-
|
|
8064
|
+
path22.join(cacheDir, "deploy-manifest.json"),
|
|
7979
8065
|
JSON.stringify(manifest, null, 2)
|
|
7980
8066
|
);
|
|
7981
8067
|
if (!registryUrl) {
|
|
@@ -8038,14 +8124,16 @@ var deployCommand = {
|
|
|
8038
8124
|
};
|
|
8039
8125
|
|
|
8040
8126
|
// packages/infrastructure/cli/src/commands/doctor.ts
|
|
8127
|
+
init_esm_shims();
|
|
8041
8128
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
8042
8129
|
import { parseArgs as parseNodeArgs8 } from "util";
|
|
8043
8130
|
|
|
8044
8131
|
// packages/infrastructure/cli/src/utils/doctorService.ts
|
|
8132
|
+
init_esm_shims();
|
|
8045
8133
|
init_src3();
|
|
8046
8134
|
init_src2();
|
|
8047
8135
|
import fs11 from "fs";
|
|
8048
|
-
import
|
|
8136
|
+
import path23 from "path";
|
|
8049
8137
|
var SUPPORTED_DIAGNOSTIC_INCLUDES = [
|
|
8050
8138
|
"workspace",
|
|
8051
8139
|
"tailwind",
|
|
@@ -8091,16 +8179,16 @@ function readJsonFile(filePath) {
|
|
|
8091
8179
|
}
|
|
8092
8180
|
}
|
|
8093
8181
|
function findWorkspacePackageJsonFiles(root) {
|
|
8094
|
-
const packagesDir =
|
|
8182
|
+
const packagesDir = path23.join(root, "packages");
|
|
8095
8183
|
if (!fs11.existsSync(packagesDir)) return [];
|
|
8096
|
-
return fs11.readdirSync(packagesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) =>
|
|
8184
|
+
return fs11.readdirSync(packagesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => path23.join(packagesDir, entry.name, "package.json")).filter((filePath) => fs11.existsSync(filePath));
|
|
8097
8185
|
}
|
|
8098
8186
|
function findFiles(dir, ext) {
|
|
8099
8187
|
const files = [];
|
|
8100
8188
|
try {
|
|
8101
8189
|
const entries = fs11.readdirSync(dir, { withFileTypes: true });
|
|
8102
8190
|
for (const entry of entries) {
|
|
8103
|
-
const fullPath =
|
|
8191
|
+
const fullPath = path23.join(dir, entry.name);
|
|
8104
8192
|
if (entry.isDirectory() && !entry.name.startsWith(".") && entry.name !== "node_modules") {
|
|
8105
8193
|
files.push(...findFiles(fullPath, ext));
|
|
8106
8194
|
} else if (entry.isFile() && entry.name.endsWith(ext)) {
|
|
@@ -8118,7 +8206,7 @@ function findFiles(dir, ext) {
|
|
|
8118
8206
|
return files;
|
|
8119
8207
|
}
|
|
8120
8208
|
function runWorkspaceDiagnostics(root, issues, checks) {
|
|
8121
|
-
const rootPackageJsonPath =
|
|
8209
|
+
const rootPackageJsonPath = path23.join(root, "package.json");
|
|
8122
8210
|
const rootPackageJson = readJsonFile(rootPackageJsonPath);
|
|
8123
8211
|
if (!rootPackageJson) {
|
|
8124
8212
|
addCheck(
|
|
@@ -8171,7 +8259,7 @@ function runWorkspaceDiagnostics(root, issues, checks) {
|
|
|
8171
8259
|
const scripts = typeof manifest.scripts === "object" && manifest.scripts !== null ? manifest.scripts : {};
|
|
8172
8260
|
const missing = requiredScripts.filter((name) => typeof scripts[name] !== "string");
|
|
8173
8261
|
if (missing.length === 0) return [];
|
|
8174
|
-
const packageName = typeof manifest.name === "string" && manifest.name.length > 0 ? manifest.name :
|
|
8262
|
+
const packageName = typeof manifest.name === "string" && manifest.name.length > 0 ? manifest.name : path23.basename(path23.dirname(filePath));
|
|
8175
8263
|
return [{ packageName, missing }];
|
|
8176
8264
|
});
|
|
8177
8265
|
if (missingScripts.length === 0) {
|
|
@@ -8206,7 +8294,7 @@ function runWorkspaceDiagnostics(root, issues, checks) {
|
|
|
8206
8294
|
);
|
|
8207
8295
|
}
|
|
8208
8296
|
function runTailwindProjectDiagnostics(root, issues, checks) {
|
|
8209
|
-
const packageJsonPath =
|
|
8297
|
+
const packageJsonPath = path23.join(root, "package.json");
|
|
8210
8298
|
const packageJson = readJsonFile(packageJsonPath);
|
|
8211
8299
|
if (!packageJson) {
|
|
8212
8300
|
addCheck(
|
|
@@ -8289,7 +8377,7 @@ function runTailwindProjectDiagnostics(root, issues, checks) {
|
|
|
8289
8377
|
);
|
|
8290
8378
|
}
|
|
8291
8379
|
const configFiles = ["tailwind.config.js", "tailwind.config.ts", "tailwind.config.mjs"];
|
|
8292
|
-
const hasConfig = configFiles.some((name) => fs11.existsSync(
|
|
8380
|
+
const hasConfig = configFiles.some((name) => fs11.existsSync(path23.join(root, name)));
|
|
8293
8381
|
addCheck(
|
|
8294
8382
|
checks,
|
|
8295
8383
|
"tailwind",
|
|
@@ -8298,7 +8386,7 @@ function runTailwindProjectDiagnostics(root, issues, checks) {
|
|
|
8298
8386
|
"info",
|
|
8299
8387
|
hasConfig ? "Tailwind config file detected." : "No tailwind.config file found."
|
|
8300
8388
|
);
|
|
8301
|
-
const tsconfig = readJsonFile(
|
|
8389
|
+
const tsconfig = readJsonFile(path23.join(root, "tsconfig.json"));
|
|
8302
8390
|
const jsx = tsconfig?.compilerOptions?.jsx;
|
|
8303
8391
|
addCheck(
|
|
8304
8392
|
checks,
|
|
@@ -8464,7 +8552,7 @@ async function runAnalysisDiagnostics(root, issues, checks, verbose) {
|
|
|
8464
8552
|
}
|
|
8465
8553
|
}
|
|
8466
8554
|
var runDiagnostics = async (options = {}) => {
|
|
8467
|
-
const root =
|
|
8555
|
+
const root = path23.resolve(options.root ?? process.cwd());
|
|
8468
8556
|
const includes = parseIncludes(options.include);
|
|
8469
8557
|
const issues = [];
|
|
8470
8558
|
const checks = [];
|
|
@@ -8583,10 +8671,11 @@ function printDoctorOutput(result, output) {
|
|
|
8583
8671
|
}
|
|
8584
8672
|
|
|
8585
8673
|
// packages/infrastructure/cli/src/commands/misc.ts
|
|
8674
|
+
init_esm_shims();
|
|
8586
8675
|
init_errors();
|
|
8587
8676
|
init_fs();
|
|
8588
8677
|
init_json();
|
|
8589
|
-
import
|
|
8678
|
+
import path24 from "path";
|
|
8590
8679
|
import { parseArgs as parseNodeArgs9 } from "util";
|
|
8591
8680
|
var testCommand = {
|
|
8592
8681
|
name: "test",
|
|
@@ -8616,7 +8705,7 @@ var shareCommand = {
|
|
|
8616
8705
|
name: "share",
|
|
8617
8706
|
async run(args, context) {
|
|
8618
8707
|
const name = args.find((arg) => !arg.startsWith("-")) ?? "component-name";
|
|
8619
|
-
const manifestPath =
|
|
8708
|
+
const manifestPath = path24.join(process.cwd(), ".tw-cache", "deploy-manifest.json");
|
|
8620
8709
|
const defaultManifest = {
|
|
8621
8710
|
name,
|
|
8622
8711
|
version: "0.1.0"
|
|
@@ -8702,14 +8791,14 @@ var isVersionOutdated = (currentVersion, latestVersion) => {
|
|
|
8702
8791
|
};
|
|
8703
8792
|
var resolveCurrentCliVersion = async (context) => {
|
|
8704
8793
|
const candidates = [
|
|
8705
|
-
|
|
8706
|
-
|
|
8707
|
-
|
|
8794
|
+
path24.resolve(context.runtimeDir, "..", "package.json"),
|
|
8795
|
+
path24.resolve(process.cwd(), "packages", "cli", "package.json"),
|
|
8796
|
+
path24.resolve(process.cwd(), "package.json")
|
|
8708
8797
|
];
|
|
8709
8798
|
for (const candidate of candidates) {
|
|
8710
8799
|
if (!await pathExists2(candidate)) continue;
|
|
8711
8800
|
const pkg = await readJsonSafe(candidate);
|
|
8712
|
-
const isCliPackage = pkg?.version && (pkg.name === CLI_PACKAGE_NAME || candidate.includes(`${
|
|
8801
|
+
const isCliPackage = pkg?.version && (pkg.name === CLI_PACKAGE_NAME || candidate.includes(`${path24.sep}packages${path24.sep}cli${path24.sep}`));
|
|
8713
8802
|
if (isCliPackage) return pkg.version ?? "0.0.0";
|
|
8714
8803
|
}
|
|
8715
8804
|
return "0.0.0";
|
|
@@ -8860,6 +8949,7 @@ var miscCommands = [
|
|
|
8860
8949
|
];
|
|
8861
8950
|
|
|
8862
8951
|
// packages/infrastructure/cli/src/commands/plugin.ts
|
|
8952
|
+
init_esm_shims();
|
|
8863
8953
|
init_errors();
|
|
8864
8954
|
init_json();
|
|
8865
8955
|
var pluginCommand = {
|
|
@@ -8946,13 +9036,17 @@ var pluginCommand = {
|
|
|
8946
9036
|
}
|
|
8947
9037
|
};
|
|
8948
9038
|
|
|
9039
|
+
// packages/infrastructure/cli/src/commands/preflight.ts
|
|
9040
|
+
init_esm_shims();
|
|
9041
|
+
|
|
8949
9042
|
// packages/infrastructure/cli/src/preflight.ts
|
|
9043
|
+
init_esm_shims();
|
|
8950
9044
|
init_args();
|
|
8951
9045
|
init_errors();
|
|
8952
9046
|
init_fs();
|
|
8953
9047
|
init_json();
|
|
8954
9048
|
init_src4();
|
|
8955
|
-
import
|
|
9049
|
+
import path26 from "path";
|
|
8956
9050
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
8957
9051
|
var DEFAULT_TAILWIND_CSS2 = '@import "tailwindcss";\n';
|
|
8958
9052
|
var DEFAULT_TW_CONFIG = `${JSON.stringify(
|
|
@@ -8979,8 +9073,8 @@ async function validateThemeConfig(cwd2) {
|
|
|
8979
9073
|
const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
|
|
8980
9074
|
let configPath = null;
|
|
8981
9075
|
for (const file of twConfigFiles) {
|
|
8982
|
-
if (await pathExists2(
|
|
8983
|
-
configPath =
|
|
9076
|
+
if (await pathExists2(path26.join(cwd2, file))) {
|
|
9077
|
+
configPath = path26.join(cwd2, file);
|
|
8984
9078
|
break;
|
|
8985
9079
|
}
|
|
8986
9080
|
}
|
|
@@ -9071,7 +9165,7 @@ function resolveCliEntry(scriptPath) {
|
|
|
9071
9165
|
async function hasTailwindCssImport(cwd2) {
|
|
9072
9166
|
const cssFiles = ["src/app/globals.css", "src/index.css", "src/style.css", "app/globals.css"];
|
|
9073
9167
|
for (const file of cssFiles) {
|
|
9074
|
-
const raw = await readFileSafe(
|
|
9168
|
+
const raw = await readFileSafe(path26.join(cwd2, file));
|
|
9075
9169
|
if (raw?.includes("tailwindcss")) return true;
|
|
9076
9170
|
}
|
|
9077
9171
|
return false;
|
|
@@ -9087,7 +9181,7 @@ async function hasSafelistSource(cwd2) {
|
|
|
9087
9181
|
"app/globals.css"
|
|
9088
9182
|
];
|
|
9089
9183
|
for (const file of cssFiles) {
|
|
9090
|
-
const raw = await readFileSafe(
|
|
9184
|
+
const raw = await readFileSafe(path26.join(cwd2, file));
|
|
9091
9185
|
if (raw === null) continue;
|
|
9092
9186
|
if (raw.includes("tw-classes")) return { found: true, cssFile: file };
|
|
9093
9187
|
if (raw.includes("tailwindcss")) return { found: false, cssFile: file };
|
|
@@ -9095,8 +9189,8 @@ async function hasSafelistSource(cwd2) {
|
|
|
9095
9189
|
return { found: false, cssFile: null };
|
|
9096
9190
|
}
|
|
9097
9191
|
async function applyTailwindInit(cwd2) {
|
|
9098
|
-
await ensureFileSafe(
|
|
9099
|
-
await ensureFileSafe(
|
|
9192
|
+
await ensureFileSafe(path26.join(cwd2, "src", "tailwind.css"), DEFAULT_TAILWIND_CSS2);
|
|
9193
|
+
await ensureFileSafe(path26.join(cwd2, "tailwind-styled.config.json"), DEFAULT_TW_CONFIG);
|
|
9100
9194
|
}
|
|
9101
9195
|
function check(results, id, label, pass, message, fix) {
|
|
9102
9196
|
results.push({ id, label, pass, message, fix });
|
|
@@ -9118,7 +9212,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9118
9212
|
node.major >= 20 ? `Node ${node.full} OK` : `Node ${node.full} - requires >=20. Download: https://nodejs.org`,
|
|
9119
9213
|
node.major < 20 ? "Install Node.js 20 LTS or newer from https://nodejs.org" : void 0
|
|
9120
9214
|
);
|
|
9121
|
-
const pkg = await readJsonSafe(
|
|
9215
|
+
const pkg = await readJsonSafe(path26.join(cwd2, "package.json"));
|
|
9122
9216
|
check(
|
|
9123
9217
|
results,
|
|
9124
9218
|
"package-json",
|
|
@@ -9152,7 +9246,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9152
9246
|
}
|
|
9153
9247
|
const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
|
|
9154
9248
|
const twConfigChecks = await Promise.all(
|
|
9155
|
-
twConfigFiles.map(async (file) => ({ file, exists: await pathExists2(
|
|
9249
|
+
twConfigFiles.map(async (file) => ({ file, exists: await pathExists2(path26.join(cwd2, file)) }))
|
|
9156
9250
|
);
|
|
9157
9251
|
const foundTwConfig = twConfigChecks.find((item) => item.exists)?.file ?? null;
|
|
9158
9252
|
const hasCssConfig = await hasTailwindCssImport(cwd2);
|
|
@@ -9164,7 +9258,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9164
9258
|
foundTwConfig ? `${foundTwConfig} found OK` : hasCssConfig ? "@import tailwindcss found in CSS OK" : "No Tailwind config found - run: tw init",
|
|
9165
9259
|
"tw init"
|
|
9166
9260
|
);
|
|
9167
|
-
const oldConfig = await readJsonSafe(
|
|
9261
|
+
const oldConfig = await readJsonSafe(path26.join(cwd2, "tailwind.config.js")) ?? await readJsonSafe(path26.join(cwd2, "tailwind.config.ts"));
|
|
9168
9262
|
if (oldConfig) {
|
|
9169
9263
|
const hasOldJit = oldConfig.mode === "jit";
|
|
9170
9264
|
const hasOldPurge = "purge" in oldConfig;
|
|
@@ -9188,7 +9282,7 @@ async function runPreflightCli(rawArgs) {
|
|
|
9188
9282
|
validation.message
|
|
9189
9283
|
);
|
|
9190
9284
|
}
|
|
9191
|
-
const hasTsConfig = await pathExists2(
|
|
9285
|
+
const hasTsConfig = await pathExists2(path26.join(cwd2, "tsconfig.json"));
|
|
9192
9286
|
check(
|
|
9193
9287
|
results,
|
|
9194
9288
|
"typescript",
|
|
@@ -9296,6 +9390,7 @@ var preflightCommand = {
|
|
|
9296
9390
|
};
|
|
9297
9391
|
|
|
9298
9392
|
// packages/infrastructure/cli/src/commands/registry.ts
|
|
9393
|
+
init_esm_shims();
|
|
9299
9394
|
init_errors();
|
|
9300
9395
|
var registryCommand = {
|
|
9301
9396
|
name: "registry",
|
|
@@ -9333,6 +9428,7 @@ var installRegistryCommand = {
|
|
|
9333
9428
|
};
|
|
9334
9429
|
|
|
9335
9430
|
// packages/infrastructure/cli/src/commands/scriptCommands.ts
|
|
9431
|
+
init_esm_shims();
|
|
9336
9432
|
init_errors();
|
|
9337
9433
|
import { parseArgs as parseNodeArgs10 } from "util";
|
|
9338
9434
|
async function runScriptCommand(commandName, context, relativeScriptPath, args, options = {}) {
|
|
@@ -9544,10 +9640,11 @@ var scriptCommands = [
|
|
|
9544
9640
|
];
|
|
9545
9641
|
|
|
9546
9642
|
// packages/infrastructure/cli/src/commands/storybook.ts
|
|
9643
|
+
init_esm_shims();
|
|
9547
9644
|
init_errors();
|
|
9548
9645
|
init_fs();
|
|
9549
9646
|
init_json();
|
|
9550
|
-
import
|
|
9647
|
+
import path27 from "path";
|
|
9551
9648
|
import { parseArgs as parseNodeArgs11 } from "util";
|
|
9552
9649
|
var storybookCommand = {
|
|
9553
9650
|
name: "storybook",
|
|
@@ -9586,7 +9683,7 @@ var storybookCommand = {
|
|
|
9586
9683
|
context.output.writeText(
|
|
9587
9684
|
`[tw storybook] Tip: use --variants='{"size":["sm","lg"]}' to enumerate variant combinations`
|
|
9588
9685
|
);
|
|
9589
|
-
const localBin =
|
|
9686
|
+
const localBin = path27.join(
|
|
9590
9687
|
process.cwd(),
|
|
9591
9688
|
"node_modules",
|
|
9592
9689
|
".bin",
|
|
@@ -9603,6 +9700,7 @@ var storybookCommand = {
|
|
|
9603
9700
|
};
|
|
9604
9701
|
|
|
9605
9702
|
// packages/infrastructure/cli/src/commands/studio.ts
|
|
9703
|
+
init_esm_shims();
|
|
9606
9704
|
init_errors();
|
|
9607
9705
|
import { parseArgs as parseNodeArgs12 } from "util";
|
|
9608
9706
|
var studioCommand = {
|
|
@@ -9636,6 +9734,7 @@ var studioCommand = {
|
|
|
9636
9734
|
};
|
|
9637
9735
|
|
|
9638
9736
|
// packages/infrastructure/cli/src/commands/sync.ts
|
|
9737
|
+
init_esm_shims();
|
|
9639
9738
|
init_errors();
|
|
9640
9739
|
var syncCommand = {
|
|
9641
9740
|
name: "sync",
|
|
@@ -9677,20 +9776,29 @@ var syncCommand = {
|
|
|
9677
9776
|
};
|
|
9678
9777
|
|
|
9679
9778
|
// packages/infrastructure/cli/src/commands/trace.ts
|
|
9779
|
+
init_esm_shims();
|
|
9680
9780
|
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
9681
9781
|
init_errors();
|
|
9682
9782
|
import { parseArgs as parseNodeArgs13 } from "util";
|
|
9683
9783
|
|
|
9684
9784
|
// packages/infrastructure/cli/src/utils/traceService.ts
|
|
9785
|
+
init_esm_shims();
|
|
9685
9786
|
init_internal();
|
|
9686
9787
|
|
|
9788
|
+
// packages/domain/engine/src/internal.ts
|
|
9789
|
+
init_esm_shims();
|
|
9790
|
+
|
|
9791
|
+
// packages/domain/engine/src/bundleAnalyzer.ts
|
|
9792
|
+
init_esm_shims();
|
|
9793
|
+
|
|
9687
9794
|
// packages/domain/engine/src/native-bridge.ts
|
|
9795
|
+
init_esm_shims();
|
|
9688
9796
|
init_src();
|
|
9689
9797
|
var log4 = createDebugLogger("engine:native");
|
|
9690
|
-
function
|
|
9798
|
+
function getDirname4() {
|
|
9691
9799
|
if (typeof __dirname !== "undefined") return __dirname;
|
|
9692
9800
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
9693
|
-
return
|
|
9801
|
+
return getDirname2(import.meta.url);
|
|
9694
9802
|
}
|
|
9695
9803
|
return process.cwd();
|
|
9696
9804
|
}
|
|
@@ -9734,7 +9842,7 @@ var createEngineBindingLoader = () => {
|
|
|
9734
9842
|
}
|
|
9735
9843
|
return cached;
|
|
9736
9844
|
}
|
|
9737
|
-
const runtimeDir =
|
|
9845
|
+
const runtimeDir = getDirname4();
|
|
9738
9846
|
const candidates = resolveNativeBindingCandidates({
|
|
9739
9847
|
runtimeDir,
|
|
9740
9848
|
includeDefaultCandidates: true
|
|
@@ -9865,6 +9973,7 @@ var BundleAnalyzer = class {
|
|
|
9865
9973
|
};
|
|
9866
9974
|
|
|
9867
9975
|
// packages/domain/engine/src/impactTracker.ts
|
|
9976
|
+
init_esm_shims();
|
|
9868
9977
|
var ImpactTracker = class {
|
|
9869
9978
|
bundleAnalyzer;
|
|
9870
9979
|
constructor() {
|
|
@@ -10049,6 +10158,7 @@ var ImpactTracker = class {
|
|
|
10049
10158
|
};
|
|
10050
10159
|
|
|
10051
10160
|
// packages/domain/engine/src/ir.ts
|
|
10161
|
+
init_esm_shims();
|
|
10052
10162
|
var RuleId = class {
|
|
10053
10163
|
constructor(value) {
|
|
10054
10164
|
this.value = value;
|
|
@@ -10178,6 +10288,7 @@ function createFingerprint(parts) {
|
|
|
10178
10288
|
}
|
|
10179
10289
|
|
|
10180
10290
|
// packages/domain/engine/src/reverseLookup.ts
|
|
10291
|
+
init_esm_shims();
|
|
10181
10292
|
function getNative() {
|
|
10182
10293
|
const native = getNativeEngineBinding();
|
|
10183
10294
|
if (!native?.reverseLookupFromCss || !native?.reverseLookupByProperty || !native?.reverseLookupFindDependents) {
|
|
@@ -10252,6 +10363,7 @@ var ReverseLookup = class {
|
|
|
10252
10363
|
};
|
|
10253
10364
|
|
|
10254
10365
|
// packages/domain/engine/src/resolver.ts
|
|
10366
|
+
init_esm_shims();
|
|
10255
10367
|
function toNativeInput(rule) {
|
|
10256
10368
|
return {
|
|
10257
10369
|
id: rule.id.value,
|
|
@@ -10369,6 +10481,7 @@ var CascadeResolver = class {
|
|
|
10369
10481
|
};
|
|
10370
10482
|
|
|
10371
10483
|
// packages/domain/engine/src/cssToIr.ts
|
|
10484
|
+
init_esm_shims();
|
|
10372
10485
|
function createIdGenerator() {
|
|
10373
10486
|
const state = {
|
|
10374
10487
|
ruleIdCounter: 0,
|
|
@@ -10541,6 +10654,7 @@ function _parseCssToIrFallback(css, prefix, native) {
|
|
|
10541
10654
|
}
|
|
10542
10655
|
|
|
10543
10656
|
// packages/domain/engine/src/trace.ts
|
|
10657
|
+
init_esm_shims();
|
|
10544
10658
|
function buildProvenanceChain(className) {
|
|
10545
10659
|
return {
|
|
10546
10660
|
className,
|
|
@@ -10753,12 +10867,13 @@ async function traceClass(className, options) {
|
|
|
10753
10867
|
}
|
|
10754
10868
|
|
|
10755
10869
|
// packages/infrastructure/cli/src/utils/traceTargetService.ts
|
|
10870
|
+
init_esm_shims();
|
|
10756
10871
|
init_internal();
|
|
10757
10872
|
init_src2();
|
|
10758
10873
|
import fs13 from "fs";
|
|
10759
|
-
import
|
|
10874
|
+
import path28 from "path";
|
|
10760
10875
|
function toRelativePath(root, value) {
|
|
10761
|
-
const relative =
|
|
10876
|
+
const relative = path28.relative(root, value);
|
|
10762
10877
|
return relative.length > 0 ? relative : ".";
|
|
10763
10878
|
}
|
|
10764
10879
|
function uniqueSorted(values) {
|
|
@@ -10889,8 +11004,8 @@ function traceDirectory(targetDir, root) {
|
|
|
10889
11004
|
};
|
|
10890
11005
|
}
|
|
10891
11006
|
async function traceTarget(target, options = {}) {
|
|
10892
|
-
const root =
|
|
10893
|
-
const resolvedTarget =
|
|
11007
|
+
const root = path28.resolve(options.root ?? process.cwd());
|
|
11008
|
+
const resolvedTarget = path28.resolve(root, target);
|
|
10894
11009
|
if (!fs13.existsSync(resolvedTarget)) {
|
|
10895
11010
|
throw new Error(`Trace target not found: ${resolvedTarget}`);
|
|
10896
11011
|
}
|
|
@@ -11056,16 +11171,17 @@ function printClassTraceOutput(result, output) {
|
|
|
11056
11171
|
}
|
|
11057
11172
|
|
|
11058
11173
|
// packages/infrastructure/cli/src/generateTypes.ts
|
|
11174
|
+
init_esm_shims();
|
|
11059
11175
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
11060
11176
|
init_output();
|
|
11061
11177
|
import fs14 from "fs";
|
|
11062
|
-
import
|
|
11178
|
+
import path29 from "path";
|
|
11063
11179
|
async function runGenerateTypesCli(rawArgs) {
|
|
11064
11180
|
const output = createCliOutput({ json: rawArgs.includes("--json") });
|
|
11065
11181
|
const logger = createCliLogger({ output });
|
|
11066
11182
|
const cwd2 = process.cwd();
|
|
11067
11183
|
const outFile = rawArgs.find((a) => a.startsWith("--out="))?.slice(6) ?? "src/types/tailwind-styled.d.ts";
|
|
11068
|
-
const outPath =
|
|
11184
|
+
const outPath = path29.resolve(cwd2, outFile);
|
|
11069
11185
|
output.writeText("");
|
|
11070
11186
|
output.writeText(import_picocolors6.default.bold(import_picocolors6.default.cyan(" \u25C6 tw generate-types")));
|
|
11071
11187
|
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"));
|
|
@@ -11101,12 +11217,12 @@ async function runGenerateTypesCli(rawArgs) {
|
|
|
11101
11217
|
}
|
|
11102
11218
|
output.writeText("");
|
|
11103
11219
|
output.writeText(import_picocolors6.default.bold(" [2/2]") + import_picocolors6.default.cyan(" generate .d.ts"));
|
|
11104
|
-
const outDir =
|
|
11220
|
+
const outDir = path29.dirname(outPath);
|
|
11105
11221
|
if (!fs14.existsSync(outDir)) {
|
|
11106
11222
|
fs14.mkdirSync(outDir, { recursive: true });
|
|
11107
11223
|
}
|
|
11108
11224
|
fs14.writeFileSync(outPath, result.dtsContent, "utf-8");
|
|
11109
|
-
logger.ok(
|
|
11225
|
+
logger.ok(path29.relative(cwd2, outPath));
|
|
11110
11226
|
output.writeText("");
|
|
11111
11227
|
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"));
|
|
11112
11228
|
output.writeText(import_picocolors6.default.bold(import_picocolors6.default.green(" \u2713 types generated")));
|
|
@@ -11117,8 +11233,8 @@ async function runGenerateTypesCli(rawArgs) {
|
|
|
11117
11233
|
}
|
|
11118
11234
|
async function loadNativeBinding2(cwd2) {
|
|
11119
11235
|
const candidates = [
|
|
11120
|
-
|
|
11121
|
-
|
|
11236
|
+
path29.join(cwd2, "native", "tailwind-styled-native.node"),
|
|
11237
|
+
path29.join(cwd2, "node_modules", "tailwind-styled-v4", "native", "tailwind-styled-native.node")
|
|
11122
11238
|
];
|
|
11123
11239
|
for (const candidate of candidates) {
|
|
11124
11240
|
if (fs14.existsSync(candidate)) {
|
|
@@ -11132,13 +11248,15 @@ async function loadNativeBinding2(cwd2) {
|
|
|
11132
11248
|
}
|
|
11133
11249
|
|
|
11134
11250
|
// packages/infrastructure/cli/src/commands/why.ts
|
|
11251
|
+
init_esm_shims();
|
|
11135
11252
|
init_errors();
|
|
11136
11253
|
import { parseArgs as parseNodeArgs14 } from "util";
|
|
11137
11254
|
|
|
11138
11255
|
// packages/infrastructure/cli/src/utils/whyService.ts
|
|
11256
|
+
init_esm_shims();
|
|
11139
11257
|
init_internal();
|
|
11140
11258
|
import fs15 from "fs";
|
|
11141
|
-
import
|
|
11259
|
+
import path30 from "path";
|
|
11142
11260
|
init_src2();
|
|
11143
11261
|
function extractVariantChain(usage) {
|
|
11144
11262
|
const segments = normalizeScannedClass(usage).split(":").filter(Boolean);
|
|
@@ -11200,7 +11318,7 @@ async function whyClass(className, options) {
|
|
|
11200
11318
|
className
|
|
11201
11319
|
]);
|
|
11202
11320
|
usedIn.push({
|
|
11203
|
-
file:
|
|
11321
|
+
file: path30.relative(root, file.file) || path30.basename(file.file),
|
|
11204
11322
|
line: location.line,
|
|
11205
11323
|
column: location.column,
|
|
11206
11324
|
usage: normalizeScannedClass(fileClass)
|
|
@@ -11664,7 +11782,7 @@ async function main2() {
|
|
|
11664
11782
|
buildProgram: buildMainProgram
|
|
11665
11783
|
});
|
|
11666
11784
|
}
|
|
11667
|
-
var __currentFile =
|
|
11785
|
+
var __currentFile = fileURLToPath7(import.meta.url);
|
|
11668
11786
|
if (process.argv[1] === __currentFile) {
|
|
11669
11787
|
main2();
|
|
11670
11788
|
}
|