@farm.js/core 0.1.15 → 0.1.16

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.
Files changed (123) hide show
  1. package/dist/agent-runtime.d.mts +5 -2
  2. package/dist/agent-runtime.d.ts +5 -2
  3. package/dist/api/client.d.mts +3 -2
  4. package/dist/api/client.d.ts +3 -2
  5. package/dist/api/route-manager.d.mts +5 -2
  6. package/dist/api/route-manager.d.ts +5 -2
  7. package/dist/api/runtime.d.mts +3 -2
  8. package/dist/api/runtime.d.ts +3 -2
  9. package/dist/{api-client-C8d7BZNp.d.mts → api-client-B-n3pm_Q.d.mts} +2 -1
  10. package/dist/{api-client-BWrEbxfO.d.ts → api-client-C0_NZEBl.d.ts} +2 -1
  11. package/dist/api.d.mts +7 -4
  12. package/dist/api.d.ts +7 -4
  13. package/dist/{app-wIYse61b.d.ts → app-AyjEsCBq.d.ts} +3 -3
  14. package/dist/{app-B3nVSjen.d.mts → app-CYPHeOo_.d.mts} +3 -3
  15. package/dist/app-markdown.d.mts +6 -3
  16. package/dist/app-markdown.d.ts +6 -3
  17. package/dist/{chunk-FOGLGRDS.mjs → chunk-7HDZYYS4.mjs} +100 -8
  18. package/dist/{chunk-UE75PB52.mjs → chunk-IL5RWYK7.mjs} +1 -1
  19. package/dist/{chunk-GNTPTTLA.mjs → chunk-IXTEENRS.mjs} +1 -1
  20. package/dist/{chunk-JRF3C33L.mjs → chunk-NHHKW2T6.mjs} +5 -4
  21. package/dist/{chunk-NJ47VORC.mjs → chunk-NUD6XBMO.mjs} +1 -1
  22. package/dist/{chunk-FBHGHMOA.mjs → chunk-TYVVIQ5M.mjs} +10 -7
  23. package/dist/{chunk-W7IVHTOP.mjs → chunk-UQZPTIML.mjs} +15 -2
  24. package/dist/{chunk-S3QW3BIS.mjs → chunk-VVTREAG5.mjs} +89 -4
  25. package/dist/{client-plugins-C1EgdoJM.d.mts → client-plugins-CIPRtSsW.d.mts} +16 -4
  26. package/dist/{client-plugins-CslwYp3E.d.ts → client-plugins-CqVtZi5X.d.ts} +16 -4
  27. package/dist/client-plugins.d.mts +5 -2
  28. package/dist/client-plugins.d.ts +5 -2
  29. package/dist/client.d.mts +8 -7
  30. package/dist/client.d.ts +8 -7
  31. package/dist/config.d.mts +5 -2
  32. package/dist/config.d.ts +5 -2
  33. package/dist/{devtools-PCGEBRSC.mjs → devtools-IU7LKZOH.mjs} +2 -2
  34. package/dist/docs.cjs +74 -3
  35. package/dist/docs.mjs +3 -3
  36. package/dist/{route-C6UClI1z.d.mts → endpoint-Bu3XgeMK.d.mts} +3 -128
  37. package/dist/{route-CHBaW55F.d.ts → endpoint-kSAxE52R.d.ts} +3 -128
  38. package/dist/env.cjs +101 -8
  39. package/dist/env.d.mts +20 -2
  40. package/dist/env.d.ts +20 -2
  41. package/dist/env.mjs +3 -1
  42. package/dist/index.cjs +212 -19
  43. package/dist/index.d.mts +16 -15
  44. package/dist/index.d.ts +16 -15
  45. package/dist/index.mjs +20 -8
  46. package/dist/integrations.d.mts +5 -2
  47. package/dist/integrations.d.ts +5 -2
  48. package/dist/internal/app-markdown-runtime.d.mts +5 -2
  49. package/dist/internal/app-markdown-runtime.d.ts +5 -2
  50. package/dist/internal/build-runtime.cjs +264 -169
  51. package/dist/internal/build-runtime.d.mts +7 -4
  52. package/dist/internal/build-runtime.d.ts +7 -4
  53. package/dist/internal/build-runtime.mjs +6 -6
  54. package/dist/internal/cli-runtime.cjs +68 -4
  55. package/dist/internal/cli-runtime.mjs +2 -2
  56. package/dist/internal/client-error-overlay.cjs +1 -1
  57. package/dist/internal/client-error-overlay.mjs +1 -1
  58. package/dist/internal/compression-runtime.d.mts +5 -2
  59. package/dist/internal/compression-runtime.d.ts +5 -2
  60. package/dist/internal/config-runtime.cjs +68 -4
  61. package/dist/internal/config-runtime.d.mts +6 -3
  62. package/dist/internal/config-runtime.d.ts +6 -3
  63. package/dist/internal/config-runtime.mjs +2 -2
  64. package/dist/internal/product-telemetry-runtime.cjs +1 -1
  65. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  66. package/dist/internal/production-runtime.d.mts +11 -8
  67. package/dist/internal/production-runtime.d.ts +11 -8
  68. package/dist/{metadata-BsUcOEXg.d.ts → metadata-8g__AMPM.d.ts} +1 -1
  69. package/dist/{metadata-B1bxCPUY.d.mts → metadata-OMX6wFNf.d.mts} +1 -1
  70. package/dist/middleware.d.mts +7 -4
  71. package/dist/middleware.d.ts +7 -4
  72. package/dist/{nitro-ICBP5APY.mjs → nitro-3N4ZXRYM.mjs} +5 -2
  73. package/dist/plugin.cjs +108 -7
  74. package/dist/plugin.d.mts +5 -2
  75. package/dist/plugin.d.ts +5 -2
  76. package/dist/plugin.mjs +3 -3
  77. package/dist/{production-runtime-CsNn2-zx.d.ts → production-runtime-BJh7o6Cr.d.ts} +1 -1
  78. package/dist/{production-runtime-BDllolVh.d.mts → production-runtime-W3M0eNDV.d.mts} +1 -1
  79. package/dist/{render-plan-EG4hNFjy.d.ts → render-plan-Be4ZGTJP.d.ts} +1 -1
  80. package/dist/{render-plan-CNUlzylR.d.mts → render-plan-io7pvDNc.d.mts} +1 -1
  81. package/dist/renderer-client.d.mts +5 -4
  82. package/dist/renderer-client.d.ts +5 -4
  83. package/dist/{request-Blh_f7Z3.d.mts → request-DZkHYQ89.d.mts} +1 -1
  84. package/dist/{request-DsVSQVfD.d.ts → request-G8JhKr4F.d.ts} +1 -1
  85. package/dist/request.d.mts +6 -3
  86. package/dist/request.d.ts +6 -3
  87. package/dist/route-BxNJT447.d.ts +128 -0
  88. package/dist/route-C_eLaFTZ.d.mts +128 -0
  89. package/dist/{route-rendering-hUETRCbM.d.ts → route-rendering-BcLLPJgN.d.ts} +1 -1
  90. package/dist/{route-rendering-LT4XSoQK.d.mts → route-rendering-CbAKr1TY.d.mts} +1 -1
  91. package/dist/routes.d.mts +4 -2
  92. package/dist/routes.d.ts +4 -2
  93. package/dist/server-fn-client.d.mts +3 -2
  94. package/dist/server-fn-client.d.ts +3 -2
  95. package/dist/server-fn.cjs +141 -3
  96. package/dist/server-fn.d.mts +72 -1
  97. package/dist/server-fn.d.ts +72 -1
  98. package/dist/server-fn.mjs +12 -1
  99. package/dist/server-plugins.d.mts +6 -3
  100. package/dist/server-plugins.d.ts +6 -3
  101. package/dist/server-query-client.d.mts +1 -0
  102. package/dist/server-query-client.d.ts +1 -0
  103. package/dist/server-query.cjs +60 -3
  104. package/dist/server-query.d.mts +6 -1
  105. package/dist/server-query.d.ts +6 -1
  106. package/dist/server-query.mjs +3 -2
  107. package/dist/server.cjs +161 -11
  108. package/dist/server.d.mts +9 -8
  109. package/dist/server.d.ts +9 -8
  110. package/dist/server.mjs +6 -6
  111. package/dist/{spa-router-csKR9Ebj.d.mts → spa-router-BcS_4nqm.d.mts} +2 -2
  112. package/dist/{spa-router-Y_2FSJQK.d.ts → spa-router-BzFBUJkn.d.ts} +2 -2
  113. package/dist/testing.d.mts +5 -3
  114. package/dist/testing.d.ts +5 -3
  115. package/dist/{utils-DR2wfZAn.d.mts → utils-5kQP1mFR.d.mts} +1 -1
  116. package/dist/{utils-jISOE9SD.d.ts → utils-C4yrAhNc.d.ts} +1 -1
  117. package/dist/version.cjs +1 -1
  118. package/dist/version.mjs +1 -1
  119. package/dist/vite.cjs +246 -149
  120. package/dist/vite.d.mts +5 -2
  121. package/dist/vite.d.ts +5 -2
  122. package/dist/vite.mjs +3 -3
  123. package/package.json +1 -1
