veryfront 0.0.9 → 0.0.11

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,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";
@@ -237,7 +236,6 @@ var init_build = __esm({
237
236
  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;
238
237
  var init_cache = __esm({
239
238
  "src/core/utils/constants/cache.ts"() {
240
- "use strict";
241
239
  SECONDS_PER_MINUTE = 60;
242
240
  MINUTES_PER_HOUR = 60;
243
241
  HOURS_PER_DAY = 24;
@@ -311,7 +309,6 @@ function getUnoCSSTailwindResetUrl() {
311
309
  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;
312
310
  var init_cdn = __esm({
313
311
  "src/core/utils/constants/cdn.ts"() {
314
- "use strict";
315
312
  ESM_CDN_BASE = "https://esm.sh";
316
313
  JSDELIVR_CDN_BASE = "https://cdn.jsdelivr.net";
317
314
  DENO_STD_BASE = "https://deno.land";
@@ -331,7 +328,6 @@ var init_cdn = __esm({
331
328
  var HASH_SEED_DJB2, HASH_SEED_FNV1A;
332
329
  var init_hash = __esm({
333
330
  "src/core/utils/constants/hash.ts"() {
334
- "use strict";
335
331
  HASH_SEED_DJB2 = 5381;
336
332
  HASH_SEED_FNV1A = 2166136261;
337
333
  }
@@ -341,7 +337,6 @@ var init_hash = __esm({
341
337
  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;
342
338
  var init_http = __esm({
343
339
  "src/core/utils/constants/http.ts"() {
344
- "use strict";
345
340
  init_cache();
346
341
  KB_IN_BYTES = 1024;
347
342
  HTTP_MODULE_FETCH_TIMEOUT_MS = 2500;
@@ -526,7 +521,7 @@ var init_deno = __esm({
526
521
  "deno.json"() {
527
522
  deno_default = {
528
523
  name: "veryfront",
529
- version: "0.0.8",
524
+ version: "0.0.11",
530
525
  nodeModulesDir: "auto",
531
526
  workspace: [
532
527
  "./examples/async-worker-redis",
@@ -916,7 +911,6 @@ function fromBase64Url(encoded) {
916
911
  }
917
912
  var init_path_utils = __esm({
918
913
  "src/core/utils/path-utils.ts"() {
919
- "use strict";
920
914
  init_logger();
921
915
  }
922
916
  });
@@ -1238,22 +1232,44 @@ var init_bundle_manifest_init = __esm({
1238
1232
  }
1239
1233
  });
1240
1234
 
1235
+ // src/platform/compat/runtime.ts
1236
+ var isDeno, isNode, isBun, isCloudflare;
1237
+ var init_runtime = __esm({
1238
+ "src/platform/compat/runtime.ts"() {
1239
+ "use strict";
1240
+ isDeno = typeof Deno !== "undefined";
1241
+ isNode = typeof globalThis.process !== "undefined" && globalThis.process?.versions?.node !== void 0;
1242
+ isBun = typeof globalThis.Bun !== "undefined";
1243
+ isCloudflare = typeof globalThis !== "undefined" && "caches" in globalThis && "WebSocketPair" in globalThis;
1244
+ }
1245
+ });
1246
+
1247
+ // src/platform/compat/process.ts
1248
+ import process2 from "node:process";
1249
+ function getEnv(key) {
1250
+ if (isDeno) {
1251
+ return process2.env(key);
1252
+ }
1253
+ return process2.env[key];
1254
+ }
1255
+ var init_process = __esm({
1256
+ "src/platform/compat/process.ts"() {
1257
+ "use strict";
1258
+ init_runtime();
1259
+ }
1260
+ });
1261
+
1241
1262
  // src/core/utils/feature-flags.ts
1242
1263
  function isRSCEnabled(config) {
1243
1264
  if (config?.experimental?.rsc !== void 0) {
1244
1265
  return config.experimental.rsc;
1245
1266
  }
1246
- if (typeof Deno !== "undefined" && Deno.env) {
1247
- return process.env("VERYFRONT_EXPERIMENTAL_RSC") === "1";
1248
- }
1249
- if (typeof process !== "undefined" && process?.env) {
1250
- return process.env.VERYFRONT_EXPERIMENTAL_RSC === "1";
1251
- }
1252
- return false;
1267
+ return getEnv("VERYFRONT_EXPERIMENTAL_RSC") === "1";
1253
1268
  }
1254
1269
  var init_feature_flags = __esm({
1255
1270
  "src/core/utils/feature-flags.ts"() {
1256
1271
  "use strict";
1272
+ init_process();
1257
1273
  }
1258
1274
  });
1259
1275
 
@@ -1712,6 +1728,7 @@ var init_define_config = __esm({
1712
1728
  "src/core/config/define-config.ts"() {
1713
1729
  "use strict";
1714
1730
  init_veryfront_error();
1731
+ init_process();
1715
1732
  }
1716
1733
  });
1717
1734
 
@@ -2163,9 +2180,9 @@ var init_filesystem_adapter = __esm({
2163
2180
  }
2164
2181
  async makeTempDir(prefix) {
2165
2182
  const { mkdtemp } = await import("node:fs/promises");
2166
- const { join: join9 } = await import("node:path");
2183
+ const { join: join8 } = await import("node:path");
2167
2184
  const { tmpdir } = await import("node:os");
2168
- return await mkdtemp(join9(tmpdir(), prefix));
2185
+ return await mkdtemp(join8(tmpdir(), prefix));
2169
2186
  }
2170
2187
  watch(paths, options) {
2171
2188
  const pathArray = Array.isArray(paths) ? paths : [paths];
@@ -2226,20 +2243,20 @@ var init_filesystem_adapter = __esm({
2226
2243
  });
2227
2244
 
2228
2245
  // src/platform/adapters/node/environment-adapter.ts
2229
- import process2 from "node:process";
2246
+ import process3 from "node:process";
2230
2247
  var NodeEnvironmentAdapter;
2231
2248
  var init_environment_adapter = __esm({
2232
2249
  "src/platform/adapters/node/environment-adapter.ts"() {
2233
2250
  "use strict";
2234
2251
  NodeEnvironmentAdapter = class {
2235
2252
  get(key) {
2236
- return process2.env[key];
2253
+ return process3.env[key];
2237
2254
  }
2238
2255
  set(key, value) {
2239
- process2.env[key] = value;
2256
+ process3.env[key] = value;
2240
2257
  }
2241
2258
  toObject() {
2242
- return { ...process2.env };
2259
+ return { ...process3.env };
2243
2260
  }
2244
2261
  };
2245
2262
  }
@@ -7184,18 +7201,6 @@ var init_error_catalog = __esm({
7184
7201
  }
7185
7202
  });
7186
7203
 
7187
- // src/platform/compat/runtime.ts
7188
- var isDeno, isNode, isBun, isCloudflare;
7189
- var init_runtime = __esm({
7190
- "src/platform/compat/runtime.ts"() {
7191
- "use strict";
7192
- isDeno = typeof Deno !== "undefined";
7193
- isNode = typeof globalThis.process !== "undefined" && globalThis.process?.versions?.node !== void 0;
7194
- isBun = typeof globalThis.Bun !== "undefined";
7195
- isCloudflare = typeof globalThis !== "undefined" && "caches" in globalThis && "WebSocketPair" in globalThis;
7196
- }
7197
- });
7198
-
7199
7204
  // src/platform/compat/console/ansi.ts
7200
7205
  var ansi, red, green, yellow, blue, magenta, cyan, white, gray, bold, dim, italic, underline, strikethrough, reset;
7201
7206
  var init_ansi = __esm({
@@ -7378,14 +7383,6 @@ var init_error_formatter = __esm({
7378
7383
  }
7379
7384
  });
7380
7385
 
7381
- // src/platform/compat/process.ts
7382
- import process3 from "node:process";
7383
- var init_process = __esm({
7384
- "src/platform/compat/process.ts"() {
7385
- init_runtime();
7386
- }
7387
- });
7388
-
7389
7386
  // src/core/errors/user-friendly/error-wrapper.ts
7390
7387
  var init_error_wrapper = __esm({
7391
7388
  "src/core/errors/user-friendly/error-wrapper.ts"() {
@@ -7481,9 +7478,9 @@ var init_filesystem_adapter2 = __esm({
7481
7478
  }
7482
7479
  async makeTempDir(prefix) {
7483
7480
  const { mkdtemp } = await import("node:fs/promises");
7484
- const { join: join9 } = await import("node:path");
7481
+ const { join: join8 } = await import("node:path");
7485
7482
  const { tmpdir } = await import("node:os");
7486
- return await mkdtemp(join9(tmpdir(), prefix));
7483
+ return await mkdtemp(join8(tmpdir(), prefix));
7487
7484
  }
7488
7485
  watch(paths, options) {
7489
7486
  const pathArray = Array.isArray(paths) ? paths : [paths];
@@ -7817,16 +7814,16 @@ function createMockAdapter() {
7817
7814
  files.set(path, content);
7818
7815
  return Promise.resolve();
7819
7816
  },
7820
- exists: async (path) => {
7817
+ exists: (path) => {
7821
7818
  if (files.has(path))
7822
- return true;
7819
+ return Promise.resolve(true);
7823
7820
  if (directories.has(path))
7824
- return true;
7821
+ return Promise.resolve(true);
7825
7822
  for (const filePath of files.keys()) {
7826
7823
  if (filePath.startsWith(path + "/"))
7827
- return true;
7824
+ return Promise.resolve(true);
7828
7825
  }
7829
- return false;
7826
+ return Promise.resolve(false);
7830
7827
  },
7831
7828
  readDir: async function* (path) {
7832
7829
  const entries = /* @__PURE__ */ new Map();
@@ -8501,6 +8498,7 @@ var LRUCacheAdapter = class {
8501
8498
 
8502
8499
  // src/core/utils/lru-wrapper.ts
8503
8500
  init_utils();
8501
+ init_process();
8504
8502
  var LRUCache = class {
8505
8503
  adapter;
8506
8504
  cleanupTimer;
@@ -8576,7 +8574,7 @@ function shouldDisableInterval() {
8576
8574
  return true;
8577
8575
  }
8578
8576
  try {
8579
- return process.env("VF_DISABLE_LRU_INTERVAL") === "1";
8577
+ return getEnv("VF_DISABLE_LRU_INTERVAL") === "1";
8580
8578
  } catch {
8581
8579
  return false;
8582
8580
  }
@@ -9381,8 +9379,19 @@ init_path_utils();
9381
9379
  // src/routing/matchers/index.ts
9382
9380
  init_utils();
9383
9381
 
9384
- // src/routing/slug-mapper/path-candidate-generator.ts
9385
- import { join as join5 } from "path";
9382
+ // src/platform/compat/path-helper.ts
9383
+ import nodePath from "node:path";
9384
+ var pathMod = null;
9385
+ var denoPathPromise = null;
9386
+ if (typeof Deno === "undefined") {
9387
+ pathMod = nodePath;
9388
+ } else {
9389
+ denoPathPromise = import("path").then((mod) => {
9390
+ pathMod = mod;
9391
+ return pathMod;
9392
+ });
9393
+ }
9394
+ var sep = nodePath.sep;
9386
9395
 
9387
9396
  // src/routing/client/dom-utils.ts
9388
9397
  init_utils();
@@ -9405,7 +9414,7 @@ init_utils();
9405
9414
  // src/routing/api/handler.ts
9406
9415
  init_utils();
9407
9416
  init_config();
9408
- import { join as join8 } from "path";
9417
+ import { join as join7 } from "path";
9409
9418
  init_veryfront_error();
9410
9419
 
9411
9420
  // src/http/responses.ts
@@ -10162,7 +10171,7 @@ function createRscInstruments(meter, config) {
10162
10171
  }
10163
10172
 
10164
10173
  // src/observability/instruments/instruments-factory.ts
10165
- async function initializeInstruments(meter, config, runtimeState) {
10174
+ function initializeInstruments(meter, config, runtimeState) {
10166
10175
  const instruments = {
10167
10176
  httpRequestCounter: null,
10168
10177
  httpRequestDuration: null,
@@ -10212,7 +10221,7 @@ async function initializeInstruments(meter, config, runtimeState) {
10212
10221
  } catch (error2) {
10213
10222
  serverLogger.warn("[metrics] Failed to initialize metric instruments", error2);
10214
10223
  }
10215
- return instruments;
10224
+ return Promise.resolve(instruments);
10216
10225
  }
10217
10226
 
10218
10227
  // src/observability/metrics/recorder.ts
@@ -11461,9 +11470,11 @@ init_utils();
11461
11470
  // src/security/secure-fs.ts
11462
11471
  init_utils();
11463
11472
 
11473
+ // src/routing/api/api-route-matcher.ts
11474
+ init_process();
11475
+
11464
11476
  // src/routing/api/module-loader/loader.ts
11465
11477
  init_utils();
11466
- import { dirname as dirname2, isAbsolute, join as join6, resolve } from "path";
11467
11478
 
11468
11479
  // src/routing/api/module-loader/esbuild-plugin.ts
11469
11480
  init_utils();
@@ -11480,12 +11491,16 @@ init_utils();
11480
11491
  // src/routing/api/module-loader/loader.ts
11481
11492
  init_veryfront_error();
11482
11493
 
11494
+ // src/platform/compat/fs.ts
11495
+ init_veryfront_error();
11496
+ init_runtime();
11497
+
11483
11498
  // src/routing/api/route-discovery.ts
11484
11499
  import { relative } from "path";
11485
11500
 
11486
11501
  // src/core/utils/file-discovery.ts
11487
11502
  init_deno2();
11488
- import { join as join7 } from "path";
11503
+ import { join as join6 } from "path";
11489
11504
 
11490
11505
  // src/routing/api/route-executor.ts
11491
11506
  init_veryfront_error();