@farm.js/core 0.1.41 → 0.1.42
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-D0eZKfci.d.ts → agent-mcp-SSD6L3VZ.d.ts} +1 -1
- package/dist/{agent-mcp-BOqIxJLI.d.mts → agent-mcp-ssVy_tea.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/{app-CzTSMJaf.d.mts → app-1h3lVT4a.d.mts} +4 -4
- package/dist/{app-DM8e1z3G.d.ts → app-KjFzdCqy.d.ts} +4 -4
- package/dist/app-manifest-D3RkVNuS.d.mts +120 -0
- package/dist/app-manifest-DaW8-tvX.d.ts +120 -0
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{chunk-PYHPXPSW.mjs → chunk-2JZHQDUY.mjs} +1 -1
- package/dist/{chunk-R65GCA6A.mjs → chunk-375K2ZVU.mjs} +7 -7
- package/dist/{chunk-L6HYACBE.cjs → chunk-7YHSD3Z6.cjs} +77 -113
- package/dist/{chunk-EH3464KF.cjs → chunk-AHFRQMRX.cjs} +1 -1
- package/dist/{chunk-EX4MKHXN.cjs → chunk-BXJ5HJTJ.cjs} +7 -6
- package/dist/{chunk-BYQVROIP.mjs → chunk-DMRPN25V.mjs} +69 -0
- package/dist/{chunk-4C7KTKX7.mjs → chunk-IVQY6UTY.mjs} +1 -1
- package/dist/{chunk-3TB5QGUW.cjs → chunk-JAXDRRRC.cjs} +70 -1
- package/dist/{chunk-32TZ3QTP.cjs → chunk-JG3MEQUH.cjs} +85 -85
- package/dist/{chunk-ENOBPDKZ.mjs → chunk-NU25TRIO.mjs} +3 -2
- package/dist/{chunk-SVPGWJZF.mjs → chunk-PIZXONIS.mjs} +71 -107
- package/dist/{chunk-JOTUZIM4.cjs → chunk-QKZMB7LY.cjs} +2 -2
- package/dist/{chunk-FJGIVDA5.mjs → chunk-QTEJGB5A.mjs} +3 -3
- package/dist/{chunk-OQ4YXWH4.cjs → chunk-TCJ4A4A2.cjs} +57 -62
- package/dist/{chunk-BGGWKZ2V.mjs → chunk-TUL355PH.mjs} +6 -11
- package/dist/{chunk-VLPII2JJ.mjs → chunk-U2UC7UGP.mjs} +1 -1
- package/dist/{chunk-ROQ4C4LJ.cjs → chunk-ZATTDMBW.cjs} +48 -48
- package/dist/{chunk-PN676AZF.cjs → chunk-ZS6HDNOM.cjs} +6 -6
- package/dist/{client-plugins-CkYwvDJ0.d.mts → client-plugins-C9Py_50W.d.mts} +78 -6
- package/dist/{client-plugins-DfeKd0sD.d.ts → client-plugins-DIem0I0W.d.ts} +78 -6
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-2YHAJYH6.cjs → devtools-2RY3EKHL.cjs} +3 -3
- package/dist/{devtools-N3QLRIQU.mjs → devtools-Q3LBNUJ7.mjs} +2 -2
- package/dist/docs.cjs +4 -4
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +3 -3
- package/dist/index.cjs +9 -9
- package/dist/index.d.mts +14 -13
- package/dist/index.d.ts +14 -13
- package/dist/index.mjs +8 -8
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +9 -9
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +8 -8
- package/dist/internal/cli-runtime.cjs +3 -3
- package/dist/internal/cli-runtime.mjs +2 -2
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +5 -5
- package/dist/internal/production-runtime.d.mts +10 -127
- package/dist/internal/production-runtime.d.ts +10 -127
- package/dist/internal/production-runtime.mjs +4 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +6 -6
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +5 -5
- package/dist/{production-runtime-BTkXQdYy.d.mts → production-runtime-CHFKIgpW.d.mts} +1 -1
- package/dist/{production-runtime-DFC7pgbp.d.ts → production-runtime-bjjWq-DA.d.ts} +1 -1
- package/dist/{render-plan-BoAK9xFC.d.ts → render-plan-B2UndB4x.d.ts} +1 -1
- package/dist/{render-plan-5rFeWmk7.d.mts → render-plan-DOHg6wdO.d.mts} +1 -1
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/{request-BxBWigtl.d.mts → request-DQcGfdgQ.d.mts} +1 -1
- package/dist/{request-fciwmd3n.d.ts → request-DVNXRQrI.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering-BLZT0IP0.d.ts → route-rendering-B_6fj-GG.d.ts} +1 -1
- package/dist/{route-rendering-BCM1QzEf.d.mts → route-rendering-CEX4mFn-.d.mts} +1 -1
- package/dist/{router-CkheNX3-.d.ts → router-CHEMHm1P.d.ts} +1 -1
- package/dist/{router-DyZJWc1_.d.mts → router-CKHPBKXX.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{runtime-DfU4sKa5.d.ts → runtime-Br2ZDTAv.d.ts} +1 -1
- package/dist/{runtime-wexvUN5J.d.mts → runtime-jj8TKNsy.d.mts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +22 -22
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +6 -6
- package/dist/{spa-router-DgsMXqfX.d.mts → spa-router-BEvS9Erj.d.mts} +2 -2
- package/dist/{spa-router-CcejECnG.d.ts → spa-router-DmCuH5B7.d.ts} +2 -2
- package/dist/{ssg-Bg4bMMhM.d.mts → ssg-57v6cZcW.d.mts} +2 -2
- package/dist/{ssg-1FGaFISl.d.ts → ssg-gT093ETk.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils-Dxbh6Hgj.d.ts → utils-CCTKvR-P.d.ts} +1 -1
- package/dist/{utils-8wtTYiH4.d.mts → utils-raHHQVyL.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +6 -6
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +5 -5
- package/package.json +1 -1
|
@@ -11,13 +11,13 @@ var _chunkCGR525MJcjs = require('./chunk-CGR525MJ.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkZS6HDNOMcjs = require('./chunk-ZS6HDNOM.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkQKZMB7LYcjs = require('./chunk-QKZMB7LY.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -45,7 +45,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkBXJ5HJTJcjs = require('./chunk-BXJ5HJTJ.cjs');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
|
|
@@ -83,7 +83,7 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
var
|
|
86
|
+
var _chunkZATTDMBWcjs = require('./chunk-ZATTDMBW.cjs');
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
|
|
@@ -107,7 +107,7 @@ var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
var
|
|
110
|
+
var _chunk7YHSD3Z6cjs = require('./chunk-7YHSD3Z6.cjs');
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
|
|
@@ -214,7 +214,7 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
|
214
214
|
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
215
215
|
|
|
216
216
|
|
|
217
|
-
var
|
|
217
|
+
var _chunkAHFRQMRXcjs = require('./chunk-AHFRQMRX.cjs');
|
|
218
218
|
|
|
219
219
|
|
|
220
220
|
var _chunkC5GUTBZKcjs = require('./chunk-C5GUTBZK.cjs');
|
|
@@ -364,7 +364,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
364
364
|
globalStylesheetHref: options.globalStylesheetHref,
|
|
365
365
|
isPathGuarded: options.isPathGuarded
|
|
366
366
|
});
|
|
367
|
-
const apiHandler =
|
|
367
|
+
const apiHandler = _chunkQKZMB7LYcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
368
368
|
rootDir: options.root,
|
|
369
369
|
srcDir: options.srcDir,
|
|
370
370
|
docs,
|
|
@@ -1700,7 +1700,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1700
1700
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
1701
1701
|
const srcDir = config.srcDir || "src";
|
|
1702
1702
|
const distDir = config.distDir || ".farm";
|
|
1703
|
-
const deployOutputDir =
|
|
1703
|
+
const deployOutputDir = _chunkBXJ5HJTJcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
1704
1704
|
const lifecyclePluginManager = options.pluginManager;
|
|
1705
1705
|
const productionViteResultPromise = Promise.allSettled([
|
|
1706
1706
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -1952,7 +1952,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1952
1952
|
}
|
|
1953
1953
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
1954
1954
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
1955
|
-
await fs4.writeFile(clientCssPath,
|
|
1955
|
+
await fs4.writeFile(clientCssPath, _chunkZATTDMBWcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
1956
1956
|
}
|
|
1957
1957
|
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
|
|
1958
1958
|
var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
|
|
@@ -2002,7 +2002,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2002
2002
|
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2003
2003
|
let plan = cache.get(key);
|
|
2004
2004
|
if (!plan) {
|
|
2005
|
-
plan =
|
|
2005
|
+
plan = _chunkZATTDMBWcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2006
2006
|
cache.set(key, plan);
|
|
2007
2007
|
}
|
|
2008
2008
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2031,14 +2031,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2031
2031
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2032
2032
|
);
|
|
2033
2033
|
}
|
|
2034
|
-
const isolatedMode =
|
|
2034
|
+
const isolatedMode = _chunkZATTDMBWcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2035
2035
|
_optionalChain([config, 'access', _39 => _39.experimental, 'optionalAccess', _40 => _40.isolatedClientHydration]),
|
|
2036
2036
|
{
|
|
2037
2037
|
serverComponents: _optionalChain([config, 'access', _41 => _41.experimental, 'optionalAccess', _42 => _42.serverComponents]) === true,
|
|
2038
2038
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2039
2039
|
}
|
|
2040
2040
|
);
|
|
2041
|
-
const planOptions =
|
|
2041
|
+
const planOptions = _chunkZATTDMBWcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2042
2042
|
config.renderer,
|
|
2043
2043
|
Boolean(unsupportedIntegrationProvider)
|
|
2044
2044
|
);
|
|
@@ -2085,7 +2085,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2085
2085
|
};
|
|
2086
2086
|
}
|
|
2087
2087
|
});
|
|
2088
|
-
const layoutAppliesToRoute =
|
|
2088
|
+
const layoutAppliesToRoute = _chunk7YHSD3Z6cjs.routeBoundaryCoversDirectory;
|
|
2089
2089
|
const routeDirectory = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (route) => _nullishCoalesce(route.directory, () => ( route.pattern)), "routeDirectory");
|
|
2090
2090
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2091
2091
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _43 => _43.docs, 'optionalAccess', _44 => _44.enabled]) && _optionalChain([config, 'access', _45 => _45.docs, 'access', _46 => _46.adapter, 'optionalAccess', _47 => _47.server]) && config.docs.adapter.react
|
|
@@ -2096,7 +2096,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2096
2096
|
), "isAdapterDocsRoute");
|
|
2097
2097
|
const syntheticDocsEntry = _optionalChain([config, 'access', _50 => _50.docs, 'optionalAccess', _51 => _51.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2098
2098
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2099
|
-
const markdownPagePlan =
|
|
2099
|
+
const markdownPagePlan = _chunkZATTDMBWcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2100
2100
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2101
2101
|
root,
|
|
2102
2102
|
isolatedMode,
|
|
@@ -2112,7 +2112,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2112
2112
|
planOptions
|
|
2113
2113
|
)
|
|
2114
2114
|
}));
|
|
2115
|
-
|
|
2115
|
+
_chunkZATTDMBWcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2116
2116
|
clientLayouts.map((layout) => ({
|
|
2117
2117
|
pattern: layout.pattern,
|
|
2118
2118
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2121,7 +2121,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2121
2121
|
[
|
|
2122
2122
|
...routePlans.map(({ route, metadata }) => ({
|
|
2123
2123
|
pattern: routeDirectory(route),
|
|
2124
|
-
depth:
|
|
2124
|
+
depth: _chunk7YHSD3Z6cjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2125
2125
|
metadata
|
|
2126
2126
|
})),
|
|
2127
2127
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -2144,7 +2144,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2144
2144
|
for (const layout of clientLayouts) {
|
|
2145
2145
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
|
|
2146
2146
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2147
|
-
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${
|
|
2147
|
+
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkZATTDMBWcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
2150
|
if (isolatedMode === "analyze") {
|
|
@@ -2168,7 +2168,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2168
2168
|
);
|
|
2169
2169
|
if (metadata.suppressedAsyncHydration) {
|
|
2170
2170
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
2171
|
-
`\u26A0\uFE0F ${
|
|
2171
|
+
`\u26A0\uFE0F ${_chunkZATTDMBWcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2172
2172
|
);
|
|
2173
2173
|
}
|
|
2174
2174
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
@@ -2193,7 +2193,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2193
2193
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries).flatMap((layout) => layout.isolatedBoundaries)
|
|
2194
2194
|
],
|
|
2195
2195
|
// The server renders a server tree only below a hydrating layout.
|
|
2196
|
-
...
|
|
2196
|
+
..._chunkZATTDMBWcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2197
2197
|
});
|
|
2198
2198
|
_chunk5QIKR7RRcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2199
2199
|
}
|
|
@@ -2229,7 +2229,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2229
2229
|
}
|
|
2230
2230
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2231
2231
|
try {
|
|
2232
|
-
return
|
|
2232
|
+
return _chunkZATTDMBWcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2233
2233
|
} catch (error) {
|
|
2234
2234
|
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2235
2235
|
return false;
|
|
@@ -2259,7 +2259,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2259
2259
|
config.trailingSlash,
|
|
2260
2260
|
_chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2261
2261
|
config.basePath,
|
|
2262
|
-
|
|
2262
|
+
_chunkZATTDMBWcjs.generateClientCachePersistenceCode.call(void 0, _chunkZATTDMBWcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2263
2263
|
adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2264
2264
|
);
|
|
2265
2265
|
await fs4.writeFile(clientEntryPath, clientHydrationCode);
|
|
@@ -2276,7 +2276,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2276
2276
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2277
2277
|
await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2278
2278
|
postcssSearchPath = clientEntryDir;
|
|
2279
|
-
tailwindVitePlugin = await
|
|
2279
|
+
tailwindVitePlugin = await _chunkZATTDMBWcjs.loadTailwindVitePlugin.call(void 0, {
|
|
2280
2280
|
builder: productionVite.builder,
|
|
2281
2281
|
announce: true
|
|
2282
2282
|
});
|
|
@@ -2347,7 +2347,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2347
2347
|
}
|
|
2348
2348
|
},
|
|
2349
2349
|
plugins: [
|
|
2350
|
-
|
|
2350
|
+
_chunkZATTDMBWcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2351
2351
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2352
2352
|
outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
|
|
2353
2353
|
}),
|
|
@@ -2372,7 +2372,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2372
2372
|
...rendererVitePlugins,
|
|
2373
2373
|
...config.vite.plugins || [],
|
|
2374
2374
|
farmServerOnlyEntriesPlugin(),
|
|
2375
|
-
|
|
2375
|
+
_chunkZATTDMBWcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
2376
2376
|
adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2377
2377
|
),
|
|
2378
2378
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -2434,7 +2434,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2434
2434
|
} : void 0,
|
|
2435
2435
|
// Ensure React is bundled for client
|
|
2436
2436
|
resolve: {
|
|
2437
|
-
alias:
|
|
2437
|
+
alias: _chunkZATTDMBWcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2438
2438
|
dedupe: [...config.renderer.dedupe || []]
|
|
2439
2439
|
},
|
|
2440
2440
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2447,7 +2447,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2447
2447
|
]
|
|
2448
2448
|
}
|
|
2449
2449
|
};
|
|
2450
|
-
await viteBuild(
|
|
2450
|
+
await viteBuild(_chunkZATTDMBWcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2451
2451
|
await mergeBuiltFontCss(outputDir);
|
|
2452
2452
|
await validateClientBuildOutput(root, srcDir, outputDir);
|
|
2453
2453
|
} finally {
|
|
@@ -3206,7 +3206,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3206
3206
|
direction: {}
|
|
3207
3207
|
}, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
|
|
3208
3208
|
const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
|
|
3209
|
-
const clientPluginEntry =
|
|
3209
|
+
const clientPluginEntry = _chunkZATTDMBWcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3210
3210
|
plugins,
|
|
3211
3211
|
root,
|
|
3212
3212
|
srcDir,
|
|
@@ -3217,7 +3217,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3217
3217
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3218
3218
|
import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3219
3219
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3220
|
-
const providerClientCode =
|
|
3220
|
+
const providerClientCode = _chunkZATTDMBWcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3221
3221
|
integrationProviders,
|
|
3222
3222
|
root,
|
|
3223
3223
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -3229,12 +3229,12 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
3229
3229
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
3230
3230
|
layoutRoutes.forEach((layout, index) => {
|
|
3231
3231
|
const relativePath = toImportPath(layout.modulePath);
|
|
3232
|
-
const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) =>
|
|
3232
|
+
const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunkZS6HDNOMcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
|
|
3233
3233
|
if (rendersOnClient) {
|
|
3234
3234
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
3235
3235
|
}
|
|
3236
|
-
const groupScope =
|
|
3237
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
3236
|
+
const groupScope = _chunk7YHSD3Z6cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3237
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk7YHSD3Z6cjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
3238
3238
|
layoutRegistrations.push(
|
|
3239
3239
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
|
|
3240
3240
|
);
|
|
@@ -3737,7 +3737,7 @@ function hasHydratableLayout(pathname) {
|
|
|
3737
3737
|
});
|
|
3738
3738
|
}
|
|
3739
3739
|
|
|
3740
|
-
${
|
|
3740
|
+
${_chunkZATTDMBWcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
3741
3741
|
// Wrap a page element with applicable layouts
|
|
3742
3742
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
3743
3743
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4716,7 +4716,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4716
4716
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
4717
4717
|
"module.exports = { plugins: [] };\n"
|
|
4718
4718
|
);
|
|
4719
|
-
tailwindVitePlugin = await
|
|
4719
|
+
tailwindVitePlugin = await _chunkZATTDMBWcjs.loadTailwindVitePlugin.call(void 0, {
|
|
4720
4720
|
builder: productionVite.builder,
|
|
4721
4721
|
label: "for SSR"
|
|
4722
4722
|
});
|
|
@@ -4812,7 +4812,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4812
4812
|
}
|
|
4813
4813
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
4814
4814
|
const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
4815
|
-
const notFoundPath =
|
|
4815
|
+
const notFoundPath = _chunkZATTDMBWcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
4816
4816
|
if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
4817
4817
|
layoutRoutes.sort((a, b) => {
|
|
4818
4818
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -4834,8 +4834,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4834
4834
|
);
|
|
4835
4835
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
4836
4836
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _63 => _63.mdx, 'optionalAccess', _64 => _64.components]));
|
|
4837
|
-
const hasMiddlewareConfig =
|
|
4838
|
-
const hasRouteContextConfig =
|
|
4837
|
+
const hasMiddlewareConfig = _chunk7YHSD3Z6cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
4838
|
+
const hasRouteContextConfig = _chunkBXJ5HJTJcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
4839
4839
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
4840
4840
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
4841
4841
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -4845,9 +4845,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4845
4845
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
4846
4846
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
4847
4847
|
);
|
|
4848
|
-
if (
|
|
4848
|
+
if (_chunkQKZMB7LYcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
4849
4849
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
4850
|
-
|
|
4850
|
+
_chunkQKZMB7LYcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
4851
4851
|
config.docs,
|
|
4852
4852
|
{ root, srcDir: config.srcDir },
|
|
4853
4853
|
(pathname) => adapterGuardedPaths.has(pathname)
|
|
@@ -4856,7 +4856,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4856
4856
|
const farmDocsCspNonceMarker = _chunk25LPIZSXcjs.createFarmCspNonce.call(void 0, config.security);
|
|
4857
4857
|
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _65 => _65.docs, 'optionalAccess', _66 => _66.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkZTP3BJG6cjs._runWithFarmCspNonce.call(void 0,
|
|
4858
4858
|
farmDocsCspNonceMarker,
|
|
4859
|
-
async () => _optionalChain([config, 'access', _67 => _67.docs, 'access', _68 => _68.adapter, 'optionalAccess', _69 => _69.server]) ? await
|
|
4859
|
+
async () => _optionalChain([config, 'access', _67 => _67.docs, 'access', _68 => _68.adapter, 'optionalAccess', _69 => _69.server]) ? await _chunkQKZMB7LYcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
4860
4860
|
root,
|
|
4861
4861
|
srcDir: config.srcDir,
|
|
4862
4862
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -5018,7 +5018,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5018
5018
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _75 => _75.env, 'optionalAccess', _76 => _76.public]) || {})
|
|
5019
5019
|
},
|
|
5020
5020
|
plugins: [
|
|
5021
|
-
|
|
5021
|
+
_chunkZATTDMBWcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
5022
5022
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
5023
5023
|
...rendererVitePlugins,
|
|
5024
5024
|
...config.vite.plugins || [],
|
|
@@ -5071,7 +5071,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5071
5071
|
resolve: {
|
|
5072
5072
|
alias: [
|
|
5073
5073
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
5074
|
-
...Object.entries(
|
|
5074
|
+
...Object.entries(_chunkZATTDMBWcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
5075
5075
|
([find, replacement]) => ({ find, replacement })
|
|
5076
5076
|
)
|
|
5077
5077
|
],
|
|
@@ -5079,7 +5079,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5079
5079
|
dedupe: [...config.renderer.dedupe || []]
|
|
5080
5080
|
}
|
|
5081
5081
|
};
|
|
5082
|
-
await viteBuild(
|
|
5082
|
+
await viteBuild(_chunkZATTDMBWcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
5083
5083
|
} finally {
|
|
5084
5084
|
if (postcssConfigDir) {
|
|
5085
5085
|
try {
|
|
@@ -5127,7 +5127,7 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
5127
5127
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
5128
5128
|
middlewareRoutes
|
|
5129
5129
|
};
|
|
5130
|
-
return _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkMY5PZYADcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) =>
|
|
5130
|
+
return _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkMY5PZYADcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk7YHSD3Z6cjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
5131
5131
|
}
|
|
5132
5132
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmDocsGuardedPaths, "getFarmDocsGuardedPaths");
|
|
5133
5133
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
@@ -5525,7 +5525,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5525
5525
|
const hasGeneratedMetadataImages = metadataImageRoutes.some(
|
|
5526
5526
|
(image) => image.sourceType === "module"
|
|
5527
5527
|
);
|
|
5528
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
5528
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk7YHSD3Z6cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5529
5529
|
const farmDocsFontAssets = _optionalChain([config, 'access', _102 => _102.docs, 'optionalAccess', _103 => _103.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
5530
5530
|
const integrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
5531
5531
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
@@ -5536,7 +5536,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5536
5536
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
5537
5537
|
);
|
|
5538
5538
|
}
|
|
5539
|
-
const providerServerModules =
|
|
5539
|
+
const providerServerModules = _chunkZATTDMBWcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
5540
5540
|
renderedIntegrationProviders,
|
|
5541
5541
|
config.root,
|
|
5542
5542
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -5556,14 +5556,14 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5556
5556
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
5557
5557
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
5558
5558
|
);
|
|
5559
|
-
const isolatedHydrationMode =
|
|
5559
|
+
const isolatedHydrationMode = _chunkZATTDMBWcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
5560
5560
|
_optionalChain([config, 'access', _106 => _106.experimental, 'optionalAccess', _107 => _107.isolatedClientHydration]),
|
|
5561
5561
|
{
|
|
5562
5562
|
serverComponents: _optionalChain([config, 'access', _108 => _108.experimental, 'optionalAccess', _109 => _109.serverComponents]) === true,
|
|
5563
5563
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
5564
5564
|
}
|
|
5565
5565
|
);
|
|
5566
|
-
const hydrationPlanOptions =
|
|
5566
|
+
const hydrationPlanOptions = _chunkZATTDMBWcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
5567
5567
|
config.renderer,
|
|
5568
5568
|
Boolean(unsupportedIntegrationProvider)
|
|
5569
5569
|
);
|
|
@@ -5577,7 +5577,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5577
5577
|
hydrationPlanOptions
|
|
5578
5578
|
)
|
|
5579
5579
|
}));
|
|
5580
|
-
const markdownPagePlan =
|
|
5580
|
+
const markdownPagePlan = _chunkZATTDMBWcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
5581
5581
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
5582
5582
|
config.root,
|
|
5583
5583
|
isolatedHydrationMode,
|
|
@@ -5595,7 +5595,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5595
5595
|
)
|
|
5596
5596
|
])
|
|
5597
5597
|
);
|
|
5598
|
-
|
|
5598
|
+
_chunkZATTDMBWcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
5599
5599
|
layoutHydrationPlans.map((layout) => ({
|
|
5600
5600
|
pattern: layout.pattern,
|
|
5601
5601
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -5604,10 +5604,10 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5604
5604
|
pageRoutes.map((route) => ({
|
|
5605
5605
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
5606
5606
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
5607
|
-
depth:
|
|
5607
|
+
depth: _chunk7YHSD3Z6cjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
5608
5608
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
5609
5609
|
})),
|
|
5610
|
-
|
|
5610
|
+
_chunk7YHSD3Z6cjs.routeBoundaryCoversDirectory
|
|
5611
5611
|
);
|
|
5612
5612
|
const providerServerImports = [
|
|
5613
5613
|
providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
|
|
@@ -5669,7 +5669,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5669
5669
|
module: ${varName},
|
|
5670
5670
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
5671
5671
|
clientModule: ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
5672
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
5672
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkZATTDMBWcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
|
|
5673
5673
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
5674
5674
|
${route.source !== void 0 ? `markdownSource: {
|
|
5675
5675
|
source: ${JSON.stringify(route.source)},
|
|
@@ -5726,12 +5726,12 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5726
5726
|
errorImports.push(
|
|
5727
5727
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
5728
5728
|
);
|
|
5729
|
-
const groupScope =
|
|
5729
|
+
const groupScope = _chunk7YHSD3Z6cjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
5730
5730
|
errorRegistrations.push(`
|
|
5731
5731
|
{
|
|
5732
|
-
pattern: ${JSON.stringify(
|
|
5732
|
+
pattern: ${JSON.stringify(_chunk7YHSD3Z6cjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
5733
5733
|
groupScope: ${JSON.stringify(groupScope)},
|
|
5734
|
-
directoryDepth: ${
|
|
5734
|
+
directoryDepth: ${_chunk7YHSD3Z6cjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
5735
5735
|
module: ${varName},
|
|
5736
5736
|
}`);
|
|
5737
5737
|
});
|
|
@@ -5920,7 +5920,7 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
5920
5920
|
const integrationRuntimeImport = integrationRuntimeExports.length ? `import { ${integrationRuntimeExports.join(", ")} } from "@farm.js/core/integrations";` : "";
|
|
5921
5921
|
const instrumentationImport = instrumentationPath ? `import * as FarmInstrumentationModule from ${toVirtualEntryImportSpecifier(instrumentationPath)};` : "";
|
|
5922
5922
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
5923
|
-
const nativeMCP =
|
|
5923
|
+
const nativeMCP = _chunkZS6HDNOMcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
5924
5924
|
const integrationImports = `
|
|
5925
5925
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
5926
5926
|
${layerConfigImports}
|
|
@@ -5928,7 +5928,7 @@ ${integrationRuntimeImport}
|
|
|
5928
5928
|
${nativeAuth.importSource}
|
|
5929
5929
|
${nativeMCP.importSource}
|
|
5930
5930
|
`;
|
|
5931
|
-
const imageRuntime =
|
|
5931
|
+
const imageRuntime = _chunkZATTDMBWcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
5932
5932
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
5933
5933
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
5934
5934
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6107,7 +6107,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
6107
6107
|
|
|
6108
6108
|
function FarmDefault404Page() {
|
|
6109
6109
|
return React.createElement(React.Fragment, null,
|
|
6110
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
6110
|
+
React.createElement("style", null, ${JSON.stringify(_chunkZATTDMBWcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
6111
6111
|
React.createElement("main", {
|
|
6112
6112
|
className: "farm-default-not-found",
|
|
6113
6113
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -6410,12 +6410,12 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
6410
6410
|
}
|
|
6411
6411
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
6412
6412
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
6413
|
-
${_optionalChain([config, 'access', _139 => _139.agent, 'optionalAccess', _140 => _140.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(
|
|
6413
|
+
${_optionalChain([config, 'access', _139 => _139.agent, 'optionalAccess', _140 => _140.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunk7YHSD3Z6cjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
6414
6414
|
` : ""}${_optionalChain([config, 'access', _141 => _141.agent, 'optionalAccess', _142 => _142.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
6415
|
-
|
|
6415
|
+
_chunk7YHSD3Z6cjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
6416
6416
|
build: config.deploymentId,
|
|
6417
|
-
packages:
|
|
6418
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
6417
|
+
packages: _chunkZATTDMBWcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
6418
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkZATTDMBWcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
6419
6419
|
})
|
|
6420
6420
|
)};
|
|
6421
6421
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -6890,7 +6890,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
6890
6890
|
let inner = markup.replace(/^\\s+/, "");
|
|
6891
6891
|
let hoisted = "";
|
|
6892
6892
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
6893
|
-
const hoistable = /${
|
|
6893
|
+
const hoistable = /${_chunk7YHSD3Z6cjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
6894
6894
|
let match;
|
|
6895
6895
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
6896
6896
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -7421,7 +7421,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
7421
7421
|
// a route guard.
|
|
7422
7422
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
7423
7423
|
pageRoutes.map((route) => route.pattern).filter(
|
|
7424
|
-
(pattern) => !pattern.includes("[") &&
|
|
7424
|
+
(pattern) => !pattern.includes("[") && _chunk7YHSD3Z6cjs.farmPathGuardCoversPage.call(void 0,
|
|
7425
7425
|
{
|
|
7426
7426
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
7427
7427
|
middlewareRoutes
|
|
@@ -7468,7 +7468,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
7468
7468
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
7469
7469
|
// registered at runtime, such as the docs engine's.
|
|
7470
7470
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
7471
|
-
_chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
7471
|
+
_chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkAHFRQMRXcjs.FARM_VERSION)
|
|
7472
7472
|
)};
|
|
7473
7473
|
let farmDefaultMCPRouteFree;
|
|
7474
7474
|
function getFarmDefaultMCPServer() {
|
|
@@ -8503,9 +8503,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8503
8503
|
` : ""}
|
|
8504
8504
|
${_optionalChain([config, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.manifest]) !== false ? `
|
|
8505
8505
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
8506
|
-
// public manifest
|
|
8506
|
+
// public manifest, the same document for every request.
|
|
8507
8507
|
if (
|
|
8508
|
-
[${JSON.stringify(
|
|
8508
|
+
[${JSON.stringify(_chunk7YHSD3Z6cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunk7YHSD3Z6cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
8509
8509
|
normalizeRuntimePath(routePathname),
|
|
8510
8510
|
)
|
|
8511
8511
|
) {
|
|
@@ -8517,7 +8517,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8517
8517
|
` : ""}
|
|
8518
8518
|
${_optionalChain([config, 'access', _159 => _159.agent, 'optionalAccess', _160 => _160.apiCatalog]) ? `
|
|
8519
8519
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
8520
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
8520
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk7YHSD3Z6cjs.FARM_API_CATALOG_PATH)}) {
|
|
8521
8521
|
return applyProductionMiddlewareHeaders(
|
|
8522
8522
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
8523
8523
|
middlewareHeaders,
|
|
@@ -9902,9 +9902,9 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
9902
9902
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
9903
9903
|
return "rewrite";
|
|
9904
9904
|
}
|
|
9905
|
-
if (
|
|
9906
|
-
if (
|
|
9907
|
-
if (
|
|
9905
|
+
if (_chunk7YHSD3Z6cjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
9906
|
+
if (_chunk7YHSD3Z6cjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
9907
|
+
if (_chunkBXJ5HJTJcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
9908
9908
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
9909
9909
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
9910
9910
|
if (_optionalChain([manifestEntry, 'optionalAccess', _177 => _177.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
@@ -9939,10 +9939,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
9939
9939
|
const nitroBuilder = nitroBuilderResult.value;
|
|
9940
9940
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
9941
9941
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
9942
|
-
const outputDir =
|
|
9942
|
+
const outputDir = _chunkBXJ5HJTJcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
9943
9943
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
9944
9944
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
9945
|
-
const imageRuntime =
|
|
9945
|
+
const imageRuntime = _chunkZATTDMBWcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
9946
9946
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
9947
9947
|
(image) => image.sourceType === "module"
|
|
9948
9948
|
);
|
|
@@ -10804,7 +10804,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
10804
10804
|
try {
|
|
10805
10805
|
await copyPackage("sharp", sharpRequire);
|
|
10806
10806
|
if (!copiedPackages.has("sharp")) {
|
|
10807
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
10807
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkZATTDMBWcjs.SHARP_INSTALL_HINT}`);
|
|
10808
10808
|
}
|
|
10809
10809
|
} catch (error) {
|
|
10810
10810
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -11042,7 +11042,7 @@ function createBuildTargetBaseline(config) {
|
|
|
11042
11042
|
preset,
|
|
11043
11043
|
distDir,
|
|
11044
11044
|
outputDir,
|
|
11045
|
-
outputWasDerived: outputDir ===
|
|
11045
|
+
outputWasDerived: outputDir === _chunkBXJ5HJTJcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
11046
11046
|
};
|
|
11047
11047
|
}
|
|
11048
11048
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
|
|
@@ -11052,8 +11052,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11052
11052
|
const distDir = config.distDir || ".farm";
|
|
11053
11053
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
11054
11054
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
11055
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
11056
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
11055
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkBXJ5HJTJcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
11056
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkBXJ5HJTJcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
11057
11057
|
return {
|
|
11058
11058
|
root,
|
|
11059
11059
|
preset,
|
|
@@ -11061,7 +11061,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11061
11061
|
distDir,
|
|
11062
11062
|
deployTarget,
|
|
11063
11063
|
outputDir,
|
|
11064
|
-
deployOutputDir:
|
|
11064
|
+
deployOutputDir: _chunkBXJ5HJTJcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
11065
11065
|
};
|
|
11066
11066
|
}
|
|
11067
11067
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
|
|
@@ -11099,7 +11099,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11099
11099
|
};
|
|
11100
11100
|
config = {
|
|
11101
11101
|
...config,
|
|
11102
|
-
images:
|
|
11102
|
+
images: _chunkZATTDMBWcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
11103
11103
|
root: targets.root,
|
|
11104
11104
|
preset: targets.preset
|
|
11105
11105
|
})
|
|
@@ -11127,7 +11127,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11127
11127
|
root,
|
|
11128
11128
|
rendererBuild.signal
|
|
11129
11129
|
);
|
|
11130
|
-
const farmApp =
|
|
11130
|
+
const farmApp = _chunkZATTDMBWcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
11131
11131
|
await farmApp.initialize();
|
|
11132
11132
|
const routeManager = farmApp.getRouteManager();
|
|
11133
11133
|
const serverRenderer = farmApp.getServerRenderer();
|
|
@@ -11234,7 +11234,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11234
11234
|
ssr: true,
|
|
11235
11235
|
buildLifetime
|
|
11236
11236
|
});
|
|
11237
|
-
const viteConfig =
|
|
11237
|
+
const viteConfig = _chunkZATTDMBWcjs.mergeFarmViteConfig.call(void 0,
|
|
11238
11238
|
{
|
|
11239
11239
|
root,
|
|
11240
11240
|
appType: "custom",
|
|
@@ -11246,7 +11246,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11246
11246
|
},
|
|
11247
11247
|
plugins: [
|
|
11248
11248
|
...rendererVitePlugins,
|
|
11249
|
-
|
|
11249
|
+
_chunkZATTDMBWcjs.farmFontImportsPlugin.call(void 0, {
|
|
11250
11250
|
root,
|
|
11251
11251
|
basePath: config.basePath,
|
|
11252
11252
|
publicDir: config.publicDir
|
|
@@ -11258,7 +11258,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11258
11258
|
hmr: false
|
|
11259
11259
|
},
|
|
11260
11260
|
resolve: {
|
|
11261
|
-
alias:
|
|
11261
|
+
alias: _chunkZATTDMBWcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
11262
11262
|
dedupe: [...config.renderer.dedupe || []]
|
|
11263
11263
|
},
|
|
11264
11264
|
optimizeDeps: {
|
|
@@ -11387,7 +11387,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
11387
11387
|
if (pluginManager) {
|
|
11388
11388
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
11389
11389
|
}
|
|
11390
|
-
const outputDir =
|
|
11390
|
+
const outputDir = _chunkBXJ5HJTJcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
11391
11391
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
11392
11392
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
11393
11393
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -11458,7 +11458,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
11458
11458
|
root,
|
|
11459
11459
|
preset,
|
|
11460
11460
|
distDir,
|
|
11461
|
-
outputDir:
|
|
11461
|
+
outputDir: _chunkBXJ5HJTJcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
11462
11462
|
});
|
|
11463
11463
|
}
|
|
11464
11464
|
}
|