veryfront 0.0.17 → 0.0.19

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/index.js CHANGED
@@ -131,6 +131,7 @@ 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";
134
135
  init_env();
135
136
  LogLevel = /* @__PURE__ */ ((LogLevel2) => {
136
137
  LogLevel2[LogLevel2["DEBUG"] = 0] = "DEBUG";
@@ -236,7 +237,6 @@ var init_build = __esm({
236
237
  var SECONDS_PER_MINUTE, MINUTES_PER_HOUR, HOURS_PER_DAY, MS_PER_SECOND, DEFAULT_LRU_MAX_ENTRIES, COMPONENT_LOADER_MAX_ENTRIES, COMPONENT_LOADER_TTL_MS, MDX_RENDERER_MAX_ENTRIES, MDX_RENDERER_TTL_MS, RENDERER_CORE_MAX_ENTRIES, RENDERER_CORE_TTL_MS, TSX_LAYOUT_MAX_ENTRIES, TSX_LAYOUT_TTL_MS, DATA_FETCHING_MAX_ENTRIES, DATA_FETCHING_TTL_MS, MDX_CACHE_TTL_PRODUCTION_MS, MDX_CACHE_TTL_DEVELOPMENT_MS, BUNDLE_CACHE_TTL_PRODUCTION_MS, BUNDLE_CACHE_TTL_DEVELOPMENT_MS, BUNDLE_MANIFEST_PROD_TTL_MS, BUNDLE_MANIFEST_DEV_TTL_MS, RSC_MANIFEST_CACHE_TTL_MS, SERVER_ACTION_DEFAULT_TTL_SEC, DENO_KV_SAFE_SIZE_LIMIT_BYTES, HTTP_CACHE_SHORT_MAX_AGE_SEC, HTTP_CACHE_MEDIUM_MAX_AGE_SEC, HTTP_CACHE_LONG_MAX_AGE_SEC, ONE_DAY_MS, CACHE_CLEANUP_INTERVAL_MS, LRU_DEFAULT_MAX_ENTRIES, LRU_DEFAULT_MAX_SIZE_BYTES, CLEANUP_INTERVAL_MULTIPLIER;
237
238
  var init_cache = __esm({
238
239
  "src/core/utils/constants/cache.ts"() {
239
- "use strict";
240
240
  SECONDS_PER_MINUTE = 60;
241
241
  MINUTES_PER_HOUR = 60;
242
242
  HOURS_PER_DAY = 24;
@@ -310,6 +310,7 @@ function getUnoCSSTailwindResetUrl() {
310
310
  var ESM_CDN_BASE, JSDELIVR_CDN_BASE, DENO_STD_BASE, REACT_VERSION_17, REACT_VERSION_18_2, REACT_VERSION_18_3, REACT_VERSION_19_RC, REACT_VERSION_19, REACT_DEFAULT_VERSION, DEFAULT_ALLOWED_CDN_HOSTS, DENO_STD_VERSION, UNOCSS_VERSION;
311
311
  var init_cdn = __esm({
312
312
  "src/core/utils/constants/cdn.ts"() {
313
+ "use strict";
313
314
  ESM_CDN_BASE = "https://esm.sh";
314
315
  JSDELIVR_CDN_BASE = "https://cdn.jsdelivr.net";
315
316
  DENO_STD_BASE = "https://deno.land";
@@ -524,16 +525,8 @@ var init_deno = __esm({
524
525
  "deno.json"() {
525
526
  deno_default = {
526
527
  name: "veryfront",
527
- version: "0.0.17",
528
+ version: "0.0.19",
528
529
  nodeModulesDir: "auto",
529
- workspace: [
530
- "./examples/async-worker-redis",
531
- "./examples/knowledge-base",
532
- "./examples/form-handling",
533
- "./examples/middleware-demo",
534
- "./examples/coding-agent",
535
- "./examples/durable-workflows"
536
- ],
537
530
  exports: {
538
531
  ".": "./src/index.ts",
539
532
  "./cli": "./src/cli/main.ts",
@@ -625,8 +618,8 @@ var init_deno = __esm({
625
618
  hast: "https://esm.sh/@types/hast@3.0.3",
626
619
  unist: "https://esm.sh/@types/unist@3.0.2",
627
620
  unified: "https://esm.sh/unified@11.0.5?dts",
628
- ai: "https://esm.sh/ai@5.0.76",
629
- "ai/react": "https://esm.sh/@ai-sdk/react@2.0.59",
621
+ ai: "https://esm.sh/ai@5.0.76?deps=react@18.3.1,react-dom@18.3.1",
622
+ "ai/react": "https://esm.sh/@ai-sdk/react@2.0.59?deps=react@18.3.1,react-dom@18.3.1",
630
623
  "@ai-sdk/openai": "https://esm.sh/@ai-sdk/openai@2.0.1",
631
624
  "@ai-sdk/anthropic": "https://esm.sh/@ai-sdk/anthropic@2.0.4",
632
625
  unocss: "https://esm.sh/unocss@0.59.0",
@@ -664,7 +657,7 @@ var init_deno = __esm({
664
657
  "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",
665
658
  "coverage:report": "deno coverage coverage --include=src/ --exclude=tests --exclude=src/**/*_test.ts --exclude=src/**/*_test.tsx --exclude=src/**/*.test.ts --exclude=src/**/*.test.tsx --lcov > coverage/lcov.info && deno run --allow-read scripts/check-coverage.ts 80",
666
659
  "coverage:html": "deno coverage coverage --include=src/ --exclude=tests --exclude=src/**/*_test.ts --exclude=src/**/*_test.tsx --exclude=src/**/*.test.ts --exclude=src/**/*.test.tsx --html",
667
- lint: "deno lint src/",
660
+ lint: "DENO_NO_PACKAGE_JSON=1 deno lint src/",
668
661
  fmt: "deno fmt src/",
669
662
  typecheck: "deno check src/index.ts src/cli/main.ts src/server/index.ts src/routing/api/index.ts src/rendering/index.ts src/platform/index.ts src/platform/adapters/index.ts src/build/index.ts src/build/production-build/index.ts src/build/transforms/index.ts src/core/config/index.ts src/core/utils/index.ts src/data/index.ts src/security/index.ts src/middleware/index.ts src/server/handlers/dev/index.ts src/server/handlers/request/api/index.ts src/rendering/cache/index.ts src/rendering/cache/stores/index.ts src/rendering/rsc/actions/index.ts src/html/index.ts src/module-system/index.ts",
670
663
  "docs:check-links": "deno run -A scripts/check-doc-links.ts",
@@ -719,13 +712,41 @@ var init_deno = __esm({
719
712
  }
720
713
  });
721
714
 
715
+ // src/platform/compat/runtime.ts
716
+ var isDeno, isNode, isBun, isCloudflare;
717
+ var init_runtime = __esm({
718
+ "src/platform/compat/runtime.ts"() {
719
+ "use strict";
720
+ isDeno = typeof Deno !== "undefined";
721
+ isNode = typeof globalThis.process !== "undefined" && globalThis.process?.versions?.node !== void 0;
722
+ isBun = typeof globalThis.Bun !== "undefined";
723
+ isCloudflare = typeof globalThis !== "undefined" && "caches" in globalThis && "WebSocketPair" in globalThis;
724
+ }
725
+ });
726
+
727
+ // src/platform/compat/process.ts
728
+ import process2 from "node:process";
729
+ function getEnv(key) {
730
+ if (isDeno) {
731
+ return process2.env(key);
732
+ }
733
+ return process2.env[key];
734
+ }
735
+ var init_process = __esm({
736
+ "src/platform/compat/process.ts"() {
737
+ "use strict";
738
+ init_runtime();
739
+ }
740
+ });
741
+
722
742
  // src/core/utils/version.ts
723
743
  var VERSION;
724
744
  var init_version = __esm({
725
745
  "src/core/utils/version.ts"() {
726
746
  "use strict";
727
747
  init_deno();
728
- VERSION = typeof deno_default.version === "string" ? deno_default.version : "0.0.0";
748
+ init_process();
749
+ VERSION = getEnv("VERYFRONT_VERSION") || (typeof deno_default.version === "string" ? deno_default.version : "0.0.0");
729
750
  }
730
751
  });
731
752
 
@@ -914,6 +935,7 @@ function fromBase64Url(encoded) {
914
935
  }
915
936
  var init_path_utils = __esm({
916
937
  "src/core/utils/path-utils.ts"() {
938
+ "use strict";
917
939
  init_logger();
918
940
  }
919
941
  });
@@ -1235,33 +1257,6 @@ var init_bundle_manifest_init = __esm({
1235
1257
  }
1236
1258
  });
1237
1259
 
1238
- // src/platform/compat/runtime.ts
1239
- var isDeno, isNode, isBun, isCloudflare;
1240
- var init_runtime = __esm({
1241
- "src/platform/compat/runtime.ts"() {
1242
- "use strict";
1243
- isDeno = typeof Deno !== "undefined";
1244
- isNode = typeof globalThis.process !== "undefined" && globalThis.process?.versions?.node !== void 0;
1245
- isBun = typeof globalThis.Bun !== "undefined";
1246
- isCloudflare = typeof globalThis !== "undefined" && "caches" in globalThis && "WebSocketPair" in globalThis;
1247
- }
1248
- });
1249
-
1250
- // src/platform/compat/process.ts
1251
- import process2 from "node:process";
1252
- function getEnv(key) {
1253
- if (isDeno) {
1254
- return process2.env(key);
1255
- }
1256
- return process2.env[key];
1257
- }
1258
- var init_process = __esm({
1259
- "src/platform/compat/process.ts"() {
1260
- "use strict";
1261
- init_runtime();
1262
- }
1263
- });
1264
-
1265
1260
  // src/core/utils/feature-flags.ts
1266
1261
  function isRSCEnabled(config) {
1267
1262
  if (config?.experimental?.rsc !== void 0) {
@@ -1829,6 +1824,9 @@ var init_deno2 = __esm({
1829
1824
  async readFile(path) {
1830
1825
  return await Deno.readTextFile(path);
1831
1826
  }
1827
+ async readFileBytes(path) {
1828
+ return await Deno.readFile(path);
1829
+ }
1832
1830
  async writeFile(path, content) {
1833
1831
  await Deno.writeTextFile(path, content);
1834
1832
  }
@@ -2156,6 +2154,11 @@ var init_filesystem_adapter = __esm({
2156
2154
  const fs = await import("node:fs/promises");
2157
2155
  return await fs.readFile(path, "utf-8");
2158
2156
  }
2157
+ async readFileBytes(path) {
2158
+ const fs = await import("node:fs/promises");
2159
+ const buffer = await fs.readFile(path);
2160
+ return buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
2161
+ }
2159
2162
  async writeFile(path, content) {
2160
2163
  const fs = await import("node:fs/promises");
2161
2164
  await fs.writeFile(path, content, "utf-8");
@@ -7299,6 +7302,7 @@ __export(node_exports2, {
7299
7302
  dim: () => dim2,
7300
7303
  gray: () => gray2,
7301
7304
  green: () => green2,
7305
+ initColors: () => initColors,
7302
7306
  italic: () => italic2,
7303
7307
  magenta: () => magenta2,
7304
7308
  red: () => red2,
@@ -7308,41 +7312,53 @@ __export(node_exports2, {
7308
7312
  white: () => white2,
7309
7313
  yellow: () => yellow2
7310
7314
  });
7311
- import pc from "picocolors";
7312
- var colors2, red2, green2, yellow2, blue2, cyan2, magenta2, white2, gray2, bold2, dim2, italic2, underline2, strikethrough2, reset2;
7315
+ async function ensurePc() {
7316
+ if (pc)
7317
+ return pc;
7318
+ const picocolorsModule = ["npm:", "picocolors"].join("");
7319
+ const mod = await import(picocolorsModule);
7320
+ pc = mod.default;
7321
+ return pc;
7322
+ }
7323
+ async function initColors() {
7324
+ await ensurePc();
7325
+ }
7326
+ var pc, lazyColor, colors2, red2, green2, yellow2, blue2, cyan2, magenta2, white2, gray2, bold2, dim2, italic2, underline2, strikethrough2, reset2;
7313
7327
  var init_node3 = __esm({
7314
7328
  "src/platform/compat/console/node.ts"() {
7315
7329
  "use strict";
7330
+ pc = null;
7331
+ lazyColor = (fn) => (s) => pc?.[fn]?.(s) ?? s;
7316
7332
  colors2 = {
7317
- red: pc.red,
7318
- green: pc.green,
7319
- yellow: pc.yellow,
7320
- blue: pc.blue,
7321
- cyan: pc.cyan,
7322
- magenta: pc.magenta,
7323
- white: pc.white,
7324
- gray: pc.gray,
7325
- bold: pc.bold,
7326
- dim: pc.dim,
7327
- italic: pc.italic,
7328
- underline: pc.underline,
7329
- strikethrough: pc.strikethrough,
7330
- reset: (text2) => pc.reset(text2)
7333
+ red: lazyColor("red"),
7334
+ green: lazyColor("green"),
7335
+ yellow: lazyColor("yellow"),
7336
+ blue: lazyColor("blue"),
7337
+ cyan: lazyColor("cyan"),
7338
+ magenta: lazyColor("magenta"),
7339
+ white: lazyColor("white"),
7340
+ gray: lazyColor("gray"),
7341
+ bold: lazyColor("bold"),
7342
+ dim: lazyColor("dim"),
7343
+ italic: lazyColor("italic"),
7344
+ underline: lazyColor("underline"),
7345
+ strikethrough: lazyColor("strikethrough"),
7346
+ reset: lazyColor("reset")
7331
7347
  };
7332
- red2 = pc.red;
7333
- green2 = pc.green;
7334
- yellow2 = pc.yellow;
7335
- blue2 = pc.blue;
7336
- cyan2 = pc.cyan;
7337
- magenta2 = pc.magenta;
7338
- white2 = pc.white;
7339
- gray2 = pc.gray;
7340
- bold2 = pc.bold;
7341
- dim2 = pc.dim;
7342
- italic2 = pc.italic;
7343
- underline2 = pc.underline;
7344
- strikethrough2 = pc.strikethrough;
7345
- reset2 = (text2) => pc.reset(text2);
7348
+ red2 = lazyColor("red");
7349
+ green2 = lazyColor("green");
7350
+ yellow2 = lazyColor("yellow");
7351
+ blue2 = lazyColor("blue");
7352
+ cyan2 = lazyColor("cyan");
7353
+ magenta2 = lazyColor("magenta");
7354
+ white2 = lazyColor("white");
7355
+ gray2 = lazyColor("gray");
7356
+ bold2 = lazyColor("bold");
7357
+ dim2 = lazyColor("dim");
7358
+ italic2 = lazyColor("italic");
7359
+ underline2 = lazyColor("underline");
7360
+ strikethrough2 = lazyColor("strikethrough");
7361
+ reset2 = lazyColor("reset");
7346
7362
  }
7347
7363
  });
7348
7364
 
@@ -7456,6 +7472,11 @@ var init_filesystem_adapter2 = __esm({
7456
7472
  const file = Bun.file(path);
7457
7473
  return await file.text();
7458
7474
  }
7475
+ async readFileBytes(path) {
7476
+ const file = Bun.file(path);
7477
+ const buffer = await file.arrayBuffer();
7478
+ return new Uint8Array(buffer);
7479
+ }
7459
7480
  async writeFile(path, content) {
7460
7481
  await Bun.write(path, content);
7461
7482
  }
@@ -7833,6 +7854,16 @@ function createMockAdapter() {
7833
7854
  }
7834
7855
  return Promise.resolve(content);
7835
7856
  },
7857
+ readFileBytes: (path) => {
7858
+ const content = files.get(path);
7859
+ if (!content) {
7860
+ throw toError(createError({
7861
+ type: "file",
7862
+ message: `File not found: ${path}`
7863
+ }));
7864
+ }
7865
+ return Promise.resolve(new TextEncoder().encode(content));
7866
+ },
7836
7867
  writeFile: (path, content) => {
7837
7868
  files.set(path, content);
7838
7869
  return Promise.resolve();
@@ -8763,7 +8794,9 @@ function createHTTPPluginForMDX() {
8763
8794
  } catch (e) {
8764
8795
  clearTimeout(timeout);
8765
8796
  return {
8766
- errors: [{ text: `Failed to fetch ${args.path}: ${e instanceof Error ? e.message : String(e)}` }]
8797
+ errors: [{
8798
+ text: `Failed to fetch ${args.path}: ${e instanceof Error ? e.message : String(e)}`
8799
+ }]
8767
8800
  };
8768
8801
  }
8769
8802
  });
@@ -8776,7 +8809,12 @@ async function loadModuleESM(compiledProgramCode, context) {
8776
8809
  const adapter = await getAdapter2();
8777
8810
  if (!context.esmCacheDir) {
8778
8811
  if (IS_NODE) {
8779
- const projectCacheDir = join4(_global.process.cwd(), "node_modules", ".cache", "veryfront-mdx");
8812
+ const projectCacheDir = join4(
8813
+ _global.process.cwd(),
8814
+ "node_modules",
8815
+ ".cache",
8816
+ "veryfront-mdx"
8817
+ );
8780
8818
  await adapter.fs.mkdir(projectCacheDir, { recursive: true });
8781
8819
  context.esmCacheDir = projectCacheDir;
8782
8820
  } else {
@@ -8862,7 +8900,10 @@ ${transformed}`;
8862
8900
  rendererLogger.info(`${LOG_PREFIX_MDX_LOADER} Successfully bundled HTTP imports`);
8863
8901
  }
8864
8902
  } catch (bundleError) {
8865
- rendererLogger.warn(`${LOG_PREFIX_MDX_LOADER} Failed to bundle HTTP imports, falling back to original code`, bundleError);
8903
+ rendererLogger.warn(
8904
+ `${LOG_PREFIX_MDX_LOADER} Failed to bundle HTTP imports, falling back to original code`,
8905
+ bundleError
8906
+ );
8866
8907
  } finally {
8867
8908
  try {
8868
8909
  const fsAny = adapter.fs;
@@ -9405,13 +9446,11 @@ init_utils();
9405
9446
  // src/platform/compat/path-helper.ts
9406
9447
  import nodePath from "node:path";
9407
9448
  var pathMod = null;
9408
- var denoPathPromise = null;
9409
9449
  if (typeof Deno === "undefined") {
9410
9450
  pathMod = nodePath;
9411
9451
  } else {
9412
- denoPathPromise = import("path").then((mod) => {
9452
+ import("path").then((mod) => {
9413
9453
  pathMod = mod;
9414
- return pathMod;
9415
9454
  });
9416
9455
  }
9417
9456
  var sep = nodePath.sep;
@@ -9813,12 +9852,15 @@ var TracingManager = class {
9813
9852
  }
9814
9853
  }
9815
9854
  async initializeTracer(config) {
9816
- const api = await import("@opentelemetry/api");
9855
+ const otelApiModule = ["npm:@opentelemetry/", "api@1"].join("");
9856
+ const api = await import(otelApiModule);
9817
9857
  this.state.api = api;
9818
9858
  this.state.tracer = api.trace.getTracer(config.serviceName || "veryfront", "0.1.0");
9819
- const { W3CTraceContextPropagator } = await import("@opentelemetry/core");
9820
- this.state.propagator = new W3CTraceContextPropagator();
9821
- api.propagation.setGlobalPropagator(this.state.propagator);
9859
+ const otelCoreModule = ["npm:@opentelemetry/", "core@1"].join("");
9860
+ const { W3CTraceContextPropagator } = await import(otelCoreModule);
9861
+ const propagator = new W3CTraceContextPropagator();
9862
+ this.state.propagator = propagator;
9863
+ api.propagation.setGlobalPropagator(propagator);
9822
9864
  if (this.state.api && this.state.tracer) {
9823
9865
  this.spanOps = new SpanOperations(this.state.api, this.state.tracer);
9824
9866
  }
@@ -11148,7 +11190,9 @@ var ResponseBuilder = class {
11148
11190
  this.stream = stream;
11149
11191
  }
11150
11192
  };
11151
- setResponseBuilderClass(ResponseBuilder);
11193
+ setResponseBuilderClass(
11194
+ ResponseBuilder
11195
+ );
11152
11196
 
11153
11197
  // src/security/http/base-handler.ts
11154
11198
  init_utils();