tailwind-styled-v4 5.1.16 → 5.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atomic.js +16 -4
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +13 -2
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +80 -68
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +77 -66
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +84 -4
- package/dist/compiler.d.ts +84 -4
- package/dist/compiler.js +245 -15
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +240 -14
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.js +209 -167
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +200 -159
- package/dist/engine.mjs.map +1 -1
- package/dist/index.browser.mjs +0 -3
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -3
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +16 -0
- package/dist/next.d.ts +16 -0
- package/dist/next.js +458 -158
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +454 -154
- package/dist/next.mjs.map +1 -1
- package/dist/runtime.js +0 -3
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +0 -3
- package/dist/runtime.mjs.map +1 -1
- package/dist/shared.js +106 -64
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +101 -60
- package/dist/shared.mjs.map +1 -1
- package/dist/theme.js +0 -3
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +0 -3
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +94 -52
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +92 -51
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +80 -68
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +77 -66
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +172 -130
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +166 -125
- package/dist/vite.mjs.map +1 -1
- package/dist/webpackLoader.js +28 -10
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +26 -9
- package/dist/webpackLoader.mjs.map +1 -1
- package/package.json +1 -1
package/dist/shared.js
CHANGED
|
@@ -230,9 +230,9 @@ function parseNative(schema, data, context) {
|
|
|
230
230
|
const result = schema.safeParse(data);
|
|
231
231
|
if (!result.success) {
|
|
232
232
|
const first = result.error.issues[0];
|
|
233
|
-
const
|
|
233
|
+
const path7 = first?.path?.join(".") ?? "(root)";
|
|
234
234
|
throw new Error(
|
|
235
|
-
`[${context}] Native binding returned unexpected data: ${
|
|
235
|
+
`[${context}] Native binding returned unexpected data: ${path7}: ${first?.message ?? "validation failed"}`
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
return result.data;
|
|
@@ -667,11 +667,11 @@ function resolvePath(...segments) {
|
|
|
667
667
|
return segments.join("/").replace(/\/+/g, "/");
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
function existsSync(
|
|
670
|
+
function existsSync(path7) {
|
|
671
671
|
if (isBrowser2) return false;
|
|
672
672
|
try {
|
|
673
673
|
const nodeFs = require(NODE_FS);
|
|
674
|
-
return nodeFs.existsSync(
|
|
674
|
+
return nodeFs.existsSync(path7);
|
|
675
675
|
} catch {
|
|
676
676
|
return false;
|
|
677
677
|
}
|
|
@@ -1026,9 +1026,9 @@ var init_native_resolution = __esm({
|
|
|
1026
1026
|
// packages/domain/shared/src/observability.ts
|
|
1027
1027
|
function createObservabilityClient(opts = {}) {
|
|
1028
1028
|
const { baseUrl = "http://localhost:7421", timeoutMs = 3e3 } = opts;
|
|
1029
|
-
async function fetchJson(
|
|
1029
|
+
async function fetchJson(path7) {
|
|
1030
1030
|
try {
|
|
1031
|
-
const res = await fetch(`${baseUrl}${
|
|
1031
|
+
const res = await fetch(`${baseUrl}${path7}`, {
|
|
1032
1032
|
signal: AbortSignal.timeout(timeoutMs)
|
|
1033
1033
|
});
|
|
1034
1034
|
if (!res.ok) return null;
|
|
@@ -1069,7 +1069,7 @@ var init_nativeBridge = __esm({
|
|
|
1069
1069
|
"use strict";
|
|
1070
1070
|
init_cjs_shims();
|
|
1071
1071
|
init_src2();
|
|
1072
|
-
_loadNative = (
|
|
1072
|
+
_loadNative = (path7) => require(path7);
|
|
1073
1073
|
log = (...args) => {
|
|
1074
1074
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
1075
1075
|
console.log("[compiler:native]", ...args);
|
|
@@ -2895,6 +2895,17 @@ var init_watch = __esm({
|
|
|
2895
2895
|
}
|
|
2896
2896
|
});
|
|
2897
2897
|
|
|
2898
|
+
// packages/domain/compiler/src/routeGraph.ts
|
|
2899
|
+
var import_node_fs, import_node_path;
|
|
2900
|
+
var init_routeGraph = __esm({
|
|
2901
|
+
"packages/domain/compiler/src/routeGraph.ts"() {
|
|
2902
|
+
"use strict";
|
|
2903
|
+
init_cjs_shims();
|
|
2904
|
+
import_node_fs = __toESM(require("fs"), 1);
|
|
2905
|
+
import_node_path = __toESM(require("path"), 1);
|
|
2906
|
+
}
|
|
2907
|
+
});
|
|
2908
|
+
|
|
2898
2909
|
// packages/domain/compiler/src/index.ts
|
|
2899
2910
|
function _layoutClassesToCss(classes) {
|
|
2900
2911
|
const native = getNativeBridge();
|
|
@@ -2930,13 +2941,13 @@ function extractContainerCssFromSource(source) {
|
|
|
2930
2941
|
}
|
|
2931
2942
|
return rules.join("\n");
|
|
2932
2943
|
}
|
|
2933
|
-
var
|
|
2944
|
+
var import_node_fs2, import_node_path2, import_node_module4, _require2, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, _fileClassesMap, _globalClasses, getRouteClasses, getAllRegisteredClasses, registerFileClasses, registerGlobalClasses, resetRouteClassRegistry, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
|
|
2934
2945
|
var init_src = __esm({
|
|
2935
2946
|
"packages/domain/compiler/src/index.ts"() {
|
|
2936
2947
|
"use strict";
|
|
2937
2948
|
init_cjs_shims();
|
|
2938
|
-
|
|
2939
|
-
|
|
2949
|
+
import_node_fs2 = __toESM(require("fs"), 1);
|
|
2950
|
+
import_node_path2 = __toESM(require("path"), 1);
|
|
2940
2951
|
import_node_module4 = require("module");
|
|
2941
2952
|
init_nativeBridge();
|
|
2942
2953
|
init_compiler();
|
|
@@ -2945,6 +2956,7 @@ var init_src = __esm({
|
|
|
2945
2956
|
init_cache();
|
|
2946
2957
|
init_redis();
|
|
2947
2958
|
init_watch();
|
|
2959
|
+
init_routeGraph();
|
|
2948
2960
|
_require2 = (0, import_node_module4.createRequire)(
|
|
2949
2961
|
typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : importMetaUrl
|
|
2950
2962
|
);
|
|
@@ -3039,7 +3051,7 @@ var init_src = __esm({
|
|
|
3039
3051
|
};
|
|
3040
3052
|
scanProjectUsage = (dirs, cwd) => {
|
|
3041
3053
|
const { batchExtractClasses: batchExtractClasses2 } = _require2("./parser");
|
|
3042
|
-
const files = dirs.map((dir) =>
|
|
3054
|
+
const files = dirs.map((dir) => import_node_path2.default.resolve(cwd, dir));
|
|
3043
3055
|
const results = batchExtractClasses2(files) || [];
|
|
3044
3056
|
const combined = {};
|
|
3045
3057
|
for (const result of results) {
|
|
@@ -3056,13 +3068,13 @@ var init_src = __esm({
|
|
|
3056
3068
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
3057
3069
|
const allClasses = Object.keys(classes).sort();
|
|
3058
3070
|
if (outputPath) {
|
|
3059
|
-
|
|
3071
|
+
import_node_fs2.default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
|
|
3060
3072
|
}
|
|
3061
3073
|
return allClasses;
|
|
3062
3074
|
};
|
|
3063
3075
|
loadSafelist = (safelistPath) => {
|
|
3064
3076
|
try {
|
|
3065
|
-
const content =
|
|
3077
|
+
const content = import_node_fs2.default.readFileSync(safelistPath, "utf-8");
|
|
3066
3078
|
return JSON.parse(content);
|
|
3067
3079
|
} catch {
|
|
3068
3080
|
return [];
|
|
@@ -3076,8 +3088,8 @@ var init_src = __esm({
|
|
|
3076
3088
|
"tailwind.config.cjs"
|
|
3077
3089
|
];
|
|
3078
3090
|
for (const file of configFiles) {
|
|
3079
|
-
const fullPath =
|
|
3080
|
-
if (
|
|
3091
|
+
const fullPath = import_node_path2.default.join(cwd, file);
|
|
3092
|
+
if (import_node_fs2.default.existsSync(fullPath)) {
|
|
3081
3093
|
const mod = require(fullPath);
|
|
3082
3094
|
return mod.default || mod;
|
|
3083
3095
|
}
|
|
@@ -3087,9 +3099,9 @@ var init_src = __esm({
|
|
|
3087
3099
|
getContentPaths = (cwd = process.cwd()) => {
|
|
3088
3100
|
return {
|
|
3089
3101
|
content: [
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3102
|
+
import_node_path2.default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
3103
|
+
import_node_path2.default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
3104
|
+
import_node_path2.default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
3093
3105
|
]
|
|
3094
3106
|
};
|
|
3095
3107
|
};
|
|
@@ -3160,10 +3172,38 @@ var init_src = __esm({
|
|
|
3160
3172
|
}
|
|
3161
3173
|
return ["/", "__global"];
|
|
3162
3174
|
};
|
|
3163
|
-
|
|
3164
|
-
|
|
3175
|
+
_fileClassesMap = /* @__PURE__ */ new Map();
|
|
3176
|
+
_globalClasses = /* @__PURE__ */ new Set();
|
|
3177
|
+
getRouteClasses = (route) => {
|
|
3178
|
+
const result = /* @__PURE__ */ new Set();
|
|
3179
|
+
for (const [filepath, classes] of _fileClassesMap) {
|
|
3180
|
+
const fileRoute = fileToRoute(filepath) ?? "__global";
|
|
3181
|
+
if (fileRoute === route) {
|
|
3182
|
+
for (const cls of classes) result.add(cls);
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
return result;
|
|
3186
|
+
};
|
|
3187
|
+
getAllRegisteredClasses = () => {
|
|
3188
|
+
const result = new Set(_globalClasses);
|
|
3189
|
+
for (const classes of _fileClassesMap.values()) {
|
|
3190
|
+
for (const cls of classes) result.add(cls);
|
|
3191
|
+
}
|
|
3192
|
+
return result;
|
|
3193
|
+
};
|
|
3194
|
+
registerFileClasses = (filepath, classes) => {
|
|
3195
|
+
if (!classes || classes.length === 0) {
|
|
3196
|
+
_fileClassesMap.delete(filepath);
|
|
3197
|
+
return;
|
|
3198
|
+
}
|
|
3199
|
+
_fileClassesMap.set(filepath, new Set(classes));
|
|
3165
3200
|
};
|
|
3166
|
-
registerGlobalClasses = (
|
|
3201
|
+
registerGlobalClasses = (classes) => {
|
|
3202
|
+
for (const cls of classes) _globalClasses.add(cls);
|
|
3203
|
+
};
|
|
3204
|
+
resetRouteClassRegistry = () => {
|
|
3205
|
+
_fileClassesMap.clear();
|
|
3206
|
+
_globalClasses.clear();
|
|
3167
3207
|
};
|
|
3168
3208
|
_incrementalEngineInstance = null;
|
|
3169
3209
|
getIncrementalEngine = () => {
|
|
@@ -3354,6 +3394,7 @@ __export(internal_exports, {
|
|
|
3354
3394
|
generateStaticStateCss: () => generateStaticStateCss,
|
|
3355
3395
|
generateStaticStateCssNative: () => generateStaticStateCssNative,
|
|
3356
3396
|
generateSubComponentTypes: () => generateSubComponentTypes,
|
|
3397
|
+
getAllRegisteredClasses: () => getAllRegisteredClasses,
|
|
3357
3398
|
getAllRoutes: () => getAllRoutes,
|
|
3358
3399
|
getBucketEngine: () => getBucketEngine,
|
|
3359
3400
|
getCacheOptimizationHints: () => getCacheOptimizationHints,
|
|
@@ -3456,6 +3497,7 @@ __export(internal_exports, {
|
|
|
3456
3497
|
resetIncrementalEngine: () => resetIncrementalEngine,
|
|
3457
3498
|
resetMemoryStats: () => resetMemoryStats,
|
|
3458
3499
|
resetResolverPoolStats: () => resetResolverPoolStats,
|
|
3500
|
+
resetRouteClassRegistry: () => resetRouteClassRegistry,
|
|
3459
3501
|
resolveCascade: () => resolveCascade,
|
|
3460
3502
|
resolveClassNames: () => resolveClassNames,
|
|
3461
3503
|
resolveColorCached: () => resolveColorCached,
|
|
@@ -3546,17 +3588,17 @@ function getNative() {
|
|
|
3546
3588
|
function* walkSourceFiles(dir) {
|
|
3547
3589
|
let entries;
|
|
3548
3590
|
try {
|
|
3549
|
-
entries =
|
|
3591
|
+
entries = import_node_fs3.default.readdirSync(dir, { withFileTypes: true });
|
|
3550
3592
|
} catch {
|
|
3551
3593
|
return;
|
|
3552
3594
|
}
|
|
3553
3595
|
for (const entry of entries) {
|
|
3554
|
-
const fullPath =
|
|
3596
|
+
const fullPath = import_node_path3.default.join(dir, entry.name);
|
|
3555
3597
|
if (entry.isDirectory()) {
|
|
3556
3598
|
if (IGNORE_PATTERNS.some((p) => entry.name === p || entry.name.startsWith(p))) continue;
|
|
3557
3599
|
yield* walkSourceFiles(fullPath);
|
|
3558
3600
|
} else if (entry.isFile()) {
|
|
3559
|
-
const ext =
|
|
3601
|
+
const ext = import_node_path3.default.extname(entry.name);
|
|
3560
3602
|
if (SOURCE_EXTENSIONS.has(ext)) yield fullPath;
|
|
3561
3603
|
}
|
|
3562
3604
|
}
|
|
@@ -3620,7 +3662,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3620
3662
|
allConfigs.push(...configs);
|
|
3621
3663
|
if (verbose) {
|
|
3622
3664
|
process.stderr.write(
|
|
3623
|
-
`[tw:static-state] ${
|
|
3665
|
+
`[tw:static-state] ${import_node_path3.default.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3624
3666
|
`
|
|
3625
3667
|
);
|
|
3626
3668
|
}
|
|
@@ -3631,7 +3673,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3631
3673
|
if (filesScanned >= maxFiles) break;
|
|
3632
3674
|
let source;
|
|
3633
3675
|
try {
|
|
3634
|
-
source =
|
|
3676
|
+
source = import_node_fs3.default.readFileSync(filePath, "utf-8");
|
|
3635
3677
|
} catch {
|
|
3636
3678
|
continue;
|
|
3637
3679
|
}
|
|
@@ -3644,7 +3686,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3644
3686
|
allConfigs.push(...configs);
|
|
3645
3687
|
if (verbose) {
|
|
3646
3688
|
process.stderr.write(
|
|
3647
|
-
`[tw:static-state] ${
|
|
3689
|
+
`[tw:static-state] ${import_node_path3.default.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3648
3690
|
`
|
|
3649
3691
|
);
|
|
3650
3692
|
}
|
|
@@ -3738,12 +3780,12 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3738
3780
|
resolvedCss: options.resolvedCss || ""
|
|
3739
3781
|
// ← ensure always passed
|
|
3740
3782
|
});
|
|
3741
|
-
const twClassesDir =
|
|
3742
|
-
|
|
3743
|
-
const stateFilePath =
|
|
3783
|
+
const twClassesDir = import_node_path3.default.join(import_node_path3.default.dirname(safelistPath), "tw-classes");
|
|
3784
|
+
import_node_fs3.default.mkdirSync(twClassesDir, { recursive: true });
|
|
3785
|
+
const stateFilePath = import_node_path3.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
3744
3786
|
if (result.rulesGenerated === 0) {
|
|
3745
3787
|
try {
|
|
3746
|
-
|
|
3788
|
+
import_node_fs3.default.writeFileSync(
|
|
3747
3789
|
stateFilePath,
|
|
3748
3790
|
"/* tw-state-static.css \u2014 tidak ada state rules yang di-generate */\n",
|
|
3749
3791
|
"utf-8"
|
|
@@ -3753,7 +3795,7 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3753
3795
|
return `[tw:static-state] tidak ada state rules yang di-generate (${result.filesScanned} files di-scan)`;
|
|
3754
3796
|
}
|
|
3755
3797
|
try {
|
|
3756
|
-
|
|
3798
|
+
import_node_fs3.default.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
|
|
3757
3799
|
return [
|
|
3758
3800
|
`[tw:static-state] ${result.rulesGenerated} static state rules di-generate`,
|
|
3759
3801
|
` \u2192 ${result.filesScanned} files scanned, ${result.filesWithStates} dengan states`,
|
|
@@ -3765,13 +3807,13 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3765
3807
|
return `[tw:static-state] gagal tulis state CSS: ${msg}`;
|
|
3766
3808
|
}
|
|
3767
3809
|
}
|
|
3768
|
-
var
|
|
3810
|
+
var import_node_fs3, import_node_path3, SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
|
|
3769
3811
|
var init_staticStateExtractor = __esm({
|
|
3770
3812
|
"packages/domain/shared/src/staticStateExtractor.ts"() {
|
|
3771
3813
|
"use strict";
|
|
3772
3814
|
init_cjs_shims();
|
|
3773
|
-
|
|
3774
|
-
|
|
3815
|
+
import_node_fs3 = __toESM(require("fs"));
|
|
3816
|
+
import_node_path3 = __toESM(require("path"));
|
|
3775
3817
|
SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs"]);
|
|
3776
3818
|
IGNORE_PATTERNS = ["node_modules", ".next", "dist", "build", ".git", "coverage", "__tests__"];
|
|
3777
3819
|
_native = null;
|
|
@@ -3789,8 +3831,8 @@ function setGlobalLogFile(filePath) {
|
|
|
3789
3831
|
_globalLogFile = filePath;
|
|
3790
3832
|
_logFileInitialized = false;
|
|
3791
3833
|
try {
|
|
3792
|
-
|
|
3793
|
-
|
|
3834
|
+
import_node_fs4.default.mkdirSync(import_node_path4.default.dirname(filePath), { recursive: true });
|
|
3835
|
+
import_node_fs4.default.writeFileSync(
|
|
3794
3836
|
filePath,
|
|
3795
3837
|
`# tailwind-styled build log \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
3796
3838
|
`,
|
|
@@ -3803,7 +3845,7 @@ function setGlobalLogFile(filePath) {
|
|
|
3803
3845
|
function writeToFile(line) {
|
|
3804
3846
|
if (!_globalLogFile || !_logFileInitialized) return;
|
|
3805
3847
|
try {
|
|
3806
|
-
|
|
3848
|
+
import_node_fs4.default.appendFileSync(_globalLogFile, line);
|
|
3807
3849
|
} catch {
|
|
3808
3850
|
}
|
|
3809
3851
|
}
|
|
@@ -3830,13 +3872,13 @@ function createLogger(prefix, level) {
|
|
|
3830
3872
|
setLogFile: (filePath) => setGlobalLogFile(filePath)
|
|
3831
3873
|
};
|
|
3832
3874
|
}
|
|
3833
|
-
var
|
|
3875
|
+
var import_node_fs4, import_node_path4, LEVELS, _globalLogFile, _logFileInitialized, logger;
|
|
3834
3876
|
var init_logger = __esm({
|
|
3835
3877
|
"packages/domain/shared/src/logger.ts"() {
|
|
3836
3878
|
"use strict";
|
|
3837
3879
|
init_cjs_shims();
|
|
3838
|
-
|
|
3839
|
-
|
|
3880
|
+
import_node_fs4 = __toESM(require("fs"));
|
|
3881
|
+
import_node_path4 = __toESM(require("path"));
|
|
3840
3882
|
LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 };
|
|
3841
3883
|
_globalLogFile = null;
|
|
3842
3884
|
_logFileInitialized = false;
|
|
@@ -3874,9 +3916,9 @@ function createDebugLogger(namespace, label) {
|
|
|
3874
3916
|
}
|
|
3875
3917
|
};
|
|
3876
3918
|
}
|
|
3877
|
-
function formatIssuePath(
|
|
3878
|
-
if (!
|
|
3879
|
-
return
|
|
3919
|
+
function formatIssuePath(path7) {
|
|
3920
|
+
if (!path7 || path7.length === 0) return "(root)";
|
|
3921
|
+
return path7.map(
|
|
3880
3922
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3881
3923
|
).join(".");
|
|
3882
3924
|
}
|
|
@@ -3890,9 +3932,9 @@ function loadNativeBinding(options) {
|
|
|
3890
3932
|
const { runtimeDir, candidates, isValid } = options;
|
|
3891
3933
|
const loadErrors = [];
|
|
3892
3934
|
for (const candidate of candidates) {
|
|
3893
|
-
const candidatePath =
|
|
3935
|
+
const candidatePath = import_node_path5.default.resolve(runtimeDir, candidate);
|
|
3894
3936
|
try {
|
|
3895
|
-
if (!
|
|
3937
|
+
if (!import_node_fs5.default.existsSync(candidatePath) && !import_node_fs5.default.existsSync(candidatePath + ".node")) {
|
|
3896
3938
|
continue;
|
|
3897
3939
|
}
|
|
3898
3940
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -3924,9 +3966,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3924
3966
|
}
|
|
3925
3967
|
}
|
|
3926
3968
|
if (!includeDefaultCandidates) return candidates;
|
|
3927
|
-
if (
|
|
3969
|
+
if (import_node_fs5.default.existsSync(runtimeDir)) {
|
|
3928
3970
|
try {
|
|
3929
|
-
for (const entry of
|
|
3971
|
+
for (const entry of import_node_fs5.default.readdirSync(runtimeDir)) {
|
|
3930
3972
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
3931
3973
|
}
|
|
3932
3974
|
} catch {
|
|
@@ -3935,22 +3977,22 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3935
3977
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3936
3978
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
3937
3979
|
for (const bin of BINARY_NAMES) {
|
|
3938
|
-
candidates.push(
|
|
3939
|
-
candidates.push(
|
|
3940
|
-
candidates.push(
|
|
3941
|
-
candidates.push(
|
|
3942
|
-
candidates.push(
|
|
3943
|
-
candidates.push(
|
|
3944
|
-
candidates.push(
|
|
3945
|
-
candidates.push(
|
|
3946
|
-
candidates.push(
|
|
3980
|
+
candidates.push(import_node_path5.default.resolve(runtimeDir, `${bin}.node`));
|
|
3981
|
+
candidates.push(import_node_path5.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
3982
|
+
candidates.push(import_node_path5.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
3983
|
+
candidates.push(import_node_path5.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3984
|
+
candidates.push(import_node_path5.default.resolve(process.cwd(), "native", `${bin}.node`));
|
|
3985
|
+
candidates.push(import_node_path5.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
3986
|
+
candidates.push(import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
3987
|
+
candidates.push(import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
3988
|
+
candidates.push(import_node_path5.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
3947
3989
|
}
|
|
3948
3990
|
return Array.from(new Set(candidates));
|
|
3949
3991
|
}
|
|
3950
3992
|
function resolveRuntimeDir(dir, importMetaUrl2) {
|
|
3951
|
-
if (dir) return
|
|
3993
|
+
if (dir) return import_node_path5.default.resolve(dir);
|
|
3952
3994
|
try {
|
|
3953
|
-
return
|
|
3995
|
+
return import_node_path5.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl2));
|
|
3954
3996
|
} catch {
|
|
3955
3997
|
return process.cwd();
|
|
3956
3998
|
}
|
|
@@ -3964,14 +4006,14 @@ function formatErrorMessage(error) {
|
|
|
3964
4006
|
if (error instanceof Error) return error.message;
|
|
3965
4007
|
return String(error);
|
|
3966
4008
|
}
|
|
3967
|
-
var import_node_crypto,
|
|
4009
|
+
var import_node_crypto, import_node_fs5, import_node_path5, import_node_url, import_node_module5, TwError, _require3, LRUCache;
|
|
3968
4010
|
var init_src2 = __esm({
|
|
3969
4011
|
"packages/domain/shared/src/index.ts"() {
|
|
3970
4012
|
"use strict";
|
|
3971
4013
|
init_cjs_shims();
|
|
3972
4014
|
import_node_crypto = require("crypto");
|
|
3973
|
-
|
|
3974
|
-
|
|
4015
|
+
import_node_fs5 = __toESM(require("fs"));
|
|
4016
|
+
import_node_path5 = __toESM(require("path"));
|
|
3975
4017
|
import_node_url = require("url");
|
|
3976
4018
|
import_node_module5 = require("module");
|
|
3977
4019
|
init_trace();
|
|
@@ -4020,8 +4062,8 @@ var init_src2 = __esm({
|
|
|
4020
4062
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
4021
4063
|
static fromZod(err) {
|
|
4022
4064
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
4023
|
-
const
|
|
4024
|
-
const message = first ? `${
|
|
4065
|
+
const path7 = formatIssuePath(first?.path);
|
|
4066
|
+
const message = first ? `${path7}: ${first.message}` : "Schema validation failed";
|
|
4025
4067
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
4026
4068
|
}
|
|
4027
4069
|
static wrap(source, code, err) {
|