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/vite.mjs
CHANGED
|
@@ -26,6 +26,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
};
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
+
// node_modules/tsup/assets/esm_shims.js
|
|
30
|
+
import path from "path";
|
|
31
|
+
import { fileURLToPath } from "url";
|
|
32
|
+
var getFilename, getDirname, __dirname, __filename;
|
|
33
|
+
var init_esm_shims = __esm({
|
|
34
|
+
"node_modules/tsup/assets/esm_shims.js"() {
|
|
35
|
+
"use strict";
|
|
36
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
37
|
+
getDirname = () => path.dirname(getFilename());
|
|
38
|
+
__dirname = /* @__PURE__ */ getDirname();
|
|
39
|
+
__filename = /* @__PURE__ */ getFilename();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
29
43
|
// packages/domain/shared/src/trace.ts
|
|
30
44
|
function getHealthColor(status) {
|
|
31
45
|
switch (status) {
|
|
@@ -119,6 +133,7 @@ function getPipelinePercentages(metrics) {
|
|
|
119
133
|
var init_trace = __esm({
|
|
120
134
|
"packages/domain/shared/src/trace.ts"() {
|
|
121
135
|
"use strict";
|
|
136
|
+
init_esm_shims();
|
|
122
137
|
}
|
|
123
138
|
});
|
|
124
139
|
|
|
@@ -134,6 +149,7 @@ var ERROR_CODES, ERROR_SUGGESTIONS;
|
|
|
134
149
|
var init_error_codes = __esm({
|
|
135
150
|
"packages/domain/shared/src/error-codes.ts"() {
|
|
136
151
|
"use strict";
|
|
152
|
+
init_esm_shims();
|
|
137
153
|
ERROR_CODES = {
|
|
138
154
|
// E0xx — Native binding
|
|
139
155
|
NATIVE_NOT_FOUND: "E001",
|
|
@@ -201,6 +217,7 @@ function isTailwindV4() {
|
|
|
201
217
|
var init_compatibility = __esm({
|
|
202
218
|
"packages/domain/shared/src/compatibility.ts"() {
|
|
203
219
|
"use strict";
|
|
220
|
+
init_esm_shims();
|
|
204
221
|
}
|
|
205
222
|
});
|
|
206
223
|
|
|
@@ -214,9 +231,9 @@ function parseNative(schema, data, context) {
|
|
|
214
231
|
const result = schema.safeParse(data);
|
|
215
232
|
if (!result.success) {
|
|
216
233
|
const first = result.error.issues[0];
|
|
217
|
-
const
|
|
234
|
+
const path17 = first?.path?.join(".") ?? "(root)";
|
|
218
235
|
throw new Error(
|
|
219
|
-
`[${context}] Native binding returned unexpected data: ${
|
|
236
|
+
`[${context}] Native binding returned unexpected data: ${path17}: ${first?.message ?? "validation failed"}`
|
|
220
237
|
);
|
|
221
238
|
}
|
|
222
239
|
return result.data;
|
|
@@ -225,6 +242,7 @@ var NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, Native
|
|
|
225
242
|
var init_native_schemas = __esm({
|
|
226
243
|
"packages/domain/shared/src/native-schemas.ts"() {
|
|
227
244
|
"use strict";
|
|
245
|
+
init_esm_shims();
|
|
228
246
|
NativeScanFileSchema = z.object({
|
|
229
247
|
file: z.string().min(1, "file path cannot be empty"),
|
|
230
248
|
classes: z.array(z.string()),
|
|
@@ -355,14 +373,14 @@ function createEsmRequire(importMetaUrl) {
|
|
|
355
373
|
if (!nodeRequire) throw new Error("require not available");
|
|
356
374
|
return nodeRequire.createRequire(importMetaUrl);
|
|
357
375
|
}
|
|
358
|
-
function
|
|
376
|
+
function getDirname2(importMetaUrl) {
|
|
359
377
|
if (isBrowser) return "";
|
|
360
378
|
if (typeof __dirname !== "undefined") return __dirname;
|
|
361
379
|
const nodePath = getNodePath();
|
|
362
380
|
const nodeUrl = getNodeUrl();
|
|
363
381
|
return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
|
|
364
382
|
}
|
|
365
|
-
function
|
|
383
|
+
function getFilename2(importMetaUrl) {
|
|
366
384
|
if (isBrowser) return "";
|
|
367
385
|
if (typeof __filename !== "undefined") return __filename;
|
|
368
386
|
return getNodeUrl().fileURLToPath(importMetaUrl);
|
|
@@ -371,7 +389,7 @@ function resolveFromRoot(...segments) {
|
|
|
371
389
|
if (isBrowser) return segments.join("/");
|
|
372
390
|
const nodePath = getNodePath();
|
|
373
391
|
const nodeFs = getNodeFs();
|
|
374
|
-
let dir = typeof __dirname !== "undefined" ? __dirname :
|
|
392
|
+
let dir = typeof __dirname !== "undefined" ? __dirname : getDirname2(getCurrentFileUrl());
|
|
375
393
|
for (let i = 0; i < 10; i++) {
|
|
376
394
|
const pkgPath = nodePath.join(dir, "package.json");
|
|
377
395
|
try {
|
|
@@ -395,12 +413,13 @@ function tryRequire(moduleName, importMetaUrl) {
|
|
|
395
413
|
}
|
|
396
414
|
function resolveNativeNodePath(importMetaUrl, ...relativeSegments) {
|
|
397
415
|
if (isBrowser) return relativeSegments.join("/");
|
|
398
|
-
return getNodePath().resolve(
|
|
416
|
+
return getNodePath().resolve(getDirname2(importMetaUrl), ...relativeSegments);
|
|
399
417
|
}
|
|
400
418
|
var isBrowser, nodeModuleRef, _nodePath, _nodeUrl, _nodeFs;
|
|
401
419
|
var init_esmHelpers = __esm({
|
|
402
420
|
"packages/domain/shared/src/esmHelpers.ts"() {
|
|
403
421
|
"use strict";
|
|
422
|
+
init_esm_shims();
|
|
404
423
|
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
405
424
|
nodeModuleRef = null;
|
|
406
425
|
_nodePath = null;
|
|
@@ -452,6 +471,7 @@ var RING_BUFFER_SIZE, TelemetryCollector, _globalCollector;
|
|
|
452
471
|
var init_telemetry = __esm({
|
|
453
472
|
"packages/domain/shared/src/telemetry.ts"() {
|
|
454
473
|
"use strict";
|
|
474
|
+
init_esm_shims();
|
|
455
475
|
RING_BUFFER_SIZE = 100;
|
|
456
476
|
TelemetryCollector = class {
|
|
457
477
|
data = [];
|
|
@@ -555,6 +575,7 @@ var ScanCacheClassEntrySchema, ScanCacheSchema, TailwindContentItemSchema, Tailw
|
|
|
555
575
|
var init_configSchemas = __esm({
|
|
556
576
|
"packages/domain/shared/src/configSchemas.ts"() {
|
|
557
577
|
"use strict";
|
|
578
|
+
init_esm_shims();
|
|
558
579
|
ScanCacheClassEntrySchema = z2.object({
|
|
559
580
|
name: z2.string().min(1),
|
|
560
581
|
usedIn: z2.array(z2.string()),
|
|
@@ -646,11 +667,11 @@ function resolvePath(...segments) {
|
|
|
646
667
|
return segments.join("/").replace(/\/+/g, "/");
|
|
647
668
|
}
|
|
648
669
|
}
|
|
649
|
-
function existsSync(
|
|
670
|
+
function existsSync(path17) {
|
|
650
671
|
if (isBrowser2) return false;
|
|
651
672
|
try {
|
|
652
673
|
const nodeFs = __require(NODE_FS);
|
|
653
|
-
return nodeFs.existsSync(
|
|
674
|
+
return nodeFs.existsSync(path17);
|
|
654
675
|
} catch {
|
|
655
676
|
return false;
|
|
656
677
|
}
|
|
@@ -704,6 +725,7 @@ var isBrowser2, NODE_URL, NODE_FS, NODE_PATH;
|
|
|
704
725
|
var init_workerResolver = __esm({
|
|
705
726
|
"packages/domain/shared/src/workerResolver.ts"() {
|
|
706
727
|
"use strict";
|
|
728
|
+
init_esm_shims();
|
|
707
729
|
isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
708
730
|
NODE_URL = typeof window === "undefined" || typeof document === "undefined" ? "node:url" : null;
|
|
709
731
|
NODE_FS = typeof window === "undefined" || typeof document === "undefined" ? "node:fs" : null;
|
|
@@ -870,13 +892,23 @@ function generateBarrelFile(exports, dir, opts = {}) {
|
|
|
870
892
|
var init_codegen = __esm({
|
|
871
893
|
"packages/domain/shared/src/codegen.ts"() {
|
|
872
894
|
"use strict";
|
|
895
|
+
init_esm_shims();
|
|
873
896
|
}
|
|
874
897
|
});
|
|
875
898
|
|
|
876
899
|
// packages/domain/shared/src/native-resolution.ts
|
|
877
900
|
import { createRequire } from "module";
|
|
878
901
|
import * as fs from "fs";
|
|
879
|
-
import * as
|
|
902
|
+
import * as path2 from "path";
|
|
903
|
+
function _safeCreateRequire() {
|
|
904
|
+
if (typeof import.meta !== "undefined" && import.meta.url && !import.meta.url.includes("unknown")) {
|
|
905
|
+
return createRequire(import.meta.url);
|
|
906
|
+
}
|
|
907
|
+
if (typeof __filename !== "undefined") {
|
|
908
|
+
return createRequire(__filename);
|
|
909
|
+
}
|
|
910
|
+
return createRequire(new URL(`file://${process.cwd()}/`).href);
|
|
911
|
+
}
|
|
880
912
|
function platformKey() {
|
|
881
913
|
if (isBrowser3) return "browser";
|
|
882
914
|
return `${process.platform}-${process.arch}`;
|
|
@@ -912,11 +944,11 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
912
944
|
const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
|
|
913
945
|
const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
914
946
|
if (runtimeDir) {
|
|
915
|
-
for (const depth of ["..",
|
|
916
|
-
const pkgRoot =
|
|
947
|
+
for (const depth of ["..", path2.join("..", ".."), path2.join("..", "..", "..")]) {
|
|
948
|
+
const pkgRoot = path2.resolve(runtimeDir, depth);
|
|
917
949
|
for (const bin of BINARY_NAMES_SELF) {
|
|
918
950
|
for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
|
|
919
|
-
const candidate =
|
|
951
|
+
const candidate = path2.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
|
|
920
952
|
tried.push(`self-bundled:${candidate}`);
|
|
921
953
|
if (fs.existsSync(candidate)) {
|
|
922
954
|
return { path: candidate, source: "prebuilt", platform, tried };
|
|
@@ -930,22 +962,22 @@ function resolveNativeBinary(runtimeDir) {
|
|
|
930
962
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
931
963
|
const localCandidates = [];
|
|
932
964
|
for (const bin of BINARY_NAMES) {
|
|
933
|
-
localCandidates.push(
|
|
934
|
-
localCandidates.push(
|
|
935
|
-
localCandidates.push(
|
|
936
|
-
localCandidates.push(
|
|
965
|
+
localCandidates.push(path2.resolve(base, `${bin}.node`));
|
|
966
|
+
localCandidates.push(path2.resolve(base, "..", `${bin}.node`));
|
|
967
|
+
localCandidates.push(path2.resolve(base, `${bin}.${platform}.node`));
|
|
968
|
+
localCandidates.push(path2.resolve(base, `${bin}.${napiPlatform}.node`));
|
|
937
969
|
}
|
|
938
970
|
for (const startDir of [cwd, base]) {
|
|
939
971
|
let dir = startDir;
|
|
940
972
|
for (let i = 0; i < 6; i++) {
|
|
941
|
-
const nativeDir =
|
|
973
|
+
const nativeDir = path2.resolve(dir, "native");
|
|
942
974
|
for (const bin of BINARY_NAMES) {
|
|
943
|
-
localCandidates.push(
|
|
944
|
-
localCandidates.push(
|
|
945
|
-
localCandidates.push(
|
|
946
|
-
localCandidates.push(
|
|
975
|
+
localCandidates.push(path2.resolve(nativeDir, `${bin}.node`));
|
|
976
|
+
localCandidates.push(path2.resolve(nativeDir, `${bin}.${platform}.node`));
|
|
977
|
+
localCandidates.push(path2.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
|
|
978
|
+
localCandidates.push(path2.resolve(nativeDir, "target", "release", `${bin}.node`));
|
|
947
979
|
}
|
|
948
|
-
const parent =
|
|
980
|
+
const parent = path2.resolve(dir, "..");
|
|
949
981
|
if (parent === dir) break;
|
|
950
982
|
dir = parent;
|
|
951
983
|
}
|
|
@@ -976,10 +1008,9 @@ var isBrowser3, _require, PLATFORM_MAP;
|
|
|
976
1008
|
var init_native_resolution = __esm({
|
|
977
1009
|
"packages/domain/shared/src/native-resolution.ts"() {
|
|
978
1010
|
"use strict";
|
|
1011
|
+
init_esm_shims();
|
|
979
1012
|
isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
|
|
980
|
-
_require =
|
|
981
|
-
typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
|
|
982
|
-
);
|
|
1013
|
+
_require = _safeCreateRequire();
|
|
983
1014
|
PLATFORM_MAP = {
|
|
984
1015
|
"linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
|
|
985
1016
|
"linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
|
|
@@ -994,9 +1025,9 @@ var init_native_resolution = __esm({
|
|
|
994
1025
|
// packages/domain/shared/src/observability.ts
|
|
995
1026
|
function createObservabilityClient(opts = {}) {
|
|
996
1027
|
const { baseUrl = "http://localhost:7421", timeoutMs = 3e3 } = opts;
|
|
997
|
-
async function fetchJson(
|
|
1028
|
+
async function fetchJson(path17) {
|
|
998
1029
|
try {
|
|
999
|
-
const res = await fetch(`${baseUrl}${
|
|
1030
|
+
const res = await fetch(`${baseUrl}${path17}`, {
|
|
1000
1031
|
signal: AbortSignal.timeout(timeoutMs)
|
|
1001
1032
|
});
|
|
1002
1033
|
if (!res.ok) return null;
|
|
@@ -1026,6 +1057,7 @@ function createObservabilityClient(opts = {}) {
|
|
|
1026
1057
|
var init_observability = __esm({
|
|
1027
1058
|
"packages/domain/shared/src/observability.ts"() {
|
|
1028
1059
|
"use strict";
|
|
1060
|
+
init_esm_shims();
|
|
1029
1061
|
}
|
|
1030
1062
|
});
|
|
1031
1063
|
|
|
@@ -1065,6 +1097,7 @@ function resetCacheStats() {
|
|
|
1065
1097
|
var init_cssGeneratorNative = __esm({
|
|
1066
1098
|
"packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
|
|
1067
1099
|
"use strict";
|
|
1100
|
+
init_esm_shims();
|
|
1068
1101
|
init_nativeBridge();
|
|
1069
1102
|
}
|
|
1070
1103
|
});
|
|
@@ -1209,6 +1242,7 @@ function twMergeRaw(classLists) {
|
|
|
1209
1242
|
var init_cssCompilationNative = __esm({
|
|
1210
1243
|
"packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
|
|
1211
1244
|
"use strict";
|
|
1245
|
+
init_esm_shims();
|
|
1212
1246
|
init_nativeBridge();
|
|
1213
1247
|
}
|
|
1214
1248
|
});
|
|
@@ -1261,6 +1295,7 @@ var require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
|
|
|
1261
1295
|
var init_tailwindEngine = __esm({
|
|
1262
1296
|
"packages/domain/compiler/src/tailwindEngine.ts"() {
|
|
1263
1297
|
"use strict";
|
|
1298
|
+
init_esm_shims();
|
|
1264
1299
|
require2 = createRequire2(
|
|
1265
1300
|
typeof __filename !== "undefined" ? `file://${__filename}` : typeof import.meta !== "undefined" && import.meta.url ? import.meta.url : "file://unknown"
|
|
1266
1301
|
);
|
|
@@ -1450,6 +1485,7 @@ var require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEM
|
|
|
1450
1485
|
var init_tailwindEngine2 = __esm({
|
|
1451
1486
|
"packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
|
|
1452
1487
|
"use strict";
|
|
1488
|
+
init_esm_shims();
|
|
1453
1489
|
init_nativeBridge();
|
|
1454
1490
|
init_cssGeneratorNative();
|
|
1455
1491
|
init_cssCompilationNative();
|
|
@@ -1534,6 +1570,7 @@ function atomicRegistrySize() {
|
|
|
1534
1570
|
var init_compilationNative = __esm({
|
|
1535
1571
|
"packages/domain/compiler/src/compiler/compilationNative.ts"() {
|
|
1536
1572
|
"use strict";
|
|
1573
|
+
init_esm_shims();
|
|
1537
1574
|
init_nativeBridge();
|
|
1538
1575
|
}
|
|
1539
1576
|
});
|
|
@@ -1634,6 +1671,7 @@ function idRegistryImport(importedData) {
|
|
|
1634
1671
|
var init_idRegistryNative = __esm({
|
|
1635
1672
|
"packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
|
|
1636
1673
|
"use strict";
|
|
1674
|
+
init_esm_shims();
|
|
1637
1675
|
init_nativeBridge();
|
|
1638
1676
|
}
|
|
1639
1677
|
});
|
|
@@ -1776,6 +1814,7 @@ function scanFilesBatchNative(filesJson) {
|
|
|
1776
1814
|
var init_streamingNative = __esm({
|
|
1777
1815
|
"packages/domain/compiler/src/compiler/streamingNative.ts"() {
|
|
1778
1816
|
"use strict";
|
|
1817
|
+
init_esm_shims();
|
|
1779
1818
|
init_nativeBridge();
|
|
1780
1819
|
}
|
|
1781
1820
|
});
|
|
@@ -1784,6 +1823,7 @@ var init_streamingNative = __esm({
|
|
|
1784
1823
|
var init_compiler = __esm({
|
|
1785
1824
|
"packages/domain/compiler/src/compiler/index.ts"() {
|
|
1786
1825
|
"use strict";
|
|
1826
|
+
init_esm_shims();
|
|
1787
1827
|
init_cssGeneratorNative();
|
|
1788
1828
|
init_compilationNative();
|
|
1789
1829
|
init_cssCompilationNative();
|
|
@@ -1797,6 +1837,7 @@ var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astEx
|
|
|
1797
1837
|
var init_parser = __esm({
|
|
1798
1838
|
"packages/domain/compiler/src/parser/index.ts"() {
|
|
1799
1839
|
"use strict";
|
|
1840
|
+
init_esm_shims();
|
|
1800
1841
|
init_nativeBridge();
|
|
1801
1842
|
parseClasses = (raw) => {
|
|
1802
1843
|
const native = getNativeBridge();
|
|
@@ -1976,6 +2017,7 @@ function resetMemoryStats() {
|
|
|
1976
2017
|
var init_analyzerNative = __esm({
|
|
1977
2018
|
"packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
|
|
1978
2019
|
"use strict";
|
|
2020
|
+
init_esm_shims();
|
|
1979
2021
|
init_nativeBridge();
|
|
1980
2022
|
}
|
|
1981
2023
|
});
|
|
@@ -2070,6 +2112,7 @@ function resolveSimpleVariants(configJson) {
|
|
|
2070
2112
|
var init_themeResolutionNative = __esm({
|
|
2071
2113
|
"packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
|
|
2072
2114
|
"use strict";
|
|
2115
|
+
init_esm_shims();
|
|
2073
2116
|
init_nativeBridge();
|
|
2074
2117
|
}
|
|
2075
2118
|
});
|
|
@@ -2118,6 +2161,7 @@ function generateSubComponentTypes(root, outputPath) {
|
|
|
2118
2161
|
var init_scannerNative = __esm({
|
|
2119
2162
|
"packages/domain/compiler/src/analyzer/scannerNative.ts"() {
|
|
2120
2163
|
"use strict";
|
|
2164
|
+
init_esm_shims();
|
|
2121
2165
|
init_nativeBridge();
|
|
2122
2166
|
}
|
|
2123
2167
|
});
|
|
@@ -2126,6 +2170,7 @@ var init_scannerNative = __esm({
|
|
|
2126
2170
|
var init_analyzer = __esm({
|
|
2127
2171
|
"packages/domain/compiler/src/analyzer/index.ts"() {
|
|
2128
2172
|
"use strict";
|
|
2173
|
+
init_esm_shims();
|
|
2129
2174
|
init_analyzerNative();
|
|
2130
2175
|
init_themeResolutionNative();
|
|
2131
2176
|
init_scannerNative();
|
|
@@ -2315,6 +2360,7 @@ function resetResolverPoolStats() {
|
|
|
2315
2360
|
var init_cacheNative = __esm({
|
|
2316
2361
|
"packages/domain/compiler/src/cache/cacheNative.ts"() {
|
|
2317
2362
|
"use strict";
|
|
2363
|
+
init_esm_shims();
|
|
2318
2364
|
init_nativeBridge();
|
|
2319
2365
|
}
|
|
2320
2366
|
});
|
|
@@ -2323,6 +2369,7 @@ var init_cacheNative = __esm({
|
|
|
2323
2369
|
var init_cache = __esm({
|
|
2324
2370
|
"packages/domain/compiler/src/cache/index.ts"() {
|
|
2325
2371
|
"use strict";
|
|
2372
|
+
init_esm_shims();
|
|
2326
2373
|
init_cacheNative();
|
|
2327
2374
|
}
|
|
2328
2375
|
});
|
|
@@ -2572,6 +2619,7 @@ function redisDiagnose() {
|
|
|
2572
2619
|
var init_redisNative = __esm({
|
|
2573
2620
|
"packages/domain/compiler/src/redis/redisNative.ts"() {
|
|
2574
2621
|
"use strict";
|
|
2622
|
+
init_esm_shims();
|
|
2575
2623
|
init_nativeBridge();
|
|
2576
2624
|
}
|
|
2577
2625
|
});
|
|
@@ -2580,6 +2628,7 @@ var init_redisNative = __esm({
|
|
|
2580
2628
|
var init_redis = __esm({
|
|
2581
2629
|
"packages/domain/compiler/src/redis/index.ts"() {
|
|
2582
2630
|
"use strict";
|
|
2631
|
+
init_esm_shims();
|
|
2583
2632
|
init_redisNative();
|
|
2584
2633
|
}
|
|
2585
2634
|
});
|
|
@@ -2719,6 +2768,7 @@ function getCompilerDiagnostics() {
|
|
|
2719
2768
|
var init_watchSystemNative = __esm({
|
|
2720
2769
|
"packages/domain/compiler/src/watch/watchSystemNative.ts"() {
|
|
2721
2770
|
"use strict";
|
|
2771
|
+
init_esm_shims();
|
|
2722
2772
|
init_nativeBridge();
|
|
2723
2773
|
}
|
|
2724
2774
|
});
|
|
@@ -2727,6 +2777,7 @@ var init_watchSystemNative = __esm({
|
|
|
2727
2777
|
var init_watch = __esm({
|
|
2728
2778
|
"packages/domain/compiler/src/watch/index.ts"() {
|
|
2729
2779
|
"use strict";
|
|
2780
|
+
init_esm_shims();
|
|
2730
2781
|
init_watchSystemNative();
|
|
2731
2782
|
}
|
|
2732
2783
|
});
|
|
@@ -2956,6 +3007,7 @@ __export(internal_exports, {
|
|
|
2956
3007
|
var init_internal = __esm({
|
|
2957
3008
|
"packages/domain/compiler/src/internal.ts"() {
|
|
2958
3009
|
"use strict";
|
|
3010
|
+
init_esm_shims();
|
|
2959
3011
|
init_src2();
|
|
2960
3012
|
init_tailwindEngine2();
|
|
2961
3013
|
init_compiler();
|
|
@@ -2969,7 +3021,7 @@ var init_internal = __esm({
|
|
|
2969
3021
|
|
|
2970
3022
|
// packages/domain/shared/src/staticStateExtractor.ts
|
|
2971
3023
|
import fs2 from "fs";
|
|
2972
|
-
import
|
|
3024
|
+
import path3 from "path";
|
|
2973
3025
|
function getNative() {
|
|
2974
3026
|
if (_native) return _native;
|
|
2975
3027
|
try {
|
|
@@ -3004,12 +3056,12 @@ function* walkSourceFiles(dir) {
|
|
|
3004
3056
|
return;
|
|
3005
3057
|
}
|
|
3006
3058
|
for (const entry of entries) {
|
|
3007
|
-
const fullPath =
|
|
3059
|
+
const fullPath = path3.join(dir, entry.name);
|
|
3008
3060
|
if (entry.isDirectory()) {
|
|
3009
3061
|
if (IGNORE_PATTERNS.some((p) => entry.name === p || entry.name.startsWith(p))) continue;
|
|
3010
3062
|
yield* walkSourceFiles(fullPath);
|
|
3011
3063
|
} else if (entry.isFile()) {
|
|
3012
|
-
const ext =
|
|
3064
|
+
const ext = path3.extname(entry.name);
|
|
3013
3065
|
if (SOURCE_EXTENSIONS.has(ext)) yield fullPath;
|
|
3014
3066
|
}
|
|
3015
3067
|
}
|
|
@@ -3073,7 +3125,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3073
3125
|
allConfigs.push(...configs);
|
|
3074
3126
|
if (verbose) {
|
|
3075
3127
|
process.stderr.write(
|
|
3076
|
-
`[tw:static-state] ${
|
|
3128
|
+
`[tw:static-state] ${path3.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3077
3129
|
`
|
|
3078
3130
|
);
|
|
3079
3131
|
}
|
|
@@ -3097,7 +3149,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3097
3149
|
allConfigs.push(...configs);
|
|
3098
3150
|
if (verbose) {
|
|
3099
3151
|
process.stderr.write(
|
|
3100
|
-
`[tw:static-state] ${
|
|
3152
|
+
`[tw:static-state] ${path3.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3101
3153
|
`
|
|
3102
3154
|
);
|
|
3103
3155
|
}
|
|
@@ -3191,9 +3243,9 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3191
3243
|
resolvedCss: options.resolvedCss || ""
|
|
3192
3244
|
// ← ensure always passed
|
|
3193
3245
|
});
|
|
3194
|
-
const twClassesDir =
|
|
3246
|
+
const twClassesDir = path3.join(path3.dirname(safelistPath), "tw-classes");
|
|
3195
3247
|
fs2.mkdirSync(twClassesDir, { recursive: true });
|
|
3196
|
-
const stateFilePath =
|
|
3248
|
+
const stateFilePath = path3.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
3197
3249
|
if (result.rulesGenerated === 0) {
|
|
3198
3250
|
try {
|
|
3199
3251
|
fs2.writeFileSync(
|
|
@@ -3222,6 +3274,7 @@ var SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
|
|
|
3222
3274
|
var init_staticStateExtractor = __esm({
|
|
3223
3275
|
"packages/domain/shared/src/staticStateExtractor.ts"() {
|
|
3224
3276
|
"use strict";
|
|
3277
|
+
init_esm_shims();
|
|
3225
3278
|
SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs"]);
|
|
3226
3279
|
IGNORE_PATTERNS = ["node_modules", ".next", "dist", "build", ".git", "coverage", "__tests__"];
|
|
3227
3280
|
_native = null;
|
|
@@ -3231,7 +3284,7 @@ var init_staticStateExtractor = __esm({
|
|
|
3231
3284
|
|
|
3232
3285
|
// packages/domain/shared/src/logger.ts
|
|
3233
3286
|
import fs3 from "fs";
|
|
3234
|
-
import
|
|
3287
|
+
import path4 from "path";
|
|
3235
3288
|
function getEnvLevel() {
|
|
3236
3289
|
const env = process.env.TWS_LOG_LEVEL?.toLowerCase();
|
|
3237
3290
|
if (env && env in LEVELS) return env;
|
|
@@ -3241,7 +3294,7 @@ function setGlobalLogFile(filePath) {
|
|
|
3241
3294
|
_globalLogFile = filePath;
|
|
3242
3295
|
_logFileInitialized = false;
|
|
3243
3296
|
try {
|
|
3244
|
-
fs3.mkdirSync(
|
|
3297
|
+
fs3.mkdirSync(path4.dirname(filePath), { recursive: true });
|
|
3245
3298
|
fs3.writeFileSync(
|
|
3246
3299
|
filePath,
|
|
3247
3300
|
`# tailwind-styled build log \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
@@ -3286,6 +3339,7 @@ var LEVELS, _globalLogFile, _logFileInitialized, logger;
|
|
|
3286
3339
|
var init_logger = __esm({
|
|
3287
3340
|
"packages/domain/shared/src/logger.ts"() {
|
|
3288
3341
|
"use strict";
|
|
3342
|
+
init_esm_shims();
|
|
3289
3343
|
LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 };
|
|
3290
3344
|
_globalLogFile = null;
|
|
3291
3345
|
_logFileInitialized = false;
|
|
@@ -3336,8 +3390,8 @@ __export(src_exports, {
|
|
|
3336
3390
|
generateComponentCode: () => generateComponentCode,
|
|
3337
3391
|
generateStorybookStory: () => generateStorybookStory,
|
|
3338
3392
|
getBuildTimeColor: () => getBuildTimeColor,
|
|
3339
|
-
getDirname: () =>
|
|
3340
|
-
getFilename: () =>
|
|
3393
|
+
getDirname: () => getDirname2,
|
|
3394
|
+
getFilename: () => getFilename2,
|
|
3341
3395
|
getGlobalTelemetry: () => getGlobalTelemetry,
|
|
3342
3396
|
getHealthColor: () => getHealthColor,
|
|
3343
3397
|
getMemoryColor: () => getMemoryColor,
|
|
@@ -3367,8 +3421,8 @@ __export(src_exports, {
|
|
|
3367
3421
|
});
|
|
3368
3422
|
import { createHash } from "crypto";
|
|
3369
3423
|
import fs4 from "fs";
|
|
3370
|
-
import
|
|
3371
|
-
import { fileURLToPath } from "url";
|
|
3424
|
+
import path5 from "path";
|
|
3425
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
3372
3426
|
import { createRequire as createRequire4 } from "module";
|
|
3373
3427
|
function createLogger2(namespace) {
|
|
3374
3428
|
const prefix = `[${namespace}]`;
|
|
@@ -3399,9 +3453,9 @@ function createDebugLogger(namespace, label) {
|
|
|
3399
3453
|
}
|
|
3400
3454
|
};
|
|
3401
3455
|
}
|
|
3402
|
-
function formatIssuePath(
|
|
3403
|
-
if (!
|
|
3404
|
-
return
|
|
3456
|
+
function formatIssuePath(path17) {
|
|
3457
|
+
if (!path17 || path17.length === 0) return "(root)";
|
|
3458
|
+
return path17.map(
|
|
3405
3459
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3406
3460
|
).join(".");
|
|
3407
3461
|
}
|
|
@@ -3415,7 +3469,7 @@ function loadNativeBinding(options) {
|
|
|
3415
3469
|
const { runtimeDir, candidates, isValid } = options;
|
|
3416
3470
|
const loadErrors = [];
|
|
3417
3471
|
for (const candidate of candidates) {
|
|
3418
|
-
const candidatePath =
|
|
3472
|
+
const candidatePath = path5.resolve(runtimeDir, candidate);
|
|
3419
3473
|
try {
|
|
3420
3474
|
if (!fs4.existsSync(candidatePath) && !fs4.existsSync(candidatePath + ".node")) {
|
|
3421
3475
|
continue;
|
|
@@ -3460,22 +3514,22 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3460
3514
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3461
3515
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
3462
3516
|
for (const bin of BINARY_NAMES) {
|
|
3463
|
-
candidates.push(
|
|
3464
|
-
candidates.push(
|
|
3465
|
-
candidates.push(
|
|
3466
|
-
candidates.push(
|
|
3467
|
-
candidates.push(
|
|
3468
|
-
candidates.push(
|
|
3469
|
-
candidates.push(
|
|
3470
|
-
candidates.push(
|
|
3471
|
-
candidates.push(
|
|
3517
|
+
candidates.push(path5.resolve(runtimeDir, `${bin}.node`));
|
|
3518
|
+
candidates.push(path5.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
3519
|
+
candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
3520
|
+
candidates.push(path5.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3521
|
+
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.node`));
|
|
3522
|
+
candidates.push(path5.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
3523
|
+
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
3524
|
+
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3525
|
+
candidates.push(path5.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
3472
3526
|
}
|
|
3473
3527
|
return Array.from(new Set(candidates));
|
|
3474
3528
|
}
|
|
3475
3529
|
function resolveRuntimeDir(dir, importMetaUrl) {
|
|
3476
|
-
if (dir) return
|
|
3530
|
+
if (dir) return path5.resolve(dir);
|
|
3477
3531
|
try {
|
|
3478
|
-
return
|
|
3532
|
+
return path5.dirname(fileURLToPath2(importMetaUrl));
|
|
3479
3533
|
} catch {
|
|
3480
3534
|
return process.cwd();
|
|
3481
3535
|
}
|
|
@@ -3493,6 +3547,7 @@ var TwError, _require2, LRUCache;
|
|
|
3493
3547
|
var init_src = __esm({
|
|
3494
3548
|
"packages/domain/shared/src/index.ts"() {
|
|
3495
3549
|
"use strict";
|
|
3550
|
+
init_esm_shims();
|
|
3496
3551
|
init_trace();
|
|
3497
3552
|
init_error_codes();
|
|
3498
3553
|
init_compatibility();
|
|
@@ -3539,8 +3594,8 @@ var init_src = __esm({
|
|
|
3539
3594
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
3540
3595
|
static fromZod(err) {
|
|
3541
3596
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
3542
|
-
const
|
|
3543
|
-
const message = first ? `${
|
|
3597
|
+
const path17 = formatIssuePath(first?.path);
|
|
3598
|
+
const message = first ? `${path17}: ${first.message}` : "Schema validation failed";
|
|
3544
3599
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
3545
3600
|
}
|
|
3546
3601
|
static wrap(source, code, err) {
|
|
@@ -3610,8 +3665,9 @@ var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttemp
|
|
|
3610
3665
|
var init_nativeBridge = __esm({
|
|
3611
3666
|
"packages/domain/compiler/src/nativeBridge.ts"() {
|
|
3612
3667
|
"use strict";
|
|
3668
|
+
init_esm_shims();
|
|
3613
3669
|
init_src();
|
|
3614
|
-
_loadNative = (
|
|
3670
|
+
_loadNative = (path17) => __require(path17);
|
|
3615
3671
|
log = (...args) => {
|
|
3616
3672
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
3617
3673
|
console.log("[compiler:native]", ...args);
|
|
@@ -3716,7 +3772,7 @@ Tried paths: ${result.tried.join("\n")}`);
|
|
|
3716
3772
|
|
|
3717
3773
|
// packages/domain/compiler/src/index.ts
|
|
3718
3774
|
import fs5 from "fs";
|
|
3719
|
-
import
|
|
3775
|
+
import path6 from "path";
|
|
3720
3776
|
import { createRequire as createRequire5 } from "module";
|
|
3721
3777
|
function _layoutClassesToCss(classes) {
|
|
3722
3778
|
const native = getNativeBridge();
|
|
@@ -3756,6 +3812,7 @@ var _require3, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess,
|
|
|
3756
3812
|
var init_src2 = __esm({
|
|
3757
3813
|
"packages/domain/compiler/src/index.ts"() {
|
|
3758
3814
|
"use strict";
|
|
3815
|
+
init_esm_shims();
|
|
3759
3816
|
init_nativeBridge();
|
|
3760
3817
|
init_compiler();
|
|
3761
3818
|
init_parser();
|
|
@@ -3857,7 +3914,7 @@ var init_src2 = __esm({
|
|
|
3857
3914
|
};
|
|
3858
3915
|
scanProjectUsage = (dirs, cwd) => {
|
|
3859
3916
|
const { batchExtractClasses: batchExtractClasses2 } = _require3("./parser");
|
|
3860
|
-
const files = dirs.map((dir) =>
|
|
3917
|
+
const files = dirs.map((dir) => path6.resolve(cwd, dir));
|
|
3861
3918
|
const results = batchExtractClasses2(files) || [];
|
|
3862
3919
|
const combined = {};
|
|
3863
3920
|
for (const result of results) {
|
|
@@ -3894,7 +3951,7 @@ var init_src2 = __esm({
|
|
|
3894
3951
|
"tailwind.config.cjs"
|
|
3895
3952
|
];
|
|
3896
3953
|
for (const file of configFiles) {
|
|
3897
|
-
const fullPath =
|
|
3954
|
+
const fullPath = path6.join(cwd, file);
|
|
3898
3955
|
if (fs5.existsSync(fullPath)) {
|
|
3899
3956
|
const mod = __require(fullPath);
|
|
3900
3957
|
return mod.default || mod;
|
|
@@ -3905,9 +3962,9 @@ var init_src2 = __esm({
|
|
|
3905
3962
|
getContentPaths = (cwd = process.cwd()) => {
|
|
3906
3963
|
return {
|
|
3907
3964
|
content: [
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3965
|
+
path6.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
3966
|
+
path6.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
3967
|
+
path6.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
3911
3968
|
]
|
|
3912
3969
|
};
|
|
3913
3970
|
};
|
|
@@ -4126,14 +4183,14 @@ __export(native_bridge_exports, {
|
|
|
4126
4183
|
startWatchNative: () => startWatchNative,
|
|
4127
4184
|
stopWatchNative: () => stopWatchNative
|
|
4128
4185
|
});
|
|
4129
|
-
import
|
|
4130
|
-
import { fileURLToPath as
|
|
4131
|
-
function
|
|
4186
|
+
import path7 from "path";
|
|
4187
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
4188
|
+
function getDirname3() {
|
|
4132
4189
|
if (typeof __dirname !== "undefined") {
|
|
4133
4190
|
return __dirname;
|
|
4134
4191
|
}
|
|
4135
4192
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4136
|
-
return
|
|
4193
|
+
return path7.dirname(fileURLToPath3(import.meta.url));
|
|
4137
4194
|
}
|
|
4138
4195
|
return process.cwd();
|
|
4139
4196
|
}
|
|
@@ -4342,6 +4399,7 @@ var log2, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader,
|
|
|
4342
4399
|
var init_native_bridge = __esm({
|
|
4343
4400
|
"packages/domain/scanner/src/native-bridge.ts"() {
|
|
4344
4401
|
"use strict";
|
|
4402
|
+
init_esm_shims();
|
|
4345
4403
|
init_src();
|
|
4346
4404
|
log2 = createDebugLogger("scanner:native");
|
|
4347
4405
|
isValidScannerBinding = (module) => {
|
|
@@ -4384,7 +4442,7 @@ var init_native_bridge = __esm({
|
|
|
4384
4442
|
}
|
|
4385
4443
|
return throwNativeBindingError();
|
|
4386
4444
|
}
|
|
4387
|
-
const runtimeDir =
|
|
4445
|
+
const runtimeDir = getDirname3();
|
|
4388
4446
|
const candidates = resolveNativeBindingCandidates({
|
|
4389
4447
|
runtimeDir,
|
|
4390
4448
|
includeDefaultCandidates: true
|
|
@@ -4425,14 +4483,14 @@ var init_native_bridge = __esm({
|
|
|
4425
4483
|
|
|
4426
4484
|
// packages/domain/scanner/src/cache-native.ts
|
|
4427
4485
|
import fs6 from "fs";
|
|
4428
|
-
import
|
|
4486
|
+
import path8 from "path";
|
|
4429
4487
|
function defaultCachePath(rootDir, cacheDir) {
|
|
4430
|
-
const dir = cacheDir ?
|
|
4431
|
-
return
|
|
4488
|
+
const dir = cacheDir ? path8.resolve(rootDir, cacheDir) : path8.join(process.cwd(), ".cache", "tailwind-styled");
|
|
4489
|
+
return path8.join(dir, "scanner-cache.json");
|
|
4432
4490
|
}
|
|
4433
4491
|
function readCache(rootDir, cacheDir) {
|
|
4434
4492
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
4435
|
-
fs6.mkdirSync(
|
|
4493
|
+
fs6.mkdirSync(path8.dirname(cachePath), { recursive: true });
|
|
4436
4494
|
const result = cacheReadNative(cachePath);
|
|
4437
4495
|
if (!result) return [];
|
|
4438
4496
|
return result.entries.map((e) => ({
|
|
@@ -4447,7 +4505,7 @@ function readCache(rootDir, cacheDir) {
|
|
|
4447
4505
|
}
|
|
4448
4506
|
function writeCache(rootDir, entries, cacheDir) {
|
|
4449
4507
|
const cachePath = defaultCachePath(rootDir, cacheDir);
|
|
4450
|
-
fs6.mkdirSync(
|
|
4508
|
+
fs6.mkdirSync(path8.dirname(cachePath), { recursive: true });
|
|
4451
4509
|
const success = cacheWriteNative(cachePath, entries);
|
|
4452
4510
|
if (!success) {
|
|
4453
4511
|
throw new Error(
|
|
@@ -4470,6 +4528,7 @@ var STALE_THRESHOLD_MS;
|
|
|
4470
4528
|
var init_cache_native = __esm({
|
|
4471
4529
|
"packages/domain/scanner/src/cache-native.ts"() {
|
|
4472
4530
|
"use strict";
|
|
4531
|
+
init_esm_shims();
|
|
4473
4532
|
init_native_bridge();
|
|
4474
4533
|
STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
4475
4534
|
}
|
|
@@ -4477,9 +4536,9 @@ var init_cache_native = __esm({
|
|
|
4477
4536
|
|
|
4478
4537
|
// packages/domain/scanner/src/parallel-scanner.ts
|
|
4479
4538
|
import { Worker, isMainThread, parentPort, workerData } from "worker_threads";
|
|
4480
|
-
import
|
|
4539
|
+
import path9 from "path";
|
|
4481
4540
|
import { availableParallelism } from "os";
|
|
4482
|
-
import { fileURLToPath as
|
|
4541
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
4483
4542
|
function collectFiles2(rootDir, extensions, ignoreDirs) {
|
|
4484
4543
|
const native = collectFilesNative(rootDir, extensions, ignoreDirs);
|
|
4485
4544
|
if (native !== null) return native;
|
|
@@ -4520,7 +4579,7 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
|
|
|
4520
4579
|
maxWorkers = Math.max(1, availableParallelism() - 1),
|
|
4521
4580
|
chunkSize = DEFAULT_CHUNK_SIZE
|
|
4522
4581
|
} = options;
|
|
4523
|
-
const files = collectFiles2(
|
|
4582
|
+
const files = collectFiles2(path9.resolve(rootDir), extensions, ignoreDirs);
|
|
4524
4583
|
if (files.length < PARALLEL_THRESHOLD) {
|
|
4525
4584
|
return mergeResults(batchExtractClassesNative2(files));
|
|
4526
4585
|
}
|
|
@@ -4540,6 +4599,7 @@ var PARALLEL_THRESHOLD, DEFAULT_CHUNK_SIZE, _workerFilename;
|
|
|
4540
4599
|
var init_parallel_scanner = __esm({
|
|
4541
4600
|
"packages/domain/scanner/src/parallel-scanner.ts"() {
|
|
4542
4601
|
"use strict";
|
|
4602
|
+
init_esm_shims();
|
|
4543
4603
|
init_src3();
|
|
4544
4604
|
init_native_bridge();
|
|
4545
4605
|
PARALLEL_THRESHOLD = 50;
|
|
@@ -4558,7 +4618,7 @@ var init_parallel_scanner = __esm({
|
|
|
4558
4618
|
parentPort.postMessage(msg);
|
|
4559
4619
|
}
|
|
4560
4620
|
}
|
|
4561
|
-
_workerFilename = typeof __filename !== "undefined" ? __filename :
|
|
4621
|
+
_workerFilename = typeof __filename !== "undefined" ? __filename : fileURLToPath4(import.meta.url);
|
|
4562
4622
|
}
|
|
4563
4623
|
});
|
|
4564
4624
|
|
|
@@ -4568,13 +4628,14 @@ var formatIssuePath2, formatIssues, parseWithSchema, NonNegativeIntegerSchema, S
|
|
|
4568
4628
|
var init_schemas = __esm({
|
|
4569
4629
|
"packages/domain/scanner/src/schemas.ts"() {
|
|
4570
4630
|
"use strict";
|
|
4631
|
+
init_esm_shims();
|
|
4571
4632
|
init_src();
|
|
4572
|
-
formatIssuePath2 = (
|
|
4633
|
+
formatIssuePath2 = (path17) => path17.length > 0 ? path17.map(
|
|
4573
4634
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
4574
4635
|
).join(".") : "<root>";
|
|
4575
4636
|
formatIssues = (error) => error.issues.map((issue) => {
|
|
4576
|
-
const
|
|
4577
|
-
return `${
|
|
4637
|
+
const path17 = formatIssuePath2(issue.path);
|
|
4638
|
+
return `${path17}: ${issue.message}`;
|
|
4578
4639
|
}).join("; ");
|
|
4579
4640
|
parseWithSchema = (schema, data, label) => {
|
|
4580
4641
|
const parsed = schema.safeParse(data);
|
|
@@ -4648,15 +4709,15 @@ __export(src_exports2, {
|
|
|
4648
4709
|
});
|
|
4649
4710
|
import fs7 from "fs";
|
|
4650
4711
|
import { createRequire as createRequire6 } from "module";
|
|
4651
|
-
import
|
|
4652
|
-
import { fileURLToPath as
|
|
4712
|
+
import path10 from "path";
|
|
4713
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
4653
4714
|
import { Worker as Worker2 } from "worker_threads";
|
|
4654
4715
|
function getRuntimeDir() {
|
|
4655
4716
|
if (typeof __dirname !== "undefined" && __dirname.length > 0) {
|
|
4656
4717
|
return __dirname;
|
|
4657
4718
|
}
|
|
4658
4719
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4659
|
-
return
|
|
4720
|
+
return path10.dirname(fileURLToPath5(import.meta.url));
|
|
4660
4721
|
}
|
|
4661
4722
|
return process.cwd();
|
|
4662
4723
|
}
|
|
@@ -4666,14 +4727,14 @@ function resolveScannerWorkerModulePath() {
|
|
|
4666
4727
|
return __dirname;
|
|
4667
4728
|
}
|
|
4668
4729
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
4669
|
-
return
|
|
4730
|
+
return path10.dirname(fileURLToPath5(import.meta.url));
|
|
4670
4731
|
}
|
|
4671
4732
|
return process.cwd();
|
|
4672
4733
|
})();
|
|
4673
4734
|
const candidates = [
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4735
|
+
path10.resolve(runtimeDir, "worker.cjs"),
|
|
4736
|
+
path10.resolve(runtimeDir, "worker.js"),
|
|
4737
|
+
path10.resolve(runtimeDir, "worker.ts")
|
|
4677
4738
|
];
|
|
4678
4739
|
for (const candidate of candidates) {
|
|
4679
4740
|
if (fs7.existsSync(candidate)) return candidate;
|
|
@@ -4739,13 +4800,13 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
|
|
|
4739
4800
|
}
|
|
4740
4801
|
})();
|
|
4741
4802
|
for (const entry of entries) {
|
|
4742
|
-
const fullPath =
|
|
4803
|
+
const fullPath = path10.join(currentDir, entry.name);
|
|
4743
4804
|
if (entry.isDirectory()) {
|
|
4744
4805
|
if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
|
|
4745
4806
|
continue;
|
|
4746
4807
|
}
|
|
4747
4808
|
if (!entry.isFile()) continue;
|
|
4748
|
-
if (!extensionSet.has(
|
|
4809
|
+
if (!extensionSet.has(path10.extname(entry.name))) continue;
|
|
4749
4810
|
candidates.push(fullPath);
|
|
4750
4811
|
}
|
|
4751
4812
|
}
|
|
@@ -4772,7 +4833,7 @@ function scanSource(source) {
|
|
|
4772
4833
|
);
|
|
4773
4834
|
}
|
|
4774
4835
|
function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
|
|
4775
|
-
return includeExtensions.includes(
|
|
4836
|
+
return includeExtensions.includes(path10.extname(filePath));
|
|
4776
4837
|
}
|
|
4777
4838
|
function scanFile2(filePath) {
|
|
4778
4839
|
const { scanFileNative: scanFileNative3 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
|
|
@@ -4943,6 +5004,7 @@ var log3, SCAN_WORKER_TIMEOUT_MS, createNativeParserLoader, nativeParserLoader,
|
|
|
4943
5004
|
var init_src3 = __esm({
|
|
4944
5005
|
"packages/domain/scanner/src/index.ts"() {
|
|
4945
5006
|
"use strict";
|
|
5007
|
+
init_esm_shims();
|
|
4946
5008
|
init_src();
|
|
4947
5009
|
init_cache_native();
|
|
4948
5010
|
init_native_bridge();
|
|
@@ -4963,7 +5025,7 @@ var init_src3 = __esm({
|
|
|
4963
5025
|
const loadNativeParserBinding = () => {
|
|
4964
5026
|
if (_state.binding !== void 0) return _state.binding;
|
|
4965
5027
|
const runtimeDir = getRuntimeDir();
|
|
4966
|
-
const req = createRequire6(
|
|
5028
|
+
const req = createRequire6(path10.join(runtimeDir, "noop.cjs"));
|
|
4967
5029
|
const _platform = process.platform;
|
|
4968
5030
|
const _arch = process.arch;
|
|
4969
5031
|
const _platformArch = `${_platform}-${_arch}`;
|
|
@@ -4971,27 +5033,27 @@ var init_src3 = __esm({
|
|
|
4971
5033
|
const candidates = [
|
|
4972
5034
|
// ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
|
|
4973
5035
|
// cwd = repo root saat run dari root, atau package dir saat workspaces
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
5036
|
+
path10.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
|
|
5037
|
+
path10.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
5038
|
+
path10.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4977
5039
|
// runtimeDir = dist/ → naik 1 level ke package root (npm install case)
|
|
4978
5040
|
// e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
5041
|
+
path10.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
|
|
5042
|
+
path10.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
|
|
5043
|
+
path10.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4982
5044
|
// runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
|
|
4983
|
-
|
|
4984
|
-
|
|
5045
|
+
path10.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
5046
|
+
path10.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4985
5047
|
// 3 level fallback (jika package di-nest lebih dangkal)
|
|
4986
|
-
|
|
4987
|
-
|
|
5048
|
+
path10.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
|
|
5049
|
+
path10.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
|
|
4988
5050
|
// ── binaryName lama: tailwind_styled_parser (backward compat) ──
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
5051
|
+
path10.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
|
|
5052
|
+
path10.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
|
|
5053
|
+
path10.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
|
|
5054
|
+
path10.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
5055
|
+
path10.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
|
|
5056
|
+
path10.resolve(
|
|
4995
5057
|
runtimeDir,
|
|
4996
5058
|
"..",
|
|
4997
5059
|
"..",
|
|
@@ -5037,10 +5099,10 @@ var init_src3 = __esm({
|
|
|
5037
5099
|
});
|
|
5038
5100
|
|
|
5039
5101
|
// packages/domain/engine/src/native-bridge.ts
|
|
5040
|
-
function
|
|
5102
|
+
function getDirname4() {
|
|
5041
5103
|
if (typeof __dirname !== "undefined") return __dirname;
|
|
5042
5104
|
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
5043
|
-
return
|
|
5105
|
+
return getDirname2(import.meta.url);
|
|
5044
5106
|
}
|
|
5045
5107
|
return process.cwd();
|
|
5046
5108
|
}
|
|
@@ -5051,6 +5113,7 @@ var log4, isValidEngineBinding, createEngineBindingLoader, engineBindingLoader;
|
|
|
5051
5113
|
var init_native_bridge2 = __esm({
|
|
5052
5114
|
"packages/domain/engine/src/native-bridge.ts"() {
|
|
5053
5115
|
"use strict";
|
|
5116
|
+
init_esm_shims();
|
|
5054
5117
|
init_src();
|
|
5055
5118
|
log4 = createDebugLogger("engine:native");
|
|
5056
5119
|
isValidEngineBinding = (module) => {
|
|
@@ -5093,7 +5156,7 @@ var init_native_bridge2 = __esm({
|
|
|
5093
5156
|
}
|
|
5094
5157
|
return cached;
|
|
5095
5158
|
}
|
|
5096
|
-
const runtimeDir =
|
|
5159
|
+
const runtimeDir = getDirname4();
|
|
5097
5160
|
const candidates = resolveNativeBindingCandidates({
|
|
5098
5161
|
runtimeDir,
|
|
5099
5162
|
includeDefaultCandidates: true
|
|
@@ -5129,24 +5192,35 @@ var init_native_bridge2 = __esm({
|
|
|
5129
5192
|
}
|
|
5130
5193
|
});
|
|
5131
5194
|
|
|
5195
|
+
// src/umbrella/vite.ts
|
|
5196
|
+
init_esm_shims();
|
|
5197
|
+
|
|
5132
5198
|
// packages/presentation/vite/src/plugin.ts
|
|
5199
|
+
init_esm_shims();
|
|
5133
5200
|
init_src2();
|
|
5134
5201
|
import fs13 from "fs";
|
|
5135
|
-
import
|
|
5202
|
+
import path16 from "path";
|
|
5136
5203
|
|
|
5137
5204
|
// packages/domain/engine/src/index.ts
|
|
5205
|
+
init_esm_shims();
|
|
5138
5206
|
import fs12 from "fs";
|
|
5139
|
-
import
|
|
5207
|
+
import path15 from "path";
|
|
5140
5208
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
5141
5209
|
|
|
5210
|
+
// packages/domain/analyzer/src/index.ts
|
|
5211
|
+
init_esm_shims();
|
|
5212
|
+
|
|
5142
5213
|
// packages/domain/analyzer/src/analyzeWorkspace.ts
|
|
5214
|
+
init_esm_shims();
|
|
5143
5215
|
init_src3();
|
|
5144
|
-
import
|
|
5216
|
+
import path12 from "path";
|
|
5145
5217
|
|
|
5146
5218
|
// packages/domain/analyzer/src/binding.ts
|
|
5219
|
+
init_esm_shims();
|
|
5147
5220
|
init_src();
|
|
5148
5221
|
|
|
5149
5222
|
// packages/domain/analyzer/src/utils.ts
|
|
5223
|
+
init_esm_shims();
|
|
5150
5224
|
init_src();
|
|
5151
5225
|
import fs8 from "fs";
|
|
5152
5226
|
var DEFAULT_TOP_LIMIT = 10;
|
|
@@ -5260,9 +5334,10 @@ async function requireNativeBinding() {
|
|
|
5260
5334
|
}
|
|
5261
5335
|
|
|
5262
5336
|
// packages/domain/analyzer/src/schemas.ts
|
|
5337
|
+
init_esm_shims();
|
|
5263
5338
|
init_src();
|
|
5264
5339
|
import { z as z4 } from "zod";
|
|
5265
|
-
var formatIssuePath3 = (
|
|
5340
|
+
var formatIssuePath3 = (path17) => path17.length > 0 ? path17.map(
|
|
5266
5341
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
5267
5342
|
).join(".") : "<root>";
|
|
5268
5343
|
var isPlainObject = (value) => {
|
|
@@ -5271,8 +5346,8 @@ var isPlainObject = (value) => {
|
|
|
5271
5346
|
return proto === Object.prototype || proto === null;
|
|
5272
5347
|
};
|
|
5273
5348
|
var formatIssues2 = (error) => error.issues.map((issue) => {
|
|
5274
|
-
const
|
|
5275
|
-
return `${
|
|
5349
|
+
const path17 = formatIssuePath3(issue.path);
|
|
5350
|
+
return `${path17}: ${issue.message}`;
|
|
5276
5351
|
}).join("; ");
|
|
5277
5352
|
var parseWithSchema2 = (schema, data, label) => {
|
|
5278
5353
|
const parsed = schema.safeParse(data);
|
|
@@ -5362,8 +5437,9 @@ var parseAnalyzerOptions = (options) => parseWithSchema2(AnalyzerOptionsSchema,
|
|
|
5362
5437
|
var parseNativeReport = (report) => parseWithSchema2(NativeReportSchema, report, "Native analyzer report is invalid");
|
|
5363
5438
|
|
|
5364
5439
|
// packages/domain/analyzer/src/semantic.ts
|
|
5440
|
+
init_esm_shims();
|
|
5365
5441
|
import fs9 from "fs";
|
|
5366
|
-
import
|
|
5442
|
+
import path11 from "path";
|
|
5367
5443
|
import { pathToFileURL } from "url";
|
|
5368
5444
|
var SUPPORTED_TAILWIND_CONFIG_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".js", ".cjs", ".mjs"]);
|
|
5369
5445
|
var tailwindConfigCache = /* @__PURE__ */ new Map();
|
|
@@ -5384,11 +5460,11 @@ var detectConflicts2 = async (usages) => {
|
|
|
5384
5460
|
};
|
|
5385
5461
|
};
|
|
5386
5462
|
var isSupportedTailwindConfigPath = (configPath) => {
|
|
5387
|
-
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(
|
|
5463
|
+
return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(path11.extname(configPath).toLowerCase());
|
|
5388
5464
|
};
|
|
5389
5465
|
var resolveTailwindConfigPath = async (root, explicitPath) => {
|
|
5390
5466
|
if (explicitPath) {
|
|
5391
|
-
const resolved =
|
|
5467
|
+
const resolved = path11.resolve(root, explicitPath);
|
|
5392
5468
|
if (!await pathExists(resolved)) return null;
|
|
5393
5469
|
return resolved;
|
|
5394
5470
|
}
|
|
@@ -5399,7 +5475,7 @@ var resolveTailwindConfigPath = async (root, explicitPath) => {
|
|
|
5399
5475
|
"tailwind.config.mjs"
|
|
5400
5476
|
];
|
|
5401
5477
|
for (const candidate of candidates) {
|
|
5402
|
-
const fullPath =
|
|
5478
|
+
const fullPath = path11.resolve(root, candidate);
|
|
5403
5479
|
if (await pathExists(fullPath)) return fullPath;
|
|
5404
5480
|
}
|
|
5405
5481
|
return null;
|
|
@@ -5639,7 +5715,7 @@ async function buildDistribution(usages, native) {
|
|
|
5639
5715
|
}
|
|
5640
5716
|
async function analyzeWorkspace(root, options = {}) {
|
|
5641
5717
|
const startedAtMs = Date.now();
|
|
5642
|
-
const resolvedRoot =
|
|
5718
|
+
const resolvedRoot = path12.resolve(root);
|
|
5643
5719
|
const normalizedOptions = parseAnalyzerOptions(options);
|
|
5644
5720
|
const scan = await (async () => {
|
|
5645
5721
|
const scanStartedAtMs = Date.now();
|
|
@@ -5748,11 +5824,12 @@ init_src3();
|
|
|
5748
5824
|
init_src();
|
|
5749
5825
|
|
|
5750
5826
|
// packages/domain/engine/src/incremental.ts
|
|
5827
|
+
init_esm_shims();
|
|
5751
5828
|
init_src3();
|
|
5752
5829
|
init_src();
|
|
5753
5830
|
init_native_bridge2();
|
|
5754
5831
|
import fs10 from "fs";
|
|
5755
|
-
import
|
|
5832
|
+
import path13 from "path";
|
|
5756
5833
|
var DEFAULT_EXTENSIONS2 = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
5757
5834
|
var log5 = createLogger2("engine:incremental");
|
|
5758
5835
|
function rebuildWorkspaceResult2(byFile) {
|
|
@@ -5785,8 +5862,8 @@ function areClassSetsEqual(a, b) {
|
|
|
5785
5862
|
function applyIncrementalChange(previous, filePath, type, scanner) {
|
|
5786
5863
|
const includeExtensions = scanner?.includeExtensions ?? DEFAULT_EXTENSIONS2;
|
|
5787
5864
|
if (!isScannableFile2(filePath, includeExtensions)) return previous;
|
|
5788
|
-
const byFile = new Map(previous.files.map((f) => [
|
|
5789
|
-
const normalizedPath =
|
|
5865
|
+
const byFile = new Map(previous.files.map((f) => [path13.resolve(f.file), f]));
|
|
5866
|
+
const normalizedPath = path13.resolve(filePath);
|
|
5790
5867
|
const native = getNativeEngineBinding();
|
|
5791
5868
|
if (!native?.processFileChange) {
|
|
5792
5869
|
throw new Error(
|
|
@@ -5818,6 +5895,7 @@ function applyIncrementalChange(previous, filePath, type, scanner) {
|
|
|
5818
5895
|
}
|
|
5819
5896
|
|
|
5820
5897
|
// packages/domain/engine/src/metrics.ts
|
|
5898
|
+
init_esm_shims();
|
|
5821
5899
|
var EngineMetricsCollector = class {
|
|
5822
5900
|
eventsReceived = 0;
|
|
5823
5901
|
eventsProcessed = 0;
|
|
@@ -5866,16 +5944,17 @@ var EngineMetricsCollector = class {
|
|
|
5866
5944
|
};
|
|
5867
5945
|
|
|
5868
5946
|
// packages/domain/engine/src/metricsWriter.ts
|
|
5947
|
+
init_esm_shims();
|
|
5869
5948
|
init_src();
|
|
5870
5949
|
import fs11 from "fs";
|
|
5871
|
-
import
|
|
5950
|
+
import path14 from "path";
|
|
5872
5951
|
import { performance } from "perf_hooks";
|
|
5873
5952
|
var _log = createLogger2("tw:metrics");
|
|
5874
5953
|
var METRICS_FILE_NAME = "metrics.json";
|
|
5875
5954
|
var CACHE_DIR = ".tw-cache";
|
|
5876
5955
|
function writeMetrics(metrics, cwd = process.cwd()) {
|
|
5877
5956
|
try {
|
|
5878
|
-
const cacheDir =
|
|
5957
|
+
const cacheDir = path14.join(cwd, CACHE_DIR);
|
|
5879
5958
|
fs11.mkdirSync(cacheDir, { recursive: true });
|
|
5880
5959
|
const mem = process.memoryUsage();
|
|
5881
5960
|
const data = {
|
|
@@ -5887,12 +5966,13 @@ function writeMetrics(metrics, cwd = process.cwd()) {
|
|
|
5887
5966
|
},
|
|
5888
5967
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
5889
5968
|
};
|
|
5890
|
-
fs11.writeFileSync(
|
|
5969
|
+
fs11.writeFileSync(path14.join(cacheDir, METRICS_FILE_NAME), JSON.stringify(data, null, 2));
|
|
5891
5970
|
} catch {
|
|
5892
5971
|
}
|
|
5893
5972
|
}
|
|
5894
5973
|
|
|
5895
5974
|
// packages/domain/engine/src/plugin-api.ts
|
|
5975
|
+
init_esm_shims();
|
|
5896
5976
|
async function runBeforeScan(plugins, context) {
|
|
5897
5977
|
for (const plugin of plugins) {
|
|
5898
5978
|
await plugin.beforeScan?.(context);
|
|
@@ -5941,6 +6021,7 @@ async function runAfterWatch(plugins, context) {
|
|
|
5941
6021
|
}
|
|
5942
6022
|
|
|
5943
6023
|
// packages/domain/engine/src/schemas.ts
|
|
6024
|
+
init_esm_shims();
|
|
5944
6025
|
import { z as z5 } from "zod";
|
|
5945
6026
|
var formatIssues3 = (error) => error.issues.map((issue) => {
|
|
5946
6027
|
const p = issue.path.length > 0 ? issue.path.join(".") : "<root>";
|
|
@@ -5997,6 +6078,7 @@ var parseEngineOptions = (options) => parseWithSchema3(EngineOptionsSchema, opti
|
|
|
5997
6078
|
var parseEngineWatchOptions = (options) => parseWithSchema3(EngineWatchOptionsSchema, options ?? {}, "engine watch options are invalid");
|
|
5998
6079
|
|
|
5999
6080
|
// packages/domain/engine/src/watch.ts
|
|
6081
|
+
init_esm_shims();
|
|
6000
6082
|
var _native2 = null;
|
|
6001
6083
|
function getNativeWatcher() {
|
|
6002
6084
|
if (_native2 !== null) return _native2;
|
|
@@ -6089,7 +6171,7 @@ var configState = {
|
|
|
6089
6171
|
var log6 = createLogger2("engine");
|
|
6090
6172
|
async function loadTailwindConfigFromPath(root, tailwindConfigPath) {
|
|
6091
6173
|
if (!tailwindConfigPath) return void 0;
|
|
6092
|
-
const configPath =
|
|
6174
|
+
const configPath = path15.resolve(root, tailwindConfigPath);
|
|
6093
6175
|
if (!fs12.existsSync(configPath)) {
|
|
6094
6176
|
throw TwError.fromIo("CONFIG_NOT_FOUND", `tailwindConfigPath not found: ${configPath}`);
|
|
6095
6177
|
}
|
|
@@ -6156,11 +6238,11 @@ async function buildFromScan(scan, root, options, tailwindConfig) {
|
|
|
6156
6238
|
};
|
|
6157
6239
|
}
|
|
6158
6240
|
function countWorkspacePackages(root) {
|
|
6159
|
-
const packagesDir =
|
|
6241
|
+
const packagesDir = path15.join(root, "packages");
|
|
6160
6242
|
if (!fs12.existsSync(packagesDir)) return 0;
|
|
6161
6243
|
try {
|
|
6162
6244
|
return fs12.readdirSync(packagesDir, { withFileTypes: true }).filter(
|
|
6163
|
-
(entry) => entry.isDirectory() && fs12.existsSync(
|
|
6245
|
+
(entry) => entry.isDirectory() && fs12.existsSync(path15.join(packagesDir, entry.name, "package.json"))
|
|
6164
6246
|
).length;
|
|
6165
6247
|
} catch (err) {
|
|
6166
6248
|
log6.debug(`countWorkspacePackages: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -6197,7 +6279,7 @@ function writeDashboardMetrics(root, mode, result, metrics) {
|
|
|
6197
6279
|
async function createEngine(rawOptions = {}) {
|
|
6198
6280
|
const options = parseEngineOptions(rawOptions);
|
|
6199
6281
|
const root = options.root ?? process.cwd();
|
|
6200
|
-
const resolvedRoot =
|
|
6282
|
+
const resolvedRoot = path15.resolve(root);
|
|
6201
6283
|
const plugins = rawOptions.plugins ?? [];
|
|
6202
6284
|
const getTailwindConfig = async () => {
|
|
6203
6285
|
if (configState.isLoaded()) return configState.getConfig();
|
|
@@ -6463,9 +6545,10 @@ async function createEngine(rawOptions = {}) {
|
|
|
6463
6545
|
}
|
|
6464
6546
|
|
|
6465
6547
|
// packages/presentation/vite/src/schemas.ts
|
|
6548
|
+
init_esm_shims();
|
|
6466
6549
|
init_src();
|
|
6467
6550
|
import { z as z6 } from "zod";
|
|
6468
|
-
var formatIssuePath4 = (
|
|
6551
|
+
var formatIssuePath4 = (path17) => path17.length > 0 ? path17.map(
|
|
6469
6552
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
6470
6553
|
).join(".") : "<root>";
|
|
6471
6554
|
var formatIssues4 = (error) => error.issues.map((issue) => {
|
|
@@ -6511,14 +6594,14 @@ function warnDeprecated(options, key, message) {
|
|
|
6511
6594
|
}
|
|
6512
6595
|
}
|
|
6513
6596
|
function isInsideDirectory(filePath, directory) {
|
|
6514
|
-
const relative =
|
|
6515
|
-
return relative === "" || !relative.startsWith("..") && !
|
|
6597
|
+
const relative = path16.relative(directory, filePath);
|
|
6598
|
+
return relative === "" || !relative.startsWith("..") && !path16.isAbsolute(relative);
|
|
6516
6599
|
}
|
|
6517
6600
|
function filterScanToDirs(scan, root, scanDirs) {
|
|
6518
|
-
const resolvedDirs = scanDirs.map((dir) =>
|
|
6601
|
+
const resolvedDirs = scanDirs.map((dir) => path16.resolve(root, dir));
|
|
6519
6602
|
if (resolvedDirs.length === 0) return scan;
|
|
6520
6603
|
const files = scan.files.filter((file) => {
|
|
6521
|
-
const absoluteFile =
|
|
6604
|
+
const absoluteFile = path16.resolve(file.file);
|
|
6522
6605
|
return resolvedDirs.some((directory) => isInsideDirectory(absoluteFile, directory));
|
|
6523
6606
|
});
|
|
6524
6607
|
const uniqueClasses = Array.from(new Set(files.flatMap((file) => file.classes))).sort();
|
|
@@ -6529,8 +6612,8 @@ function filterScanToDirs(scan, root, scanDirs) {
|
|
|
6529
6612
|
};
|
|
6530
6613
|
}
|
|
6531
6614
|
function writeJsonArtifact(root, relativePath, value) {
|
|
6532
|
-
const outputPath =
|
|
6533
|
-
fs13.mkdirSync(
|
|
6615
|
+
const outputPath = path16.resolve(root, relativePath);
|
|
6616
|
+
fs13.mkdirSync(path16.dirname(outputPath), { recursive: true });
|
|
6534
6617
|
fs13.writeFileSync(outputPath, `${JSON.stringify(value, null, 2)}
|
|
6535
6618
|
`);
|
|
6536
6619
|
}
|
|
@@ -6572,7 +6655,7 @@ function tailwindStyledPlugin(opts = {}) {
|
|
|
6572
6655
|
return rules.join("\n");
|
|
6573
6656
|
}
|
|
6574
6657
|
function getStaticCssOutputPath(root, safelistOutputPath) {
|
|
6575
|
-
return
|
|
6658
|
+
return path16.resolve(root, path16.dirname(safelistOutputPath), "_tw-state-static.css");
|
|
6576
6659
|
}
|
|
6577
6660
|
function flushStaticCss(root) {
|
|
6578
6661
|
if (staticCssPerFile.size === 0) return;
|
|
@@ -6581,7 +6664,7 @@ function tailwindStyledPlugin(opts = {}) {
|
|
|
6581
6664
|
if (!deduped.trim()) return;
|
|
6582
6665
|
const outPath = getStaticCssOutputPath(root, safelistOutput);
|
|
6583
6666
|
try {
|
|
6584
|
-
fs13.mkdirSync(
|
|
6667
|
+
fs13.mkdirSync(path16.dirname(outPath), { recursive: true });
|
|
6585
6668
|
fs13.writeFileSync(
|
|
6586
6669
|
outPath,
|
|
6587
6670
|
`/* _tw-state-static.css \u2014 Auto-generated by tailwind-styled-v4. DO NOT EDIT.
|
|
@@ -6614,11 +6697,11 @@ ${deduped}
|
|
|
6614
6697
|
"src/style.css"
|
|
6615
6698
|
];
|
|
6616
6699
|
for (const candidate of CSS_CANDIDATES) {
|
|
6617
|
-
const candidatePath =
|
|
6700
|
+
const candidatePath = path16.resolve(config.root, candidate);
|
|
6618
6701
|
if (!fs13.existsSync(candidatePath)) continue;
|
|
6619
6702
|
const content = fs13.readFileSync(candidatePath, "utf-8");
|
|
6620
6703
|
if (content.includes("_tw-state-static.css")) break;
|
|
6621
|
-
const rel =
|
|
6704
|
+
const rel = path16.relative(path16.dirname(candidatePath), outPath).replace(/\\/g, "/");
|
|
6622
6705
|
const importLine = `@import "./${rel}";`;
|
|
6623
6706
|
const tailwindImportRe = /(@import\s+["']tailwindcss["']\s*;[^\n]*\n?)/;
|
|
6624
6707
|
const updated = tailwindImportRe.test(content) ? content.replace(tailwindImportRe, `$1${importLine}
|