package/dist/server.cjs CHANGED
@@ -11971,14 +11971,33 @@ function resolveEnv(config, source = getProcessEnv()) {
11971
11971
  };
11972
11972
  return resolved;
11973
11973
  }
11974
+ function createBundledEnv(env2, source = getProcessEnv()) {
11975
+ const resolved = normalizeResolvedEnv(env2 ?? {});
11976
+ const server = {};
11977
+ const runtime3 = {};
11978
+ for (const [key, value] of Object.entries(resolved.server)) {
11979
+ if (source[key] === void 0) {
11980
+ server[key] = value;
11981
+ } else {
11982
+ runtime3[key] = getRuntimeEnvType(value);
11983
+ }
11984
+ }
11985
+ return {
11986
+ server,
11987
+ public: resolved.public,
11988
+ ...Object.keys(runtime3).length > 0 ? { runtime: { server: runtime3 } } : {}
11989
+ };
11990
+ }
11974
11991
  function setEnv(env2) {
11975
- currentEnv = normalizeResolvedEnv(env2);
11992
+ currentEnv = prepareEnv(env2);
11976
11993
  if (typeof window === "undefined") {
11977
11994
  farmEnvGlobal[FARM_ENV_SYMBOL] = currentEnv;
11978
11995
  }
11979
11996
  }
11980
11997
  function getResolvedEnv() {
11981
- return getCurrentEnv();
11998
+ const env2 = getCurrentEnv();
11999
+ if (typeof window === "undefined") readRuntimeServerEnv(env2);
12000
+ return env2;
11982
12001
  }
