tailwind-styled-v4 5.1.22 → 5.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -0
- package/dist/atomic.js +34 -4
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +31 -2
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +132 -97
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +129 -95
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +195 -1
- package/dist/compiler.d.ts +195 -1
- package/dist/compiler.js +356 -12
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +340 -10
- package/dist/compiler.mjs.map +1 -1
- package/dist/engine.js +194 -164
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +184 -155
- package/dist/engine.mjs.map +1 -1
- package/dist/index.browser.mjs +144 -14
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +45 -4
- package/dist/index.d.ts +45 -4
- package/dist/index.js +174 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +185 -21
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +489 -158
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +483 -153
- package/dist/next.mjs.map +1 -1
- package/dist/runtime-css.js +1 -1
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +1 -1
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/runtime.js +17 -0
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +23 -0
- package/dist/runtime.mjs.map +1 -1
- package/dist/shared.js +91 -61
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +85 -56
- package/dist/shared.mjs.map +1 -1
- package/dist/turbopackLoader.js +79 -49
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +76 -47
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +132 -97
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +129 -95
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +157 -127
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +150 -121
- package/dist/vite.mjs.map +1 -1
- package/dist/webpackLoader.js +39 -9
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +36 -7
- package/dist/webpackLoader.mjs.map +1 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -182
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 path8 = first?.path?.join(".") ?? "(root)";
|
|
234
234
|
throw new Error(
|
|
235
|
-
`[${context}] Native binding returned unexpected data: ${
|
|
235
|
+
`[${context}] Native binding returned unexpected data: ${path8}: ${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(path8) {
|
|
671
671
|
if (isBrowser2) return false;
|
|
672
672
|
try {
|
|
673
673
|
const nodeFs = require(NODE_FS);
|
|
674
|
-
return nodeFs.existsSync(
|
|
674
|
+
return nodeFs.existsSync(path8);
|
|
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(path8) {
|
|
1030
1030
|
try {
|
|
1031
|
-
const res = await fetch(`${baseUrl}${
|
|
1031
|
+
const res = await fetch(`${baseUrl}${path8}`, {
|
|
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 = (path8) => require(path8);
|
|
1073
1073
|
log = (...args) => {
|
|
1074
1074
|
if (process.env.DEBUG?.includes("compiler:native")) {
|
|
1075
1075
|
console.log("[compiler:native]", ...args);
|
|
@@ -2906,6 +2906,33 @@ var init_routeGraph = __esm({
|
|
|
2906
2906
|
}
|
|
2907
2907
|
});
|
|
2908
2908
|
|
|
2909
|
+
// packages/domain/compiler/src/semanticComponentAnalyzer.ts
|
|
2910
|
+
var init_semanticComponentAnalyzer = __esm({
|
|
2911
|
+
"packages/domain/compiler/src/semanticComponentAnalyzer.ts"() {
|
|
2912
|
+
"use strict";
|
|
2913
|
+
init_cjs_shims();
|
|
2914
|
+
}
|
|
2915
|
+
});
|
|
2916
|
+
|
|
2917
|
+
// packages/domain/compiler/src/typeGeneratorFromMetadata.ts
|
|
2918
|
+
var init_typeGeneratorFromMetadata = __esm({
|
|
2919
|
+
"packages/domain/compiler/src/typeGeneratorFromMetadata.ts"() {
|
|
2920
|
+
"use strict";
|
|
2921
|
+
init_cjs_shims();
|
|
2922
|
+
}
|
|
2923
|
+
});
|
|
2924
|
+
|
|
2925
|
+
// packages/domain/compiler/src/typeGenerationPlugin.ts
|
|
2926
|
+
var import_node_fs2, import_node_path2;
|
|
2927
|
+
var init_typeGenerationPlugin = __esm({
|
|
2928
|
+
"packages/domain/compiler/src/typeGenerationPlugin.ts"() {
|
|
2929
|
+
"use strict";
|
|
2930
|
+
init_cjs_shims();
|
|
2931
|
+
import_node_fs2 = __toESM(require("fs"), 1);
|
|
2932
|
+
import_node_path2 = __toESM(require("path"), 1);
|
|
2933
|
+
}
|
|
2934
|
+
});
|
|
2935
|
+
|
|
2909
2936
|
// packages/domain/compiler/src/index.ts
|
|
2910
2937
|
function _layoutClassesToCss(classes) {
|
|
2911
2938
|
const native = getNativeBridge();
|
|
@@ -2941,13 +2968,13 @@ function extractContainerCssFromSource(source) {
|
|
|
2941
2968
|
}
|
|
2942
2969
|
return rules.join("\n");
|
|
2943
2970
|
}
|
|
2944
|
-
var
|
|
2971
|
+
var import_node_fs3, import_node_path3, 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;
|
|
2945
2972
|
var init_src = __esm({
|
|
2946
2973
|
"packages/domain/compiler/src/index.ts"() {
|
|
2947
2974
|
"use strict";
|
|
2948
2975
|
init_cjs_shims();
|
|
2949
|
-
|
|
2950
|
-
|
|
2976
|
+
import_node_fs3 = __toESM(require("fs"), 1);
|
|
2977
|
+
import_node_path3 = __toESM(require("path"), 1);
|
|
2951
2978
|
import_node_module4 = require("module");
|
|
2952
2979
|
init_nativeBridge();
|
|
2953
2980
|
init_compiler();
|
|
@@ -2957,6 +2984,9 @@ var init_src = __esm({
|
|
|
2957
2984
|
init_redis();
|
|
2958
2985
|
init_watch();
|
|
2959
2986
|
init_routeGraph();
|
|
2987
|
+
init_semanticComponentAnalyzer();
|
|
2988
|
+
init_typeGeneratorFromMetadata();
|
|
2989
|
+
init_typeGenerationPlugin();
|
|
2960
2990
|
_require2 = (0, import_node_module4.createRequire)(
|
|
2961
2991
|
typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : importMetaUrl
|
|
2962
2992
|
);
|
|
@@ -3051,7 +3081,7 @@ var init_src = __esm({
|
|
|
3051
3081
|
};
|
|
3052
3082
|
scanProjectUsage = (dirs, cwd) => {
|
|
3053
3083
|
const { batchExtractClasses: batchExtractClasses2 } = _require2("./parser");
|
|
3054
|
-
const files = dirs.map((dir) =>
|
|
3084
|
+
const files = dirs.map((dir) => import_node_path3.default.resolve(cwd, dir));
|
|
3055
3085
|
const results = batchExtractClasses2(files) || [];
|
|
3056
3086
|
const combined = {};
|
|
3057
3087
|
for (const result of results) {
|
|
@@ -3068,13 +3098,13 @@ var init_src = __esm({
|
|
|
3068
3098
|
const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
|
|
3069
3099
|
const allClasses = Object.keys(classes).sort();
|
|
3070
3100
|
if (outputPath) {
|
|
3071
|
-
|
|
3101
|
+
import_node_fs3.default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
|
|
3072
3102
|
}
|
|
3073
3103
|
return allClasses;
|
|
3074
3104
|
};
|
|
3075
3105
|
loadSafelist = (safelistPath) => {
|
|
3076
3106
|
try {
|
|
3077
|
-
const content =
|
|
3107
|
+
const content = import_node_fs3.default.readFileSync(safelistPath, "utf-8");
|
|
3078
3108
|
return JSON.parse(content);
|
|
3079
3109
|
} catch {
|
|
3080
3110
|
return [];
|
|
@@ -3088,8 +3118,8 @@ var init_src = __esm({
|
|
|
3088
3118
|
"tailwind.config.cjs"
|
|
3089
3119
|
];
|
|
3090
3120
|
for (const file of configFiles) {
|
|
3091
|
-
const fullPath =
|
|
3092
|
-
if (
|
|
3121
|
+
const fullPath = import_node_path3.default.join(cwd, file);
|
|
3122
|
+
if (import_node_fs3.default.existsSync(fullPath)) {
|
|
3093
3123
|
const mod = require(fullPath);
|
|
3094
3124
|
return mod.default || mod;
|
|
3095
3125
|
}
|
|
@@ -3099,9 +3129,9 @@ var init_src = __esm({
|
|
|
3099
3129
|
getContentPaths = (cwd = process.cwd()) => {
|
|
3100
3130
|
return {
|
|
3101
3131
|
content: [
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3132
|
+
import_node_path3.default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
|
|
3133
|
+
import_node_path3.default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
|
|
3134
|
+
import_node_path3.default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
|
|
3105
3135
|
]
|
|
3106
3136
|
};
|
|
3107
3137
|
};
|
|
@@ -3588,17 +3618,17 @@ function getNative() {
|
|
|
3588
3618
|
function* walkSourceFiles(dir) {
|
|
3589
3619
|
let entries;
|
|
3590
3620
|
try {
|
|
3591
|
-
entries =
|
|
3621
|
+
entries = import_node_fs4.default.readdirSync(dir, { withFileTypes: true });
|
|
3592
3622
|
} catch {
|
|
3593
3623
|
return;
|
|
3594
3624
|
}
|
|
3595
3625
|
for (const entry of entries) {
|
|
3596
|
-
const fullPath =
|
|
3626
|
+
const fullPath = import_node_path4.default.join(dir, entry.name);
|
|
3597
3627
|
if (entry.isDirectory()) {
|
|
3598
3628
|
if (IGNORE_PATTERNS.some((p) => entry.name === p || entry.name.startsWith(p))) continue;
|
|
3599
3629
|
yield* walkSourceFiles(fullPath);
|
|
3600
3630
|
} else if (entry.isFile()) {
|
|
3601
|
-
const ext =
|
|
3631
|
+
const ext = import_node_path4.default.extname(entry.name);
|
|
3602
3632
|
if (SOURCE_EXTENSIONS.has(ext)) yield fullPath;
|
|
3603
3633
|
}
|
|
3604
3634
|
}
|
|
@@ -3662,7 +3692,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3662
3692
|
allConfigs.push(...configs);
|
|
3663
3693
|
if (verbose) {
|
|
3664
3694
|
process.stderr.write(
|
|
3665
|
-
`[tw:static-state] ${
|
|
3695
|
+
`[tw:static-state] ${import_node_path4.default.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3666
3696
|
`
|
|
3667
3697
|
);
|
|
3668
3698
|
}
|
|
@@ -3673,7 +3703,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3673
3703
|
if (filesScanned >= maxFiles) break;
|
|
3674
3704
|
let source;
|
|
3675
3705
|
try {
|
|
3676
|
-
source =
|
|
3706
|
+
source = import_node_fs4.default.readFileSync(filePath, "utf-8");
|
|
3677
3707
|
} catch {
|
|
3678
3708
|
continue;
|
|
3679
3709
|
}
|
|
@@ -3686,7 +3716,7 @@ function extractStaticStateCss(srcDir, options = {}) {
|
|
|
3686
3716
|
allConfigs.push(...configs);
|
|
3687
3717
|
if (verbose) {
|
|
3688
3718
|
process.stderr.write(
|
|
3689
|
-
`[tw:static-state] ${
|
|
3719
|
+
`[tw:static-state] ${import_node_path4.default.relative(srcDir, filePath)}: ${configs.length} komponen
|
|
3690
3720
|
`
|
|
3691
3721
|
);
|
|
3692
3722
|
}
|
|
@@ -3780,12 +3810,12 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3780
3810
|
resolvedCss: options.resolvedCss || ""
|
|
3781
3811
|
// ← ensure always passed
|
|
3782
3812
|
});
|
|
3783
|
-
const twClassesDir =
|
|
3784
|
-
|
|
3785
|
-
const stateFilePath =
|
|
3813
|
+
const twClassesDir = import_node_path4.default.join(import_node_path4.default.dirname(safelistPath), "tw-classes");
|
|
3814
|
+
import_node_fs4.default.mkdirSync(twClassesDir, { recursive: true });
|
|
3815
|
+
const stateFilePath = import_node_path4.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
|
|
3786
3816
|
if (result.rulesGenerated === 0) {
|
|
3787
3817
|
try {
|
|
3788
|
-
|
|
3818
|
+
import_node_fs4.default.writeFileSync(
|
|
3789
3819
|
stateFilePath,
|
|
3790
3820
|
"/* tw-state-static.css \u2014 tidak ada state rules yang di-generate */\n",
|
|
3791
3821
|
"utf-8"
|
|
@@ -3795,7 +3825,7 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3795
3825
|
return `[tw:static-state] tidak ada state rules yang di-generate (${result.filesScanned} files di-scan)`;
|
|
3796
3826
|
}
|
|
3797
3827
|
try {
|
|
3798
|
-
|
|
3828
|
+
import_node_fs4.default.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
|
|
3799
3829
|
return [
|
|
3800
3830
|
`[tw:static-state] ${result.rulesGenerated} static state rules di-generate`,
|
|
3801
3831
|
` \u2192 ${result.filesScanned} files scanned, ${result.filesWithStates} dengan states`,
|
|
@@ -3807,13 +3837,13 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
|
|
|
3807
3837
|
return `[tw:static-state] gagal tulis state CSS: ${msg}`;
|
|
3808
3838
|
}
|
|
3809
3839
|
}
|
|
3810
|
-
var
|
|
3840
|
+
var import_node_fs4, import_node_path4, SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
|
|
3811
3841
|
var init_staticStateExtractor = __esm({
|
|
3812
3842
|
"packages/domain/shared/src/staticStateExtractor.ts"() {
|
|
3813
3843
|
"use strict";
|
|
3814
3844
|
init_cjs_shims();
|
|
3815
|
-
|
|
3816
|
-
|
|
3845
|
+
import_node_fs4 = __toESM(require("fs"));
|
|
3846
|
+
import_node_path4 = __toESM(require("path"));
|
|
3817
3847
|
SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs"]);
|
|
3818
3848
|
IGNORE_PATTERNS = ["node_modules", ".next", "dist", "build", ".git", "coverage", "__tests__"];
|
|
3819
3849
|
_native = null;
|
|
@@ -3831,8 +3861,8 @@ function setGlobalLogFile(filePath) {
|
|
|
3831
3861
|
_globalLogFile = filePath;
|
|
3832
3862
|
_logFileInitialized = false;
|
|
3833
3863
|
try {
|
|
3834
|
-
|
|
3835
|
-
|
|
3864
|
+
import_node_fs5.default.mkdirSync(import_node_path5.default.dirname(filePath), { recursive: true });
|
|
3865
|
+
import_node_fs5.default.writeFileSync(
|
|
3836
3866
|
filePath,
|
|
3837
3867
|
`# tailwind-styled build log \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
3838
3868
|
`,
|
|
@@ -3845,7 +3875,7 @@ function setGlobalLogFile(filePath) {
|
|
|
3845
3875
|
function writeToFile(line) {
|
|
3846
3876
|
if (!_globalLogFile || !_logFileInitialized) return;
|
|
3847
3877
|
try {
|
|
3848
|
-
|
|
3878
|
+
import_node_fs5.default.appendFileSync(_globalLogFile, line);
|
|
3849
3879
|
} catch {
|
|
3850
3880
|
}
|
|
3851
3881
|
}
|
|
@@ -3872,13 +3902,13 @@ function createLogger(prefix, level) {
|
|
|
3872
3902
|
setLogFile: (filePath) => setGlobalLogFile(filePath)
|
|
3873
3903
|
};
|
|
3874
3904
|
}
|
|
3875
|
-
var
|
|
3905
|
+
var import_node_fs5, import_node_path5, LEVELS, _globalLogFile, _logFileInitialized, logger;
|
|
3876
3906
|
var init_logger = __esm({
|
|
3877
3907
|
"packages/domain/shared/src/logger.ts"() {
|
|
3878
3908
|
"use strict";
|
|
3879
3909
|
init_cjs_shims();
|
|
3880
|
-
|
|
3881
|
-
|
|
3910
|
+
import_node_fs5 = __toESM(require("fs"));
|
|
3911
|
+
import_node_path5 = __toESM(require("path"));
|
|
3882
3912
|
LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 };
|
|
3883
3913
|
_globalLogFile = null;
|
|
3884
3914
|
_logFileInitialized = false;
|
|
@@ -3916,9 +3946,9 @@ function createDebugLogger(namespace, label) {
|
|
|
3916
3946
|
}
|
|
3917
3947
|
};
|
|
3918
3948
|
}
|
|
3919
|
-
function formatIssuePath(
|
|
3920
|
-
if (!
|
|
3921
|
-
return
|
|
3949
|
+
function formatIssuePath(path8) {
|
|
3950
|
+
if (!path8 || path8.length === 0) return "(root)";
|
|
3951
|
+
return path8.map(
|
|
3922
3952
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
3923
3953
|
).join(".");
|
|
3924
3954
|
}
|
|
@@ -3932,9 +3962,9 @@ function loadNativeBinding(options) {
|
|
|
3932
3962
|
const { runtimeDir, candidates, isValid } = options;
|
|
3933
3963
|
const loadErrors = [];
|
|
3934
3964
|
for (const candidate of candidates) {
|
|
3935
|
-
const candidatePath =
|
|
3965
|
+
const candidatePath = import_node_path6.default.resolve(runtimeDir, candidate);
|
|
3936
3966
|
try {
|
|
3937
|
-
if (!
|
|
3967
|
+
if (!import_node_fs6.default.existsSync(candidatePath) && !import_node_fs6.default.existsSync(candidatePath + ".node")) {
|
|
3938
3968
|
continue;
|
|
3939
3969
|
}
|
|
3940
3970
|
const mod = requireNativeModule(candidatePath);
|
|
@@ -3966,9 +3996,9 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3966
3996
|
}
|
|
3967
3997
|
}
|
|
3968
3998
|
if (!includeDefaultCandidates) return candidates;
|
|
3969
|
-
if (
|
|
3999
|
+
if (import_node_fs6.default.existsSync(runtimeDir)) {
|
|
3970
4000
|
try {
|
|
3971
|
-
for (const entry of
|
|
4001
|
+
for (const entry of import_node_fs6.default.readdirSync(runtimeDir)) {
|
|
3972
4002
|
if (entry.endsWith(".node")) candidates.push(entry);
|
|
3973
4003
|
}
|
|
3974
4004
|
} catch {
|
|
@@ -3977,22 +4007,22 @@ function resolveNativeBindingCandidates(options) {
|
|
|
3977
4007
|
const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
|
|
3978
4008
|
const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
|
|
3979
4009
|
for (const bin of BINARY_NAMES) {
|
|
3980
|
-
candidates.push(
|
|
3981
|
-
candidates.push(
|
|
3982
|
-
candidates.push(
|
|
3983
|
-
candidates.push(
|
|
3984
|
-
candidates.push(
|
|
3985
|
-
candidates.push(
|
|
3986
|
-
candidates.push(
|
|
3987
|
-
candidates.push(
|
|
3988
|
-
candidates.push(
|
|
4010
|
+
candidates.push(import_node_path6.default.resolve(runtimeDir, `${bin}.node`));
|
|
4011
|
+
candidates.push(import_node_path6.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
|
|
4012
|
+
candidates.push(import_node_path6.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
|
|
4013
|
+
candidates.push(import_node_path6.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
|
|
4014
|
+
candidates.push(import_node_path6.default.resolve(process.cwd(), "native", `${bin}.node`));
|
|
4015
|
+
candidates.push(import_node_path6.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
|
|
4016
|
+
candidates.push(import_node_path6.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
|
|
4017
|
+
candidates.push(import_node_path6.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
|
|
4018
|
+
candidates.push(import_node_path6.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
|
|
3989
4019
|
}
|
|
3990
4020
|
return Array.from(new Set(candidates));
|
|
3991
4021
|
}
|
|
3992
4022
|
function resolveRuntimeDir(dir, importMetaUrl2) {
|
|
3993
|
-
if (dir) return
|
|
4023
|
+
if (dir) return import_node_path6.default.resolve(dir);
|
|
3994
4024
|
try {
|
|
3995
|
-
return
|
|
4025
|
+
return import_node_path6.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl2));
|
|
3996
4026
|
} catch {
|
|
3997
4027
|
return process.cwd();
|
|
3998
4028
|
}
|
|
@@ -4006,14 +4036,14 @@ function formatErrorMessage(error) {
|
|
|
4006
4036
|
if (error instanceof Error) return error.message;
|
|
4007
4037
|
return String(error);
|
|
4008
4038
|
}
|
|
4009
|
-
var import_node_crypto,
|
|
4039
|
+
var import_node_crypto, import_node_fs6, import_node_path6, import_node_url, import_node_module5, TwError, _require3, LRUCache;
|
|
4010
4040
|
var init_src2 = __esm({
|
|
4011
4041
|
"packages/domain/shared/src/index.ts"() {
|
|
4012
4042
|
"use strict";
|
|
4013
4043
|
init_cjs_shims();
|
|
4014
4044
|
import_node_crypto = require("crypto");
|
|
4015
|
-
|
|
4016
|
-
|
|
4045
|
+
import_node_fs6 = __toESM(require("fs"));
|
|
4046
|
+
import_node_path6 = __toESM(require("path"));
|
|
4017
4047
|
import_node_url = require("url");
|
|
4018
4048
|
import_node_module5 = require("module");
|
|
4019
4049
|
init_trace();
|
|
@@ -4062,8 +4092,8 @@ var init_src2 = __esm({
|
|
|
4062
4092
|
/** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
|
|
4063
4093
|
static fromZod(err) {
|
|
4064
4094
|
const first = err.issues?.[0] ?? err.errors?.[0];
|
|
4065
|
-
const
|
|
4066
|
-
const message = first ? `${
|
|
4095
|
+
const path8 = formatIssuePath(first?.path);
|
|
4096
|
+
const message = first ? `${path8}: ${first.message}` : "Schema validation failed";
|
|
4067
4097
|
return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
|
|
4068
4098
|
}
|
|
4069
4099
|
static wrap(source, code, err) {
|