@farm.js/core 0.2.0-beta.1 → 0.2.0-beta.2
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-handler-IUL6OPC3.cjs → agent-mcp-handler-EXOG55M4.cjs} +5 -5
- package/dist/{agent-mcp-handler-GDY5CPPW.mjs → agent-mcp-handler-VX4NDDHR.mjs} +4 -4
- package/dist/{agent-mcp.d-BdM0pIrD.d.ts → agent-mcp.d-DBaonhLg.d.ts} +1 -1
- package/dist/{agent-mcp.d-CMGqpUbk.d.mts → agent-mcp.d-DhCEzIfu.d.mts} +1 -1
- package/dist/agent-runtime.cjs +2 -2
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +1 -1
- package/dist/analyzer-OWIHFO5M.cjs +17 -0
- package/dist/{analyzer-RYSF2BM3.mjs → analyzer-T2U345WL.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- 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 +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/{app-manifest.d-COhjPgHn.d.ts → app-manifest.d-nLVFFd7N.d.ts} +1 -1
- package/dist/{app-manifest.d-BeDB2OVm.d.mts → app-manifest.d-uE0JGZKN.d.mts} +1 -1
- package/dist/app-markdown.cjs +6 -4
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +7 -5
- package/dist/{app.d-CoY-zsJt.d.ts → app.d-CwVkAUEU.d.ts} +13 -7
- package/dist/{app.d-DE5KNbmf.d.mts → app.d-DGGcNXV7.d.mts} +13 -7
- package/dist/{chunk-AG27TI6Q.mjs → chunk-23NBOP43.mjs} +3 -0
- package/dist/{chunk-OOOUYA6L.mjs → chunk-26ZTI2ZO.mjs} +4 -4
- package/dist/{chunk-CPMK7EFR.mjs → chunk-4Q263EQI.mjs} +2 -2
- package/dist/{chunk-2NOHVIJ3.cjs → chunk-5LJF4KUZ.cjs} +17 -4
- package/dist/{chunk-5AL2GXAU.mjs → chunk-7MMDEIVC.mjs} +1 -1
- package/dist/{chunk-QBXS4TNG.mjs → chunk-BL54BTVJ.mjs} +1 -1
- package/dist/{chunk-VZWAXQME.mjs → chunk-BW563VZZ.mjs} +34 -2
- package/dist/{chunk-ZPQY7O64.cjs → chunk-CBB7I6HW.cjs} +3 -3
- package/dist/{chunk-KMGHXIDA.cjs → chunk-CHOOBTDD.cjs} +2 -2
- package/dist/{chunk-ISSFWEPY.mjs → chunk-COK4IXOO.mjs} +35 -18
- package/dist/{chunk-YU2MNIIY.mjs → chunk-CRF5MOLO.mjs} +17 -4
- package/dist/{chunk-NQ3Y6E2T.mjs → chunk-CV4MOEMO.mjs} +2 -2
- package/dist/{chunk-OLKYHTLN.cjs → chunk-DA432P2F.cjs} +5 -5
- package/dist/{chunk-B3HQTGXS.cjs → chunk-DVAZ53X6.cjs} +6 -1
- package/dist/{chunk-XRSNW4IU.mjs → chunk-E72GG355.mjs} +5 -0
- package/dist/{chunk-FJGA3XWL.cjs → chunk-EA5HVG45.cjs} +2 -2
- package/dist/{chunk-NG2EZ6QS.cjs → chunk-EODGIFI7.cjs} +4 -2
- package/dist/{chunk-Y3DO7BIJ.cjs → chunk-EUZFBHPP.cjs} +3 -0
- package/dist/{chunk-KRU3XPOW.cjs → chunk-EXPVSFAG.cjs} +14 -11
- package/dist/{chunk-EACD6ND7.cjs → chunk-EZUTDTFM.cjs} +7 -7
- package/dist/{chunk-KCJBIWBM.mjs → chunk-GVORDLLV.mjs} +1 -1
- package/dist/{chunk-XGL42MQ7.mjs → chunk-HIDZM23B.mjs} +1 -1
- package/dist/{chunk-23BZ7ZH6.mjs → chunk-HNB5JHBO.mjs} +5 -2
- package/dist/{chunk-DZC2XGK4.mjs → chunk-HVGINJTO.mjs} +81 -28
- package/dist/{chunk-EBKYRP2P.mjs → chunk-I5KPOXUE.mjs} +1 -1
- package/dist/{chunk-HR5GU4UU.cjs → chunk-ILQSRLKK.cjs} +4 -4
- package/dist/{chunk-L4B7PB3H.cjs → chunk-J2EKGR6E.cjs} +1025 -480
- package/dist/{chunk-26WP75W5.cjs → chunk-JDT733EW.cjs} +41 -27
- package/dist/{chunk-W53Z4WDI.cjs → chunk-JH4CDG4G.cjs} +8 -8
- package/dist/{chunk-KQ6TYQU7.cjs → chunk-KDQKTX3Q.cjs} +4 -4
- package/dist/{chunk-PEQJ4UUT.mjs → chunk-LP6DIYGA.mjs} +2 -2
- package/dist/{chunk-Z7ZRBCAB.mjs → chunk-LQ3FISSD.mjs} +58 -37
- package/dist/{chunk-KBIM7PFQ.cjs → chunk-M4YXD6MD.cjs} +272 -219
- package/dist/{chunk-6ETHVRFO.cjs → chunk-MWAWMFG3.cjs} +407 -386
- package/dist/{chunk-ECVSRE4Y.mjs → chunk-N2BRIN7I.mjs} +1 -1
- package/dist/{chunk-MO4UTDQ6.mjs → chunk-NNNMFSXG.mjs} +1 -1
- package/dist/{chunk-V3Y3R3JJ.cjs → chunk-NOSLIDSG.cjs} +1 -1
- package/dist/{chunk-ICOJ2BC6.mjs → chunk-NWF2FTFV.mjs} +24 -10
- package/dist/{chunk-M3JYBZO2.cjs → chunk-OLIWLN4I.cjs} +2 -2
- package/dist/{chunk-YPAOC3FO.mjs → chunk-P2TGLGRR.mjs} +4 -4
- package/dist/{chunk-THGSPDFD.cjs → chunk-PAKB6JHX.cjs} +7 -7
- package/dist/{chunk-NVXU5BEG.mjs → chunk-Q637AXGZ.mjs} +172 -47
- package/dist/{chunk-ZZGQD3LL.mjs → chunk-QO24II6C.mjs} +4 -2
- package/dist/{chunk-HENPVGZC.cjs → chunk-RBSGFS5X.cjs} +66 -34
- package/dist/{chunk-IJPRCQHW.cjs → chunk-RGMUS3HO.cjs} +10 -10
- package/dist/{chunk-OIPPISQ6.cjs → chunk-RTAWQXME.cjs} +273 -148
- package/dist/{chunk-DMSXZNQR.cjs → chunk-RZI6436F.cjs} +2 -2
- package/dist/{chunk-HZY63K5C.mjs → chunk-S6MGFULY.mjs} +2 -2
- package/dist/{chunk-5GFTMTX3.cjs → chunk-SAUGKNCF.cjs} +2 -2
- package/dist/{chunk-6BMAGVDI.cjs → chunk-SCE7VWPN.cjs} +12 -12
- package/dist/{chunk-PKV3JGMS.mjs → chunk-SSFAPTRD.mjs} +1 -1
- package/dist/{chunk-ND65INFS.cjs → chunk-SWPLGPYF.cjs} +7 -7
- package/dist/{chunk-WP77JDKI.cjs → chunk-UCJCU2IL.cjs} +14 -14
- package/dist/{chunk-WX752VMN.mjs → chunk-UCRNNDNS.mjs} +1 -1
- package/dist/{chunk-27ESPHQA.cjs → chunk-UGWKNZ4U.cjs} +44 -27
- package/dist/{chunk-FLKG2PYH.cjs → chunk-UOMSGJHK.cjs} +11 -11
- package/dist/{chunk-2U2GRXP5.mjs → chunk-UWDFH3ZV.mjs} +1 -1
- package/dist/{chunk-AMMFRXFW.mjs → chunk-V5FEFFHV.mjs} +1 -1
- package/dist/{chunk-HR4N2K4V.mjs → chunk-WABOJXAA.mjs} +2 -2
- package/dist/{chunk-LTXKRIST.mjs → chunk-WANLI3ZC.mjs} +2 -2
- package/dist/{chunk-HQEYZSF3.cjs → chunk-WPURVYXT.cjs} +2 -2
- package/dist/{chunk-TE7AX6HB.mjs → chunk-WV63R4GE.mjs} +1 -1
- package/dist/{chunk-CIQCJ72N.mjs → chunk-XOLYZZDX.mjs} +693 -148
- package/dist/{chunk-4ZVKDHS6.cjs → chunk-YSRZSKQB.cjs} +4 -4
- package/dist/{cli-runtime.d-jqZ7YCsm.d.ts → cli-runtime.d-Dbl-gIoz.d.ts} +5 -5
- package/dist/{cli-runtime.d-qL44rqYO.d.mts → cli-runtime.d-oUiNuspW.d.mts} +5 -5
- package/dist/{client-component.d-BDD5aiUb.d.ts → client-component.d-CT4q7tmy.d.ts} +1 -1
- package/dist/{client-component.d-B2L2LyAr.d.mts → client-component.d-DaUqOhZT.d.mts} +1 -1
- package/dist/{client-plugins.d-Crct3m_r.d.ts → client-plugins.d-24qhjX8c.d.ts} +30 -4
- package/dist/{client-plugins.d-Dzc3vOw_.d.mts → client-plugins.d-BfGTqbAH.d.mts} +30 -4
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-JTJA2KIZ.cjs → devtools-5WDQQDTA.cjs} +6 -6
- package/dist/{devtools-5DBTT2DI.mjs → devtools-DPYIYHTI.mjs} +5 -5
- package/dist/docs.cjs +8 -8
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +7 -7
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/{handler.d-B1S1ZBqS.d.mts → handler.d-GfNuz57p.d.mts} +1 -1
- package/dist/{handler.d-ZweCBJD4.d.ts → handler.d-Oca5kNSz.d.ts} +1 -1
- package/dist/{headers.d-C-yGl_f6.d.mts → headers.d-C_lsQIWA.d.mts} +1 -1
- package/dist/{headers.d-BgBdQN8x.d.ts → headers.d-b8gHJDvu.d.ts} +1 -1
- package/dist/index.cjs +33 -29
- package/dist/{index.d-13h3oDu7.d.mts → index.d-BLtjh1aS.d.mts} +1 -1
- package/dist/{index.d-CtoniAXT.d.ts → index.d-Ckv6kHFm.d.ts} +1 -1
- package/dist/index.d.mts +23 -23
- package/dist/index.d.ts +23 -23
- package/dist/index.mjs +34 -30
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.cjs +4 -2
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +3 -1
- package/dist/internal/app-markdown-runtime.cjs +5 -3
- package/dist/internal/app-markdown-runtime.d.mts +10 -5
- package/dist/internal/app-markdown-runtime.d.ts +10 -5
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +26 -26
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +25 -25
- package/dist/internal/cli-runtime.cjs +10 -10
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +9 -9
- 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 +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +7 -7
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +6 -6
- package/dist/internal/infra-analytics-runtime.cjs +9 -9
- package/dist/internal/infra-analytics-runtime.mjs +7 -7
- package/dist/internal/metadata-image-runtime.d.mts +2 -2
- package/dist/internal/metadata-image-runtime.d.ts +2 -2
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-node-env.cjs +2 -2
- package/dist/internal/production-node-env.mjs +1 -1
- package/dist/internal/production-runtime.cjs +12 -12
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +11 -11
- package/dist/internal/spa-router.cjs +3 -3
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/spa-router.mjs +2 -2
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-_6Un9wdK.d.mts → mount.d-BCS8mD4E.d.mts} +1 -1
- package/dist/{mount.d-DyKlRR6z.d.ts → mount.d-DEX8eref.d.ts} +1 -1
- package/dist/{native-tree-5TENEQ7Y.cjs → native-tree-52CUAP3N.cjs} +3 -3
- package/dist/{native-tree-LNO7K6JR.mjs → native-tree-AO7PQ7FR.mjs} +2 -2
- package/dist/{navigation-delegate.d-BbW1_pf_.d.ts → navigation-delegate.d-Cgi28e5Q.d.ts} +1 -1
- package/dist/{navigation-delegate.d-B9GjWbov.d.mts → navigation-delegate.d-F83ugsZW.d.mts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +4 -4
- package/dist/plugin.cjs +19 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +18 -18
- package/dist/query/client.cjs +7 -7
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-DaM1NPnm.d.mts → render-plan.d-BkVY4aFb.d.mts} +1 -1
- package/dist/{render-plan.d-D0FV9lDT.d.ts → render-plan.d-DCF2GZdD.d.ts} +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +22 -11
- package/dist/renderer.d.ts +22 -11
- package/dist/{request.d-CrXC7voZ.d.ts → request.d-C5o-4dU2.d.ts} +1 -1
- package/dist/{request.d-DVSLilGx.d.mts → request.d-DMPB53-i.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-CWi3UYtR.d.mts → route-rendering.d-DDvArvik.d.mts} +1 -1
- package/dist/{route-rendering.d-OfbM_rj8.d.ts → route-rendering.d-DfP6zRP7.d.ts} +1 -1
- package/dist/{router.d-YKVirmj4.d.mts → router.d-1Skf2XCO.d.mts} +1 -1
- package/dist/{router.d-Bm9FNSu3.d.ts → router.d-s40h7aoS.d.ts} +1 -1
- package/dist/routes.d.mts +3 -3
- package/dist/routes.d.ts +3 -3
- package/dist/{rsc-pipeline-W5DSWDHD.mjs → rsc-pipeline-O2YMVHUF.mjs} +7 -7
- package/dist/{rsc-pipeline-LGXJGGMW.cjs → rsc-pipeline-SFQSMVI7.cjs} +8 -8
- package/dist/{runtime-UOZKSM5S.mjs → runtime-K2X3IZAF.mjs} +6 -6
- package/dist/{runtime-YV4X5FAK.cjs → runtime-WOTVFYQY.cjs} +8 -8
- package/dist/{runtime.d-BVj6apd0.d.mts → runtime.d-Bykc5Qfg.d.mts} +1 -1
- package/dist/{runtime.d-D7QYVJGO.d.ts → runtime.d-k-9kFUsM.d.ts} +1 -1
- package/dist/{server-components-status.d-BDVcxi0z.d.mts → server-components-status.d-D-HixBe0.d.mts} +1 -1
- package/dist/{server-components-status.d-CfKDpmCH.d.ts → server-components-status.d-DLNd1C5j.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +41 -41
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +20 -20
- package/dist/{spa-router.d-DGmropfK.d.mts → spa-router.d-DIlXwm00.d.mts} +2 -2
- package/dist/{spa-router.d-nE1jHNGt.d.ts → spa-router.d-Dl-EJeJT.d.ts} +2 -2
- package/dist/{ssg.d-DS-gXUbf.d.mts → ssg.d-D2ZV0bhs.d.mts} +2 -2
- package/dist/{ssg.d-jXlUAKzg.d.ts → ssg.d-bE-ylg0e.d.ts} +2 -2
- package/dist/{store-core.d-B5cwOd8g.d.ts → store-core.d-BmdnMopD.d.ts} +2 -2
- package/dist/{store-core.d-C-gATBwd.d.mts → store-core.d-DPsCYzV7.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-BODwBtkz.d.ts → utils.d-BFZQcBZV.d.ts} +1 -1
- package/dist/{utils.d-Cmj-fzds.d.mts → utils.d-nM3OHKq5.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +19 -19
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +18 -18
- package/package.json +1 -1
- package/dist/analyzer-IIWSUXSQ.cjs +0 -17
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
_resolveFarmMarkdownIndexAlias,
|
|
9
9
|
createFarmMarkdownViewResponse,
|
|
10
10
|
requestAcceptsMarkdown
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CRF5MOLO.mjs";
|
|
12
12
|
import {
|
|
13
13
|
withoutFarmDeploymentCookie
|
|
14
14
|
} from "./chunk-IWJONXPF.mjs";
|
|
@@ -107,23 +107,36 @@ async function evaluateMdxSource(body, filePath, renderer) {
|
|
|
107
107
|
var MARKDOWN_ROUTE_CONFIG_EXPORT = /^export\s+const\s+(dynamic|revalidate|ssg)\s*=\s*("[^"\\]*"|'[^'\\]*'|\d+(?:\.\d+)?|true|false)\s*;?\s*$/;
|
|
108
108
|
function readFarmMarkdownRouteConfig(body) {
|
|
109
109
|
const config = {};
|
|
110
|
+
for (const match of findFarmMarkdownRouteConfigExports(body.split("\n")).values()) {
|
|
111
|
+
const literal = match[2];
|
|
112
|
+
config[match[1]] = literal === "true" ? true : literal === "false" ? false : /^\d/.test(literal) ? Number(literal) : literal.slice(1, -1);
|
|
113
|
+
}
|
|
114
|
+
return config;
|
|
115
|
+
}
|
|
116
|
+
function findFarmMarkdownRouteConfigExports(lines) {
|
|
117
|
+
const exports = /* @__PURE__ */ new Map();
|
|
110
118
|
let fence;
|
|
111
|
-
|
|
119
|
+
lines.forEach((raw, index) => {
|
|
120
|
+
const line = raw.endsWith("\r") ? raw.slice(0, -1) : raw;
|
|
112
121
|
const marker = line.match(/^ {0,3}(`{3,}|~{3,})/)?.[1];
|
|
113
122
|
if (fence) {
|
|
114
123
|
if (marker && marker[0] === fence[0] && marker.length >= fence.length) fence = void 0;
|
|
115
|
-
|
|
124
|
+
return;
|
|
116
125
|
}
|
|
117
126
|
if (marker) {
|
|
118
127
|
fence = marker;
|
|
119
|
-
|
|
128
|
+
return;
|
|
120
129
|
}
|
|
121
130
|
const match = line.match(MARKDOWN_ROUTE_CONFIG_EXPORT);
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
if (match) exports.set(index, match);
|
|
132
|
+
});
|
|
133
|
+
return exports;
|
|
134
|
+
}
|
|
135
|
+
function withoutFarmMarkdownRouteConfig(source) {
|
|
136
|
+
const lines = source.split("\n");
|
|
137
|
+
const exports = findFarmMarkdownRouteConfigExports(lines);
|
|
138
|
+
if (exports.size === 0) return source;
|
|
139
|
+
return lines.filter((_, index) => !exports.has(index)).join("\n");
|
|
127
140
|
}
|
|
128
141
|
function createFarmMarkdownRouteModule(input) {
|
|
129
142
|
const { body } = parseMarkdownFrontmatter(input.source);
|
|
@@ -325,7 +338,7 @@ async function createFarmMarkdownSourceResponse(options) {
|
|
|
325
338
|
return createFarmMarkdownViewResponse({
|
|
326
339
|
request: options.request,
|
|
327
340
|
requestUrl: url,
|
|
328
|
-
markdown: source.source,
|
|
341
|
+
markdown: withoutFarmMarkdownRouteConfig(source.source),
|
|
329
342
|
status: 200,
|
|
330
343
|
headers,
|
|
331
344
|
markdownPath: headers.get("Content-Location")
|
|
@@ -341,6 +354,7 @@ export {
|
|
|
341
354
|
compileFarmMarkdownPage,
|
|
342
355
|
FARM_MARKDOWN_PRECOMPILED_PAGES,
|
|
343
356
|
readFarmMarkdownRouteConfig,
|
|
357
|
+
withoutFarmMarkdownRouteConfig,
|
|
344
358
|
createFarmMarkdownRouteModule,
|
|
345
359
|
isFarmMarkdownPublicSourceResponse,
|
|
346
360
|
FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS,
|
|
@@ -18,14 +18,14 @@ var _chunkCCAUIBIScjs = require('./chunk-CCAUIBIS.cjs');
|
|
|
18
18
|
var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkNOSLIDSGcjs = require('./chunk-NOSLIDSG.cjs');
|
|
22
22
|
|
|
23
23
|
// src/mobile/analyzer.ts
|
|
24
24
|
var _crypto = require('crypto');
|
|
25
25
|
var _fs = require('fs');
|
|
26
26
|
var _promises = require('fs/promises');
|
|
27
27
|
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
28
|
-
var ANALYZER_VERSION = `8:${
|
|
28
|
+
var ANALYZER_VERSION = `8:${_chunkNOSLIDSGcjs.FARM_VERSION}`;
|
|
29
29
|
var INTRINSIC_KINDS = {};
|
|
30
30
|
for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
|
|
31
31
|
INTRINSIC_KINDS[tag] = "View";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FARM_DEFAULT_MCP_PATH,
|
|
3
3
|
FARM_DEFAULT_MCP_TOOLS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WABOJXAA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
normalizeFarmProductionSiteOrigin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SSFAPTRD.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveFarmAppManifestConfig
|
|
10
10
|
} from "./chunk-SQ5O7I3L.mjs";
|
|
11
11
|
import {
|
|
12
12
|
emitFarmAgentRead,
|
|
13
13
|
getFarmMarkdownMirrorPath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CRF5MOLO.mjs";
|
|
15
15
|
import {
|
|
16
16
|
readFarmEnvironmentValue
|
|
17
17
|
} from "./chunk-WXFY5JIY.mjs";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-YT2ZMLXK.mjs";
|
|
30
30
|
import {
|
|
31
31
|
FARM_VERSION
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-I5KPOXUE.mjs";
|
|
33
33
|
import {
|
|
34
34
|
applyFarmBasePath
|
|
35
35
|
} from "./chunk-SF3JB56B.mjs";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUCJCU2ILcjs = require('./chunk-UCJCU2IL.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkKDQKTX3Qcjs = require('./chunk-KDQKTX3Q.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
10
10
|
|
|
11
11
|
// src/navigation.ts
|
|
12
12
|
function useRouter2() {
|
|
13
|
-
const router =
|
|
13
|
+
const router = _chunkUCJCU2ILcjs.useRouter.call(void 0, );
|
|
14
14
|
return {
|
|
15
15
|
push: router.push,
|
|
16
16
|
replace: router.replace,
|
|
@@ -18,19 +18,19 @@ function useRouter2() {
|
|
|
18
18
|
forward: router.forward,
|
|
19
19
|
refresh() {
|
|
20
20
|
if (typeof window === "undefined") return Promise.resolve();
|
|
21
|
-
return
|
|
21
|
+
return _chunkKDQKTX3Qcjs.getRouter.call(void 0, ).refresh();
|
|
22
22
|
},
|
|
23
23
|
prefetch(href) {
|
|
24
24
|
if (typeof window === "undefined") return Promise.resolve();
|
|
25
|
-
return
|
|
25
|
+
return _chunkKDQKTX3Qcjs.getRouter.call(void 0, ).prefetch(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href));
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function usePathname() {
|
|
30
|
-
return
|
|
30
|
+
return _chunkUCJCU2ILcjs.useRouter.call(void 0, ).pathname;
|
|
31
31
|
}
|
|
32
32
|
function useSearchParams() {
|
|
33
|
-
return
|
|
33
|
+
return _chunkUCJCU2ILcjs.useRouter.call(void 0, ).searchParams;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "./chunk-U6GMCDRS.mjs";
|
|
29
29
|
import {
|
|
30
30
|
FARM_VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-I5KPOXUE.mjs";
|
|
32
32
|
|
|
33
33
|
// src/environment-vite.ts
|
|
34
34
|
import { existsSync, readFileSync, realpathSync } from "fs";
|
|
@@ -158,9 +158,16 @@ var snapshot;
|
|
|
158
158
|
var base;
|
|
159
159
|
var volatile;
|
|
160
160
|
var trace;
|
|
161
|
+
var traceGroups;
|
|
161
162
|
function farmSourceSnapshotPathKey(file, paths = path2) {
|
|
163
|
+
if (paths === path2 && path2.sep === "/" && isNormalizedPosixPath(file)) return file;
|
|
162
164
|
return paths.resolve(file);
|
|
163
165
|
}
|
|
166
|
+
function isNormalizedPosixPath(file) {
|
|
167
|
+
if (file.charCodeAt(0) !== 47) return false;
|
|
168
|
+
if (file.length === 1) return true;
|
|
169
|
+
return !file.endsWith("/") && !file.endsWith("/.") && !file.endsWith("/..") && !file.includes("//") && !file.includes("/./") && !file.includes("/../");
|
|
170
|
+
}
|
|
164
171
|
function getFarmSourceStamp(file) {
|
|
165
172
|
try {
|
|
166
173
|
const stat = fs.statSync(file);
|
|
@@ -268,15 +275,34 @@ function memoizeInFarmSourceSnapshot(scope, key, compute, lasting) {
|
|
|
268
275
|
function noteFarmSourceRead(file) {
|
|
269
276
|
trace?.add(file);
|
|
270
277
|
}
|
|
278
|
+
function noteFarmSourceReads(files) {
|
|
279
|
+
if (traceGroups) traceGroups.add(files);
|
|
280
|
+
else if (trace) for (const file of files) trace.add(file);
|
|
281
|
+
}
|
|
271
282
|
function traceFarmSourceReads(operation) {
|
|
283
|
+
const { result, files } = traceReads(operation, false);
|
|
284
|
+
return { result, files: [...files] };
|
|
285
|
+
}
|
|
286
|
+
function traceFarmSourceReadGroups(operation) {
|
|
287
|
+
const { result, files, groups } = traceReads(operation, true);
|
|
288
|
+
return { result, files: [...files], groups: [...groups] };
|
|
289
|
+
}
|
|
290
|
+
function traceReads(operation, grouped) {
|
|
272
291
|
const outer = trace;
|
|
292
|
+
const outerGroups = traceGroups;
|
|
273
293
|
const files = /* @__PURE__ */ new Set();
|
|
294
|
+
const groups = grouped ? /* @__PURE__ */ new Set() : void 0;
|
|
274
295
|
trace = files;
|
|
296
|
+
traceGroups = groups;
|
|
275
297
|
try {
|
|
276
|
-
return { result: operation(), files
|
|
298
|
+
return { result: operation(), files, groups };
|
|
277
299
|
} finally {
|
|
278
300
|
trace = outer;
|
|
279
|
-
|
|
301
|
+
traceGroups = outerGroups;
|
|
302
|
+
if (outer) {
|
|
303
|
+
for (const file of files) outer.add(file);
|
|
304
|
+
if (groups) for (const group of groups) noteFarmSourceReads(group);
|
|
305
|
+
}
|
|
280
306
|
}
|
|
281
307
|
}
|
|
282
308
|
|
|
@@ -304,11 +330,19 @@ function packageNameOf(specifier) {
|
|
|
304
330
|
return { name, subpath: parts.slice(name.startsWith("@") ? 2 : 1).join("/") };
|
|
305
331
|
}
|
|
306
332
|
function findPackageDirectory(importer, name) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
333
|
+
const start = path3.dirname(importer);
|
|
334
|
+
return memoizeInFarmSourceSnapshot(
|
|
335
|
+
"package-directory",
|
|
336
|
+
`${farmSourceSnapshotPathKey(start)}\0${name}`,
|
|
337
|
+
() => {
|
|
338
|
+
for (let current = start; ; current = path3.dirname(current)) {
|
|
339
|
+
const directory = path3.join(current, "node_modules", name);
|
|
340
|
+
if (fs2.existsSync(path3.join(directory, "package.json"))) return fs2.realpathSync(directory);
|
|
341
|
+
if (path3.dirname(current) === current) return null;
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
(directory) => directory !== null
|
|
345
|
+
);
|
|
312
346
|
}
|
|
313
347
|
function pickTarget(value, conditions) {
|
|
314
348
|
if (typeof value === "string") return value;
|
|
@@ -505,7 +539,11 @@ function traceExport(file, name, depth) {
|
|
|
505
539
|
return void 0;
|
|
506
540
|
}
|
|
507
541
|
function traceFarmExport(file, name) {
|
|
508
|
-
return
|
|
542
|
+
return memoizeInFarmSourceSnapshot(
|
|
543
|
+
"export-kind",
|
|
544
|
+
`${farmSourceSnapshotPathKey(file)}\0${name}`,
|
|
545
|
+
() => traceExport(file, name, 0)?.kind
|
|
546
|
+
);
|
|
509
547
|
}
|
|
510
548
|
function isFarmClientExport(file, name) {
|
|
511
549
|
return traceFarmExport(file, name) === "client";
|
|
@@ -785,9 +823,21 @@ function readModuleImports(file) {
|
|
|
785
823
|
return imports;
|
|
786
824
|
}
|
|
787
825
|
var clientOnlyFreeFiles = /* @__PURE__ */ new Set();
|
|
788
|
-
function invalidateFarmClientOnlyScan() {
|
|
826
|
+
function invalidateFarmClientOnlyScan(file, event) {
|
|
827
|
+
if (file && event === "update" && path3.basename(file) !== "package.json" && !isClientOnlyScanned(file)) {
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
789
830
|
clientOnlyFreeFiles.clear();
|
|
790
831
|
}
|
|
832
|
+
function isClientOnlyScanned(file) {
|
|
833
|
+
const resolved = path3.resolve(file);
|
|
834
|
+
if (clientOnlyFreeFiles.has(resolved)) return true;
|
|
835
|
+
try {
|
|
836
|
+
return clientOnlyFreeFiles.has(fs2.realpathSync(resolved));
|
|
837
|
+
} catch {
|
|
838
|
+
return true;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
791
841
|
function resolveServerEntry(importer, specifier) {
|
|
792
842
|
const parsed = packageNameOf(specifier);
|
|
793
843
|
if (!parsed || REACT_PACKAGES.has(parsed.name) || parsed.name.startsWith("@farm.js/")) {
|
|
@@ -1818,15 +1868,12 @@ function ensureFarmPackageClientReference(root, specifier, exportName, importer)
|
|
|
1818
1868
|
`export { __farm_reference__ as ${exportName} };`,
|
|
1819
1869
|
""
|
|
1820
1870
|
].join("\n");
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
fs3.mkdirSync(path4.dirname(file), { recursive: true });
|
|
1828
|
-
fs3.writeFileSync(file, source);
|
|
1829
|
-
}
|
|
1871
|
+
memoizeInFarmSourceSnapshot(
|
|
1872
|
+
"client-reference-file",
|
|
1873
|
+
`${file}\0${source}`,
|
|
1874
|
+
() => writeIfChanged(file, source),
|
|
1875
|
+
() => false
|
|
1876
|
+
);
|
|
1830
1877
|
return file;
|
|
1831
1878
|
}
|
|
1832
1879
|
function writeIfChanged(file, source) {
|
|
@@ -2154,6 +2201,7 @@ var PackageClientBoundaryCache = class {
|
|
|
2154
2201
|
else this.dirty = true;
|
|
2155
2202
|
}
|
|
2156
2203
|
}
|
|
2204
|
+
if (visited.size === 0) return entries?.find((entry) => entry.stops.length === 0);
|
|
2157
2205
|
return entries?.find(
|
|
2158
2206
|
(entry) => entry.stops.every((file) => visited.has(file)) && !entry.files.some((file) => visited.has(file))
|
|
2159
2207
|
);
|
|
@@ -2314,6 +2362,11 @@ async function withPackageClientBoundaryCache(operation) {
|
|
|
2314
2362
|
await cache2.persist();
|
|
2315
2363
|
}
|
|
2316
2364
|
}
|
|
2365
|
+
function bindPackageClientBoundaryCache() {
|
|
2366
|
+
const cache2 = getPackageClientBoundaryCache();
|
|
2367
|
+
if (!cache2) return (operation) => operation();
|
|
2368
|
+
return (operation) => getPackageClientBoundaryCache() ? operation() : getStorage().run(cache2, operation);
|
|
2369
|
+
}
|
|
2317
2370
|
function usePackageClientBoundaryCacheFile(file) {
|
|
2318
2371
|
getPackageClientBoundaryCache()?.load(file);
|
|
2319
2372
|
}
|
|
@@ -2888,6 +2941,14 @@ function isAsyncLocalDeclaration(tokens, name) {
|
|
|
2888
2941
|
}
|
|
2889
2942
|
return false;
|
|
2890
2943
|
}
|
|
2944
|
+
function parseImportedModuleMetadata(content) {
|
|
2945
|
+
if (!content) return parseClientModuleMetadata(content, false);
|
|
2946
|
+
return memoizeInFarmSourceSnapshot(
|
|
2947
|
+
"imported-module-metadata",
|
|
2948
|
+
content,
|
|
2949
|
+
() => parseClientModuleMetadata(content, false)
|
|
2950
|
+
);
|
|
2951
|
+
}
|
|
2891
2952
|
function parseClientModuleMetadata(content, inspectIslandExport, sourcePath) {
|
|
2892
2953
|
if (!content) {
|
|
2893
2954
|
return {
|
|
@@ -2950,7 +3011,7 @@ function getFarmClientRenderingBindings(code, file, root) {
|
|
|
2950
3011
|
for (const [specifier, locals] of getStaticImportBindings(code)) {
|
|
2951
3012
|
const imported = resolveImportedModule(file, specifier, root);
|
|
2952
3013
|
if (!imported.path) continue;
|
|
2953
|
-
const metadata = imported.local ? inspectClientModuleMetadata(imported.path, root, /* @__PURE__ */ new Set([path8.resolve(file)]), false) : inspectPackageClientBoundary(imported.path, root
|
|
3014
|
+
const metadata = imported.local ? inspectClientModuleMetadata(imported.path, root, /* @__PURE__ */ new Set([path8.resolve(file)]), false) : inspectPackageClientBoundary(imported.path, root);
|
|
2954
3015
|
if (metadata.isClientComponent || metadata.shouldHydrate) bindings.push(...locals);
|
|
2955
3016
|
}
|
|
2956
3017
|
return bindings;
|
|
@@ -3273,9 +3334,17 @@ function exportListNames(content) {
|
|
|
3273
3334
|
}
|
|
3274
3335
|
return names;
|
|
3275
3336
|
}
|
|
3337
|
+
var NO_IMPORT_BINDINGS = /* @__PURE__ */ new Map();
|
|
3276
3338
|
function getStaticImportBindings(content) {
|
|
3339
|
+
if (!content) return NO_IMPORT_BINDINGS;
|
|
3340
|
+
return memoizeInFarmSourceSnapshot(
|
|
3341
|
+
"import-bindings",
|
|
3342
|
+
content,
|
|
3343
|
+
() => scanStaticImportBindings(content)
|
|
3344
|
+
);
|
|
3345
|
+
}
|
|
3346
|
+
function scanStaticImportBindings(content) {
|
|
3277
3347
|
const bindings = /* @__PURE__ */ new Map();
|
|
3278
|
-
if (!content) return bindings;
|
|
3279
3348
|
const tokens = tokenizeModuleSource(content);
|
|
3280
3349
|
for (let index = 0; index < tokens.length; index++) {
|
|
3281
3350
|
if (tokens[index].value !== "import" || tokens[index - 1]?.value === ".") continue;
|
|
@@ -3582,7 +3651,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
3582
3651
|
if (visiting.has(moduleSourcePath)) return 0;
|
|
3583
3652
|
visiting.add(moduleSourcePath);
|
|
3584
3653
|
const content = readModuleCode(moduleSourcePath);
|
|
3585
|
-
const parsed =
|
|
3654
|
+
const parsed = parseImportedModuleMetadata(content);
|
|
3586
3655
|
if (parsed.isClientComponent) {
|
|
3587
3656
|
if (!isIsolatableClientBoundarySource(content)) {
|
|
3588
3657
|
fallbackReason = `client boundary ${moduleSourcePath} uses an unsupported export shape`;
|
|
@@ -3644,7 +3713,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
3644
3713
|
if (reference) importedBoundaryCount += visit(reference);
|
|
3645
3714
|
}
|
|
3646
3715
|
} else {
|
|
3647
|
-
const packageMetadata = inspectPackageClientBoundary(importedPath, root
|
|
3716
|
+
const packageMetadata = inspectPackageClientBoundary(importedPath, root);
|
|
3648
3717
|
if (!packageMetadata.shouldHydrate) continue;
|
|
3649
3718
|
const references = options.packageReferences && projectRoot ? findFarmPackageClientImports(
|
|
3650
3719
|
content ?? "",
|
|
@@ -3769,37 +3838,59 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
|
|
|
3769
3838
|
function farmWorkspaceServerEntry(entry) {
|
|
3770
3839
|
const real = realpathOrSelf(entry);
|
|
3771
3840
|
if (real.split(path8.sep).includes("node_modules")) return null;
|
|
3772
|
-
if (
|
|
3841
|
+
if (parseImportedModuleMetadata(readIfExists(real)).isClientComponent) return null;
|
|
3773
3842
|
return real;
|
|
3774
3843
|
}
|
|
3775
3844
|
function realpathOrSelf(file) {
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3845
|
+
const real = memoizeInFarmSourceSnapshot(
|
|
3846
|
+
"realpath",
|
|
3847
|
+
farmSourceSnapshotPathKey(file),
|
|
3848
|
+
() => {
|
|
3849
|
+
try {
|
|
3850
|
+
return fs7.realpathSync(file);
|
|
3851
|
+
} catch {
|
|
3852
|
+
return null;
|
|
3853
|
+
}
|
|
3854
|
+
},
|
|
3855
|
+
(resolved) => resolved !== null
|
|
3856
|
+
);
|
|
3857
|
+
return real ?? file;
|
|
3858
|
+
}
|
|
3859
|
+
var NODE_MODULES_SEGMENT2 = `${path8.sep}node_modules${path8.sep}`;
|
|
3860
|
+
function getInstalledPackageDirectory(file, start) {
|
|
3861
|
+
let end = file.indexOf(path8.sep, start);
|
|
3862
|
+
if (end !== -1 && file[start] === "@") end = file.indexOf(path8.sep, end + 1);
|
|
3863
|
+
return end === -1 ? file : file.slice(0, end);
|
|
3864
|
+
}
|
|
3865
|
+
function installedRealPath(file) {
|
|
3866
|
+
const segment = file.lastIndexOf(NODE_MODULES_SEGMENT2);
|
|
3867
|
+
if (segment === -1) return file;
|
|
3868
|
+
const directory = getInstalledPackageDirectory(file, segment + NODE_MODULES_SEGMENT2.length);
|
|
3869
|
+
const real = realpathOrSelf(directory);
|
|
3870
|
+
if (real === directory || !real.includes(NODE_MODULES_SEGMENT2)) return file;
|
|
3871
|
+
return real + file.slice(directory.length);
|
|
3872
|
+
}
|
|
3873
|
+
var NO_VISITED_FILES = /* @__PURE__ */ new Set();
|
|
3782
3874
|
function getBarePackageReexports(content) {
|
|
3783
3875
|
return getImportSpecifiers(content, { reexportsOnly: true }).filter(
|
|
3784
3876
|
(specifier) => bareSpecifierPackage(specifier)
|
|
3785
3877
|
);
|
|
3786
3878
|
}
|
|
3787
|
-
function inspectPackageClientBoundary(
|
|
3879
|
+
function inspectPackageClientBoundary(importedPath, root, visited) {
|
|
3880
|
+
const resolvedPath = importedPath && installedRealPath(importedPath);
|
|
3788
3881
|
const cache2 = getPackageClientBoundaryCache();
|
|
3789
|
-
if (!cache2 || !resolvedPath || visited
|
|
3790
|
-
return traversePackageClientBoundary(resolvedPath, root, visited);
|
|
3882
|
+
if (!cache2 || !resolvedPath || visited?.has(resolvedPath)) {
|
|
3883
|
+
return traversePackageClientBoundary(resolvedPath, root, visited ?? /* @__PURE__ */ new Set());
|
|
3791
3884
|
}
|
|
3792
3885
|
const key = `${root ?? ""}\0${resolvedPath}`;
|
|
3793
|
-
const cached = cache2.find(key, visited);
|
|
3886
|
+
const cached = cache2.find(key, visited ?? NO_VISITED_FILES);
|
|
3794
3887
|
if (cached) {
|
|
3795
|
-
for (const file of cached.files)
|
|
3796
|
-
|
|
3797
|
-
noteFarmSourceRead(file);
|
|
3798
|
-
}
|
|
3888
|
+
if (visited) for (const file of cached.files) visited.add(file);
|
|
3889
|
+
noteFarmSourceReads(cached.files);
|
|
3799
3890
|
return { ...cached.result };
|
|
3800
3891
|
}
|
|
3801
3892
|
const trace2 = new PackageInspectionTrace();
|
|
3802
|
-
const result = traversePackageClientBoundary(resolvedPath, root, visited, trace2);
|
|
3893
|
+
const result = traversePackageClientBoundary(resolvedPath, root, visited ?? /* @__PURE__ */ new Set(), trace2);
|
|
3803
3894
|
cache2.add(key, trace2.toEntry(result));
|
|
3804
3895
|
return result;
|
|
3805
3896
|
}
|
|
@@ -3815,7 +3906,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
|
3815
3906
|
visited.add(resolvedPath);
|
|
3816
3907
|
trace2?.visit(resolvedPath);
|
|
3817
3908
|
const content = readIfExists(resolvedPath);
|
|
3818
|
-
const parsed =
|
|
3909
|
+
const parsed = parseImportedModuleMetadata(content);
|
|
3819
3910
|
let importsClientBoundary = false;
|
|
3820
3911
|
let importedIslandStrategy = null;
|
|
3821
3912
|
const reexports = getBarePackageReexports(content);
|
|
@@ -4273,7 +4364,7 @@ function resolveSourceCandidatePath(candidate) {
|
|
|
4273
4364
|
function isFarmPackageClientBoundary(importerPath, specifier, root) {
|
|
4274
4365
|
const imported = resolveImportedModule(importerPath, specifier, root);
|
|
4275
4366
|
if (imported.local || !imported.path) return false;
|
|
4276
|
-
return inspectPackageClientBoundary(imported.path, root
|
|
4367
|
+
return inspectPackageClientBoundary(imported.path, root).shouldHydrate;
|
|
4277
4368
|
}
|
|
4278
4369
|
var CLIENT_PACKAGE_SCAN_EXTENSIONS = /\.(?:[cm]?[jt]sx?)$/;
|
|
4279
4370
|
var CLIENT_PACKAGE_SCAN_SKIP = /* @__PURE__ */ new Set([
|
|
@@ -4369,11 +4460,37 @@ var clientReachableModules = /* @__PURE__ */ new Map();
|
|
|
4369
4460
|
function invalidateFarmClientReachableModules() {
|
|
4370
4461
|
clientReachableModules.clear();
|
|
4371
4462
|
}
|
|
4463
|
+
function isClientEntrySource(content) {
|
|
4464
|
+
return hasUseClientDirective(content) || hasHydrateExport(content);
|
|
4465
|
+
}
|
|
4466
|
+
function getClientReachableImports(content) {
|
|
4467
|
+
return getImportSpecifiers(content, { dynamic: true });
|
|
4468
|
+
}
|
|
4469
|
+
function noteFarmClientReachableModuleChange(file, event, options) {
|
|
4470
|
+
if (event !== "update") {
|
|
4471
|
+
invalidateFarmClientReachableModules();
|
|
4472
|
+
return;
|
|
4473
|
+
}
|
|
4474
|
+
const resolved = path8.resolve(file);
|
|
4475
|
+
let content;
|
|
4476
|
+
for (const [key, scan] of clientReachableModules) {
|
|
4477
|
+
const read = scan.reads.get(resolved);
|
|
4478
|
+
if (!read) {
|
|
4479
|
+
if (options.appSource) clientReachableModules.delete(key);
|
|
4480
|
+
continue;
|
|
4481
|
+
}
|
|
4482
|
+
if (content === void 0) content = readIfExists(resolved);
|
|
4483
|
+
if (read.entry !== void 0 && read.entry !== isClientEntrySource(content) || read.imports !== void 0 && read.imports !== getClientReachableImports(content).join("\0")) {
|
|
4484
|
+
clientReachableModules.delete(key);
|
|
4485
|
+
}
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4372
4488
|
function getFarmClientReachableModules(directory, root) {
|
|
4373
4489
|
const key = `${path8.resolve(root)}\0${path8.resolve(directory)}`;
|
|
4374
4490
|
const cached = clientReachableModules.get(key);
|
|
4375
|
-
if (cached) return cached;
|
|
4491
|
+
if (cached) return cached.modules;
|
|
4376
4492
|
const reachable = /* @__PURE__ */ new Set();
|
|
4493
|
+
const reads = /* @__PURE__ */ new Map();
|
|
4377
4494
|
const queue = [];
|
|
4378
4495
|
const walk2 = (current) => {
|
|
4379
4496
|
let entries;
|
|
@@ -4387,8 +4504,9 @@ function getFarmClientReachableModules(directory, root) {
|
|
|
4387
4504
|
if (entry.isDirectory()) {
|
|
4388
4505
|
if (!entry.name.startsWith(".") && !CLIENT_PACKAGE_SCAN_SKIP.has(entry.name)) walk2(file);
|
|
4389
4506
|
} else if (isScannedSourceFile(entry.name)) {
|
|
4390
|
-
const
|
|
4391
|
-
|
|
4507
|
+
const clientEntry = isClientEntrySource(readIfExists(file));
|
|
4508
|
+
reads.set(path8.resolve(file), { entry: clientEntry });
|
|
4509
|
+
if (clientEntry) queue.push(file);
|
|
4392
4510
|
}
|
|
4393
4511
|
}
|
|
4394
4512
|
};
|
|
@@ -4397,14 +4515,18 @@ function getFarmClientReachableModules(directory, root) {
|
|
|
4397
4515
|
const file = path8.resolve(queue.pop());
|
|
4398
4516
|
if (reachable.has(file)) continue;
|
|
4399
4517
|
reachable.add(file);
|
|
4400
|
-
|
|
4518
|
+
const imports = getClientReachableImports(readIfExists(file));
|
|
4519
|
+
const read = reads.get(file);
|
|
4520
|
+
if (read) read.imports = imports.join("\0");
|
|
4521
|
+
else reads.set(file, { imports: imports.join("\0") });
|
|
4522
|
+
for (const specifier of imports) {
|
|
4401
4523
|
const imported = resolveImportedModule(file, specifier, root);
|
|
4402
4524
|
if (imported.local && imported.path && !reachable.has(path8.resolve(imported.path))) {
|
|
4403
4525
|
queue.push(imported.path);
|
|
4404
4526
|
}
|
|
4405
4527
|
}
|
|
4406
4528
|
}
|
|
4407
|
-
clientReachableModules.set(key, reachable);
|
|
4529
|
+
clientReachableModules.set(key, { modules: reachable, reads });
|
|
4408
4530
|
return reachable;
|
|
4409
4531
|
}
|
|
4410
4532
|
function resolveFarmClientOptimizeDeps(directory, root) {
|
|
@@ -4890,6 +5012,7 @@ export {
|
|
|
4890
5012
|
memoizeInFarmSourceSnapshot,
|
|
4891
5013
|
noteFarmSourceRead,
|
|
4892
5014
|
traceFarmSourceReads,
|
|
5015
|
+
traceFarmSourceReadGroups,
|
|
4893
5016
|
rewriteFarmReactServerClientModuleImports,
|
|
4894
5017
|
rewriteFarmReactServerImports,
|
|
4895
5018
|
invalidateFarmClientOnlyScan,
|
|
@@ -4907,6 +5030,7 @@ export {
|
|
|
4907
5030
|
ensureFarmIslandContainerReference,
|
|
4908
5031
|
wrapFarmIslandContainers,
|
|
4909
5032
|
withPackageClientBoundaryCache,
|
|
5033
|
+
bindPackageClientBoundaryCache,
|
|
4910
5034
|
usePackageClientBoundaryCacheFile,
|
|
4911
5035
|
resolvePackageClientBoundaryCacheFile,
|
|
4912
5036
|
runWithPackageClientBoundaryCacheFile,
|
|
@@ -4931,11 +5055,12 @@ export {
|
|
|
4931
5055
|
enforceFarmIsolatedHydrationRouteBudget,
|
|
4932
5056
|
isIsolatableClientBoundarySource,
|
|
4933
5057
|
isFarmClientModulePlanUnchanged,
|
|
5058
|
+
getInstalledPackageDirectory,
|
|
4934
5059
|
resolveImportedModule,
|
|
4935
5060
|
isFarmPackageClientBoundary,
|
|
4936
5061
|
collectFarmClientPackageImports,
|
|
4937
5062
|
collectFarmServerBundledPackageInfo,
|
|
4938
|
-
|
|
5063
|
+
noteFarmClientReachableModuleChange,
|
|
4939
5064
|
getFarmClientReachableModules,
|
|
4940
5065
|
resolveFarmClientOptimizeDeps,
|
|
4941
5066
|
createFarmDiagnostic,
|
|
@@ -132,7 +132,7 @@ import { trapUnhandledErrors } from "#nitro/runtime/error/hooks";
|
|
|
132
132
|
import { setupCloseHooks } from "#nitro/runtime/shutdown";
|
|
133
133
|
import { startScheduleRunner } from "#nitro/runtime/task";
|
|
134
134
|
import { tracingSrvxPlugins } from "#nitro/virtual/tracing";
|
|
135
|
-
import { farmProductionLifecycle } from ${JSON.stringify(nitroEntryImport)};${desktop ? `
|
|
135
|
+
import { farmPrepareNativeRoutes, farmProductionLifecycle } from ${JSON.stringify(nitroEntryImport)};${desktop ? `
|
|
136
136
|
import { realpathSync } from "node:fs";
|
|
137
137
|
import { pathToFileURL } from "node:url";
|
|
138
138
|
import { createFarmDesktopGuard } from ${JSON.stringify(desktop.guardModule)};
|
|
@@ -196,7 +196,9 @@ if (!shutdownConfig.disabled) {
|
|
|
196
196
|
|
|
197
197
|
try {
|
|
198
198
|
await Promise.race([
|
|
199
|
-
Promise.resolve()
|
|
199
|
+
Promise.resolve()
|
|
200
|
+
.then(() => farmProductionLifecycle.start())
|
|
201
|
+
.then(() => farmPrepareNativeRoutes()),
|
|
200
202
|
startupSignalPromise,
|
|
201
203
|
]);
|
|
202
204
|
} catch (error) {
|