11983
12002
  function resolveEnvScope(shape, source, scope) {
11984
12003
  if (!shape) {
@@ -12013,7 +12032,7 @@ function createEnvProxy(scope) {
12013
12032
  return void 0;
12014
12033
  }
12015
12034
  const env2 = getEnvScope(scope);
12016
- return env2[property];
12035
+ return scope === "server" ? readServerEnvKey(env2, property) : env2[property];
12017
12036
  },
12018
12037
  ownKeys() {
12019
12038
  return Reflect.ownKeys(getEnvScope(scope));
@@ -12036,10 +12055,75 @@ function createEnvProxy(scope) {
12036
12055
  );
12037
12056
  }
12038
12057
  function getEnvScope(scope) {
12058
+ const env2 = getCurrentEnv();
12039
12059
  if (scope === "server") {
12040
12060
  assertServerEnvAccess();
12061
+ readRuntimeServerEnv(env2);
12062
+ }
12063
+ return env2[scope] || {};
12064
+ }
12065
+ function readServerEnvKey(server, key) {
12066
+ const value = server[key];
12067
+ if (value === void 0) {
12068
+ const state = getCurrentEnv()[FARM_ENV_RUNTIME_SYMBOL];
12069
+ if (state && key in state.pending && !state.warned.has(key)) {
12070
+ state.warned.add(key);
12071
+ console.warn(
12072
+ `[Farm] Server env "${key}" was set when this app was built but is not set where the server runs, so it reads as undefined. Farm reads server env at runtime and does not store it in the build output; set "${key}" in the server's environment.`
12073
+ );
12074
+ }
12041
12075
  }
12042
- return getCurrentEnv()[scope] || {};
12076
+ return value;
12077
+ }
12078
+ function readRuntimeServerEnv(env2) {
12079
+ const state = env2[FARM_ENV_RUNTIME_SYMBOL];
12080
+ if (!state) return;
12081
+ const source = getProcessEnv();
12082
+ for (const [key, type] of Object.entries(state.pending)) {
12083
+ const raw = source[key];
12084
+ if (raw === void 0) continue;
12085
+ env2.server[key] = coerceRuntimeEnvValue(raw, type);
12086
+ delete state.pending[key];
12087
+ }
12088
+ }
12089
+ function getRuntimeEnvType(value) {
12090
+ if (typeof value === "number") return "number";
12091
+ if (typeof value === "boolean") return "boolean";
12092
+ if (value !== null && typeof value === "object" && !(value instanceof Date)) return "json";
12093
+ return "string";
12094
+ }
12095
+ function coerceRuntimeEnvValue(raw, type) {
12096
+ if (type === "number") {
12097
+ const value = Number(raw);
12098
+ return raw.trim() !== "" && Number.isFinite(value) ? value : raw;
12099
+ }
12100
+ if (type === "boolean") {
12101
+ if (/^(true|1)$/i.test(raw.trim())) return true;
12102
+ if (/^(false|0|)$/i.test(raw.trim())) return false;
12103
+ return raw;
12104
+ }
12105
+ if (type === "json") {
12106
+ try {
12107
+ return JSON.parse(raw);
12108
+ } catch {
12109
+ return raw;
12110
+ }
12111
+ }
12112
+ return raw;
12113
+ }
12114
+ function prepareEnv(env2) {
12115
+ const normalized = normalizeResolvedEnv(env2);
12116
+ const runtime3 = env2.runtime?.server;
12117
+ if (!isRecord4(runtime3) || Object.keys(runtime3).length === 0) return normalized;
12118
+ const prepared = { server: { ...normalized.server }, public: normalized.public };
12119
+ Object.defineProperty(prepared, FARM_ENV_RUNTIME_SYMBOL, {
12120
+ value: {
12121
+ pending: { ...runtime3 },
12122
+ warned: /* @__PURE__ */ new Set()
12123
+ },
12124
+ enumerable: false
12125
+ });
12126
+ return prepared;
12043
12127
  }
12044
12128
  function assertServerEnvAccess() {
12045
12129
  if (typeof window !== "undefined") {
@@ -12068,7 +12152,7 @@ function getCurrentEnv() {
12068
12152
  function getInjectedEnv() {
12069
12153
  try {
12070
12154
  if (typeof __FARM_ENV__ !== "undefined" && __FARM_ENV__) {
12071
- return normalizeResolvedEnv(__FARM_ENV__);
12155
+ return prepareEnv(__FARM_ENV__);
12072
12156
  }
12073
12157
  } catch {
12074
12158
  }
@@ -12098,14 +12182,16 @@ function getProcessEnv() {
12098
12182
  }
12099
12183
  return {};
12100
12184
  }
12101
- var FARM_ENV_SYMBOL, farmEnvGlobal, currentEnv, env, publicEnv;
12185
+ var FARM_ENV_SYMBOL, FARM_ENV_RUNTIME_SYMBOL, farmEnvGlobal, currentEnv, env, publicEnv;
12102
12186
  var init_env = __esm({
12103
12187
  "src/env.ts"() {
12104
12188
  "use strict";
12105
12189
  FARM_ENV_SYMBOL = /* @__PURE__ */ Symbol.for("farm.env");
12190
+ FARM_ENV_RUNTIME_SYMBOL = /* @__PURE__ */ Symbol.for("farm.env.runtime");
12106
12191
  farmEnvGlobal = globalThis;
12107
12192
  currentEnv = getInitialEnv();
12108
12193
  __name(resolveEnv, "resolveEnv");
12194
+ __name(createBundledEnv, "createBundledEnv");
12109
12195
  __name(setEnv, "setEnv");
12110
12196
  __name(getResolvedEnv, "getResolvedEnv");
12111
12197
  env = createEnvProxy("server");
@@ -12114,6 +12200,11 @@ var init_env = __esm({
12114
12200
  __name(parseEnvValue, "parseEnvValue");
12115
12201
  __name(createEnvProxy, "createEnvProxy");
12116
12202
  __name(getEnvScope, "getEnvScope");
12203
+ __name(readServerEnvKey, "readServerEnvKey");
12204
+ __name(readRuntimeServerEnv, "readRuntimeServerEnv");
12205
+ __name(getRuntimeEnvType, "getRuntimeEnvType");
12206
+ __name(coerceRuntimeEnvValue, "coerceRuntimeEnvValue");
12207
+ __name(prepareEnv, "prepareEnv");
12117
12208
  __name(assertServerEnvAccess, "assertServerEnvAccess");
12118
12209
  __name(getInitialEnv, "getInitialEnv");
12119
12210
  __name(getCurrentEnv, "getCurrentEnv");
@@ -29669,7 +29760,7 @@ _setFarmThemeServerSnapshotResolver(() => {
29669
29760
  });
29670
29761
 
29671
29762
  // package.json
29672
- var version = "0.1.15";
29763
+ var version = "0.1.16";
29673
29764
 
29674
29765
  // src/version.ts
29675
29766
  var FARM_VERSION = version;
@@ -32638,6 +32729,7 @@ function createFarmApp(config, viteServer) {
32638
32729
  __name(createFarmApp, "createFarmApp");
32639
32730
 
32640
32731
  // src/vite.ts
32732
+ init_env();
32641
32733
  init_utils();
32642
32734
 
32643
32735
  // src/plugin.ts
@@ -38600,7 +38692,7 @@ function getEnvDefines(config, configEnv) {
38600
38692
  )
38601
38693
  };
38602
38694
  if (configEnv?.isSsrBuild) {
38603
- defines.__FARM_ENV__ = JSON.stringify(getFullEnvDefine(config));
38695
+ defines.__FARM_ENV__ = JSON.stringify(createBundledEnv(getFullEnvDefine(config)));
38604
38696
  }
38605
38697
  return defines;
38606
38698
  }
@@ -43031,8 +43123,46 @@ init_server_action_security();
43031
43123
  init_server_action_security();
43032
43124
  init_cache();
43033
43125
  init_server_fn_error();
43126
+ init_navigation_errors();
43034
43127
  init_server_fn_error();
43035
43128
  var FARM_SERVER_FN_SYMBOL = /* @__PURE__ */ Symbol.for("farm.server-fn");
43129
+ var FARM_SERVER_FUNCTION_DESCRIPTOR = /* @__PURE__ */ Symbol.for("farm.server-function.descriptor");
43130
+ var _ServerFnInputError = class _ServerFnInputError extends Error {
43131
+ constructor(cause) {
43132
+ super("Server function input is invalid");
43133
+ this.cause = cause;
43134
+ }
43135
+ };
43136
+ __name(_ServerFnInputError, "ServerFnInputError");
43137
+ var ServerFnInputError = _ServerFnInputError;
43138
+ function createServerFunctionDescriptor(kind, options, run) {
43139
+ return Object.freeze({
43140
+ kind,
43141
+ input: options.input,
43142
+ output: options.output,
43143
+ mcp: options.mcp === void 0 ? void 0 : Object.freeze({ ...options.mcp }),
43144
+ run
43145
+ });
43146
+ }
43147
+ __name(createServerFunctionDescriptor, "createServerFunctionDescriptor");
43148
+ function _attachServerFunctionDescriptor(target, descriptor) {
43149
+ Object.defineProperty(target, FARM_SERVER_FUNCTION_DESCRIPTOR, {
43150
+ value: descriptor,
43151
+ enumerable: false
43152
+ });
43153
+ }
43154
+ __name(_attachServerFunctionDescriptor, "_attachServerFunctionDescriptor");
43155
+ function getServerFunctionRunner(value) {
43156
+ if (typeof value !== "function") return void 0;
43157
+ return value[FARM_SERVER_FUNCTION_DESCRIPTOR];
43158
+ }
43159
+ __name(getServerFunctionRunner, "getServerFunctionRunner");
43160
+ function _runServerFunctionForCaller(value, input) {
43161
+ const runner = getServerFunctionRunner(value);
43162
+ if (!runner) throw new TypeError("Expected a function created with createServerFn");
43163
+ return runner.run(input);
43164
+ }
43165
+ __name(_runServerFunctionForCaller, "_runServerFunctionForCaller");
43036
43166
  var UNSAFE_FORM_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
43037
43167
  function createServerFn(options) {
43038
43168
  if (!options || typeof options.handler !== "function") {
@@ -43041,10 +43171,15 @@ function createServerFn(options) {
43041
43171
  const middleware = resolveServerFnMiddleware(options.middleware);
43042
43172
  const errors = normalizeServerFnErrors(options.errors);
43043
43173
  const error = createServerFnErrorHandler(errors);
43044
- const serverFn = /* @__PURE__ */ __name(async (value) => {
43174
+ const run = /* @__PURE__ */ __name(async (value, labelInputErrors) => {
43045
43175
  const formData = isFormData(value) ? value : void 0;
43046
43176
  const rawInput = formData ? formDataToObject2(formData) : value;
43047
- const input = await _parseServerFnSchema(options.input, rawInput, "input");
43177
+ let input;
43178
+ try {
43179
+ input = await _parseServerFnSchema(options.input, rawInput, "input");
43180
+ } catch (cause) {
43181
+ throw labelInputErrors ? new ServerFnInputError(cause) : cause;
43182
+ }
43048
43183
  const executionContext = getServerActionExecutionContext();
43049
43184
  const request2 = executionContext?.request ?? _resolveCurrentRequest();
43050
43185
  const signal = executionContext?.signal ?? request2?.signal ?? getServerActionSignal();
@@ -43070,7 +43205,8 @@ function createServerFn(options) {
43070
43205
  await applyFarmCacheInvalidationTargets(declaration);
43071
43206
  }
43072
43207
  return parsedResult;
43073
- }, "serverFn");
43208
+ }, "run");
43209
+ const serverFn = /* @__PURE__ */ __name((value) => run(value, false), "serverFn");
43074
43210
  Object.defineProperties(serverFn, {
43075
43211
  [FARM_SERVER_FN_SYMBOL]: {
43076
43212
  value: true,
@@ -43101,6 +43237,10 @@ function createServerFn(options) {
43101
43237
  enumerable: false
43102
43238
  }
43103
43239
  });
43240
+ _attachServerFunctionDescriptor(
43241
+ serverFn,
43242
+ createServerFunctionDescriptor("action", options, (value) => run(value, true))
43243
+ );
43104
43244
  return serverFn;
43105
43245
  }
43106
43246
  __name(createServerFn, "createServerFn");
@@ -43377,6 +43517,16 @@ function createServerQuery(options) {
43377
43517
  enumerable: false
43378
43518
  }
43379
43519
  });
43520
+ _attachServerFunctionDescriptor(
43521
+ query,
43522
+ createServerFunctionDescriptor("query", options, async (value) => {
43523
+ const result = await _runServerFunctionForCaller(
43524
+ execute,
43525
+ value
43526
+ );
43527
+ return result.data;
43528
+ })
43529
+ );
43380
43530
  return query;
43381
43531
  }
43382
43532
  __name(createServerQuery, "createServerQuery");
package/dist/server.d.mts CHANGED
@@ -1,14 +1,14 @@
1
- export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-B3nVSjen.mjs';
2
- import { w as FarmConfig } from './client-plugins-C1EgdoJM.mjs';
3
- export { A as AppRoutePattern, a3 as BuildOptions, X as ErrorBoundary, O as ErrorProps, h as FarmAppContext, z as FarmComponentType, t as FarmContextFactory, I as FarmContextFactoryInput, J as FarmIsolatedClientHydrationMode, a8 as FarmLayerEntry, ac as FarmLayerResolution, D as FarmMigrationCommand, E as FarmMigrationsConfig, G as FarmMigrationsUserConfig, b as FarmRequest, c as FarmResponse, aa as FarmSourceRoot, $ as GenerateStaticParams, V as Layout, T as LayoutMetadataProps, a0 as LayoutModule, L as LayoutProps, W as Loading, K as LoadingProps, M as Metadata, a1 as MetadataJsonLd, S as MetadataProps, a7 as MetadataRobots, a6 as MetadataRobotsDirectives, u as MiddlewareProps, N as NitroPreset, U as Page, i as PageProps, Q as PagePropsWithMiddleware, C as PageRouteParams, P as ParsedRoute, j as PluginContextProps, ab as ResolveFarmLayersOptions, a9 as ResolvedFarmLayer, H as ResolvedFarmMigrationsConfig, k as RouteModule, R as RouteSegment, a5 as SSGCollectionResult, a4 as SSGPage, a2 as ServerAction, Z as StaticPathParams, Y as StaticPathPrimitive, _ as StaticRouteParams, ah as createFarmConfigResolutionPlugin, y as defineConfig, x as farmPlugin, af as getFarmAppDirectories, ag as getFarmLayerAliases, ae as getFarmSourceRoots, ai as loadFarmConfigFile, ad as resolveFarmLayers } from './client-plugins-C1EgdoJM.mjs';
4
- export { g as fileExists, h as globFiles, l as logger, m as matchRoute, b as matchRouteParts, c as matchRoutePrefix, d as matchRoutePrefixParts, p as parseRoutePath, i as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, a as splitRoutePath, e as toPosixPath, t as toRootRelativeUrlPath, f as toViteModuleId } from './utils-DR2wfZAn.mjs';
1
+ export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-CYPHeOo_.mjs';
2
+ import { w as FarmConfig } from './client-plugins-CIPRtSsW.mjs';
3
+ export { A as AppRoutePattern, a3 as BuildOptions, X as ErrorBoundary, O as ErrorProps, h as FarmAppContext, z as FarmComponentType, t as FarmContextFactory, I as FarmContextFactoryInput, J as FarmIsolatedClientHydrationMode, a8 as FarmLayerEntry, ac as FarmLayerResolution, D as FarmMigrationCommand, E as FarmMigrationsConfig, G as FarmMigrationsUserConfig, b as FarmRequest, c as FarmResponse, aa as FarmSourceRoot, $ as GenerateStaticParams, V as Layout, T as LayoutMetadataProps, a0 as LayoutModule, L as LayoutProps, W as Loading, K as LoadingProps, M as Metadata, a1 as MetadataJsonLd, S as MetadataProps, a7 as MetadataRobots, a6 as MetadataRobotsDirectives, u as MiddlewareProps, N as NitroPreset, U as Page, i as PageProps, Q as PagePropsWithMiddleware, C as PageRouteParams, P as ParsedRoute, j as PluginContextProps, ab as ResolveFarmLayersOptions, a9 as ResolvedFarmLayer, H as ResolvedFarmMigrationsConfig, k as RouteModule, R as RouteSegment, a5 as SSGCollectionResult, a4 as SSGPage, a2 as ServerAction, Z as StaticPathParams, Y as StaticPathPrimitive, _ as StaticRouteParams, ah as createFarmConfigResolutionPlugin, y as defineConfig, x as farmPlugin, af as getFarmAppDirectories, ag as getFarmLayerAliases, ae as getFarmSourceRoots, ai as loadFarmConfigFile, ad as resolveFarmLayers } from './client-plugins-CIPRtSsW.mjs';
4
+ export { g as fileExists, h as globFiles, l as logger, m as matchRoute, b as matchRouteParts, c as matchRoutePrefix, d as matchRoutePrefixParts, p as parseRoutePath, i as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, a as splitRoutePath, e as toPosixPath, t as toRootRelativeUrlPath, f as toViteModuleId } from './utils-5kQP1mFR.mjs';
5
5
  export { createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage } from './storage.mjs';
6
6
  export { CacheKeyFactory, DefinedCacheKey, FarmCacheAdapter, FarmCacheEntry, FarmCacheInvalidationStreamOptions, FarmCacheInvalidationTarget, FarmCacheOptions, FarmCacheSetOptions, FarmCacheStorage, FarmCacheUserConfig, FarmClientCacheUserConfig, FarmDataCache, GetFarmCacheEntryOptions, InferCacheKeyData, RevalidateTagProfile, RouteDataCacheKey, StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag } from './cache.mjs';
7
7
  export { AfterCallback, FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after } from './after.mjs';
8
8
  export { FARM_SERVER_QUERY_SYMBOL, ServerQuery, ServerQueryKey, ServerQueryOptions, ServerQueryOutputOptions, ServerQueryStaleTime, createServerQuery } from './server-query.mjs';
9
9
  import { ViteDevServer } from 'vite';
10
10
  import './types-Z0aotQ8w.mjs';
11
- export { g as getCurrentRequest } from './request-Blh_f7Z3.mjs';
11
+ export { g as getCurrentRequest } from './request-DZkHYQ89.mjs';
12
12
  import { ServerResponse } from 'node:http';
13
13
  export { getTheme, getThemeSnapshot } from './theme/server.mjs';
14
14
  export { DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, FarmServerActionsConfig, PreparedServerActionRequest, ResolvedFarmServerActionsConfig, SanitizedServerActionError, ServerActionRequestError, ServerActionRequestKind, createServerActionRequestErrorResponse, getServerActionExecutionContext, getServerActionInvalidations, getServerActionSignal, prepareServerActionRequest, resolveServerActionsConfig, runWithServerActionRequest, sanitizeServerActionError, validateServerActionRequest } from './server-action-security.mjs';
@@ -26,10 +26,11 @@ import './routes.mjs';
26
26
  import 'react';
27
27
  import './server-fn.mjs';
28
28
  import './server-fn-error-DDh14a0V.mjs';
29
+ import './endpoint-Bu3XgeMK.mjs';
29
30
  import './renderer.mjs';
30
31
  import './deployment.mjs';
31
32
  import './lifecycle-DK06VuKP.mjs';
32
- import './route-C6UClI1z.mjs';
33
+ import './route-C_eLaFTZ.mjs';
33
34
  import 'http';
34
35
  import './schema.mjs';
35
36
  import './integration-api-BbaiokCC.mjs';
@@ -42,8 +43,8 @@ import 'esbuild';
42
43
  import './types-DQnyD3VD.mjs';
43
44
  import './font.mjs';
44
45
  import './island-CfGru1MO.mjs';
45
- import './metadata-B1bxCPUY.mjs';
46
- import './render-plan-CNUlzylR.mjs';
46
+ import './metadata-OMX6wFNf.mjs';
47
+ import './render-plan-io7pvDNc.mjs';
47
48
  import './runtime-AOJge4vQ.mjs';
48
49
  import './resolver-DhW0CqZN.mjs';
49
50
 
package/dist/server.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-wIYse61b.js';
2
- import { w as FarmConfig } from './client-plugins-CslwYp3E.js';
3
- export { A as AppRoutePattern, a3 as BuildOptions, X as ErrorBoundary, O as ErrorProps, h as FarmAppContext, z as FarmComponentType, t as FarmContextFactory, I as FarmContextFactoryInput, J as FarmIsolatedClientHydrationMode, a8 as FarmLayerEntry, ac as FarmLayerResolution, D as FarmMigrationCommand, E as FarmMigrationsConfig, G as FarmMigrationsUserConfig, b as FarmRequest, c as FarmResponse, aa as FarmSourceRoot, $ as GenerateStaticParams, V as Layout, T as LayoutMetadataProps, a0 as LayoutModule, L as LayoutProps, W as Loading, K as LoadingProps, M as Metadata, a1 as MetadataJsonLd, S as MetadataProps, a7 as MetadataRobots, a6 as MetadataRobotsDirectives, u as MiddlewareProps, N as NitroPreset, U as Page, i as PageProps, Q as PagePropsWithMiddleware, C as PageRouteParams, P as ParsedRoute, j as PluginContextProps, ab as ResolveFarmLayersOptions, a9 as ResolvedFarmLayer, H as ResolvedFarmMigrationsConfig, k as RouteModule, R as RouteSegment, a5 as SSGCollectionResult, a4 as SSGPage, a2 as ServerAction, Z as StaticPathParams, Y as StaticPathPrimitive, _ as StaticRouteParams, ah as createFarmConfigResolutionPlugin, y as defineConfig, x as farmPlugin, af as getFarmAppDirectories, ag as getFarmLayerAliases, ae as getFarmSourceRoots, ai as loadFarmConfigFile, ad as resolveFarmLayers } from './client-plugins-CslwYp3E.js';
4
- export { g as fileExists, h as globFiles, l as logger, m as matchRoute, b as matchRouteParts, c as matchRoutePrefix, d as matchRoutePrefixParts, p as parseRoutePath, i as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, a as splitRoutePath, e as toPosixPath, t as toRootRelativeUrlPath, f as toViteModuleId } from './utils-jISOE9SD.js';
1
+ export { F as FarmApp, R as RouteManager, S as ServerRenderer, c as createFarmApp } from './app-AyjEsCBq.js';
2
+ import { w as FarmConfig } from './client-plugins-CqVtZi5X.js';
3
+ export { A as AppRoutePattern, a3 as BuildOptions, X as ErrorBoundary, O as ErrorProps, h as FarmAppContext, z as FarmComponentType, t as FarmContextFactory, I as FarmContextFactoryInput, J as FarmIsolatedClientHydrationMode, a8 as FarmLayerEntry, ac as FarmLayerResolution, D as FarmMigrationCommand, E as FarmMigrationsConfig, G as FarmMigrationsUserConfig, b as FarmRequest, c as FarmResponse, aa as FarmSourceRoot, $ as GenerateStaticParams, V as Layout, T as LayoutMetadataProps, a0 as LayoutModule, L as LayoutProps, W as Loading, K as LoadingProps, M as Metadata, a1 as MetadataJsonLd, S as MetadataProps, a7 as MetadataRobots, a6 as MetadataRobotsDirectives, u as MiddlewareProps, N as NitroPreset, U as Page, i as PageProps, Q as PagePropsWithMiddleware, C as PageRouteParams, P as ParsedRoute, j as PluginContextProps, ab as ResolveFarmLayersOptions, a9 as ResolvedFarmLayer, H as ResolvedFarmMigrationsConfig, k as RouteModule, R as RouteSegment, a5 as SSGCollectionResult, a4 as SSGPage, a2 as ServerAction, Z as StaticPathParams, Y as StaticPathPrimitive, _ as StaticRouteParams, ah as createFarmConfigResolutionPlugin, y as defineConfig, x as farmPlugin, af as getFarmAppDirectories, ag as getFarmLayerAliases, ae as getFarmSourceRoots, ai as loadFarmConfigFile, ad as resolveFarmLayers } from './client-plugins-CqVtZi5X.js';
4
+ export { g as fileExists, h as globFiles, l as logger, m as matchRoute, b as matchRouteParts, c as matchRoutePrefix, d as matchRoutePrefixParts, p as parseRoutePath, i as parseSearchParams, r as resolveAppPath, s as segmentsToPattern, a as splitRoutePath, e as toPosixPath, t as toRootRelativeUrlPath, f as toViteModuleId } from './utils-C4yrAhNc.js';
5
5
  export { createFarmStorage, createStorageClient, databaseStorage, defineStorageClient, disposeStorage, driverStorage, getStorage, initStorage, libsqlStorage, localStorage, memoryStorage, mongodbStorage, mysql2Storage, mysqlStorage, netlifyBlobsStorage, pgStorage, pgliteStorage, planetscaleStorage, postgresStorage, redisStorage, resolveStorageRuntimeClient, s3Storage, sqliteStorage, upstashStorage, vercelBlobStorage, vercelKVStorage } from './storage.js';
6
6
  export { CacheKeyFactory, DefinedCacheKey, FarmCacheAdapter, FarmCacheEntry, FarmCacheInvalidationStreamOptions, FarmCacheInvalidationTarget, FarmCacheOptions, FarmCacheSetOptions, FarmCacheStorage, FarmCacheUserConfig, FarmClientCacheUserConfig, FarmDataCache, GetFarmCacheEntryOptions, InferCacheKeyData, RevalidateTagProfile, RouteDataCacheKey, StorageFarmCacheAdapterOptions, applyFarmCacheInvalidationTargets, applyFarmCacheInvalidations, configureFarmCache, createFarmCacheInvalidationStream, createFarmCacheKey, createPathCacheTag, createRouteDataCacheKey, createRouteDataCacheTag, defineCacheKey, getFarmDataCache, invalidate, invalidateRouteData, normalizeRevalidatePath, revalidatePath, revalidateTag, storageCacheAdapter, unstable_cache, updateTag } from './cache.js';
7
7
  export { AfterCallback, FarmAfterPlatformContext, _runWithAfterNodeResponse, _runWithAfterRequest, _withAfterNodeMiddleware, after } from './after.js';
8
8
  export { FARM_SERVER_QUERY_SYMBOL, ServerQuery, ServerQueryKey, ServerQueryOptions, ServerQueryOutputOptions, ServerQueryStaleTime, createServerQuery } from './server-query.js';
9
9
  import { ViteDevServer } from 'vite';
10
10
  import './types-Z0aotQ8w.js';
11
- export { g as getCurrentRequest } from './request-DsVSQVfD.js';
11
+ export { g as getCurrentRequest } from './request-G8JhKr4F.js';
12
12
  import { ServerResponse } from 'node:http';
13
13
  export { getTheme, getThemeSnapshot } from './theme/server.js';
14
14
  export { DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT, FarmServerActionsConfig, PreparedServerActionRequest, ResolvedFarmServerActionsConfig, SanitizedServerActionError, ServerActionRequestError, ServerActionRequestKind, createServerActionRequestErrorResponse, getServerActionExecutionContext, getServerActionInvalidations, getServerActionSignal, prepareServerActionRequest, resolveServerActionsConfig, runWithServerActionRequest, sanitizeServerActionError, validateServerActionRequest } from './server-action-security.js';
@@ -26,10 +26,11 @@ import './routes.js';
26
26
  import 'react';
27
27
  import './server-fn.js';
28
28
  import './server-fn-error-DDh14a0V.js';
29
+ import './endpoint-kSAxE52R.js';
29
30
  import './renderer.js';
30
31
  import './deployment.js';
31
32
  import './lifecycle-DK06VuKP.js';
32
- import './route-CHBaW55F.js';
33
+ import './route-BxNJT447.js';
33
34
  import 'http';
34
35
  import './schema.js';
35
36
  import './integration-api-BbaiokCC.js';
@@ -42,8 +43,8 @@ import 'esbuild';
42
43
  import './types-DQnyD3VD.js';
43
44
  import './font.js';
44
45
  import './island-CfGru1MO.js';
45
- import './metadata-BsUcOEXg.js';
46
- import './render-plan-EG4hNFjy.js';
46
+ import './metadata-8g__AMPM.js';
47
+ import './render-plan-Be4ZGTJP.js';
47
48
  import './runtime-BirxPwbZ.js';
48
49
  import './resolver-PPEeiJ6M.js';
49
50
 
package/dist/server.mjs CHANGED
@@ -10,12 +10,12 @@ import {
10
10
  import {
11
11
  FARM_SERVER_QUERY_SYMBOL,
12
12
  createServerQuery
13
- } from "./chunk-W7IVHTOP.mjs";
14
- import "./chunk-S3QW3BIS.mjs";
13
+ } from "./chunk-UQZPTIML.mjs";
14
+ import "./chunk-VVTREAG5.mjs";
15
15
  import {
16
16
  loadConfig,
17
17
  resolveConfig
18
- } from "./chunk-GNTPTTLA.mjs";
18
+ } from "./chunk-IXTEENRS.mjs";
19
19
  import "./chunk-XZNTNMHT.mjs";
20
20
  import {
21
21
  loadFarmInstrumentation,
@@ -40,7 +40,7 @@ import {
40
40
  farmPlugin,
41
41
  farmServerOnlyEntriesPlugin,
42
42
  mergeFarmViteConfig
43
- } from "./chunk-JRF3C33L.mjs";
43
+ } from "./chunk-NHHKW2T6.mjs";
44
44
  import "./chunk-27JNCYEK.mjs";
45
45
  import {
46
46
  readSchemaTables
@@ -96,7 +96,7 @@ import {
96
96
  sanitizeServerActionError,
97
97
  validateServerActionRequest
98
98
  } from "./chunk-QCFFHV5H.mjs";
99
- import "./chunk-FOGLGRDS.mjs";
99
+ import "./chunk-7HDZYYS4.mjs";
100
100
  import "./chunk-KATQ6I56.mjs";
101
101
  import "./chunk-LUC2FAGW.mjs";
102
102
  import "./chunk-FA2W42OV.mjs";
@@ -188,7 +188,7 @@ import {
188
188
  } from "./chunk-Z2RZJZIZ.mjs";
189
189
  import {
190
190
  FARM_VERSION
191
- } from "./chunk-UE75PB52.mjs";
191
+ } from "./chunk-IL5RWYK7.mjs";
192
192
  import "./chunk-54UPOYFS.mjs";
193
193
  import "./chunk-WNSDDRNU.mjs";
194
194
  import "./chunk-JPLUGGRV.mjs";
@@ -1,8 +1,8 @@
1
- import { M as Metadata } from './client-plugins-C1EgdoJM.mjs';
1
+ import { M as Metadata } from './client-plugins-CIPRtSsW.mjs';
2
2
  import { F as FarmClientPluginManager } from './lifecycle-DK06VuKP.mjs';
3
3
  import { F as FarmI18nClientSnapshot } from './types-Z0aotQ8w.mjs';
4
4
  import { F as FarmIslandStrategy } from './island-CfGru1MO.mjs';
5
- import { F as FarmRouteRenderPlan } from './render-plan-CNUlzylR.mjs';
5
+ import { F as FarmRouteRenderPlan } from './render-plan-io7pvDNc.mjs';
6
6
 
7
7
  type NavigationMetadata = (Metadata & Record<string, any>) | undefined;
8
8
 
@@ -1,8 +1,8 @@
1
- import { M as Metadata } from './client-plugins-CslwYp3E.js';
1
+ import { M as Metadata } from './client-plugins-CqVtZi5X.js';
2
2
  import { F as FarmClientPluginManager } from './lifecycle-DK06VuKP.js';
3
3
  import { F as FarmI18nClientSnapshot } from './types-Z0aotQ8w.js';
4
4
  import { F as FarmIslandStrategy } from './island-CfGru1MO.js';
5
- import { F as FarmRouteRenderPlan } from './render-plan-EG4hNFjy.js';
5
+ import { F as FarmRouteRenderPlan } from './render-plan-Be4ZGTJP.js';
6
6
 
7
7
  type NavigationMetadata = (Metadata & Record<string, any>) | undefined;
8
8
 
@@ -1,12 +1,13 @@
1
1
  import { ReactElement } from 'react';
2
- import { t as FarmContextFactory, u as MiddlewareProps, j as PluginContextProps, k as RouteModule } from './client-plugins-C1EgdoJM.mjs';
2
+ import { t as FarmContextFactory, u as MiddlewareProps, j as PluginContextProps, k as RouteModule } from './client-plugins-CIPRtSsW.mjs';
3
3
  import './types-Z0aotQ8w.mjs';
4
+ import { ServerFn } from './server-fn.mjs';
4
5
  import { a as APIRouteParams } from './route-pattern-W-SsJGSp.mjs';
5
6
  import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.mjs';
6
7
  import { FarmRouterQueryValue, FarmRouterPathParams } from './router.mjs';
7
- import { ServerFn } from './server-fn.mjs';
8
8
  import './lifecycle-DK06VuKP.mjs';
9
- import './route-C6UClI1z.mjs';
9
+ import './route-C_eLaFTZ.mjs';
10
+ import './endpoint-Bu3XgeMK.mjs';
10
11
  import './cache.mjs';
11
12
  import './renderer.mjs';
12
13
  import './deployment.mjs';
@@ -31,6 +32,7 @@ import './server-action-security.mjs';
31
32
  import './server-fn-error-DDh14a0V.mjs';
32
33
  import 'esbuild';
33
34
  import './image-config-Duob7wER.mjs';
35
+ import './server-query.mjs';
34
36
  import './types-DQnyD3VD.mjs';
35
37
  import './font.mjs';
36
38
  import './after.mjs';
package/dist/testing.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ReactElement } from 'react';
2
- import { t as FarmContextFactory, u as MiddlewareProps, j as PluginContextProps, k as RouteModule } from './client-plugins-CslwYp3E.js';
2
+ import { t as FarmContextFactory, u as MiddlewareProps, j as PluginContextProps, k as RouteModule } from './client-plugins-CqVtZi5X.js';
3
3
  import './types-Z0aotQ8w.js';
4
+ import { ServerFn } from './server-fn.js';
4
5
  import { a as APIRouteParams } from './route-pattern-W-SsJGSp.js';
5
6
  import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.js';
6
7
  import { FarmRouterQueryValue, FarmRouterPathParams } from './router.js';
7
- import { ServerFn } from './server-fn.js';
8
8
  import './lifecycle-DK06VuKP.js';
9
- import './route-CHBaW55F.js';
9
+ import './route-BxNJT447.js';
10
+ import './endpoint-kSAxE52R.js';
10
11
  import './cache.js';
11
12
  import './renderer.js';
12
13
  import './deployment.js';
@@ -31,6 +32,7 @@ import './server-action-security.js';
31
32
  import './server-fn-error-DDh14a0V.js';
32
33
  import 'esbuild';
33
34
  import './image-config-Duob7wER.js';
35
+ import './server-query.js';
34
36
  import './types-DQnyD3VD.js';
35
37
  import './font.js';
36
38
  import './after.js';
@@ -1,4 +1,4 @@
1
- import { P as ParsedRoute, R as RouteSegment } from './client-plugins-C1EgdoJM.mjs';
1
+ import { P as ParsedRoute, R as RouteSegment } from './client-plugins-CIPRtSsW.mjs';
2
2
 
3
3
  declare function parseRoutePath(filePath: string): ParsedRoute;
4
4
  declare function segmentsToPattern(segments: RouteSegment[]): string;
@@ -1,4 +1,4 @@
1
- import { P as ParsedRoute, R as RouteSegment } from './client-plugins-CslwYp3E.js';
1
+ import { P as ParsedRoute, R as RouteSegment } from './client-plugins-CqVtZi5X.js';
2
2
 
3
3
  declare function parseRoutePath(filePath: string): ParsedRoute;
4
4
  declare function segmentsToPattern(segments: RouteSegment[]): string;
package/dist/version.cjs CHANGED
@@ -25,7 +25,7 @@ __export(version_exports, {
25
25
  module.exports = __toCommonJS(version_exports);
26
26
 
27
27
  // package.json
28
- var version = "0.1.15";
28
+ var version = "0.1.16";
29
29
 
30
30
  // src/version.ts
31
31
  var FARM_VERSION = version;
package/dist/version.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FARM_VERSION
3
- } from "./chunk-UE75PB52.mjs";
3
+ } from "./chunk-IL5RWYK7.mjs";
4
4
  import "./chunk-LPEX4YW6.mjs";
5
5
  export {
6
6
  FARM_VERSION