@farm.js/core 0.1.44 → 0.1.46
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/{agent-mcp-EnzWYv_X.d.ts → agent-mcp-BtK_KZ1m.d.ts} +2 -2
- package/dist/{agent-mcp-CWI-awqd.d.mts → agent-mcp-Cc-ypyNi.d.mts} +2 -2
- package/dist/agent-runtime.d.mts +10 -10
- package/dist/agent-runtime.d.ts +10 -10
- package/dist/api/client.d.mts +3 -3
- package/dist/api/client.d.ts +3 -3
- package/dist/api/route-manager.d.mts +16 -16
- package/dist/api/route-manager.d.ts +16 -16
- package/dist/api/runtime.d.mts +12 -12
- package/dist/api/runtime.d.ts +12 -12
- package/dist/{api-client-Dk9QOLwr.d.mts → api-client-CFdv-Xgh.d.mts} +3 -3
- package/dist/{api-client-BJv9mTbO.d.ts → api-client-CvI5oOBE.d.ts} +3 -3
- package/dist/api.d.mts +17 -17
- package/dist/api.d.ts +17 -17
- package/dist/{app-DG3dE8v5.d.mts → app-2SBLAaNq.d.mts} +8 -8
- package/dist/{app-CAN_2Cqo.d.ts → app-BlXGEpdA.d.ts} +8 -8
- package/dist/{app-manifest-DazjgQya.d.ts → app-manifest-D1Tgp8ya.d.ts} +1 -1
- package/dist/{app-manifest-8x5VjZ0L.d.mts → app-manifest-nZHIvS3a.d.mts} +1 -1
- package/dist/app-markdown.d.mts +11 -11
- package/dist/app-markdown.d.ts +11 -11
- package/dist/{base-path-BU16ETmo.d.mts → base-path-leyrqXbX.d.mts} +1 -1
- package/dist/{base-path-BU16ETmo.d.ts → base-path-leyrqXbX.d.ts} +1 -1
- package/dist/{chunk-YFLBG2W3.mjs → chunk-4GRLJURM.mjs} +1 -1
- package/dist/{chunk-GA6JM4L6.cjs → chunk-A7XJHKRK.cjs} +43 -43
- package/dist/{chunk-T44ECMEP.cjs → chunk-DQNWI2PV.cjs} +6 -6
- package/dist/{chunk-5GBL2LKD.cjs → chunk-E6Z63WDR.cjs} +237 -135
- package/dist/{chunk-3YJMBQ27.cjs → chunk-F6KWRHF5.cjs} +1 -1
- package/dist/{chunk-AI3WVJNP.cjs → chunk-HDFNAUSG.cjs} +50 -50
- package/dist/{chunk-R4J2UOV4.mjs → chunk-HNGR7CTG.mjs} +1 -1
- package/dist/{chunk-2MKTHHEU.mjs → chunk-JBL546U4.mjs} +3 -3
- package/dist/{chunk-QGFKXYC7.mjs → chunk-KLDBRGD5.mjs} +2 -2
- package/dist/{chunk-XUHIRBXY.mjs → chunk-TUGIZGTH.mjs} +1 -1
- package/dist/{chunk-ERA5RP3L.mjs → chunk-YLPEGQDE.mjs} +175 -73
- package/dist/{chunk-XPSGGECF.cjs → chunk-ZM6U54TC.cjs} +2 -2
- package/dist/{client-plugins-nQ0tYt4l.d.mts → client-plugins-DEmIQo5R.d.mts} +1438 -1438
- package/dist/{client-plugins-BGS0wqzc.d.ts → client-plugins-br48Hpmk.d.ts} +1438 -1438
- package/dist/client-plugins.d.mts +10 -10
- package/dist/client-plugins.d.ts +10 -10
- package/dist/client.d.mts +17 -17
- package/dist/client.d.ts +17 -17
- package/dist/config.d.mts +10 -10
- package/dist/config.d.ts +10 -10
- package/dist/docs.d.mts +11 -11
- package/dist/docs.d.ts +11 -11
- package/dist/{endpoint-BOE0IAaG.d.ts → endpoint-BgHn0lhl.d.ts} +1 -1
- package/dist/{endpoint-DGZRZHux.d.mts → endpoint-BkMSCRf6.d.mts} +1 -1
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config-BpH1q5R8.d.ts → image-config-CeDgNyX4.d.mts} +1 -1
- package/dist/{image-config-BpH1q5R8.d.mts → image-config-CeDgNyX4.d.ts} +1 -1
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/{index-BJJfLxJo.d.mts → index-Cl3akY5U.d.mts} +2 -2
- package/dist/{index-Cy26isrh.d.ts → index-CyD9Rfso.d.ts} +2 -2
- package/dist/{index-CwoOP-MW.d.ts → index-MocnSP3a.d.ts} +2 -2
- package/dist/{index-y1jgR74U.d.mts → index-_nhUt_dh.d.mts} +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.d.mts +32 -32
- package/dist/index.d.ts +32 -32
- package/dist/index.mjs +5 -5
- package/dist/{instrumentation-runtime-CE06JLHZ.d.mts → instrumentation-runtime-CX9Zh-16.d.mts} +1 -1
- package/dist/{instrumentation-runtime-CE06JLHZ.d.ts → instrumentation-runtime-CX9Zh-16.d.ts} +1 -1
- package/dist/instrumentation.d.mts +2 -2
- package/dist/instrumentation.d.ts +2 -2
- package/dist/integrations.d.mts +10 -10
- package/dist/integrations.d.ts +10 -10
- package/dist/internal/app-markdown-runtime.d.mts +11 -11
- package/dist/internal/app-markdown-runtime.d.ts +11 -11
- package/dist/internal/build-runtime.cjs +6 -6
- package/dist/internal/build-runtime.d.mts +12 -12
- package/dist/internal/build-runtime.d.ts +12 -12
- package/dist/internal/build-runtime.mjs +5 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +1 -1
- package/dist/internal/client-runtime.d.ts +1 -1
- package/dist/internal/compression-runtime.d.mts +10 -10
- package/dist/internal/compression-runtime.d.ts +10 -10
- package/dist/internal/config-runtime.d.mts +11 -11
- package/dist/internal/config-runtime.d.ts +11 -11
- package/dist/internal/form-actions.d.mts +1 -1
- package/dist/internal/form-actions.d.ts +1 -1
- package/dist/internal/islx-client.d.mts +4 -0
- package/dist/internal/islx-client.d.ts +4 -0
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +4 -4
- package/dist/internal/production-runtime.d.mts +25 -25
- package/dist/internal/production-runtime.d.ts +25 -25
- package/dist/internal/production-runtime.mjs +3 -3
- package/dist/{layers-CM5i6T7z.d.mts → layers-D9fbe-rz.d.mts} +1 -1
- package/dist/{layers-CM5i6T7z.d.ts → layers-D9fbe-rz.d.ts} +1 -1
- package/dist/markdown.d.mts +10 -10
- package/dist/markdown.d.ts +10 -10
- package/dist/middleware.d.mts +12 -12
- package/dist/middleware.d.ts +12 -12
- package/dist/navigation.d.mts +13 -13
- package/dist/navigation.d.ts +13 -13
- package/dist/{observability-CoXunYhS.d.mts → observability-B2363jB6.d.mts} +1 -1
- package/dist/{observability-CoXunYhS.d.ts → observability-B2363jB6.d.ts} +1 -1
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/og.d.mts +0 -5
- package/dist/og.d.ts +0 -5
- package/dist/plugin.cjs +5 -5
- package/dist/plugin.d.mts +12 -12
- package/dist/plugin.d.ts +12 -12
- package/dist/plugin.mjs +4 -4
- package/dist/{production-runtime-ClFA_1KQ.d.mts → production-runtime-BEbIyIUe.d.mts} +4 -4
- package/dist/{production-runtime-BVMDgHrA.d.ts → production-runtime-DsHjccVI.d.ts} +4 -4
- package/dist/{ssg-XnMHCyEc.d.ts → programmatic-routes-client-DlMKstmL.d.ts} +57 -57
- package/dist/{ssg-ByrOVYdM.d.mts → programmatic-routes-client-Dqr6tHND.d.mts} +57 -57
- package/dist/{render-plan-CoSovy_O.d.mts → render-plan-Bu6XOxNg.d.mts} +1 -1
- package/dist/{render-plan-y2DefWf8.d.ts → render-plan-MefW_fLC.d.ts} +1 -1
- package/dist/renderer/react/server.d.mts +1 -1
- package/dist/renderer/react/server.d.ts +1 -1
- package/dist/renderer-client.d.mts +12 -12
- package/dist/renderer-client.d.ts +12 -12
- package/dist/{request-cNM09Q7e.d.mts → request-BBe1B8Bk.d.mts} +1 -1
- package/dist/{request-aG5Wovm5.d.ts → request-CMsRJQK3.d.ts} +1 -1
- package/dist/request.d.mts +11 -11
- package/dist/request.d.ts +11 -11
- package/dist/{resolver-khasx3fU.d.mts → resolver-C2G-3Tm6.d.mts} +1 -1
- package/dist/{resolver-DadfRL6F.d.ts → resolver-DC57A4vz.d.ts} +1 -1
- package/dist/{integration-api-DWyMmvrR.d.mts → route-2_yXC6gv.d.mts} +100 -100
- package/dist/{integration-api-BuPHMeKz.d.ts → route-DFhZj6jN.d.ts} +100 -100
- package/dist/{route-pattern-W-SsJGSp.d.mts → route-pattern-CVsVbq5n.d.mts} +1 -1
- package/dist/{route-pattern-W-SsJGSp.d.ts → route-pattern-CVsVbq5n.d.ts} +1 -1
- package/dist/{route-rendering-EyInfsjI.d.mts → route-rendering-DTLNruPw.d.ts} +1 -1
- package/dist/{route-rendering-B3uQmCWX.d.ts → route-rendering-Do8tuYgh.d.mts} +1 -1
- package/dist/{router-DNUf-Bg1.d.ts → router-BJreOZ-k.d.ts} +2 -2
- package/dist/{router-Devibh4r.d.mts → router-o2mZB9Y4.d.mts} +2 -2
- package/dist/routes.d.mts +11 -11
- package/dist/routes.d.ts +11 -11
- package/dist/{runtime-BgDQzBiu.d.ts → runtime-B9HmxiZc.d.ts} +2 -2
- package/dist/{runtime-CV2UCV-5.d.mts → runtime-CCxTmGuf.d.mts} +2 -2
- package/dist/{runtime-CLr9P5kn.d.ts → runtime-Cp5YZNz4.d.mts} +5 -5
- package/dist/{runtime-9KZb8AI5.d.mts → runtime-Da57KD8F.d.ts} +5 -5
- package/dist/server-action-security.d.mts +1 -1
- package/dist/server-action-security.d.ts +1 -1
- package/dist/server-fn-client.d.mts +4 -4
- package/dist/server-fn-client.d.ts +4 -4
- package/dist/{server-fn-error-DDh14a0V.d.mts → server-fn-error-DrcH9cc1.d.mts} +1 -1
- package/dist/{server-fn-error-DDh14a0V.d.ts → server-fn-error-DrcH9cc1.d.ts} +1 -1
- package/dist/server-fn.d.mts +3 -3
- package/dist/server-fn.d.ts +3 -3
- package/dist/server-plugins.d.mts +11 -11
- package/dist/server-plugins.d.ts +11 -11
- package/dist/server-query-client.d.mts +2 -2
- package/dist/server-query-client.d.ts +2 -2
- package/dist/server-query.d.mts +2 -2
- package/dist/server-query.d.ts +2 -2
- package/dist/server.cjs +14 -14
- package/dist/server.d.mts +20 -20
- package/dist/server.d.ts +20 -20
- package/dist/server.mjs +4 -4
- package/dist/{spa-router-Ds6R_oe-.d.ts → spa-router-CN2vc0GY.d.ts} +4 -4
- package/dist/{spa-router-BIxh4IY-.d.mts → spa-router-COZLIB7k.d.mts} +4 -4
- package/dist/storage.d.mts +3 -3
- package/dist/storage.d.ts +3 -3
- package/dist/testing.d.mts +12 -12
- package/dist/testing.d.ts +12 -12
- package/dist/theme/server.d.mts +1 -1
- package/dist/theme/server.d.ts +1 -1
- package/dist/{types-CnH8DOqo.d.mts → types--Wh02r5_.d.mts} +1 -1
- package/dist/{types-CnH8DOqo.d.ts → types--Wh02r5_.d.ts} +1 -1
- package/dist/{types-Cc8l9IqS.d.ts → types-BnIqOn9w.d.mts} +1 -1
- package/dist/{types-Cc8l9IqS.d.mts → types-BnIqOn9w.d.ts} +1 -1
- package/dist/{utils-BN70ueSN.d.ts → utils-BAtVIHfw.d.mts} +2 -2
- package/dist/{utils-BrjR5xRs.d.mts → utils-Y8MZrj4b.d.ts} +2 -2
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +5 -5
- package/dist/vite.d.mts +14 -14
- package/dist/vite.d.ts +14 -14
- package/dist/vite.mjs +4 -4
- package/dist/{workflows-IWP1ddBm.d.mts → workflows-Df1C_7OG.d.mts} +1 -1
- package/dist/{workflows-IWP1ddBm.d.ts → workflows-Df1C_7OG.d.ts} +1 -1
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ var _chunkCGR525MJcjs = require('./chunk-CGR525MJ.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkDQNWI2PVcjs = require('./chunk-DQNWI2PV.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -82,7 +82,7 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
var
|
|
85
|
+
var _chunkA7XJHKRKcjs = require('./chunk-A7XJHKRK.cjs');
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
|
|
@@ -109,7 +109,7 @@ var _chunk3XEMGDBFcjs = require('./chunk-3XEMGDBF.cjs');
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
var
|
|
112
|
+
var _chunkZM6U54TCcjs = require('./chunk-ZM6U54TC.cjs');
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
var _chunkTI7UANHIcjs = require('./chunk-TI7UANHI.cjs');
|
|
@@ -224,7 +224,7 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
|
224
224
|
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
225
225
|
|
|
226
226
|
|
|
227
|
-
var
|
|
227
|
+
var _chunkF6KWRHF5cjs = require('./chunk-F6KWRHF5.cjs');
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
var _chunkC5GUTBZKcjs = require('./chunk-C5GUTBZK.cjs');
|
|
@@ -1965,7 +1965,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1965
1965
|
}
|
|
1966
1966
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
1967
1967
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
1968
|
-
await fs4.writeFile(clientCssPath,
|
|
1968
|
+
await fs4.writeFile(clientCssPath, _chunkA7XJHKRKcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
1969
1969
|
}
|
|
1970
1970
|
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
|
|
1971
1971
|
var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
|
|
@@ -2015,7 +2015,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2015
2015
|
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2016
2016
|
let plan = cache.get(key);
|
|
2017
2017
|
if (!plan) {
|
|
2018
|
-
plan =
|
|
2018
|
+
plan = _chunkA7XJHKRKcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2019
2019
|
cache.set(key, plan);
|
|
2020
2020
|
}
|
|
2021
2021
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2044,14 +2044,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2044
2044
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2045
2045
|
);
|
|
2046
2046
|
}
|
|
2047
|
-
const isolatedMode =
|
|
2047
|
+
const isolatedMode = _chunkA7XJHKRKcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2048
2048
|
_optionalChain([config, 'access', _39 => _39.experimental, 'optionalAccess', _40 => _40.isolatedClientHydration]),
|
|
2049
2049
|
{
|
|
2050
2050
|
serverComponents: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _41 => _41.experimental, 'optionalAccess', _42 => _42.serverComponents])) === "rsc",
|
|
2051
2051
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2052
2052
|
}
|
|
2053
2053
|
);
|
|
2054
|
-
const planOptions =
|
|
2054
|
+
const planOptions = _chunkA7XJHKRKcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2055
2055
|
config.renderer,
|
|
2056
2056
|
Boolean(unsupportedIntegrationProvider)
|
|
2057
2057
|
);
|
|
@@ -2102,7 +2102,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2102
2102
|
};
|
|
2103
2103
|
}
|
|
2104
2104
|
});
|
|
2105
|
-
const layoutAppliesToRoute =
|
|
2105
|
+
const layoutAppliesToRoute = _chunkZM6U54TCcjs.routeBoundaryCoversDirectory;
|
|
2106
2106
|
const routeDirectory = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (route) => _nullishCoalesce(route.directory, () => ( route.pattern)), "routeDirectory");
|
|
2107
2107
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2108
2108
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _45 => _45.docs, 'optionalAccess', _46 => _46.enabled]) && _optionalChain([config, 'access', _47 => _47.docs, 'access', _48 => _48.adapter, 'optionalAccess', _49 => _49.server]) && config.docs.adapter.react
|
|
@@ -2113,7 +2113,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2113
2113
|
), "isAdapterDocsRoute");
|
|
2114
2114
|
const syntheticDocsEntry = _optionalChain([config, 'access', _52 => _52.docs, 'optionalAccess', _53 => _53.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2115
2115
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2116
|
-
const markdownPagePlan =
|
|
2116
|
+
const markdownPagePlan = _chunkA7XJHKRKcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2117
2117
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2118
2118
|
root,
|
|
2119
2119
|
isolatedMode,
|
|
@@ -2129,7 +2129,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2129
2129
|
pagePlanOptions
|
|
2130
2130
|
)
|
|
2131
2131
|
}));
|
|
2132
|
-
|
|
2132
|
+
_chunkA7XJHKRKcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2133
2133
|
clientLayouts.map((layout) => ({
|
|
2134
2134
|
pattern: layout.pattern,
|
|
2135
2135
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2138,7 +2138,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2138
2138
|
[
|
|
2139
2139
|
...routePlans.map(({ route, metadata }) => ({
|
|
2140
2140
|
pattern: routeDirectory(route),
|
|
2141
|
-
depth:
|
|
2141
|
+
depth: _chunkZM6U54TCcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2142
2142
|
metadata
|
|
2143
2143
|
})),
|
|
2144
2144
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -2161,7 +2161,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2161
2161
|
for (const layout of clientLayouts) {
|
|
2162
2162
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
|
|
2163
2163
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2164
|
-
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${
|
|
2164
|
+
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkA7XJHKRKcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
2167
2167
|
if (isolatedMode === "analyze") {
|
|
@@ -2185,7 +2185,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2185
2185
|
);
|
|
2186
2186
|
if (metadata.suppressedAsyncHydration) {
|
|
2187
2187
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
2188
|
-
`\u26A0\uFE0F ${
|
|
2188
|
+
`\u26A0\uFE0F ${_chunkA7XJHKRKcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2189
2189
|
);
|
|
2190
2190
|
}
|
|
2191
2191
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
@@ -2210,7 +2210,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2210
2210
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries).flatMap((layout) => layout.isolatedBoundaries)
|
|
2211
2211
|
],
|
|
2212
2212
|
// The server renders a server tree only below a hydrating layout.
|
|
2213
|
-
...
|
|
2213
|
+
..._chunkA7XJHKRKcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2214
2214
|
});
|
|
2215
2215
|
_chunk5QIKR7RRcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2216
2216
|
}
|
|
@@ -2246,7 +2246,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2246
2246
|
}
|
|
2247
2247
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2248
2248
|
try {
|
|
2249
|
-
return
|
|
2249
|
+
return _chunkA7XJHKRKcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2250
2250
|
} catch (error) {
|
|
2251
2251
|
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2252
2252
|
return false;
|
|
@@ -2276,7 +2276,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2276
2276
|
config.trailingSlash,
|
|
2277
2277
|
_chunkB6XAA7V6cjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2278
2278
|
config.basePath,
|
|
2279
|
-
|
|
2279
|
+
_chunkA7XJHKRKcjs.generateClientCachePersistenceCode.call(void 0, _chunkA7XJHKRKcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2280
2280
|
adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2281
2281
|
_chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.serverComponents])) === "islands"
|
|
2282
2282
|
);
|
|
@@ -2365,7 +2365,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2365
2365
|
}
|
|
2366
2366
|
},
|
|
2367
2367
|
plugins: [
|
|
2368
|
-
|
|
2368
|
+
_chunkA7XJHKRKcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2369
2369
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2370
2370
|
outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
|
|
2371
2371
|
}),
|
|
@@ -2390,7 +2390,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2390
2390
|
...rendererVitePlugins,
|
|
2391
2391
|
...config.vite.plugins || [],
|
|
2392
2392
|
farmServerOnlyEntriesPlugin(),
|
|
2393
|
-
|
|
2393
|
+
_chunkA7XJHKRKcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
2394
2394
|
adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2395
2395
|
),
|
|
2396
2396
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -2452,7 +2452,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2452
2452
|
} : void 0,
|
|
2453
2453
|
// Ensure React is bundled for client
|
|
2454
2454
|
resolve: {
|
|
2455
|
-
alias:
|
|
2455
|
+
alias: _chunkA7XJHKRKcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2456
2456
|
dedupe: [...config.renderer.dedupe || []]
|
|
2457
2457
|
},
|
|
2458
2458
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2465,7 +2465,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2465
2465
|
]
|
|
2466
2466
|
}
|
|
2467
2467
|
};
|
|
2468
|
-
await viteBuild(
|
|
2468
|
+
await viteBuild(_chunkA7XJHKRKcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2469
2469
|
await mergeBuiltFontCss(outputDir);
|
|
2470
2470
|
await validateClientBuildOutput(root, srcDir, outputDir);
|
|
2471
2471
|
} finally {
|
|
@@ -3260,7 +3260,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3260
3260
|
direction: {}
|
|
3261
3261
|
}, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
3262
3262
|
const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
|
|
3263
|
-
const clientPluginEntry =
|
|
3263
|
+
const clientPluginEntry = _chunkA7XJHKRKcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3264
3264
|
plugins,
|
|
3265
3265
|
root,
|
|
3266
3266
|
srcDir,
|
|
@@ -3271,7 +3271,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3271
3271
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3272
3272
|
import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3273
3273
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3274
|
-
const providerClientCode =
|
|
3274
|
+
const providerClientCode = _chunkA7XJHKRKcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3275
3275
|
integrationProviders,
|
|
3276
3276
|
root,
|
|
3277
3277
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -3283,12 +3283,12 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
3283
3283
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
3284
3284
|
layoutRoutes.forEach((layout, index) => {
|
|
3285
3285
|
const relativePath = toImportPath(layout.modulePath);
|
|
3286
|
-
const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) =>
|
|
3286
|
+
const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunkDQNWI2PVcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
|
|
3287
3287
|
if (rendersOnClient) {
|
|
3288
3288
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
3289
3289
|
}
|
|
3290
|
-
const groupScope =
|
|
3291
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
3290
|
+
const groupScope = _chunkZM6U54TCcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3291
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkZM6U54TCcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
3292
3292
|
layoutRegistrations.push(
|
|
3293
3293
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
|
|
3294
3294
|
);
|
|
@@ -3791,7 +3791,7 @@ function hasHydratableLayout(pathname) {
|
|
|
3791
3791
|
});
|
|
3792
3792
|
}
|
|
3793
3793
|
|
|
3794
|
-
${
|
|
3794
|
+
${_chunkA7XJHKRKcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
3795
3795
|
// Wrap a page element with applicable layouts
|
|
3796
3796
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
3797
3797
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4938,7 +4938,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4938
4938
|
}
|
|
4939
4939
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
4940
4940
|
const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
4941
|
-
const notFoundPath =
|
|
4941
|
+
const notFoundPath = _chunkA7XJHKRKcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
4942
4942
|
if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
4943
4943
|
layoutRoutes.sort((a, b) => {
|
|
4944
4944
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -4960,7 +4960,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4960
4960
|
);
|
|
4961
4961
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
4962
4962
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _67 => _67.mdx, 'optionalAccess', _68 => _68.components]));
|
|
4963
|
-
const hasMiddlewareConfig =
|
|
4963
|
+
const hasMiddlewareConfig = _chunkZM6U54TCcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
4964
4964
|
const hasRouteContextConfig = _chunkLPE3ED4Rcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
4965
4965
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
4966
4966
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
@@ -5144,7 +5144,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5144
5144
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _79 => _79.env, 'optionalAccess', _80 => _80.public]) || {})
|
|
5145
5145
|
},
|
|
5146
5146
|
plugins: [
|
|
5147
|
-
|
|
5147
|
+
_chunkA7XJHKRKcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
5148
5148
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
5149
5149
|
...rendererVitePlugins,
|
|
5150
5150
|
...config.vite.plugins || [],
|
|
@@ -5197,7 +5197,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5197
5197
|
resolve: {
|
|
5198
5198
|
alias: [
|
|
5199
5199
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
5200
|
-
...Object.entries(
|
|
5200
|
+
...Object.entries(_chunkA7XJHKRKcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
5201
5201
|
([find, replacement]) => ({ find, replacement })
|
|
5202
5202
|
)
|
|
5203
5203
|
],
|
|
@@ -5205,7 +5205,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5205
5205
|
dedupe: [...config.renderer.dedupe || []]
|
|
5206
5206
|
}
|
|
5207
5207
|
};
|
|
5208
|
-
await viteBuild(
|
|
5208
|
+
await viteBuild(_chunkA7XJHKRKcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
5209
5209
|
} finally {
|
|
5210
5210
|
if (postcssConfigDir) {
|
|
5211
5211
|
try {
|
|
@@ -5253,7 +5253,7 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
5253
5253
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
5254
5254
|
middlewareRoutes
|
|
5255
5255
|
};
|
|
5256
|
-
return _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkMY5PZYADcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) =>
|
|
5256
|
+
return _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkMY5PZYADcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkZM6U54TCcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
5257
5257
|
}
|
|
5258
5258
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmDocsGuardedPaths, "getFarmDocsGuardedPaths");
|
|
5259
5259
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
@@ -5655,7 +5655,7 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5655
5655
|
const hasGeneratedMetadataImages = metadataImageRoutes.some(
|
|
5656
5656
|
(image) => image.sourceType === "module"
|
|
5657
5657
|
);
|
|
5658
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
5658
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkZM6U54TCcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5659
5659
|
const farmDocsFontAssets = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
5660
5660
|
const integrationProviders = _chunkB6XAA7V6cjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
5661
5661
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
@@ -5666,7 +5666,7 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5666
5666
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
5667
5667
|
);
|
|
5668
5668
|
}
|
|
5669
|
-
const providerServerModules =
|
|
5669
|
+
const providerServerModules = _chunkA7XJHKRKcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
5670
5670
|
renderedIntegrationProviders,
|
|
5671
5671
|
config.root,
|
|
5672
5672
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -5686,14 +5686,14 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5686
5686
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
5687
5687
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
5688
5688
|
);
|
|
5689
|
-
const isolatedHydrationMode =
|
|
5689
|
+
const isolatedHydrationMode = _chunkA7XJHKRKcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
5690
5690
|
_optionalChain([config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.isolatedClientHydration]),
|
|
5691
5691
|
{
|
|
5692
5692
|
serverComponents: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "rsc",
|
|
5693
5693
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
5694
5694
|
}
|
|
5695
5695
|
);
|
|
5696
|
-
const hydrationPlanOptions =
|
|
5696
|
+
const hydrationPlanOptions = _chunkA7XJHKRKcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
5697
5697
|
config.renderer,
|
|
5698
5698
|
Boolean(unsupportedIntegrationProvider)
|
|
5699
5699
|
);
|
|
@@ -5711,7 +5711,7 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5711
5711
|
hydrationPlanOptions
|
|
5712
5712
|
)
|
|
5713
5713
|
}));
|
|
5714
|
-
const markdownPagePlan =
|
|
5714
|
+
const markdownPagePlan = _chunkA7XJHKRKcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
5715
5715
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
5716
5716
|
config.root,
|
|
5717
5717
|
isolatedHydrationMode,
|
|
@@ -5729,7 +5729,7 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5729
5729
|
)
|
|
5730
5730
|
])
|
|
5731
5731
|
);
|
|
5732
|
-
|
|
5732
|
+
_chunkA7XJHKRKcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
5733
5733
|
layoutHydrationPlans.map((layout) => ({
|
|
5734
5734
|
pattern: layout.pattern,
|
|
5735
5735
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -5738,10 +5738,10 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5738
5738
|
pageRoutes.map((route) => ({
|
|
5739
5739
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
5740
5740
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
5741
|
-
depth:
|
|
5741
|
+
depth: _chunkZM6U54TCcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
5742
5742
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
5743
5743
|
})),
|
|
5744
|
-
|
|
5744
|
+
_chunkZM6U54TCcjs.routeBoundaryCoversDirectory
|
|
5745
5745
|
);
|
|
5746
5746
|
const providerServerImports = [
|
|
5747
5747
|
providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
|
|
@@ -5803,7 +5803,7 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5803
5803
|
module: ${varName},
|
|
5804
5804
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
5805
5805
|
clientModule: ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
5806
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
5806
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkA7XJHKRKcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
|
|
5807
5807
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
5808
5808
|
${route.source !== void 0 ? `markdownSource: {
|
|
5809
5809
|
source: ${JSON.stringify(route.source)},
|
|
@@ -5860,12 +5860,12 @@ function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
|
5860
5860
|
errorImports.push(
|
|
5861
5861
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
5862
5862
|
);
|
|
5863
|
-
const groupScope =
|
|
5863
|
+
const groupScope = _chunkZM6U54TCcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
5864
5864
|
errorRegistrations.push(`
|
|
5865
5865
|
{
|
|
5866
|
-
pattern: ${JSON.stringify(
|
|
5866
|
+
pattern: ${JSON.stringify(_chunkZM6U54TCcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
5867
5867
|
groupScope: ${JSON.stringify(groupScope)},
|
|
5868
|
-
directoryDepth: ${
|
|
5868
|
+
directoryDepth: ${_chunkZM6U54TCcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
5869
5869
|
module: ${varName},
|
|
5870
5870
|
}`);
|
|
5871
5871
|
});
|
|
@@ -6061,7 +6061,7 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
6061
6061
|
const integrationRuntimeImport = integrationRuntimeExports.length ? `import { ${integrationRuntimeExports.join(", ")} } from "@farm.js/core/integrations";` : "";
|
|
6062
6062
|
const instrumentationImport = instrumentationPath ? `import * as FarmInstrumentationModule from ${toVirtualEntryImportSpecifier(instrumentationPath)};` : "";
|
|
6063
6063
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
6064
|
-
const nativeMCP =
|
|
6064
|
+
const nativeMCP = _chunkDQNWI2PVcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
6065
6065
|
const integrationImports = `
|
|
6066
6066
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
6067
6067
|
${layerConfigImports}
|
|
@@ -6069,7 +6069,7 @@ ${integrationRuntimeImport}
|
|
|
6069
6069
|
${nativeAuth.importSource}
|
|
6070
6070
|
${nativeMCP.importSource}
|
|
6071
6071
|
`;
|
|
6072
|
-
const imageRuntime =
|
|
6072
|
+
const imageRuntime = _chunkA7XJHKRKcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
6073
6073
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
6074
6074
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
6075
6075
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6248,7 +6248,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
6248
6248
|
|
|
6249
6249
|
function FarmDefault404Page() {
|
|
6250
6250
|
return React.createElement(React.Fragment, null,
|
|
6251
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
6251
|
+
React.createElement("style", null, ${JSON.stringify(_chunkA7XJHKRKcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
6252
6252
|
React.createElement("main", {
|
|
6253
6253
|
className: "farm-default-not-found",
|
|
6254
6254
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -6551,12 +6551,12 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
6551
6551
|
}
|
|
6552
6552
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
6553
6553
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
6554
|
-
${_optionalChain([config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(
|
|
6554
|
+
${_optionalChain([config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkZM6U54TCcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
6555
6555
|
` : ""}${_optionalChain([config, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
6556
|
-
|
|
6556
|
+
_chunkZM6U54TCcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
6557
6557
|
build: config.deploymentId,
|
|
6558
|
-
packages:
|
|
6559
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
6558
|
+
packages: _chunkA7XJHKRKcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
6559
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkA7XJHKRKcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
6560
6560
|
})
|
|
6561
6561
|
)};
|
|
6562
6562
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -7020,6 +7020,73 @@ function createFarmDocumentStream(contentStream, prefix, suffix, onComplete) {
|
|
|
7020
7020
|
});
|
|
7021
7021
|
}
|
|
7022
7022
|
|
|
7023
|
+
// Streams a layout's own <html> document. React's output is held until the opening <body>, so
|
|
7024
|
+
// Farm's head assets go into the document's head (openDocument); the body then streams through.
|
|
7025
|
+
// The closing </body></html> React writes with its shell is held back: Suspense content React
|
|
7026
|
+
// streams later belongs inside the body, before Farm's footer (closeDocument) and the closing tags.
|
|
7027
|
+
function createFarmFullDocumentStream(contentStream, openDocument, closeDocument, onComplete) {
|
|
7028
|
+
const encoder = new TextEncoder();
|
|
7029
|
+
const decoder = new TextDecoder();
|
|
7030
|
+
const reader = contentStream.getReader();
|
|
7031
|
+
// The footer renders after the handler returned, outside its async scope.
|
|
7032
|
+
const cspNonce = _resolveCurrentCspNonce();
|
|
7033
|
+
let opening = "";
|
|
7034
|
+
let opened = false;
|
|
7035
|
+
let rootOpened = false;
|
|
7036
|
+
let closing = false;
|
|
7037
|
+
return new ReadableStream({
|
|
7038
|
+
async pull(controller) {
|
|
7039
|
+
try {
|
|
7040
|
+
for (;;) {
|
|
7041
|
+
const result = await reader.read();
|
|
7042
|
+
let text = result.done ? decoder.decode() : decoder.decode(result.value, { stream: true });
|
|
7043
|
+
if (!opened) {
|
|
7044
|
+
opening += text;
|
|
7045
|
+
if (!result.done && !/<body\\b[^>]*>/i.test(opening)) continue;
|
|
7046
|
+
opened = true;
|
|
7047
|
+
text = opening;
|
|
7048
|
+
opening = "";
|
|
7049
|
+
const closeAt = text.search(/<\\/body>/i);
|
|
7050
|
+
const head = closeAt >= 0 ? text.slice(0, closeAt) : text;
|
|
7051
|
+
const rest = closeAt >= 0 ? text.slice(closeAt) : "";
|
|
7052
|
+
// ensureFarmDocumentRoot opens #root unless the layout's body already does.
|
|
7053
|
+
rootOpened = !/<body\\b[^>]*>\\s*<div\\b[^>]*\\sid=["']root["']/i.test(head);
|
|
7054
|
+
text = openDocument(head) + rest;
|
|
7055
|
+
}
|
|
7056
|
+
if (!closing) {
|
|
7057
|
+
const closeAt = text.search(/<\\/body>/i);
|
|
7058
|
+
if (closeAt >= 0) {
|
|
7059
|
+
closing = true;
|
|
7060
|
+
// Drop the closing tags and Farm's wrapper divs around the document; keep what React
|
|
7061
|
+
// wrote after them.
|
|
7062
|
+
text = text.slice(0, closeAt) +
|
|
7063
|
+
text.slice(closeAt).replace(/^<\\/body>\\s*(?:<\\/html>)?(?:\\s*<\\/div>)*/i, "");
|
|
7064
|
+
}
|
|
7065
|
+
}
|
|
7066
|
+
if (result.done) {
|
|
7067
|
+
const footer = await _runWithFarmCspNonce(cspNonce, function() {
|
|
7068
|
+
return closeDocument(rootOpened);
|
|
7069
|
+
});
|
|
7070
|
+
controller.enqueue(encoder.encode(text + footer + "</body>\\n</html>"));
|
|
7071
|
+
if (onComplete) onComplete();
|
|
7072
|
+
controller.close();
|
|
7073
|
+
return;
|
|
7074
|
+
}
|
|
7075
|
+
if (text) {
|
|
7076
|
+
controller.enqueue(encoder.encode(text));
|
|
7077
|
+
return;
|
|
7078
|
+
}
|
|
7079
|
+
}
|
|
7080
|
+
} catch (error) {
|
|
7081
|
+
controller.error(error);
|
|
7082
|
+
}
|
|
7083
|
+
},
|
|
7084
|
+
cancel(reason) {
|
|
7085
|
+
return reader.cancel(reason);
|
|
7086
|
+
},
|
|
7087
|
+
});
|
|
7088
|
+
}
|
|
7089
|
+
|
|
7023
7090
|
function stripFarmDocumentWrappers(markup) {
|
|
7024
7091
|
return peelFarmDocumentPrefix(markup).inner;
|
|
7025
7092
|
}
|
|
@@ -7031,7 +7098,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
7031
7098
|
let inner = markup.replace(/^\\s+/, "");
|
|
7032
7099
|
let hoisted = "";
|
|
7033
7100
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
7034
|
-
const hoistable = /${
|
|
7101
|
+
const hoistable = /${_chunkZM6U54TCcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
7035
7102
|
let match;
|
|
7036
7103
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
7037
7104
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -7562,7 +7629,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
7562
7629
|
// a route guard.
|
|
7563
7630
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
7564
7631
|
pageRoutes.map((route) => route.pattern).filter(
|
|
7565
|
-
(pattern) => !pattern.includes("[") &&
|
|
7632
|
+
(pattern) => !pattern.includes("[") && _chunkZM6U54TCcjs.farmPathGuardCoversPage.call(void 0,
|
|
7566
7633
|
{
|
|
7567
7634
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
7568
7635
|
middlewareRoutes
|
|
@@ -7609,7 +7676,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
7609
7676
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
7610
7677
|
// registered at runtime, such as the docs engine's.
|
|
7611
7678
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
7612
|
-
_chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
7679
|
+
_chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkF6KWRHF5cjs.FARM_VERSION)
|
|
7613
7680
|
)};
|
|
7614
7681
|
let farmDefaultMCPRouteFree;
|
|
7615
7682
|
function getFarmDefaultMCPServer() {
|
|
@@ -8646,7 +8713,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8646
8713
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
8647
8714
|
// public manifest, the same document for every request.
|
|
8648
8715
|
if (
|
|
8649
|
-
[${JSON.stringify(
|
|
8716
|
+
[${JSON.stringify(_chunkZM6U54TCcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkZM6U54TCcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
8650
8717
|
normalizeRuntimePath(routePathname),
|
|
8651
8718
|
)
|
|
8652
8719
|
) {
|
|
@@ -8658,7 +8725,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8658
8725
|
` : ""}
|
|
8659
8726
|
${_optionalChain([config, 'access', _167 => _167.agent, 'optionalAccess', _168 => _168.apiCatalog]) ? `
|
|
8660
8727
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
8661
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
8728
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkZM6U54TCcjs.FARM_API_CATALOG_PATH)}) {
|
|
8662
8729
|
return applyProductionMiddlewareHeaders(
|
|
8663
8730
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
8664
8731
|
middlewareHeaders,
|
|
@@ -9306,15 +9373,60 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9306
9373
|
const initialHtml = html !== undefined ? html : renderedPage.shellHtml || "";
|
|
9307
9374
|
const hasFullDocument = opensFarmFullDocument(initialHtml);
|
|
9308
9375
|
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
//
|
|
9312
|
-
//
|
|
9313
|
-
|
|
9376
|
+
const rendererHead = renderedPage.head || "";
|
|
9377
|
+
const rendererHasTitle = /<title[\\s>]/i.test(rendererHead);
|
|
9378
|
+
// First <title> wins: the fallback framework title yields to a
|
|
9379
|
+
// renderer-emitted one; explicit metadata titles still come first.
|
|
9380
|
+
const suppressDefaultTitle =
|
|
9381
|
+
!renderedMetadata.hasExplicitTitle && rendererHasTitle;
|
|
9382
|
+
// A layout's own <html> document with Farm's head assets merged in and the #root the client
|
|
9383
|
+
// hydrates opening its body: the whole document, or a streamed one's opening.
|
|
9384
|
+
const composeFarmFullDocument = function(markup) {
|
|
9385
|
+
let composed = addFarmFallbackIcon(
|
|
9386
|
+
ensureFarmDocumentRoot(ensureFarmDocumentHead(markup)),
|
|
9387
|
+
hasFavicon,
|
|
9388
|
+
);
|
|
9389
|
+
composed = composed
|
|
9390
|
+
// Inject CSS link after opening head tag or first meta tag
|
|
9391
|
+
.replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + renderFarmClientModulePreloads(composed, route.clientModule); })
|
|
9392
|
+
.replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
|
|
9393
|
+
// Explicit metadata wins over renderer and layout titles. Without
|
|
9394
|
+
// explicit metadata, a renderer title wins over the layout title.
|
|
9395
|
+
.replace(/<head([^>]*)>([\\s\\S]*?)<\\/head>/i, (match, attrs, headContent) => {
|
|
9396
|
+
const hasAuthoritativeTitle = renderedMetadata.hasExplicitTitle || rendererHasTitle;
|
|
9397
|
+
let nextHeadContent = hasAuthoritativeTitle
|
|
9398
|
+
? headContent.replace(/<title\\b[^>]*>[\\s\\S]*?<\\/title>\\s*/gi, "")
|
|
9399
|
+
: headContent;
|
|
9400
|
+
if (renderedMetadata.hasExplicitTitle) {
|
|
9401
|
+
nextHeadContent += "\\n <title>" + title + "</title>";
|
|
9402
|
+
}
|
|
9403
|
+
if (metaTags) nextHeadContent += metaTags;
|
|
9404
|
+
// Renderer-emitted head markup (e.g. <svelte:head>). Function
|
|
9405
|
+
// replacement below keeps $-sequences literal.
|
|
9406
|
+
const effectiveRendererHead = renderedMetadata.hasExplicitTitle
|
|
9407
|
+
? rendererHead.replace(/<title\\b[^>]*>[\\s\\S]*?<\\/title>\\s*/gi, "")
|
|
9408
|
+
: rendererHead;
|
|
9409
|
+
if (effectiveRendererHead) nextHeadContent += "\\n " + effectiveRendererHead;
|
|
9410
|
+
return nextHeadContent === headContent
|
|
9411
|
+
? match
|
|
9412
|
+
: "<head" + attrs + ">" + nextHeadContent + "\\n</head>";
|
|
9413
|
+
});
|
|
9414
|
+
// Last, so the charset (and the viewport, unless the layout wrote one) open the head.
|
|
9415
|
+
composed = ensureFarmDocumentMeta(composed, viewportTags);
|
|
9416
|
+
if (!composed.trim().startsWith('<!DOCTYPE')) {
|
|
9417
|
+
composed = '<!DOCTYPE html>\\n' + composed;
|
|
9418
|
+
}
|
|
9419
|
+
return composed;
|
|
9420
|
+
};
|
|
9421
|
+
|
|
9422
|
+
// Stream a suspended body as soon as React's shell is ready, a layout's own <html> document
|
|
9423
|
+
// included. Localized documents and cacheable PPR shells still use the buffered path
|
|
9424
|
+
// because they require whole-document transformation, and so does the anonymous check
|
|
9425
|
+
// behind a page's Markdown source: there, a redirect() under a loading boundary must still
|
|
9426
|
+
// decide the status.
|
|
9314
9427
|
if (
|
|
9315
9428
|
pageStatus === 200 &&
|
|
9316
9429
|
renderedPage.stream &&
|
|
9317
|
-
!hasFullDocument &&
|
|
9318
9430
|
!farmI18nSnapshot &&
|
|
9319
9431
|
!pprCacheKey &&
|
|
9320
9432
|
!_isFarmMarkdownPageCheck(request.headers.get(FARM_MARKDOWN_PAGE_CHECK_HEADER))
|
|
@@ -9324,6 +9436,15 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9324
9436
|
farmResolvedRuntimeConfig.basePath,
|
|
9325
9437
|
getFarmTheme(request)
|
|
9326
9438
|
);
|
|
9439
|
+
// The page's client data and entry, after its content.
|
|
9440
|
+
const farmClientScripts = function() {
|
|
9441
|
+
return ' ' + renderFarmClientBootstrapScript(
|
|
9442
|
+
pageProps.__farmCanonicalPath,
|
|
9443
|
+
routeSlotPayload,
|
|
9444
|
+
clientPageProps
|
|
9445
|
+
) + '\\n' +
|
|
9446
|
+
' ' + renderFarmClientEntryScript() + '\\n';
|
|
9447
|
+
};
|
|
9327
9448
|
const streamPrefix = '<!DOCTYPE html>\\n<html lang="en">\\n<head>\\n' +
|
|
9328
9449
|
farmThemeDocument.head + '\\n' +
|
|
9329
9450
|
' <meta charset="utf-8">\\n' +
|
|
@@ -9334,32 +9455,22 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9334
9455
|
' <link rel="modulepreload" href="/__farm_client_js_src__">' + renderFarmClientModulePreloads(null, route.clientModule) + '\\n' +
|
|
9335
9456
|
renderFarmRendererHydrationScript() + '\\n' +
|
|
9336
9457
|
'</head>\\n<body>\\n <div id="root">';
|
|
9337
|
-
const streamSuffix = '</div>\\n' +
|
|
9338
|
-
' ' + renderFarmClientBootstrapScript(
|
|
9339
|
-
pageProps.__farmCanonicalPath,
|
|
9340
|
-
routeSlotPayload,
|
|
9341
|
-
clientPageProps
|
|
9342
|
-
) + '\\n' +
|
|
9343
|
-
' ' + renderFarmClientEntryScript() + '\\n' +
|
|
9344
|
-
'</body>\\n</html>';
|
|
9458
|
+
const streamSuffix = '</div>\\n' + farmClientScripts() + '</body>\\n</html>';
|
|
9345
9459
|
const themedStreamPrefix = streamPrefix.replace(
|
|
9346
9460
|
'<html lang="en">',
|
|
9347
9461
|
() => '<html lang="en"' + farmThemeDocument.attributes + '>'
|
|
9348
9462
|
);
|
|
9349
|
-
const
|
|
9350
|
-
renderedPage.stream,
|
|
9351
|
-
themedStreamPrefix,
|
|
9352
|
-
async function() {
|
|
9463
|
+
const lateNavigationRecovery = async function() {
|
|
9353
9464
|
// A redirect()/notFound() after the 200 shell went out can only
|
|
9354
9465
|
// be recovered in the document.
|
|
9355
9466
|
const lateNavigationError = renderedPage.streamErrors.find(function(error) {
|
|
9356
9467
|
return isFarmRedirectError(error) || isFarmNotFoundError(error);
|
|
9357
9468
|
});
|
|
9358
|
-
if (!lateNavigationError) return
|
|
9469
|
+
if (!lateNavigationError) return "";
|
|
9359
9470
|
if (isFarmRedirectError(lateNavigationError)) {
|
|
9360
9471
|
return createLateRedirectRecovery(
|
|
9361
9472
|
getFarmRedirectError(lateNavigationError).url
|
|
9362
|
-
)
|
|
9473
|
+
);
|
|
9363
9474
|
}
|
|
9364
9475
|
try {
|
|
9365
9476
|
return createLateNotFoundRecovery(
|
|
@@ -9367,7 +9478,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9367
9478
|
wrapWithFarmIntegrationProviders(createFarmNotFoundElement(pathname)),
|
|
9368
9479
|
getFarmRendererRenderOptions()
|
|
9369
9480
|
)
|
|
9370
|
-
)
|
|
9481
|
+
);
|
|
9371
9482
|
} catch (error) {
|
|
9372
9483
|
// The layouts are already in the shell; a not-found page that
|
|
9373
9484
|
// needs their context cannot render alone, so use Farm's.
|
|
@@ -9377,10 +9488,10 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9377
9488
|
React.createElement(FarmDefault404Page),
|
|
9378
9489
|
getFarmRendererRenderOptions()
|
|
9379
9490
|
)
|
|
9380
|
-
)
|
|
9491
|
+
);
|
|
9381
9492
|
}
|
|
9382
|
-
}
|
|
9383
|
-
|
|
9493
|
+
};
|
|
9494
|
+
const onStreamComplete = function() {
|
|
9384
9495
|
if (pprBypassReason === "refresh") {
|
|
9385
9496
|
emitFarmEvent({
|
|
9386
9497
|
type: "ppr.refresh.complete",
|
|
@@ -9395,8 +9506,41 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9395
9506
|
status: pageStatus,
|
|
9396
9507
|
durationMs: Date.now() - requestStartTime,
|
|
9397
9508
|
});
|
|
9398
|
-
}
|
|
9399
|
-
|
|
9509
|
+
};
|
|
9510
|
+
const streamedDocument = hasFullDocument
|
|
9511
|
+
? createFarmFullDocumentStream(
|
|
9512
|
+
renderedPage.stream,
|
|
9513
|
+
function(opening) {
|
|
9514
|
+
// Farm's wrappers and the head elements React hoisted ahead of the layout's <html>.
|
|
9515
|
+
const peeled = peelFarmDocumentPrefix(opening);
|
|
9516
|
+
const start = opening.search(/<!doctype|<html[\\s>]/i);
|
|
9517
|
+
return applyFarmThemeDocument(
|
|
9518
|
+
composeFarmFullDocument(
|
|
9519
|
+
restoreFarmHoistedHead(opening.slice(Math.max(start, 0)), peeled.hoisted)
|
|
9520
|
+
// The client entry arrives last: fetch it while the body streams.
|
|
9521
|
+
).replace(/<\\/head>/i, function() {
|
|
9522
|
+
return ' <link rel="modulepreload" href="/__farm_client_js_src__">\\n</head>';
|
|
9523
|
+
}),
|
|
9524
|
+
farmThemeConfig,
|
|
9525
|
+
farmResolvedRuntimeConfig.basePath,
|
|
9526
|
+
getFarmTheme(request)
|
|
9527
|
+
);
|
|
9528
|
+
},
|
|
9529
|
+
async function(rootOpened) {
|
|
9530
|
+
return (await lateNavigationRecovery()) +
|
|
9531
|
+
(rootOpened ? '</div>\\n' : '') +
|
|
9532
|
+
farmClientScripts();
|
|
9533
|
+
},
|
|
9534
|
+
onStreamComplete
|
|
9535
|
+
)
|
|
9536
|
+
: createFarmDocumentStream(
|
|
9537
|
+
renderedPage.stream,
|
|
9538
|
+
themedStreamPrefix,
|
|
9539
|
+
async function() {
|
|
9540
|
+
return (await lateNavigationRecovery()) + streamSuffix;
|
|
9541
|
+
},
|
|
9542
|
+
onStreamComplete
|
|
9543
|
+
);
|
|
9400
9544
|
return applyProductionMiddlewareHeaders(farmOwnedResponse(streamedDocument, {
|
|
9401
9545
|
status: pageStatus,
|
|
9402
9546
|
headers: { ...responseHeaders, "x-farm-preload-streaming": "1" },
|
|
@@ -9410,44 +9554,10 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9410
9554
|
}
|
|
9411
9555
|
}
|
|
9412
9556
|
|
|
9413
|
-
const rendererHead = renderedPage.head || "";
|
|
9414
|
-
const rendererHasTitle = /<title[\\s>]/i.test(rendererHead);
|
|
9415
|
-
// First <title> wins: the fallback framework title yields to a
|
|
9416
|
-
// renderer-emitted one; explicit metadata titles still come first.
|
|
9417
|
-
const suppressDefaultTitle =
|
|
9418
|
-
!renderedMetadata.hasExplicitTitle && rendererHasTitle;
|
|
9419
9557
|
let fullHtml;
|
|
9420
9558
|
if (hasFullDocument) {
|
|
9421
9559
|
// Layout provides full HTML structure - inject CSS and client script
|
|
9422
|
-
|
|
9423
|
-
ensureFarmDocumentRoot(ensureFarmDocumentHead(extractFarmFullDocument(html) || html)),
|
|
9424
|
-
hasFavicon,
|
|
9425
|
-
);
|
|
9426
|
-
fullHtml = html
|
|
9427
|
-
// Inject CSS link after opening head tag or first meta tag
|
|
9428
|
-
.replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + renderFarmClientModulePreloads(html, route.clientModule); })
|
|
9429
|
-
.replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
|
|
9430
|
-
// Explicit metadata wins over renderer and layout titles. Without
|
|
9431
|
-
// explicit metadata, a renderer title wins over the layout title.
|
|
9432
|
-
.replace(/<head([^>]*)>([\\s\\S]*?)<\\/head>/i, (match, attrs, headContent) => {
|
|
9433
|
-
const hasAuthoritativeTitle = renderedMetadata.hasExplicitTitle || rendererHasTitle;
|
|
9434
|
-
let nextHeadContent = hasAuthoritativeTitle
|
|
9435
|
-
? headContent.replace(/<title\\b[^>]*>[\\s\\S]*?<\\/title>\\s*/gi, "")
|
|
9436
|
-
: headContent;
|
|
9437
|
-
if (renderedMetadata.hasExplicitTitle) {
|
|
9438
|
-
nextHeadContent += "\\n <title>" + title + "</title>";
|
|
9439
|
-
}
|
|
9440
|
-
if (metaTags) nextHeadContent += metaTags;
|
|
9441
|
-
// Renderer-emitted head markup (e.g. <svelte:head>). Function
|
|
9442
|
-
// replacement below keeps $-sequences literal.
|
|
9443
|
-
const effectiveRendererHead = renderedMetadata.hasExplicitTitle
|
|
9444
|
-
? rendererHead.replace(/<title\\b[^>]*>[\\s\\S]*?<\\/title>\\s*/gi, "")
|
|
9445
|
-
: rendererHead;
|
|
9446
|
-
if (effectiveRendererHead) nextHeadContent += "\\n " + effectiveRendererHead;
|
|
9447
|
-
return nextHeadContent === headContent
|
|
9448
|
-
? match
|
|
9449
|
-
: "<head" + attrs + ">" + nextHeadContent + "\\n</head>";
|
|
9450
|
-
})
|
|
9560
|
+
fullHtml = composeFarmFullDocument(extractFarmFullDocument(html) || html)
|
|
9451
9561
|
// Inject client script before closing body tag. Function replacement:
|
|
9452
9562
|
// serialized page props may contain $-sequences ($&, $', $$) that a
|
|
9453
9563
|
// string replacement would expand into surrounding document markup,
|
|
@@ -9461,14 +9571,6 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9461
9571
|
) + '\\n' +
|
|
9462
9572
|
' ' + renderFarmClientEntryScript() + '\\n</body>',
|
|
9463
9573
|
);
|
|
9464
|
-
|
|
9465
|
-
// Last, so the charset (and the viewport, unless the layout wrote one) open the head.
|
|
9466
|
-
fullHtml = ensureFarmDocumentMeta(fullHtml, viewportTags);
|
|
9467
|
-
|
|
9468
|
-
// Add DOCTYPE if not present
|
|
9469
|
-
if (!fullHtml.trim().startsWith('<!DOCTYPE')) {
|
|
9470
|
-
fullHtml = '<!DOCTYPE html>\\n' + fullHtml;
|
|
9471
|
-
}
|
|
9472
9574
|
} else {
|
|
9473
9575
|
// No layout with full document - wrap in HTML structure
|
|
9474
9576
|
fullHtml = \`<!DOCTYPE html>
|
|
@@ -10109,8 +10211,8 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
10109
10211
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
10110
10212
|
return "rewrite";
|
|
10111
10213
|
}
|
|
10112
|
-
if (
|
|
10113
|
-
if (
|
|
10214
|
+
if (_chunkZM6U54TCcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
10215
|
+
if (_chunkZM6U54TCcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
10114
10216
|
if (_chunkLPE3ED4Rcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
10115
10217
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
10116
10218
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
@@ -10149,7 +10251,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10149
10251
|
const outputDir = _chunkLPE3ED4Rcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
10150
10252
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
10151
10253
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
10152
|
-
const imageRuntime =
|
|
10254
|
+
const imageRuntime = _chunkA7XJHKRKcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
10153
10255
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
10154
10256
|
(image) => image.sourceType === "module"
|
|
10155
10257
|
);
|
|
@@ -11011,7 +11113,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
11011
11113
|
try {
|
|
11012
11114
|
await copyPackage("sharp", sharpRequire);
|
|
11013
11115
|
if (!copiedPackages.has("sharp")) {
|
|
11014
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
11116
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkA7XJHKRKcjs.SHARP_INSTALL_HINT}`);
|
|
11015
11117
|
}
|
|
11016
11118
|
} catch (error) {
|
|
11017
11119
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -11312,7 +11414,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11312
11414
|
};
|
|
11313
11415
|
config = {
|
|
11314
11416
|
...config,
|
|
11315
|
-
images:
|
|
11417
|
+
images: _chunkA7XJHKRKcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
11316
11418
|
root: targets.root,
|
|
11317
11419
|
preset: targets.preset
|
|
11318
11420
|
})
|
|
@@ -11340,7 +11442,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11340
11442
|
root,
|
|
11341
11443
|
rendererBuild.signal
|
|
11342
11444
|
);
|
|
11343
|
-
const farmApp =
|
|
11445
|
+
const farmApp = _chunkA7XJHKRKcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
11344
11446
|
await farmApp.initialize();
|
|
11345
11447
|
const routeManager = farmApp.getRouteManager();
|
|
11346
11448
|
const serverRenderer = farmApp.getServerRenderer();
|
|
@@ -11447,7 +11549,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11447
11549
|
ssr: true,
|
|
11448
11550
|
buildLifetime
|
|
11449
11551
|
});
|
|
11450
|
-
const viteConfig =
|
|
11552
|
+
const viteConfig = _chunkA7XJHKRKcjs.mergeFarmViteConfig.call(void 0,
|
|
11451
11553
|
{
|
|
11452
11554
|
root,
|
|
11453
11555
|
appType: "custom",
|
|
@@ -11459,7 +11561,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11459
11561
|
},
|
|
11460
11562
|
plugins: [
|
|
11461
11563
|
...rendererVitePlugins,
|
|
11462
|
-
|
|
11564
|
+
_chunkA7XJHKRKcjs.farmFontImportsPlugin.call(void 0, {
|
|
11463
11565
|
root,
|
|
11464
11566
|
basePath: config.basePath,
|
|
11465
11567
|
publicDir: config.publicDir
|
|
@@ -11471,7 +11573,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11471
11573
|
hmr: false
|
|
11472
11574
|
},
|
|
11473
11575
|
resolve: {
|
|
11474
|
-
alias:
|
|
11576
|
+
alias: _chunkA7XJHKRKcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
11475
11577
|
dedupe: [...config.renderer.dedupe || []]
|
|
11476
11578
|
},
|
|
11477
11579
|
optimizeDeps: {
|