veryfront 0.0.31 → 0.0.32
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/ai/dev.js +9 -3
- package/dist/ai/dev.js.map +2 -2
- package/dist/ai/index.js +129 -116
- package/dist/ai/index.js.map +4 -4
- package/dist/cli.js +471 -310
- package/dist/components.js +62 -29
- package/dist/components.js.map +3 -3
- package/dist/config.js +5 -4
- package/dist/config.js.map +4 -4
- package/dist/data.js +21 -11
- package/dist/data.js.map +4 -4
- package/dist/index.js +113 -61
- package/dist/index.js.map +3 -3
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -131,7 +131,6 @@ function __loggerResetForTests(options = {}) {
|
|
|
131
131
|
var LogLevel, originalConsole, cachedLogLevel, ConsoleLogger, getDefaultLevel, trackedLoggers, cliLogger, serverLogger, rendererLogger, bundlerLogger, agentLogger, logger;
|
|
132
132
|
var init_logger = __esm({
|
|
133
133
|
"src/core/utils/logger/logger.ts"() {
|
|
134
|
-
"use strict";
|
|
135
134
|
init_env();
|
|
136
135
|
LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
137
136
|
LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
|
|
@@ -330,7 +329,6 @@ var init_cdn = __esm({
|
|
|
330
329
|
var HASH_SEED_DJB2, HASH_SEED_FNV1A;
|
|
331
330
|
var init_hash = __esm({
|
|
332
331
|
"src/core/utils/constants/hash.ts"() {
|
|
333
|
-
"use strict";
|
|
334
332
|
HASH_SEED_DJB2 = 5381;
|
|
335
333
|
HASH_SEED_FNV1A = 2166136261;
|
|
336
334
|
}
|
|
@@ -340,7 +338,6 @@ var init_hash = __esm({
|
|
|
340
338
|
var KB_IN_BYTES, HTTP_MODULE_FETCH_TIMEOUT_MS, HMR_RECONNECT_DELAY_MS, HMR_RELOAD_DELAY_MS, HMR_FILE_WATCHER_DEBOUNCE_MS, HMR_KEEP_ALIVE_INTERVAL_MS, DASHBOARD_RECONNECT_DELAY_MS, SERVER_FUNCTION_DEFAULT_TIMEOUT_MS, PREFETCH_MAX_SIZE_BYTES, PREFETCH_DEFAULT_TIMEOUT_MS, PREFETCH_DEFAULT_DELAY_MS, HTTP_OK, HTTP_NO_CONTENT, HTTP_CREATED, HTTP_REDIRECT_FOUND, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST, HTTP_UNAUTHORIZED, HTTP_FORBIDDEN, HTTP_NOT_FOUND, HTTP_METHOD_NOT_ALLOWED, HTTP_GONE, HTTP_PAYLOAD_TOO_LARGE, HTTP_URI_TOO_LONG, HTTP_TOO_MANY_REQUESTS, HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE, HTTP_SERVER_ERROR, HTTP_INTERNAL_SERVER_ERROR, HTTP_BAD_GATEWAY, HTTP_NOT_IMPLEMENTED, HTTP_UNAVAILABLE, HTTP_NETWORK_CONNECT_TIMEOUT, HTTP_STATUS_SUCCESS_MIN, HTTP_STATUS_REDIRECT_MIN, HTTP_STATUS_CLIENT_ERROR_MIN, HTTP_STATUS_SERVER_ERROR_MIN, HTTP_CONTENT_TYPES, MS_PER_MINUTE, HTTP_CONTENT_TYPE_IMAGE_PNG, HTTP_CONTENT_TYPE_IMAGE_JPEG, HTTP_CONTENT_TYPE_IMAGE_WEBP, HTTP_CONTENT_TYPE_IMAGE_AVIF, HTTP_CONTENT_TYPE_IMAGE_SVG, HTTP_CONTENT_TYPE_IMAGE_GIF, HTTP_CONTENT_TYPE_IMAGE_ICO;
|
|
341
339
|
var init_http = __esm({
|
|
342
340
|
"src/core/utils/constants/http.ts"() {
|
|
343
|
-
"use strict";
|
|
344
341
|
init_cache();
|
|
345
342
|
KB_IN_BYTES = 1024;
|
|
346
343
|
HTTP_MODULE_FETCH_TIMEOUT_MS = 2500;
|
|
@@ -444,6 +441,7 @@ var init_html = __esm({
|
|
|
444
441
|
var DEFAULT_DEV_SERVER_PORT, DEFAULT_REDIS_PORT, DEFAULT_API_SERVER_PORT, DEFAULT_PREVIEW_SERVER_PORT, DEFAULT_METRICS_PORT, BYTES_PER_KB, BYTES_PER_MB, DEFAULT_IMAGE_THUMBNAIL_SIZE, DEFAULT_IMAGE_SMALL_SIZE, DEFAULT_IMAGE_LARGE_SIZE, RESPONSIVE_IMAGE_WIDTH_XS, RESPONSIVE_IMAGE_WIDTH_SM, RESPONSIVE_IMAGE_WIDTH_MD, RESPONSIVE_IMAGE_WIDTH_LG, RESPONSIVE_IMAGE_WIDTHS, MAX_CHUNK_SIZE_KB, MIN_PORT, MAX_PORT, DEFAULT_SERVER_PORT;
|
|
445
442
|
var init_network = __esm({
|
|
446
443
|
"src/core/utils/constants/network.ts"() {
|
|
444
|
+
"use strict";
|
|
447
445
|
DEFAULT_DEV_SERVER_PORT = 3e3;
|
|
448
446
|
DEFAULT_REDIS_PORT = 6379;
|
|
449
447
|
DEFAULT_API_SERVER_PORT = 8080;
|
|
@@ -524,8 +522,15 @@ var init_deno = __esm({
|
|
|
524
522
|
"deno.json"() {
|
|
525
523
|
deno_default = {
|
|
526
524
|
name: "veryfront",
|
|
527
|
-
version: "0.0.
|
|
528
|
-
|
|
525
|
+
version: "0.0.32",
|
|
526
|
+
exclude: [
|
|
527
|
+
"npm/",
|
|
528
|
+
"dist/",
|
|
529
|
+
"coverage/",
|
|
530
|
+
"scripts/",
|
|
531
|
+
"examples/",
|
|
532
|
+
"tests/"
|
|
533
|
+
],
|
|
529
534
|
exports: {
|
|
530
535
|
".": "./src/index.ts",
|
|
531
536
|
"./cli": "./src/cli/main.ts",
|
|
@@ -619,11 +624,13 @@ var init_deno = __esm({
|
|
|
619
624
|
unified: "https://esm.sh/unified@11.0.5?dts",
|
|
620
625
|
ai: "https://esm.sh/ai@5.0.76?deps=react@18.3.1,react-dom@18.3.1",
|
|
621
626
|
"ai/react": "https://esm.sh/@ai-sdk/react@2.0.59?deps=react@18.3.1,react-dom@18.3.1",
|
|
627
|
+
"@ai-sdk/react": "https://esm.sh/@ai-sdk/react@2.0.59?deps=react@18.3.1,react-dom@18.3.1",
|
|
622
628
|
"@ai-sdk/openai": "https://esm.sh/@ai-sdk/openai@2.0.1",
|
|
623
629
|
"@ai-sdk/anthropic": "https://esm.sh/@ai-sdk/anthropic@2.0.4",
|
|
624
630
|
unocss: "https://esm.sh/unocss@0.59.0",
|
|
625
631
|
"@unocss/core": "https://esm.sh/@unocss/core@0.59.0",
|
|
626
|
-
"@unocss/preset-wind": "https://esm.sh/@unocss/preset-wind@0.59.0"
|
|
632
|
+
"@unocss/preset-wind": "https://esm.sh/@unocss/preset-wind@0.59.0",
|
|
633
|
+
redis: "npm:redis"
|
|
627
634
|
},
|
|
628
635
|
compilerOptions: {
|
|
629
636
|
jsx: "react-jsx",
|
|
@@ -649,8 +656,6 @@ var init_deno = __esm({
|
|
|
649
656
|
test: "DENO_JOBS=1 deno test --parallel --fail-fast --allow-all --unstable-worker-options --unstable-net",
|
|
650
657
|
"test:unit": "DENO_JOBS=1 deno test --parallel --allow-all --v8-flags=--max-old-space-size=8192 --ignore=tests --unstable-worker-options --unstable-net",
|
|
651
658
|
"test:integration": "DENO_JOBS=1 deno test --parallel --fail-fast --allow-all tests --unstable-worker-options --unstable-net",
|
|
652
|
-
"test:batches": "deno run --allow-all scripts/test-batches.ts",
|
|
653
|
-
"test:unsafe": "DENO_JOBS=1 deno test --parallel --fail-fast --allow-all --coverage=coverage --unstable-worker-options --unstable-net",
|
|
654
659
|
"test:coverage": "rm -rf coverage && DENO_JOBS=1 deno test --parallel --fail-fast --allow-all --coverage=coverage --unstable-worker-options --unstable-net || exit 1",
|
|
655
660
|
"test:coverage:unit": "rm -rf coverage && DENO_JOBS=1 deno test --parallel --fail-fast --allow-all --coverage=coverage --ignore=tests --unstable-worker-options --unstable-net || exit 1",
|
|
656
661
|
"test:coverage:integration": "rm -rf coverage && DENO_JOBS=1 deno test --parallel --fail-fast --allow-all --coverage=coverage tests --unstable-worker-options --unstable-net || exit 1",
|
|
@@ -664,6 +669,7 @@ var init_deno = __esm({
|
|
|
664
669
|
"lint:ban-deep-imports": "deno run --allow-read scripts/ban-deep-imports.ts",
|
|
665
670
|
"lint:ban-internal-root-imports": "deno run --allow-read scripts/ban-internal-root-imports.ts",
|
|
666
671
|
"lint:check-awaits": "deno run --allow-read scripts/check-unawaited-promises.ts",
|
|
672
|
+
"lint:platform": "deno run --allow-read scripts/lint-platform-agnostic.ts",
|
|
667
673
|
"check:circular": "deno run -A jsr:@cunarist/deno-circular-deps src/index.ts"
|
|
668
674
|
},
|
|
669
675
|
lint: {
|
|
@@ -724,17 +730,61 @@ var init_runtime = __esm({
|
|
|
724
730
|
});
|
|
725
731
|
|
|
726
732
|
// src/platform/compat/process.ts
|
|
727
|
-
|
|
733
|
+
function cwd() {
|
|
734
|
+
if (isDeno) {
|
|
735
|
+
return process.cwd();
|
|
736
|
+
}
|
|
737
|
+
if (hasNodeProcess2) {
|
|
738
|
+
return nodeProcess.cwd();
|
|
739
|
+
}
|
|
740
|
+
throw new Error("cwd() is not supported in this runtime");
|
|
741
|
+
}
|
|
728
742
|
function getEnv(key) {
|
|
729
743
|
if (isDeno) {
|
|
730
|
-
return
|
|
744
|
+
return process.env(key);
|
|
745
|
+
}
|
|
746
|
+
if (hasNodeProcess2) {
|
|
747
|
+
return nodeProcess.env[key];
|
|
748
|
+
}
|
|
749
|
+
return void 0;
|
|
750
|
+
}
|
|
751
|
+
function memoryUsage() {
|
|
752
|
+
if (isDeno) {
|
|
753
|
+
const usage2 = Deno.memoryUsage();
|
|
754
|
+
return {
|
|
755
|
+
rss: usage2.rss,
|
|
756
|
+
heapTotal: usage2.heapTotal,
|
|
757
|
+
heapUsed: usage2.heapUsed,
|
|
758
|
+
external: usage2.external
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
if (!hasNodeProcess2) {
|
|
762
|
+
throw new Error("memoryUsage() is not supported in this runtime");
|
|
763
|
+
}
|
|
764
|
+
const usage = nodeProcess.memoryUsage();
|
|
765
|
+
return {
|
|
766
|
+
rss: usage.rss,
|
|
767
|
+
heapTotal: usage.heapTotal,
|
|
768
|
+
heapUsed: usage.heapUsed,
|
|
769
|
+
external: usage.external || 0
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
function execPath() {
|
|
773
|
+
if (isDeno) {
|
|
774
|
+
return Deno.execPath();
|
|
731
775
|
}
|
|
732
|
-
|
|
776
|
+
if (hasNodeProcess2) {
|
|
777
|
+
return nodeProcess.execPath;
|
|
778
|
+
}
|
|
779
|
+
return "";
|
|
733
780
|
}
|
|
781
|
+
var nodeProcess, hasNodeProcess2;
|
|
734
782
|
var init_process = __esm({
|
|
735
783
|
"src/platform/compat/process.ts"() {
|
|
736
784
|
"use strict";
|
|
737
785
|
init_runtime();
|
|
786
|
+
nodeProcess = globalThis.process;
|
|
787
|
+
hasNodeProcess2 = !!nodeProcess?.versions?.node;
|
|
738
788
|
}
|
|
739
789
|
});
|
|
740
790
|
|
|
@@ -934,6 +984,7 @@ function fromBase64Url(encoded) {
|
|
|
934
984
|
}
|
|
935
985
|
var init_path_utils = __esm({
|
|
936
986
|
"src/core/utils/path-utils.ts"() {
|
|
987
|
+
"use strict";
|
|
937
988
|
init_logger();
|
|
938
989
|
}
|
|
939
990
|
});
|
|
@@ -1271,13 +1322,11 @@ var init_feature_flags = __esm({
|
|
|
1271
1322
|
|
|
1272
1323
|
// src/core/utils/platform.ts
|
|
1273
1324
|
function isCompiledBinary() {
|
|
1274
|
-
|
|
1275
|
-
const hasExecPath = hasDeno && typeof Deno.execPath === "function";
|
|
1276
|
-
if (!hasExecPath)
|
|
1325
|
+
if (!isDeno)
|
|
1277
1326
|
return false;
|
|
1278
1327
|
try {
|
|
1279
|
-
const
|
|
1280
|
-
return
|
|
1328
|
+
const path = execPath();
|
|
1329
|
+
return path.includes("veryfront");
|
|
1281
1330
|
} catch {
|
|
1282
1331
|
return false;
|
|
1283
1332
|
}
|
|
@@ -1285,6 +1334,8 @@ function isCompiledBinary() {
|
|
|
1285
1334
|
var init_platform = __esm({
|
|
1286
1335
|
"src/core/utils/platform.ts"() {
|
|
1287
1336
|
"use strict";
|
|
1337
|
+
init_runtime();
|
|
1338
|
+
init_process();
|
|
1288
1339
|
}
|
|
1289
1340
|
});
|
|
1290
1341
|
|
|
@@ -1674,7 +1725,7 @@ var init_schema = __esm({
|
|
|
1674
1725
|
});
|
|
1675
1726
|
|
|
1676
1727
|
// src/core/config/loader.ts
|
|
1677
|
-
import { join } from "path";
|
|
1728
|
+
import { join } from "node:path";
|
|
1678
1729
|
function getDefaultImportMapForConfig() {
|
|
1679
1730
|
return { imports: getReactImportMap(REACT_DEFAULT_VERSION) };
|
|
1680
1731
|
}
|
|
@@ -2267,20 +2318,20 @@ var init_filesystem_adapter = __esm({
|
|
|
2267
2318
|
});
|
|
2268
2319
|
|
|
2269
2320
|
// src/platform/adapters/node/environment-adapter.ts
|
|
2270
|
-
import
|
|
2321
|
+
import process2 from "node:process";
|
|
2271
2322
|
var NodeEnvironmentAdapter;
|
|
2272
2323
|
var init_environment_adapter = __esm({
|
|
2273
2324
|
"src/platform/adapters/node/environment-adapter.ts"() {
|
|
2274
2325
|
"use strict";
|
|
2275
2326
|
NodeEnvironmentAdapter = class {
|
|
2276
2327
|
get(key) {
|
|
2277
|
-
return
|
|
2328
|
+
return process2.env[key];
|
|
2278
2329
|
}
|
|
2279
2330
|
set(key, value) {
|
|
2280
|
-
|
|
2331
|
+
process2.env[key] = value;
|
|
2281
2332
|
}
|
|
2282
2333
|
toObject() {
|
|
2283
|
-
return { ...
|
|
2334
|
+
return { ...process2.env };
|
|
2284
2335
|
}
|
|
2285
2336
|
};
|
|
2286
2337
|
}
|
|
@@ -8075,7 +8126,9 @@ var init_registry = __esm({
|
|
|
8075
8126
|
"Cloudflare Workers detected but requires manual initialization. Use: await runtime.set(createCloudflareAdapter(env))"
|
|
8076
8127
|
);
|
|
8077
8128
|
}
|
|
8078
|
-
|
|
8129
|
+
throw new Error(
|
|
8130
|
+
"Unsupported runtime detected. Supported runtimes: deno, node, bun. For Cloudflare Workers, call runtime.set(createCloudflareAdapter(env))."
|
|
8131
|
+
);
|
|
8079
8132
|
}
|
|
8080
8133
|
/**
|
|
8081
8134
|
* Initialize the adapter
|
|
@@ -8102,7 +8155,6 @@ __export(detect_exports, {
|
|
|
8102
8155
|
nodeAdapter: () => nodeAdapter,
|
|
8103
8156
|
runtime: () => runtime
|
|
8104
8157
|
});
|
|
8105
|
-
import process4 from "node:process";
|
|
8106
8158
|
function isDeno2(global) {
|
|
8107
8159
|
return "Deno" in global && typeof global.Deno === "object";
|
|
8108
8160
|
}
|
|
@@ -8119,7 +8171,8 @@ function detectRuntime() {
|
|
|
8119
8171
|
if (isBun2(globalThis)) {
|
|
8120
8172
|
return "bun";
|
|
8121
8173
|
}
|
|
8122
|
-
|
|
8174
|
+
const globalProcess = globalThis.process;
|
|
8175
|
+
if (globalProcess?.versions?.node) {
|
|
8123
8176
|
return "node";
|
|
8124
8177
|
}
|
|
8125
8178
|
if (isCloudflare2(globalThis)) {
|
|
@@ -8650,7 +8703,7 @@ function getCacheNamespace() {
|
|
|
8650
8703
|
// src/module-system/import-map/loader.ts
|
|
8651
8704
|
init_utils();
|
|
8652
8705
|
init_config();
|
|
8653
|
-
import { dirname, join as join2 } from "path";
|
|
8706
|
+
import { dirname, join as join2 } from "node:path";
|
|
8654
8707
|
|
|
8655
8708
|
// src/module-system/import-map/default-import-map.ts
|
|
8656
8709
|
init_utils();
|
|
@@ -8721,9 +8774,9 @@ function transformImportsWithMap(code, importMap, scope, options) {
|
|
|
8721
8774
|
}
|
|
8722
8775
|
|
|
8723
8776
|
// src/build/transforms/mdx/esm-module-loader.ts
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8777
|
+
init_runtime();
|
|
8778
|
+
init_process();
|
|
8779
|
+
import { join as join4 } from "node:path";
|
|
8727
8780
|
var LOG_PREFIX_MDX_LOADER = "[mdx-loader]";
|
|
8728
8781
|
var LOG_PREFIX_MDX_RENDERER = "[mdx-renderer]";
|
|
8729
8782
|
var JSX_IMPORT_PATTERN = /import\s+([^'"]+)\s+from\s+['"]file:\/\/([^'"]+\.(jsx|tsx))['"];?/g;
|
|
@@ -8806,9 +8859,9 @@ async function loadModuleESM(compiledProgramCode, context) {
|
|
|
8806
8859
|
const { getAdapter: getAdapter2 } = await Promise.resolve().then(() => (init_detect(), detect_exports));
|
|
8807
8860
|
const adapter = await getAdapter2();
|
|
8808
8861
|
if (!context.esmCacheDir) {
|
|
8809
|
-
if (
|
|
8862
|
+
if (isNode) {
|
|
8810
8863
|
const projectCacheDir = join4(
|
|
8811
|
-
|
|
8864
|
+
cwd(),
|
|
8812
8865
|
"node_modules",
|
|
8813
8866
|
".cache",
|
|
8814
8867
|
"veryfront-mdx"
|
|
@@ -8820,7 +8873,7 @@ async function loadModuleESM(compiledProgramCode, context) {
|
|
|
8820
8873
|
}
|
|
8821
8874
|
}
|
|
8822
8875
|
let rewritten;
|
|
8823
|
-
if (
|
|
8876
|
+
if (isNode) {
|
|
8824
8877
|
rewritten = compiledProgramCode;
|
|
8825
8878
|
} else {
|
|
8826
8879
|
rewritten = transformImportsWithMap(
|
|
@@ -8875,7 +8928,7 @@ ${transformed}`;
|
|
|
8875
8928
|
if (/\bconst\s+MDXLayout\b/.test(rewritten) && !/export\s+\{[^}]*MDXLayout/.test(rewritten)) {
|
|
8876
8929
|
rewritten += "\nexport { MDXLayout as __vfLayout };\n";
|
|
8877
8930
|
}
|
|
8878
|
-
if (
|
|
8931
|
+
if (isNode && HTTP_IMPORT_PATTERN.test(rewritten)) {
|
|
8879
8932
|
rendererLogger.info(`${LOG_PREFIX_MDX_LOADER} Bundling HTTP imports via esbuild for Node.js`);
|
|
8880
8933
|
const { build: build2 } = await import("esbuild/mod.js");
|
|
8881
8934
|
const tempSourcePath = join4(context.esmCacheDir, `temp-${hashString(rewritten)}.mjs`);
|
|
@@ -9417,6 +9470,7 @@ import { jsx as jsx9 } from "react/jsx-runtime";
|
|
|
9417
9470
|
|
|
9418
9471
|
// src/data/data-fetching-cache.ts
|
|
9419
9472
|
init_cache();
|
|
9473
|
+
init_process();
|
|
9420
9474
|
|
|
9421
9475
|
// src/data/server-data-fetcher.ts
|
|
9422
9476
|
init_utils();
|
|
@@ -9447,7 +9501,7 @@ var pathMod = null;
|
|
|
9447
9501
|
if (typeof Deno === "undefined") {
|
|
9448
9502
|
pathMod = nodePath;
|
|
9449
9503
|
} else {
|
|
9450
|
-
import("path").then((mod) => {
|
|
9504
|
+
import("node:path").then((mod) => {
|
|
9451
9505
|
pathMod = mod;
|
|
9452
9506
|
});
|
|
9453
9507
|
}
|
|
@@ -9474,7 +9528,7 @@ init_utils();
|
|
|
9474
9528
|
// src/routing/api/handler.ts
|
|
9475
9529
|
init_utils();
|
|
9476
9530
|
init_config();
|
|
9477
|
-
import { join as join7 } from "path";
|
|
9531
|
+
import { join as join7 } from "node:path";
|
|
9478
9532
|
init_veryfront_error();
|
|
9479
9533
|
|
|
9480
9534
|
// src/http/responses.ts
|
|
@@ -9610,6 +9664,7 @@ init_logger();
|
|
|
9610
9664
|
init_utils();
|
|
9611
9665
|
|
|
9612
9666
|
// src/observability/tracing/config.ts
|
|
9667
|
+
init_process();
|
|
9613
9668
|
var DEFAULT_CONFIG2 = {
|
|
9614
9669
|
enabled: false,
|
|
9615
9670
|
exporter: "console",
|
|
@@ -9645,13 +9700,10 @@ function applyEnvFromAdapter(config, envAdapter) {
|
|
|
9645
9700
|
}
|
|
9646
9701
|
function applyEnvFromDeno(config) {
|
|
9647
9702
|
try {
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
config.serviceName = denoEnv.get("OTEL_SERVICE_NAME") || config.serviceName;
|
|
9653
|
-
config.endpoint = denoEnv.get("OTEL_EXPORTER_OTLP_ENDPOINT") || denoEnv.get("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT") || config.endpoint;
|
|
9654
|
-
const exporterType = denoEnv.get("OTEL_TRACES_EXPORTER");
|
|
9703
|
+
config.enabled = getEnv("OTEL_TRACES_ENABLED") === "true" || getEnv("VERYFRONT_OTEL") === "1" || config.enabled;
|
|
9704
|
+
config.serviceName = getEnv("OTEL_SERVICE_NAME") || config.serviceName;
|
|
9705
|
+
config.endpoint = getEnv("OTEL_EXPORTER_OTLP_ENDPOINT") || getEnv("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT") || config.endpoint;
|
|
9706
|
+
const exporterType = getEnv("OTEL_TRACES_EXPORTER");
|
|
9655
9707
|
if (isValidExporter(exporterType)) {
|
|
9656
9708
|
config.exporter = exporterType;
|
|
9657
9709
|
}
|
|
@@ -9894,6 +9946,8 @@ var tracingManager = new TracingManager();
|
|
|
9894
9946
|
init_utils();
|
|
9895
9947
|
|
|
9896
9948
|
// src/observability/metrics/config.ts
|
|
9949
|
+
init_process();
|
|
9950
|
+
init_process();
|
|
9897
9951
|
var DEFAULT_METRICS_COLLECT_INTERVAL_MS2 = 6e4;
|
|
9898
9952
|
var DEFAULT_CONFIG3 = {
|
|
9899
9953
|
enabled: false,
|
|
@@ -9920,14 +9974,11 @@ function loadConfig2(config, adapter) {
|
|
|
9920
9974
|
}
|
|
9921
9975
|
} else {
|
|
9922
9976
|
try {
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
if (exporterType === "prometheus" || exporterType === "otlp" || exporterType === "console") {
|
|
9929
|
-
finalConfig.exporter = exporterType;
|
|
9930
|
-
}
|
|
9977
|
+
finalConfig.enabled = getEnv("OTEL_METRICS_ENABLED") === "true" || getEnv("VERYFRONT_OTEL") === "1" || finalConfig.enabled;
|
|
9978
|
+
finalConfig.endpoint = getEnv("OTEL_EXPORTER_OTLP_ENDPOINT") || getEnv("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT") || finalConfig.endpoint;
|
|
9979
|
+
const exporterType = getEnv("OTEL_METRICS_EXPORTER");
|
|
9980
|
+
if (exporterType === "prometheus" || exporterType === "otlp" || exporterType === "console") {
|
|
9981
|
+
finalConfig.exporter = exporterType;
|
|
9931
9982
|
}
|
|
9932
9983
|
} catch {
|
|
9933
9984
|
}
|
|
@@ -9936,10 +9987,7 @@ function loadConfig2(config, adapter) {
|
|
|
9936
9987
|
}
|
|
9937
9988
|
function getMemoryUsage() {
|
|
9938
9989
|
try {
|
|
9939
|
-
|
|
9940
|
-
return process.memoryUsage();
|
|
9941
|
-
}
|
|
9942
|
-
return null;
|
|
9990
|
+
return memoryUsage();
|
|
9943
9991
|
} catch {
|
|
9944
9992
|
return null;
|
|
9945
9993
|
}
|
|
@@ -10112,9 +10160,9 @@ function createMemoryInstruments(meter, config) {
|
|
|
10112
10160
|
}
|
|
10113
10161
|
);
|
|
10114
10162
|
memoryUsageGauge.addCallback((result) => {
|
|
10115
|
-
const
|
|
10116
|
-
if (
|
|
10117
|
-
result.observe(
|
|
10163
|
+
const memoryUsage2 = getMemoryUsage();
|
|
10164
|
+
if (memoryUsage2) {
|
|
10165
|
+
result.observe(memoryUsage2.rss);
|
|
10118
10166
|
}
|
|
10119
10167
|
});
|
|
10120
10168
|
const heapUsageGauge = meter.createObservableGauge(
|
|
@@ -10125,9 +10173,9 @@ function createMemoryInstruments(meter, config) {
|
|
|
10125
10173
|
}
|
|
10126
10174
|
);
|
|
10127
10175
|
heapUsageGauge.addCallback((result) => {
|
|
10128
|
-
const
|
|
10129
|
-
if (
|
|
10130
|
-
result.observe(
|
|
10176
|
+
const memoryUsage2 = getMemoryUsage();
|
|
10177
|
+
if (memoryUsage2) {
|
|
10178
|
+
result.observe(memoryUsage2.heapUsed);
|
|
10131
10179
|
}
|
|
10132
10180
|
});
|
|
10133
10181
|
return {
|
|
@@ -10770,6 +10818,7 @@ function applyCORSHeadersSync(options) {
|
|
|
10770
10818
|
|
|
10771
10819
|
// src/security/http/cors/constants.ts
|
|
10772
10820
|
init_config();
|
|
10821
|
+
init_process();
|
|
10773
10822
|
|
|
10774
10823
|
// src/security/http/cors/preflight.ts
|
|
10775
10824
|
init_logger();
|
|
@@ -11560,12 +11609,15 @@ init_veryfront_error();
|
|
|
11560
11609
|
init_veryfront_error();
|
|
11561
11610
|
init_runtime();
|
|
11562
11611
|
|
|
11612
|
+
// src/routing/api/module-loader/loader.ts
|
|
11613
|
+
init_runtime();
|
|
11614
|
+
|
|
11563
11615
|
// src/routing/api/route-discovery.ts
|
|
11564
|
-
import { relative } from "path";
|
|
11616
|
+
import { relative } from "node:path";
|
|
11565
11617
|
|
|
11566
11618
|
// src/core/utils/file-discovery.ts
|
|
11567
11619
|
init_deno2();
|
|
11568
|
-
import { join as join6 } from "path";
|
|
11620
|
+
import { join as join6 } from "node:path";
|
|
11569
11621
|
|
|
11570
11622
|
// src/routing/api/route-executor.ts
|
|
11571
11623
|
init_veryfront_error();
|