veryfront 0.0.17 → 0.0.21

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.
@@ -525,16 +525,8 @@ var init_deno = __esm({
525
525
  "deno.json"() {
526
526
  deno_default = {
527
527
  name: "veryfront",
528
- version: "0.0.17",
528
+ version: "0.0.21",
529
529
  nodeModulesDir: "auto",
530
- workspace: [
531
- "./examples/async-worker-redis",
532
- "./examples/knowledge-base",
533
- "./examples/form-handling",
534
- "./examples/middleware-demo",
535
- "./examples/coding-agent",
536
- "./examples/durable-workflows"
537
- ],
538
530
  exports: {
539
531
  ".": "./src/index.ts",
540
532
  "./cli": "./src/cli/main.ts",
@@ -626,8 +618,8 @@ var init_deno = __esm({
626
618
  hast: "https://esm.sh/@types/hast@3.0.3",
627
619
  unist: "https://esm.sh/@types/unist@3.0.2",
628
620
  unified: "https://esm.sh/unified@11.0.5?dts",
629
- ai: "https://esm.sh/ai@5.0.76",
630
- "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",
631
623
  "@ai-sdk/openai": "https://esm.sh/@ai-sdk/openai@2.0.1",
632
624
  "@ai-sdk/anthropic": "https://esm.sh/@ai-sdk/anthropic@2.0.4",
633
625
  unocss: "https://esm.sh/unocss@0.59.0",
@@ -665,7 +657,7 @@ var init_deno = __esm({
665
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",
666
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",
667
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",
668
- lint: "deno lint src/",
660
+ lint: "DENO_NO_PACKAGE_JSON=1 deno lint src/",
669
661
  fmt: "deno fmt src/",
670
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",
671
663
  "docs:check-links": "deno run -A scripts/check-doc-links.ts",
@@ -720,13 +712,41 @@ var init_deno = __esm({
720
712
  }
721
713
  });
722
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
+
723
742
  // src/core/utils/version.ts
724
743
  var VERSION;
725
744
  var init_version = __esm({
726
745
  "src/core/utils/version.ts"() {
727
746
  "use strict";
728
747
  init_deno();
729
- 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");
730
750
  }
731
751
  });
732
752
 
@@ -1237,33 +1257,6 @@ var init_bundle_manifest_init = __esm({
1237
1257
  }
1238
1258
  });
1239
1259
 
1240
- // src/platform/compat/runtime.ts
1241
- var isDeno, isNode, isBun, isCloudflare;
1242
- var init_runtime = __esm({
1243
- "src/platform/compat/runtime.ts"() {
1244
- "use strict";
1245
- isDeno = typeof Deno !== "undefined";
1246
- isNode = typeof globalThis.process !== "undefined" && globalThis.process?.versions?.node !== void 0;
1247
- isBun = typeof globalThis.Bun !== "undefined";
1248
- isCloudflare = typeof globalThis !== "undefined" && "caches" in globalThis && "WebSocketPair" in globalThis;
1249
- }
1250
- });
1251
-
1252
- // src/platform/compat/process.ts
1253
- import process2 from "node:process";
1254
- function getEnv(key) {
1255
- if (isDeno) {
1256
- return process2.env(key);
1257
- }
1258
- return process2.env[key];
1259
- }
1260
- var init_process = __esm({
1261
- "src/platform/compat/process.ts"() {
1262
- "use strict";
1263
- init_runtime();
1264
- }
1265
- });
1266
-
1267
1260
  // src/core/utils/feature-flags.ts
1268
1261
  function isRSCEnabled(config) {
1269
1262
  if (config?.experimental?.rsc !== void 0) {
@@ -1798,6 +1791,9 @@ var init_deno2 = __esm({
1798
1791
  async readFile(path) {
1799
1792
  return await Deno.readTextFile(path);
1800
1793
  }
1794
+ async readFileBytes(path) {
1795
+ return await Deno.readFile(path);
1796
+ }
1801
1797
  async writeFile(path, content) {
1802
1798
  await Deno.writeTextFile(path, content);
1803
1799
  }
@@ -2125,6 +2121,11 @@ var init_filesystem_adapter = __esm({
2125
2121
  const fs = await import("node:fs/promises");
2126
2122
  return await fs.readFile(path, "utf-8");
2127
2123
  }
2124
+ async readFileBytes(path) {
2125
+ const fs = await import("node:fs/promises");
2126
+ const buffer = await fs.readFile(path);
2127
+ return buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
2128
+ }
2128
2129
  async writeFile(path, content) {
2129
2130
  const fs = await import("node:fs/promises");
2130
2131
  await fs.writeFile(path, content, "utf-8");
@@ -7268,6 +7269,7 @@ __export(node_exports2, {
7268
7269
  dim: () => dim2,
7269
7270
  gray: () => gray2,
7270
7271
  green: () => green2,
7272
+ initColors: () => initColors,
7271
7273
  italic: () => italic2,
7272
7274
  magenta: () => magenta2,
7273
7275
  red: () => red2,
@@ -7277,41 +7279,53 @@ __export(node_exports2, {
7277
7279
  white: () => white2,
7278
7280
  yellow: () => yellow2
7279
7281
  });
7280
- import pc from "picocolors";
7281
- var colors2, red2, green2, yellow2, blue2, cyan2, magenta2, white2, gray2, bold2, dim2, italic2, underline2, strikethrough2, reset2;
7282
+ async function ensurePc() {
7283
+ if (pc)
7284
+ return pc;
7285
+ const picocolorsModule = ["npm:", "picocolors"].join("");
7286
+ const mod = await import(picocolorsModule);
7287
+ pc = mod.default;
7288
+ return pc;
7289
+ }
7290
+ async function initColors() {
7291
+ await ensurePc();
7292
+ }
7293
+ var pc, lazyColor, colors2, red2, green2, yellow2, blue2, cyan2, magenta2, white2, gray2, bold2, dim2, italic2, underline2, strikethrough2, reset2;
7282
7294
  var init_node3 = __esm({
7283
7295
  "src/platform/compat/console/node.ts"() {
7284
7296
  "use strict";
7297
+ pc = null;
7298
+ lazyColor = (fn) => (s) => pc?.[fn]?.(s) ?? s;
7285
7299
  colors2 = {
7286
- red: pc.red,
7287
- green: pc.green,
7288
- yellow: pc.yellow,
7289
- blue: pc.blue,
7290
- cyan: pc.cyan,
7291
- magenta: pc.magenta,
7292
- white: pc.white,
7293
- gray: pc.gray,
7294
- bold: pc.bold,
7295
- dim: pc.dim,
7296
- italic: pc.italic,
7297
- underline: pc.underline,
7298
- strikethrough: pc.strikethrough,
7299
- reset: (text) => pc.reset(text)
7300
+ red: lazyColor("red"),
7301
+ green: lazyColor("green"),
7302
+ yellow: lazyColor("yellow"),
7303
+ blue: lazyColor("blue"),
7304
+ cyan: lazyColor("cyan"),
7305
+ magenta: lazyColor("magenta"),
7306
+ white: lazyColor("white"),
7307
+ gray: lazyColor("gray"),
7308
+ bold: lazyColor("bold"),
7309
+ dim: lazyColor("dim"),
7310
+ italic: lazyColor("italic"),
7311
+ underline: lazyColor("underline"),
7312
+ strikethrough: lazyColor("strikethrough"),
7313
+ reset: lazyColor("reset")
7300
7314
  };
7301
- red2 = pc.red;
7302
- green2 = pc.green;
7303
- yellow2 = pc.yellow;
7304
- blue2 = pc.blue;
7305
- cyan2 = pc.cyan;
7306
- magenta2 = pc.magenta;
7307
- white2 = pc.white;
7308
- gray2 = pc.gray;
7309
- bold2 = pc.bold;
7310
- dim2 = pc.dim;
7311
- italic2 = pc.italic;
7312
- underline2 = pc.underline;
7313
- strikethrough2 = pc.strikethrough;
7314
- reset2 = (text) => pc.reset(text);
7315
+ red2 = lazyColor("red");
7316
+ green2 = lazyColor("green");
7317
+ yellow2 = lazyColor("yellow");
7318
+ blue2 = lazyColor("blue");
7319
+ cyan2 = lazyColor("cyan");
7320
+ magenta2 = lazyColor("magenta");
7321
+ white2 = lazyColor("white");
7322
+ gray2 = lazyColor("gray");
7323
+ bold2 = lazyColor("bold");
7324
+ dim2 = lazyColor("dim");
7325
+ italic2 = lazyColor("italic");
7326
+ underline2 = lazyColor("underline");
7327
+ strikethrough2 = lazyColor("strikethrough");
7328
+ reset2 = lazyColor("reset");
7315
7329
  }
7316
7330
  });
7317
7331
 
@@ -7425,6 +7439,11 @@ var init_filesystem_adapter2 = __esm({
7425
7439
  const file = Bun.file(path);
7426
7440
  return await file.text();
7427
7441
  }
7442
+ async readFileBytes(path) {
7443
+ const file = Bun.file(path);
7444
+ const buffer = await file.arrayBuffer();
7445
+ return new Uint8Array(buffer);
7446
+ }
7428
7447
  async writeFile(path, content) {
7429
7448
  await Bun.write(path, content);
7430
7449
  }
@@ -7802,6 +7821,16 @@ function createMockAdapter() {
7802
7821
  }
7803
7822
  return Promise.resolve(content);
7804
7823
  },
7824
+ readFileBytes: (path) => {
7825
+ const content = files.get(path);
7826
+ if (!content) {
7827
+ throw toError(createError({
7828
+ type: "file",
7829
+ message: `File not found: ${path}`
7830
+ }));
7831
+ }
7832
+ return Promise.resolve(new TextEncoder().encode(content));
7833
+ },
7805
7834
  writeFile: (path, content) => {
7806
7835
  files.set(path, content);
7807
7836
  return Promise.resolve();
@@ -8732,7 +8761,9 @@ function createHTTPPluginForMDX() {
8732
8761
  } catch (e) {
8733
8762
  clearTimeout(timeout);
8734
8763
  return {
8735
- errors: [{ text: `Failed to fetch ${args.path}: ${e instanceof Error ? e.message : String(e)}` }]
8764
+ errors: [{
8765
+ text: `Failed to fetch ${args.path}: ${e instanceof Error ? e.message : String(e)}`
8766
+ }]
8736
8767
  };
8737
8768
  }
8738
8769
  });
@@ -8745,7 +8776,12 @@ async function loadModuleESM(compiledProgramCode, context) {
8745
8776
  const adapter = await getAdapter2();
8746
8777
  if (!context.esmCacheDir) {
8747
8778
  if (IS_NODE) {
8748
- const projectCacheDir = join4(_global.process.cwd(), "node_modules", ".cache", "veryfront-mdx");
8779
+ const projectCacheDir = join4(
8780
+ _global.process.cwd(),
8781
+ "node_modules",
8782
+ ".cache",
8783
+ "veryfront-mdx"
8784
+ );
8749
8785
  await adapter.fs.mkdir(projectCacheDir, { recursive: true });
8750
8786
  context.esmCacheDir = projectCacheDir;
8751
8787
  } else {
@@ -8831,7 +8867,10 @@ ${transformed}`;
8831
8867
  rendererLogger.info(`${LOG_PREFIX_MDX_LOADER} Successfully bundled HTTP imports`);
8832
8868
  }
8833
8869
  } catch (bundleError) {
8834
- rendererLogger.warn(`${LOG_PREFIX_MDX_LOADER} Failed to bundle HTTP imports, falling back to original code`, bundleError);
8870
+ rendererLogger.warn(
8871
+ `${LOG_PREFIX_MDX_LOADER} Failed to bundle HTTP imports, falling back to original code`,
8872
+ bundleError
8873
+ );
8835
8874
  } finally {
8836
8875
  try {
8837
8876
  const fsAny = adapter.fs;