@farm.js/core 0.1.73 → 0.1.74
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-RK7LDYEL.mjs → agent-mcp-handler-HX4F4VKN.mjs} +4 -4
- package/dist/{agent-mcp-handler-VBCA3WZ6.cjs → agent-mcp-handler-NRIL4JBC.cjs} +5 -5
- package/dist/{agent-mcp.d-PvEf-1mi.d.mts → agent-mcp.d-BEhDfdWc.d.mts} +1 -1
- package/dist/{agent-mcp.d-D_gHjCAE.d.ts → agent-mcp.d-CX8_oOT_.d.ts} +1 -1
- package/dist/agent-runtime.cjs +4 -4
- package/dist/agent-runtime.d.mts +4 -4
- package/dist/agent-runtime.d.ts +4 -4
- package/dist/agent-runtime.mjs +3 -3
- package/dist/{analyzer-MFYCJT75.mjs → analyzer-2K35LIQZ.mjs} +2 -2
- package/dist/analyzer-6EOYURMV.cjs +16 -0
- package/dist/api/client.d.mts +3 -3
- package/dist/api/client.d.ts +3 -3
- package/dist/api/client.native.d.mts +4 -4
- package/dist/api/client.native.d.ts +4 -4
- package/dist/api/node.cjs +9 -8
- package/dist/api/node.d.mts +6 -6
- package/dist/api/node.d.ts +6 -6
- package/dist/api/node.mjs +8 -7
- package/dist/api/route-manager.cjs +11 -9
- package/dist/api/route-manager.d.mts +9 -7
- package/dist/api/route-manager.d.ts +9 -7
- package/dist/api/route-manager.mjs +10 -8
- package/dist/api/runtime.cjs +8 -7
- package/dist/api/runtime.d.mts +5 -5
- package/dist/api/runtime.d.ts +5 -5
- package/dist/api/runtime.mjs +7 -6
- package/dist/{api-client.d-Bp35zMqR.d.mts → api-client.d-CyVmI4Di.d.mts} +2 -2
- package/dist/{api-client.d-CFI_xL0V.d.ts → api-client.d-DrTM7BdH.d.ts} +2 -2
- package/dist/api.cjs +13 -11
- package/dist/api.d.mts +9 -9
- package/dist/api.d.ts +9 -9
- package/dist/api.mjs +12 -10
- package/dist/{app-manifest.d-CN7cEWHX.d.mts → app-manifest.d-BcXt2yCx.d.mts} +10 -1
- package/dist/{app-manifest.d-BpVTg43i.d.ts → app-manifest.d-CVEx1CFB.d.ts} +10 -1
- package/dist/app-markdown.cjs +8 -4
- package/dist/app-markdown.d.mts +6 -6
- package/dist/app-markdown.d.ts +6 -6
- package/dist/app-markdown.mjs +7 -3
- package/dist/{app.d-DO4PTCWm.d.ts → app.d-B6i8CSrx.d.ts} +30 -4
- package/dist/{app.d-BFWzAdTe.d.mts → app.d-DowzSmT5.d.mts} +30 -4
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +8 -0
- package/dist/cache.d.ts +8 -0
- package/dist/cache.mjs +1 -1
- package/dist/chunk-2DOI6HLJ.cjs +284 -0
- package/dist/chunk-2GQBBOFH.mjs +76 -0
- package/dist/{chunk-5LOARKDP.cjs → chunk-2TZ3F6TN.cjs} +29 -17
- package/dist/{chunk-TDCP3Z4T.cjs → chunk-35GBGSQZ.cjs} +3 -3
- package/dist/{chunk-VPETSSWN.cjs → chunk-3BUJIPKE.cjs} +2 -2
- package/dist/{chunk-Y5LEPEVH.mjs → chunk-3ODLJRA6.mjs} +1 -1
- package/dist/{chunk-DMAP4RND.cjs → chunk-3OMLZLDE.cjs} +54 -16
- package/dist/{chunk-VNBDN5W2.cjs → chunk-47ZDUDN5.cjs} +64 -27
- package/dist/{chunk-2W4GNXGX.cjs → chunk-4AB62NMW.cjs} +2 -2
- package/dist/{chunk-HDPT6OYE.cjs → chunk-4M5ESTJ2.cjs} +10 -2
- package/dist/{chunk-TAU3OF5B.cjs → chunk-56HHUSR5.cjs} +420 -337
- package/dist/chunk-5XD2ULJG.mjs +114 -0
- package/dist/{chunk-JX5VOLAV.cjs → chunk-65OS2TOT.cjs} +4 -4
- package/dist/{chunk-7GMBETHM.mjs → chunk-6JEXH7N6.mjs} +1 -1
- package/dist/{chunk-TY5KCYDE.mjs → chunk-72NTEYCX.mjs} +10 -3
- package/dist/{chunk-KDOZORJD.cjs → chunk-737MIVX3.cjs} +22 -22
- package/dist/{chunk-ROCF6UQD.cjs → chunk-77SVUQM5.cjs} +74 -17
- package/dist/{chunk-CKQAQFF6.mjs → chunk-7RKHXF4P.mjs} +2 -2
- package/dist/{chunk-GJEC5S4V.mjs → chunk-7VCLTNED.mjs} +1 -1
- package/dist/{chunk-CLEWORVY.cjs → chunk-ACAEFEOH.cjs} +38 -41
- package/dist/{chunk-OBYM5S5G.mjs → chunk-AL6E63FZ.mjs} +2 -2
- package/dist/{chunk-DQ2DI3Y7.mjs → chunk-AO5IRA2N.mjs} +2 -2
- package/dist/{chunk-CYRIIVD4.mjs → chunk-AU5UPNOD.mjs} +2 -2
- package/dist/{chunk-Z3IN6GEX.mjs → chunk-B3XY6FMC.mjs} +69 -12
- package/dist/{chunk-U7VH3Q5E.cjs → chunk-B5WZP3T3.cjs} +15 -2
- package/dist/{chunk-IBVN7SW5.mjs → chunk-BFOMCSZ2.mjs} +292 -120
- package/dist/{chunk-I4KPA2C6.mjs → chunk-BIX46FTI.mjs} +1 -1
- package/dist/{chunk-YZLEOMMA.mjs → chunk-BNXV3PRM.mjs} +4 -4
- package/dist/{chunk-3GNVIYPO.cjs → chunk-BSJMWCWM.cjs} +7 -7
- package/dist/{chunk-WVQNXXNE.cjs → chunk-BWFBTTJ5.cjs} +2 -2
- package/dist/{chunk-FEFCISOX.cjs → chunk-CEVXKJKF.cjs} +2 -2
- package/dist/{chunk-B67CW2LM.mjs → chunk-CF77L6RL.mjs} +33 -36
- package/dist/{chunk-OB45EAQL.mjs → chunk-CXQZQK6R.mjs} +3 -2
- package/dist/{chunk-255J7K4X.mjs → chunk-D2IAYGYA.mjs} +1 -1
- package/dist/{chunk-ILQ5DKYF.cjs → chunk-D4TYE6MY.cjs} +2 -2
- package/dist/{chunk-4YHGQDTT.cjs → chunk-DM2YGTRH.cjs} +24 -17
- package/dist/{chunk-ICFPTHXM.mjs → chunk-DRBXYJZ6.mjs} +7 -3
- package/dist/{chunk-E3HDJCWF.mjs → chunk-DRHHTHA3.mjs} +1 -1
- package/dist/{chunk-YXIQYWOK.cjs → chunk-DTBRSRTR.cjs} +23 -5
- package/dist/{chunk-JZQS3ZOI.mjs → chunk-E4T7WJJN.mjs} +10 -2
- package/dist/{chunk-YAEN3L2F.cjs → chunk-EF5AP4CV.cjs} +21 -2
- package/dist/{chunk-SPP3EZTJ.cjs → chunk-EHJOSIXM.cjs} +137 -67
- package/dist/{chunk-JZBU7V4D.mjs → chunk-ELJQWUAR.mjs} +125 -55
- package/dist/{chunk-DMXMIE2C.cjs → chunk-ENYBDM4U.cjs} +2 -2
- package/dist/{chunk-ZFEJ2SF2.cjs → chunk-EWIEJQP6.cjs} +28 -28
- package/dist/{chunk-ODBM54RT.cjs → chunk-F244KE2D.cjs} +7 -7
- package/dist/{chunk-WW3LRNQV.mjs → chunk-FCBUNILW.mjs} +1 -1
- package/dist/{chunk-GZOKWJIW.mjs → chunk-FEQ72ZHD.mjs} +16 -9
- package/dist/{chunk-ME7RVELR.mjs → chunk-FGXSWRWA.mjs} +20 -1
- package/dist/{chunk-2AFW7673.cjs → chunk-FNWL5DMG.cjs} +4 -3
- package/dist/{chunk-XUSJVHHD.cjs → chunk-FYV6DTAG.cjs} +738 -485
- package/dist/{chunk-7PPLTD3P.cjs → chunk-G7S6XG6X.cjs} +6 -6
- package/dist/{chunk-AQIO3RNL.mjs → chunk-GK2GBIXD.mjs} +3 -3
- package/dist/{chunk-IHTDLCDJ.cjs → chunk-GRHSQYD4.cjs} +17 -4
- package/dist/{chunk-W44X6IC2.cjs → chunk-HBLYSWIJ.cjs} +13 -9
- package/dist/chunk-HK4VJI27.cjs +76 -0
- package/dist/{chunk-EGIY4A7V.cjs → chunk-HKZVC5GP.cjs} +2 -2
- package/dist/{chunk-EYPSKXO4.mjs → chunk-HRQV5Q3J.mjs} +1 -1
- package/dist/{chunk-S7MWSFFP.cjs → chunk-IBEHVSU4.cjs} +2 -2
- package/dist/{chunk-JMOCMXTQ.mjs → chunk-IG4IQMIW.mjs} +1 -1
- package/dist/{chunk-GPO3LJDJ.cjs → chunk-IJFNXP3D.cjs} +2 -2
- package/dist/{chunk-FRO4BB2T.mjs → chunk-IP2R2TAE.mjs} +1 -1
- package/dist/{chunk-FETMUBIA.mjs → chunk-IZ5WOTQP.mjs} +1 -1
- package/dist/{chunk-CSLHNBPS.cjs → chunk-J42QN7OC.cjs} +6 -6
- package/dist/{chunk-NDDRTFN4.mjs → chunk-J7EUGGTY.mjs} +2 -2
- package/dist/{chunk-MJEKMT6B.mjs → chunk-JI6N4W2I.mjs} +125 -42
- package/dist/{chunk-GJ7QVFAG.mjs → chunk-JOECBGY7.mjs} +1 -1
- package/dist/{chunk-CL52PD6D.cjs → chunk-JSUVQ5HG.cjs} +8 -8
- package/dist/{chunk-DZHTNSQ5.cjs → chunk-JWHRVBCZ.cjs} +14 -14
- package/dist/{chunk-462MUII7.mjs → chunk-JZ43UD6S.mjs} +7 -7
- package/dist/{chunk-RLEALQEN.mjs → chunk-KIRIFO6T.mjs} +43 -5
- package/dist/{chunk-XGTFLG73.cjs → chunk-KMYOKQPP.cjs} +18 -11
- package/dist/{chunk-WX63N6C5.mjs → chunk-KNEYWPZV.mjs} +64 -27
- package/dist/{chunk-XI3OXOMK.mjs → chunk-KUMKBBYP.mjs} +1 -1
- package/dist/{chunk-VT25ERQK.mjs → chunk-KWUZJZ23.mjs} +21 -3
- package/dist/{chunk-SVQX5HYW.mjs → chunk-LHFGTR7F.mjs} +2 -2
- package/dist/{chunk-4P5634G6.cjs → chunk-LIQJYEQP.cjs} +14 -9
- package/dist/chunk-LXTYJ2HW.mjs +139 -0
- package/dist/{chunk-5PDMBWAF.cjs → chunk-MKQ27TGW.cjs} +5 -5
- package/dist/{chunk-SUQACHER.mjs → chunk-MQ5HA7H2.mjs} +2 -2
- package/dist/{chunk-HY6IVQ54.mjs → chunk-MUITBU5Z.mjs} +1 -1
- package/dist/{chunk-QKEZLYON.cjs → chunk-NET6PBUH.cjs} +2 -2
- package/dist/{chunk-YBY34UHB.mjs → chunk-NKETXVKP.mjs} +15 -2
- package/dist/chunk-NRWEY2CM.mjs +25 -0
- package/dist/chunk-NU5XLYRN.cjs +139 -0
- package/dist/{chunk-HTXKSREF.cjs → chunk-NXGQIXR7.cjs} +345 -173
- package/dist/{chunk-PXAHSCR6.cjs → chunk-O2A6HE76.cjs} +4 -4
- package/dist/{chunk-OAEDVXVE.mjs → chunk-O6K4G7YA.mjs} +5 -2
- package/dist/{chunk-73K53YPP.mjs → chunk-OSKIG4OP.mjs} +1 -1
- package/dist/{chunk-OXNZUCHN.cjs → chunk-P3EZKU6L.cjs} +18 -18
- package/dist/{chunk-HGB4PM2C.cjs → chunk-PG6ZIHKE.cjs} +102 -30
- package/dist/{chunk-YZK64PZT.cjs → chunk-Q3MVNRAO.cjs} +1071 -650
- package/dist/{chunk-AZ6IW6SF.mjs → chunk-Q4G52OSW.mjs} +1 -1
- package/dist/{chunk-TPYAYFMF.cjs → chunk-QL3YZTGZ.cjs} +2 -2
- package/dist/{chunk-UVZMSRHF.mjs → chunk-R4BWNP73.mjs} +2 -2
- package/dist/{chunk-OIP62QEL.mjs → chunk-R6Q6VSGU.mjs} +24 -9
- package/dist/{chunk-B6RBJJ5G.mjs → chunk-RBRIKT6B.mjs} +15 -2
- package/dist/{chunk-C6CUUBY5.cjs → chunk-RHI67C2V.cjs} +5 -5
- package/dist/chunk-RK3YYUX6.cjs +114 -0
- package/dist/{chunk-Y2LU4LE5.mjs → chunk-ROPMQNCG.mjs} +2 -2
- package/dist/{chunk-QIXEU2WV.cjs → chunk-RQ4UZJPR.cjs} +3 -3
- package/dist/{chunk-UVQRMUAR.cjs → chunk-RSL3YFJG.cjs} +1 -1
- package/dist/{chunk-JWY66PID.cjs → chunk-S3D6SL2V.cjs} +9 -6
- package/dist/{chunk-4HGLJOXZ.cjs → chunk-TPDKFRQX.cjs} +11 -11
- package/dist/{chunk-6O6PAZZR.mjs → chunk-UHAARKF3.mjs} +2 -2
- package/dist/{chunk-QSTRBKHZ.mjs → chunk-UJWRXBVP.mjs} +2 -2
- package/dist/{chunk-KTDG4THT.cjs → chunk-V6T3UJAH.cjs} +7 -7
- package/dist/{chunk-IXZSBO76.mjs → chunk-VFPFXMTF.mjs} +1 -1
- package/dist/{chunk-CPMME66W.mjs → chunk-VKLV7GF4.mjs} +72 -0
- package/dist/{chunk-TU6VAH4V.cjs → chunk-VKRMO3EZ.cjs} +8 -8
- package/dist/chunk-VWIW47FW.cjs +25 -0
- package/dist/{chunk-LGR7565L.cjs → chunk-VZKCGHWC.cjs} +39 -24
- package/dist/{chunk-JWLRBDDC.cjs → chunk-WH3PBJS7.cjs} +2 -2
- package/dist/{chunk-QGCSUC5O.mjs → chunk-WS4SLJW5.mjs} +403 -150
- package/dist/{chunk-5OFNUETM.mjs → chunk-WTTJ2YS2.mjs} +9 -1
- package/dist/{chunk-RLFGKJQ6.mjs → chunk-X2KNHD4B.mjs} +14 -2
- package/dist/{chunk-5CFHQ7HM.mjs → chunk-XXKMAHYE.mjs} +1 -1
- package/dist/{chunk-MBCRWU3P.cjs → chunk-XZPI44Q7.cjs} +4 -4
- package/dist/{chunk-ACGBXN3U.cjs → chunk-Y4FEQBKY.cjs} +17 -9
- package/dist/{chunk-4CTCSKAF.mjs → chunk-YH33PZ3K.mjs} +1 -1
- package/dist/chunk-YQWRBBAA.mjs +284 -0
- package/dist/{chunk-REK6HZSU.mjs → chunk-YWDRWG4L.mjs} +962 -541
- package/dist/{chunk-E46NXBNJ.mjs → chunk-ZD7JUTBY.mjs} +11 -6
- package/dist/{chunk-JDO346NV.mjs → chunk-ZLRWO5GK.mjs} +1 -1
- package/dist/{chunk-HFUOLILA.cjs → chunk-ZRCGPSUM.cjs} +4 -4
- package/dist/{chunk-4Z3YLMSW.cjs → chunk-ZZGANFQH.cjs} +10 -10
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-sF-Znk0j.d.ts → client-component.d-DYOwmq0c.d.ts} +80 -3
- package/dist/{client-component.d-C71rMuHF.d.mts → client-component.d-edV76QvU.d.mts} +80 -3
- package/dist/{client-plugins.d-MFibjgBg.d.ts → client-plugins.d-BmJYW2FY.d.ts} +19 -6
- package/dist/{client-plugins.d-B-Gd9mWR.d.mts → client-plugins.d-DwvqqGsU.d.mts} +19 -6
- package/dist/client-plugins.d.mts +4 -4
- package/dist/client-plugins.d.ts +4 -4
- package/dist/client.cjs +6 -5
- package/dist/client.d.mts +11 -11
- package/dist/client.d.ts +11 -11
- package/dist/client.mjs +5 -4
- package/dist/config.d.mts +4 -4
- package/dist/config.d.ts +4 -4
- package/dist/cron.cjs +6 -2
- package/dist/cron.d.mts +11 -2
- package/dist/cron.d.ts +11 -2
- package/dist/cron.mjs +7 -3
- package/dist/desktop.d.mts +5 -5
- package/dist/desktop.d.ts +5 -5
- package/dist/{devtools-TDIJ6HVC.mjs → devtools-WPX62NG2.mjs} +10 -9
- package/dist/{devtools-6K4QXFRL.cjs → devtools-YMDS7PUA.cjs} +12 -11
- package/dist/docs.cjs +13 -12
- package/dist/docs.d.mts +5 -5
- package/dist/docs.d.ts +5 -5
- package/dist/docs.mjs +12 -11
- package/dist/{endpoint.d-BkMSCRf6.d.mts → endpoint.d-BXbBpKoh.d.mts} +42 -1
- package/dist/{endpoint.d-BgHn0lhl.d.ts → endpoint.d-Dx_1k6Du.d.ts} +42 -1
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/headers.cjs +3 -3
- package/dist/{headers.d-uQ6BR59u.d.ts → headers.d-BIbQyAxJ.d.ts} +1 -1
- package/dist/{headers.d-BUxGJTsj.d.mts → headers.d-BtNxFc2s.d.mts} +1 -1
- package/dist/headers.mjs +2 -2
- package/dist/index.cjs +70 -59
- package/dist/{index.d-BCGfxCXY.d.ts → index.d-CQ_wUzOV.d.ts} +1 -1
- package/dist/{index.d-CuWOJ-un.d.mts → index.d-CQdDRXd1.d.mts} +1 -1
- package/dist/index.d.mts +62 -28
- package/dist/index.d.ts +62 -28
- package/dist/index.mjs +66 -55
- package/dist/integrations/orm.d.mts +4 -4
- package/dist/integrations/orm.d.ts +4 -4
- package/dist/integrations.cjs +4 -4
- package/dist/integrations.d.mts +4 -4
- package/dist/integrations.d.ts +4 -4
- package/dist/integrations.mjs +3 -3
- package/dist/internal/app-markdown-runtime.cjs +7 -3
- package/dist/internal/app-markdown-runtime.d.mts +17 -6
- package/dist/internal/app-markdown-runtime.d.ts +17 -6
- package/dist/internal/app-markdown-runtime.mjs +6 -2
- package/dist/internal/build-runtime.cjs +41 -39
- package/dist/internal/build-runtime.d.mts +6 -6
- package/dist/internal/build-runtime.d.ts +6 -6
- package/dist/internal/build-runtime.mjs +40 -38
- package/dist/internal/cli-runtime.cjs +20 -19
- package/dist/internal/cli-runtime.mjs +19 -18
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +6 -2
- package/dist/internal/client-runtime.d.mts +21 -9
- package/dist/internal/client-runtime.d.ts +21 -9
- package/dist/internal/client-runtime.mjs +5 -1
- package/dist/internal/compression-runtime.d.mts +4 -4
- package/dist/internal/compression-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.cjs +12 -11
- package/dist/internal/config-runtime.d.mts +6 -6
- package/dist/internal/config-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.mjs +11 -10
- package/dist/internal/form-actions.cjs +5 -4
- package/dist/internal/form-actions.d.mts +2 -2
- package/dist/internal/form-actions.d.ts +2 -2
- package/dist/internal/form-actions.mjs +4 -3
- package/dist/internal/infra-analytics-runtime.cjs +10 -10
- package/dist/internal/infra-analytics-runtime.mjs +8 -8
- 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-runtime.cjs +32 -22
- package/dist/internal/production-runtime.d.mts +64 -13
- package/dist/internal/production-runtime.d.ts +64 -13
- package/dist/internal/production-runtime.mjs +31 -21
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +4 -4
- package/dist/internal/vercel-edge-middleware.mjs +3 -3
- package/dist/{lifecycle.d-keQs5Swc.d.mts → lifecycle.d-OtGWAvJT.d.mts} +4 -0
- package/dist/{lifecycle.d-keQs5Swc.d.ts → lifecycle.d-OtGWAvJT.d.ts} +4 -0
- package/dist/{manager-JIA66YJ2.mjs → manager-RHB2P35B.mjs} +4 -1
- package/dist/{manager-JOHU6BQI.cjs → manager-S77ZARTC.cjs} +5 -2
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +4 -4
- package/dist/markdown.d.ts +4 -4
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.cjs +6 -6
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +5 -5
- package/dist/{mount.d-BIYmcGGg.d.mts → mount.d-6bhpBQQB.d.mts} +1 -1
- package/dist/{mount.d-q8k0cJV0.d.ts → mount.d-C-u7rFkM.d.ts} +1 -1
- package/dist/{native-server-fn-handler-EP5AFJYE.mjs → native-server-fn-handler-I66X4E5S.mjs} +6 -5
- package/dist/{native-server-fn-handler-QRTXGZA4.cjs → native-server-fn-handler-W4FSD76W.cjs} +7 -6
- package/dist/{native-tree-OYGKP2NZ.mjs → native-tree-3X23BT3N.mjs} +2 -2
- package/dist/{native-tree-R6CQMDTI.cjs → native-tree-TAPKR7QJ.cjs} +3 -3
- package/dist/{navigation-delegate.d-CYBUupsv.d.mts → navigation-delegate.d-nx6gtsY4.d.mts} +1 -1
- package/dist/{navigation-delegate.d-Btfs6Uoa.d.ts → navigation-delegate.d-xsG4T1x-.d.ts} +1 -1
- package/dist/navigation.cjs +4 -4
- package/dist/navigation.d.mts +7 -7
- package/dist/navigation.d.ts +7 -7
- package/dist/navigation.mjs +3 -3
- package/dist/{nitro-2LMOMIST.cjs → nitro-SSFTPZMW.cjs} +4 -4
- package/dist/{nitro-72TFIGGO.mjs → nitro-XTQ2HKDL.mjs} +1 -1
- package/dist/plugin.cjs +36 -33
- package/dist/plugin.d.mts +7 -7
- package/dist/plugin.d.ts +7 -7
- package/dist/plugin.mjs +35 -32
- package/dist/query/client.cjs +5 -5
- package/dist/query/client.mjs +1 -1
- package/dist/{render-plan.d-BlyxqKMu.d.mts → render-plan.d-B5y3h97B.d.mts} +1 -1
- package/dist/{render-plan.d-0FHusf1D.d.ts → render-plan.d-gW0fwKz2.d.ts} +1 -1
- package/dist/renderer-client.cjs +4 -4
- package/dist/renderer-client.d.mts +7 -7
- package/dist/renderer-client.d.ts +7 -7
- package/dist/renderer-client.mjs +1 -1
- package/dist/request.cjs +2 -2
- package/dist/{request.d-CX-gks1l.d.mts → request.d-B0ugAadD.d.ts} +9 -2
- package/dist/{request.d-CPdVjssg.d.ts → request.d-DLq33nYo.d.mts} +9 -2
- package/dist/request.d.mts +5 -5
- package/dist/request.d.ts +5 -5
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-CcvZ_4N2.d.mts → route-rendering.d-DSeIV7yV.d.mts} +1 -1
- package/dist/{route-rendering.d-DcOoSNoG.d.ts → route-rendering.d-ytaqDQD6.d.ts} +1 -1
- package/dist/{route.d-DrXkpvcg.d.mts → route.d-Cd4Fi6BA.d.ts} +3 -1
- package/dist/{route.d-hs-_cyHn.d.ts → route.d-ShmtqqVQ.d.mts} +3 -1
- package/dist/{router.d-D2QnK8cM.d.ts → router.d-BaEAEGPg.d.ts} +1 -1
- package/dist/{router.d-C8RHma4A.d.mts → router.d-Chd5cpe3.d.mts} +1 -1
- package/dist/routes.cjs +5 -3
- package/dist/routes.d.mts +4 -4
- package/dist/routes.d.ts +4 -4
- package/dist/routes.mjs +4 -2
- package/dist/{rsc-pipeline-LC2FBZAR.mjs → rsc-pipeline-DPMYONEV.mjs} +12 -11
- package/dist/{rsc-pipeline-NTAM65NT.cjs → rsc-pipeline-XIUUMMG5.cjs} +13 -12
- package/dist/{runtime-U4PAMTVH.cjs → runtime-WD77S3C5.cjs} +25 -25
- package/dist/{runtime-MWAC7NWR.mjs → runtime-XIUJZTZ3.mjs} +16 -16
- package/dist/{runtime.d-BQUHHq8M.d.mts → runtime.d-DpCs0eAO.d.mts} +3 -3
- package/dist/{runtime.d-1l_1bLrL.d.ts → runtime.d-h2USyQsz.d.ts} +3 -3
- package/dist/server-action-security.cjs +5 -3
- package/dist/server-action-security.d.mts +11 -3
- package/dist/server-action-security.d.ts +11 -3
- package/dist/server-action-security.mjs +4 -2
- package/dist/server-fn-client.d.mts +3 -3
- package/dist/server-fn-client.d.ts +3 -3
- package/dist/server-fn.cjs +6 -5
- package/dist/server-fn.d.mts +1 -1
- package/dist/server-fn.d.ts +1 -1
- package/dist/server-fn.mjs +5 -4
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +53 -9
- package/dist/server-plugins.d.ts +53 -9
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.d.mts +1 -1
- package/dist/server-query-client.d.ts +1 -1
- package/dist/server-query.cjs +7 -6
- package/dist/server-query.d.mts +1 -1
- package/dist/server-query.d.ts +1 -1
- package/dist/server-query.mjs +6 -5
- package/dist/server.cjs +62 -67
- package/dist/server.d.mts +14 -14
- package/dist/server.d.ts +14 -14
- package/dist/server.mjs +41 -46
- package/dist/{spa-router.d-BzPdi48R.d.mts → spa-router.d-DCQVtEaE.d.mts} +11 -5
- package/dist/{spa-router.d-BJtXNeqo.d.ts → spa-router.d-DpdJHs1q.d.ts} +11 -5
- package/dist/testing.cjs +16 -14
- package/dist/testing.d.mts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.mjs +12 -10
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{utils.d-B4ZW-6z6.d.mts → utils.d-DKDZtAY5.d.mts} +1 -1
- package/dist/{utils.d-DquC6qxy.d.ts → utils.d-DmicwMvS.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +36 -33
- package/dist/vite.d.mts +13 -8
- package/dist/vite.d.ts +13 -8
- package/dist/vite.mjs +35 -32
- package/package.json +1 -1
- package/dist/analyzer-V5ZMRIIY.cjs +0 -16
- package/dist/chunk-6I4BFRE7.cjs +0 -51
- package/dist/chunk-EIVGPQN5.mjs +0 -51
- /package/dist/{chunk-QEJWNXRI.cjs → chunk-EMRYJG4U.cjs} +0 -0
- /package/dist/{chunk-TXE4SAMV.mjs → chunk-H2ZJ35NW.mjs} +0 -0
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
var _chunk3QM74STYcjs = require('./chunk-3QM74STY.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunk2DOI6HLJcjs = require('./chunk-2DOI6HLJ.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
8
13
|
var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
|
|
9
14
|
|
|
10
15
|
|
|
@@ -33,12 +38,12 @@ var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
|
|
|
33
38
|
|
|
34
39
|
|
|
35
40
|
|
|
36
|
-
var
|
|
41
|
+
var _chunk56HHUSR5cjs = require('./chunk-56HHUSR5.cjs');
|
|
37
42
|
|
|
38
43
|
|
|
39
44
|
|
|
40
45
|
|
|
41
|
-
var
|
|
46
|
+
var _chunkENYBDM4Ucjs = require('./chunk-ENYBDM4U.cjs');
|
|
42
47
|
|
|
43
48
|
|
|
44
49
|
var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
|
|
@@ -48,7 +53,7 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
48
53
|
|
|
49
54
|
|
|
50
55
|
|
|
51
|
-
var
|
|
56
|
+
var _chunkACAEFEOHcjs = require('./chunk-ACAEFEOH.cjs');
|
|
52
57
|
|
|
53
58
|
|
|
54
59
|
|
|
@@ -62,7 +67,7 @@ var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
|
62
67
|
|
|
63
68
|
|
|
64
69
|
|
|
65
|
-
var
|
|
70
|
+
var _chunkO2A6HE76cjs = require('./chunk-O2A6HE76.cjs');
|
|
66
71
|
|
|
67
72
|
|
|
68
73
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
@@ -80,13 +85,13 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
|
80
85
|
|
|
81
86
|
|
|
82
87
|
|
|
83
|
-
var
|
|
88
|
+
var _chunkDM2YGTRHcjs = require('./chunk-DM2YGTRH.cjs');
|
|
84
89
|
|
|
85
90
|
|
|
86
|
-
var
|
|
91
|
+
var _chunkVKRMO3EZcjs = require('./chunk-VKRMO3EZ.cjs');
|
|
87
92
|
|
|
88
93
|
|
|
89
|
-
var
|
|
94
|
+
var _chunkD4TYE6MYcjs = require('./chunk-D4TYE6MY.cjs');
|
|
90
95
|
|
|
91
96
|
|
|
92
97
|
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
@@ -126,7 +131,11 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
126
131
|
|
|
127
132
|
|
|
128
133
|
|
|
129
|
-
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
var _chunkNXGQIXR7cjs = require('./chunk-NXGQIXR7.cjs');
|
|
130
139
|
|
|
131
140
|
|
|
132
141
|
|
|
@@ -150,10 +159,10 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
150
159
|
|
|
151
160
|
|
|
152
161
|
|
|
153
|
-
var
|
|
162
|
+
var _chunkF244KE2Dcjs = require('./chunk-F244KE2D.cjs');
|
|
154
163
|
|
|
155
164
|
|
|
156
|
-
var
|
|
165
|
+
var _chunkMKQ27TGWcjs = require('./chunk-MKQ27TGW.cjs');
|
|
157
166
|
|
|
158
167
|
|
|
159
168
|
var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
@@ -183,7 +192,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
183
192
|
|
|
184
193
|
|
|
185
194
|
|
|
186
|
-
var
|
|
195
|
+
var _chunkVZKCGHWCcjs = require('./chunk-VZKCGHWC.cjs');
|
|
187
196
|
|
|
188
197
|
|
|
189
198
|
|
|
@@ -195,21 +204,21 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
|
195
204
|
|
|
196
205
|
|
|
197
206
|
|
|
198
|
-
var
|
|
207
|
+
var _chunkPG6ZIHKEcjs = require('./chunk-PG6ZIHKE.cjs');
|
|
199
208
|
|
|
200
209
|
|
|
201
210
|
|
|
202
211
|
|
|
203
212
|
|
|
204
213
|
|
|
205
|
-
var
|
|
214
|
+
var _chunk65OS2TOTcjs = require('./chunk-65OS2TOT.cjs');
|
|
206
215
|
|
|
207
216
|
|
|
208
217
|
|
|
209
218
|
var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
|
|
210
219
|
|
|
211
220
|
|
|
212
|
-
var
|
|
221
|
+
var _chunkY4FEQBKYcjs = require('./chunk-Y4FEQBKY.cjs');
|
|
213
222
|
|
|
214
223
|
|
|
215
224
|
|
|
@@ -225,7 +234,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
225
234
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
226
235
|
|
|
227
236
|
|
|
228
|
-
var
|
|
237
|
+
var _chunk2TZ3F6TNcjs = require('./chunk-2TZ3F6TN.cjs');
|
|
229
238
|
|
|
230
239
|
|
|
231
240
|
var _chunkNLBK37HIcjs = require('./chunk-NLBK37HI.cjs');
|
|
@@ -237,7 +246,7 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
|
|
|
237
246
|
|
|
238
247
|
|
|
239
248
|
|
|
240
|
-
var
|
|
249
|
+
var _chunkKMYOKQPPcjs = require('./chunk-KMYOKQPP.cjs');
|
|
241
250
|
|
|
242
251
|
|
|
243
252
|
var _chunkLRB5OVRTcjs = require('./chunk-LRB5OVRT.cjs');
|
|
@@ -288,7 +297,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
288
297
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
289
298
|
|
|
290
299
|
|
|
291
|
-
var
|
|
300
|
+
var _chunkRSL3YFJGcjs = require('./chunk-RSL3YFJG.cjs');
|
|
292
301
|
|
|
293
302
|
|
|
294
303
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -318,11 +327,12 @@ var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
|
318
327
|
|
|
319
328
|
|
|
320
329
|
|
|
321
|
-
var
|
|
330
|
+
var _chunkXZPI44Q7cjs = require('./chunk-XZPI44Q7.cjs');
|
|
322
331
|
|
|
323
332
|
|
|
324
333
|
|
|
325
|
-
|
|
334
|
+
|
|
335
|
+
var _chunk4M5ESTJ2cjs = require('./chunk-4M5ESTJ2.cjs');
|
|
326
336
|
|
|
327
337
|
|
|
328
338
|
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
@@ -676,36 +686,197 @@ function findClientServerFnViolation(code, id) {
|
|
|
676
686
|
const specifiers = match[1];
|
|
677
687
|
for (const factory of SERVER_FN_FACTORIES) {
|
|
678
688
|
if (!new RegExp(`(?:^|[\\s{,])${factory}(?:[\\s},]|$)`).test(specifiers)) continue;
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
}
|
|
689
|
+
const call = new RegExp(`(?<![\\w$.])${factory}\\s*(?:<[^>]*>)?\\s*\\(`).exec(code);
|
|
690
|
+
if (call) return { factory, start: call.index };
|
|
682
691
|
}
|
|
683
692
|
}
|
|
684
693
|
return null;
|
|
685
694
|
}
|
|
686
|
-
function
|
|
687
|
-
return
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
695
|
+
function createServerFnBoundaryDiagnostic(violation, id, location) {
|
|
696
|
+
return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
|
|
697
|
+
"CLIENT_SERVER_FUNCTION",
|
|
698
|
+
id,
|
|
699
|
+
`${violation.factory} handlers run only on the server, but this module is bundled into the client, so the handler and its Node-only imports would run in the browser.`,
|
|
700
|
+
location
|
|
701
|
+
);
|
|
693
702
|
}
|
|
694
703
|
|
|
695
704
|
// src/client-boundary-env.ts
|
|
705
|
+
|
|
696
706
|
var FUNCTION_BODY_TYPES = /* @__PURE__ */ new Set([
|
|
697
707
|
"FunctionDeclaration",
|
|
698
708
|
"FunctionExpression",
|
|
699
709
|
"ArrowFunctionExpression"
|
|
700
710
|
]);
|
|
711
|
+
var BARE_BUILTIN_NAMES = new Set(
|
|
712
|
+
_module.builtinModules.filter((name) => !name.startsWith("_") && !name.includes(":")).map((name) => name.split("/", 1)[0])
|
|
713
|
+
);
|
|
714
|
+
var BARE_BUILTIN_SPECIFIER_RE = new RegExp(
|
|
715
|
+
String.raw`(?:\bfrom|\bimport|\brequire)\s*\(?\s*["'](?:` + [...BARE_BUILTIN_NAMES].join("|") + String.raw`)(?:/[^"']*)?["']`
|
|
716
|
+
);
|
|
717
|
+
var SPECIFIER_POSITION_RE = /(?:\bfrom|\bimport|\brequire)\s*\(?\s*$/;
|
|
701
718
|
function shouldInspectClientBoundary(id, code) {
|
|
702
719
|
if (id.startsWith("\0") || id.startsWith("virtual:") || id.includes("node_modules")) return false;
|
|
703
|
-
return
|
|
720
|
+
return mayUseServerOnlyApis(code);
|
|
721
|
+
}
|
|
722
|
+
var KEYWORDS_BEFORE_EXPRESSION = /* @__PURE__ */ new Set([
|
|
723
|
+
"await",
|
|
724
|
+
"case",
|
|
725
|
+
"delete",
|
|
726
|
+
"do",
|
|
727
|
+
"else",
|
|
728
|
+
"in",
|
|
729
|
+
"instanceof",
|
|
730
|
+
"new",
|
|
731
|
+
"of",
|
|
732
|
+
"return",
|
|
733
|
+
"throw",
|
|
734
|
+
"typeof",
|
|
735
|
+
"void",
|
|
736
|
+
"yield"
|
|
737
|
+
]);
|
|
738
|
+
function isBuiltinNameCode(code) {
|
|
739
|
+
return code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 95;
|
|
740
|
+
}
|
|
741
|
+
function isIdentifierCode(code) {
|
|
742
|
+
return code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 95 || code === 36 || code > 127;
|
|
743
|
+
}
|
|
744
|
+
function mayUseServerOnlyApis(code) {
|
|
745
|
+
if (!code.includes("process.env") && !code.includes("node:") && !BARE_BUILTIN_SPECIFIER_RE.test(code)) {
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
748
|
+
const templateBraces = [];
|
|
749
|
+
let index = 0;
|
|
750
|
+
let previous = 0;
|
|
751
|
+
let previousWordStart = -1;
|
|
752
|
+
const startsBuiltinSpecifier = (quote) => {
|
|
753
|
+
const start = quote + 1;
|
|
754
|
+
if (code.startsWith("node:", start)) return true;
|
|
755
|
+
let end = start;
|
|
756
|
+
while (end < code.length && isBuiltinNameCode(code.charCodeAt(end))) end += 1;
|
|
757
|
+
const after = code.charCodeAt(end);
|
|
758
|
+
return end > start && (after === code.charCodeAt(quote) || after === 47) && BARE_BUILTIN_NAMES.has(code.slice(start, end)) && SPECIFIER_POSITION_RE.test(code.slice(Math.max(0, quote - 16), quote));
|
|
759
|
+
};
|
|
760
|
+
const skipTemplateText = () => {
|
|
761
|
+
while (index < code.length) {
|
|
762
|
+
const character = code.charCodeAt(index);
|
|
763
|
+
if (character === 92) {
|
|
764
|
+
index += 2;
|
|
765
|
+
} else if (character === 96) {
|
|
766
|
+
index += 1;
|
|
767
|
+
previous = 96;
|
|
768
|
+
return false;
|
|
769
|
+
} else if (character === 36 && code.charCodeAt(index + 1) === 123) {
|
|
770
|
+
index += 2;
|
|
771
|
+
templateBraces.push(0);
|
|
772
|
+
previous = 123;
|
|
773
|
+
return true;
|
|
774
|
+
} else {
|
|
775
|
+
index += 1;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return false;
|
|
779
|
+
};
|
|
780
|
+
while (index < code.length) {
|
|
781
|
+
const character = code.charCodeAt(index);
|
|
782
|
+
const next = code.charCodeAt(index + 1);
|
|
783
|
+
if (character === 47 && next === 47) {
|
|
784
|
+
const end = code.indexOf("\n", index);
|
|
785
|
+
index = end === -1 ? code.length : end;
|
|
786
|
+
continue;
|
|
787
|
+
}
|
|
788
|
+
if (character === 47 && next === 42) {
|
|
789
|
+
const end = code.indexOf("*/", index + 2);
|
|
790
|
+
index = end === -1 ? code.length : end + 2;
|
|
791
|
+
continue;
|
|
792
|
+
}
|
|
793
|
+
if (character === 39 || character === 34) {
|
|
794
|
+
if (startsBuiltinSpecifier(index)) return true;
|
|
795
|
+
index += 1;
|
|
796
|
+
while (index < code.length) {
|
|
797
|
+
const inner = code.charCodeAt(index);
|
|
798
|
+
if (inner === 92) {
|
|
799
|
+
index += 2;
|
|
800
|
+
continue;
|
|
801
|
+
}
|
|
802
|
+
index += 1;
|
|
803
|
+
if (inner === character || inner === 10) break;
|
|
804
|
+
}
|
|
805
|
+
previous = character;
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
if (character === 96) {
|
|
809
|
+
if (startsBuiltinSpecifier(index)) return true;
|
|
810
|
+
index += 1;
|
|
811
|
+
skipTemplateText();
|
|
812
|
+
continue;
|
|
813
|
+
}
|
|
814
|
+
if (character === 47) {
|
|
815
|
+
const word = previousWordStart === -1 ? "" : code.slice(previousWordStart, index).trim();
|
|
816
|
+
const startsExpression = !(isIdentifierCode(previous) || previous === 41 || previous === 93) || KEYWORDS_BEFORE_EXPRESSION.has(word);
|
|
817
|
+
index += 1;
|
|
818
|
+
if (startsExpression) {
|
|
819
|
+
let inClass = false;
|
|
820
|
+
while (index < code.length) {
|
|
821
|
+
const inner = code.charCodeAt(index);
|
|
822
|
+
if (inner === 10) break;
|
|
823
|
+
index += 1;
|
|
824
|
+
if (inner === 92) index += 1;
|
|
825
|
+
else if (inner === 91) inClass = true;
|
|
826
|
+
else if (inner === 93) inClass = false;
|
|
827
|
+
else if (inner === 47 && !inClass) break;
|
|
828
|
+
}
|
|
829
|
+
previous = 41;
|
|
830
|
+
previousWordStart = -1;
|
|
831
|
+
} else {
|
|
832
|
+
previous = 47;
|
|
833
|
+
previousWordStart = -1;
|
|
834
|
+
}
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
if (templateBraces.length > 0 && (character === 123 || character === 125)) {
|
|
838
|
+
const depth = templateBraces.length - 1;
|
|
839
|
+
if (character === 123) {
|
|
840
|
+
templateBraces[depth] += 1;
|
|
841
|
+
} else if (templateBraces[depth] === 0) {
|
|
842
|
+
templateBraces.pop();
|
|
843
|
+
index += 1;
|
|
844
|
+
skipTemplateText();
|
|
845
|
+
continue;
|
|
846
|
+
} else {
|
|
847
|
+
templateBraces[depth] -= 1;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
if (isIdentifierCode(character)) {
|
|
851
|
+
const start = index;
|
|
852
|
+
if (character === 112 && code.startsWith("process.env", index) && !isIdentifierCode(previous === 0 ? 32 : code.charCodeAt(index - 1))) {
|
|
853
|
+
return true;
|
|
854
|
+
}
|
|
855
|
+
while (index < code.length && isIdentifierCode(code.charCodeAt(index))) index += 1;
|
|
856
|
+
previous = code.charCodeAt(index - 1);
|
|
857
|
+
previousWordStart = start;
|
|
858
|
+
continue;
|
|
859
|
+
}
|
|
860
|
+
if (character > 32) {
|
|
861
|
+
previous = character;
|
|
862
|
+
previousWordStart = -1;
|
|
863
|
+
}
|
|
864
|
+
index += 1;
|
|
865
|
+
}
|
|
866
|
+
return false;
|
|
704
867
|
}
|
|
705
868
|
function analyzeClientBoundary(program, publicKeys) {
|
|
706
|
-
const
|
|
707
|
-
const
|
|
708
|
-
const
|
|
869
|
+
const findings = [];
|
|
870
|
+
const seen = /* @__PURE__ */ new Set();
|
|
871
|
+
const add = (kind, name, node) => {
|
|
872
|
+
const key = `${kind}\0${name}`;
|
|
873
|
+
if (seen.has(key)) return;
|
|
874
|
+
seen.add(key);
|
|
875
|
+
findings.push({ kind, name, start: _nullishCoalesce(node.start, () => ( 0)) });
|
|
876
|
+
};
|
|
877
|
+
const addEnvKey = (key, node) => {
|
|
878
|
+
if (key !== "NODE_ENV") add(publicKeys.has(key) ? "public-env" : "server-env", key, node);
|
|
879
|
+
};
|
|
709
880
|
const visit = (node, inFunction) => {
|
|
710
881
|
if (!node || typeof node !== "object") return;
|
|
711
882
|
if (Array.isArray(node)) {
|
|
@@ -715,13 +886,20 @@ function analyzeClientBoundary(program, publicKeys) {
|
|
|
715
886
|
const estree = node;
|
|
716
887
|
if (typeof estree.type !== "string") return;
|
|
717
888
|
if (!inFunction) {
|
|
718
|
-
const builtin =
|
|
719
|
-
if (builtin !== void 0)
|
|
889
|
+
const builtin = readBuiltinSource(estree);
|
|
890
|
+
if (builtin !== void 0) add("builtin", builtin, estree);
|
|
720
891
|
const key = readProcessEnvKey(estree);
|
|
721
892
|
if (key !== void 0) {
|
|
722
|
-
|
|
723
|
-
|
|
893
|
+
addEnvKey(key, estree);
|
|
894
|
+
return;
|
|
895
|
+
}
|
|
896
|
+
if (estree.type === "VariableDeclarator" && isProcessEnv(estree.init) && _optionalChain([estree, 'access', _30 => _30.id, 'optionalAccess', _31 => _31.type]) === "ObjectPattern") {
|
|
897
|
+
for (const property of _nullishCoalesce(estree.id.properties, () => ( []))) {
|
|
898
|
+
if (property.type !== "Property") continue;
|
|
899
|
+
const name = readPropertyKey(property);
|
|
900
|
+
if (name !== void 0) addEnvKey(name, property);
|
|
724
901
|
}
|
|
902
|
+
visit(estree.id.properties, inFunction);
|
|
725
903
|
return;
|
|
726
904
|
}
|
|
727
905
|
}
|
|
@@ -732,31 +910,26 @@ function analyzeClientBoundary(program, publicKeys) {
|
|
|
732
910
|
}
|
|
733
911
|
};
|
|
734
912
|
visit(program.body, false);
|
|
735
|
-
return
|
|
736
|
-
envKeys: [...envKeys],
|
|
737
|
-
publicEnvKeys: [...publicEnvKeys],
|
|
738
|
-
builtinImports: [...builtinImports]
|
|
739
|
-
};
|
|
913
|
+
return findings;
|
|
740
914
|
}
|
|
741
|
-
function
|
|
915
|
+
function readBuiltinSource(node) {
|
|
916
|
+
let value;
|
|
742
917
|
if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
}
|
|
746
|
-
if (node.type === "CallExpression") {
|
|
918
|
+
value = _optionalChain([node, 'access', _32 => _32.source, 'optionalAccess', _33 => _33.value]);
|
|
919
|
+
} else if (node.type === "CallExpression") {
|
|
747
920
|
const callee = node.callee;
|
|
748
|
-
if (_optionalChain([callee, 'optionalAccess',
|
|
749
|
-
const arg = _optionalChain([node, 'access',
|
|
750
|
-
|
|
751
|
-
return typeof value === "string" && value.startsWith("node:") ? value : void 0;
|
|
921
|
+
if (_optionalChain([callee, 'optionalAccess', _34 => _34.type]) === "Identifier" && callee.name === "require") {
|
|
922
|
+
const arg = _optionalChain([node, 'access', _35 => _35.arguments, 'optionalAccess', _36 => _36[0]]);
|
|
923
|
+
value = _optionalChain([arg, 'optionalAccess', _37 => _37.type]) === "Literal" ? arg.value : void 0;
|
|
752
924
|
}
|
|
753
925
|
}
|
|
754
|
-
return void 0;
|
|
926
|
+
return typeof value === "string" && _module.isBuiltin.call(void 0, value) ? value : void 0;
|
|
927
|
+
}
|
|
928
|
+
function isProcessEnv(node) {
|
|
929
|
+
return _optionalChain([node, 'optionalAccess', _38 => _38.type]) === "MemberExpression" && !node.computed && _optionalChain([node, 'access', _39 => _39.object, 'optionalAccess', _40 => _40.type]) === "Identifier" && node.object.name === "process" && _optionalChain([node, 'access', _41 => _41.property, 'optionalAccess', _42 => _42.name]) === "env";
|
|
755
930
|
}
|
|
756
931
|
function readProcessEnvKey(node) {
|
|
757
|
-
if (node.type !== "MemberExpression"
|
|
758
|
-
const object = node.object;
|
|
759
|
-
if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _36 => _36.object, 'optionalAccess', _37 => _37.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _38 => _38.property, 'optionalAccess', _39 => _39.name]) !== "env") {
|
|
932
|
+
if (node.type !== "MemberExpression" || !isProcessEnv(node.object)) {
|
|
760
933
|
return void 0;
|
|
761
934
|
}
|
|
762
935
|
const property = node.property;
|
|
@@ -770,25 +943,36 @@ function readProcessEnvKey(node) {
|
|
|
770
943
|
}
|
|
771
944
|
return void 0;
|
|
772
945
|
}
|
|
773
|
-
function
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
946
|
+
function readPropertyKey(property) {
|
|
947
|
+
const key = property.key;
|
|
948
|
+
if (!property.computed && _optionalChain([key, 'optionalAccess', _43 => _43.type]) === "Identifier") return key.name;
|
|
949
|
+
const value = _optionalChain([key, 'optionalAccess', _44 => _44.type]) === "Literal" ? key.value : void 0;
|
|
950
|
+
return typeof value === "string" ? value : void 0;
|
|
951
|
+
}
|
|
952
|
+
function createClientBoundaryDiagnostic(file, finding, location) {
|
|
953
|
+
switch (finding.kind) {
|
|
954
|
+
case "server-env":
|
|
955
|
+
return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
|
|
956
|
+
"CLIENT_SERVER_ENV",
|
|
957
|
+
file,
|
|
958
|
+
`process.env.${finding.name} is read at module scope in a module compiled for the browser, where it is undefined.`,
|
|
959
|
+
location
|
|
960
|
+
);
|
|
961
|
+
case "public-env":
|
|
962
|
+
return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
|
|
963
|
+
"CLIENT_PROCESS_ENV_PUBLIC",
|
|
964
|
+
file,
|
|
965
|
+
`process.env.${finding.name} is declared public, but process.env is not populated in the browser, so this module-scope read is undefined there.`,
|
|
966
|
+
location
|
|
967
|
+
);
|
|
968
|
+
case "builtin":
|
|
969
|
+
return _chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
|
|
970
|
+
"CLIENT_NODE_BUILTIN",
|
|
971
|
+
file,
|
|
972
|
+
`"${finding.name}" is imported into a module compiled for the browser, which gets a stub whose exports without a Web API equivalent are undefined.`,
|
|
973
|
+
location
|
|
974
|
+
);
|
|
790
975
|
}
|
|
791
|
-
return lines.join("\n");
|
|
792
976
|
}
|
|
793
977
|
|
|
794
978
|
// src/image-vite.ts
|
|
@@ -819,7 +1003,7 @@ function farmImageImportsPlugin() {
|
|
|
819
1003
|
async transform(code, id) {
|
|
820
1004
|
const filePath = id.split("?", 1)[0];
|
|
821
1005
|
if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
|
|
822
|
-
const defaultExport = _optionalChain([code, 'access',
|
|
1006
|
+
const defaultExport = _optionalChain([code, 'access', _45 => _45.match, 'call', _46 => _46(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _47 => _47[1]]);
|
|
823
1007
|
if (!defaultExport) return null;
|
|
824
1008
|
return createStaticImageModule(filePath, `const src = ${defaultExport};`);
|
|
825
1009
|
}
|
|
@@ -917,7 +1101,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
|
|
|
917
1101
|
}
|
|
918
1102
|
const edits = [];
|
|
919
1103
|
const declarations = (_nullishCoalesce(program.body, () => ( []))).filter(
|
|
920
|
-
(node) => node.type === "ImportDeclaration" && _optionalChain([node, 'access',
|
|
1104
|
+
(node) => node.type === "ImportDeclaration" && _optionalChain([node, 'access', _48 => _48.source, 'optionalAccess', _49 => _49.value]) === "react" && node.importKind !== "type"
|
|
921
1105
|
);
|
|
922
1106
|
const namespaces = /* @__PURE__ */ new Set();
|
|
923
1107
|
let memberImportAt = null;
|
|
@@ -932,7 +1116,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
|
|
|
932
1116
|
const caches = specifiers.filter(
|
|
933
1117
|
(specifier) => specifier.type === "ImportSpecifier" && specifier.importKind !== "type" && Object.prototype.hasOwnProperty.call(
|
|
934
1118
|
REACT_CACHE_APIS,
|
|
935
|
-
_nullishCoalesce(_nullishCoalesce(_optionalChain([specifier, 'access',
|
|
1119
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([specifier, 'access', _50 => _50.imported, 'optionalAccess', _51 => _51.name]), () => ( _optionalChain([specifier, 'access', _52 => _52.imported, 'optionalAccess', _53 => _53.value]))), () => ( ""))
|
|
936
1120
|
)
|
|
937
1121
|
);
|
|
938
1122
|
if (caches.length === 0) continue;
|
|
@@ -946,7 +1130,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
|
|
|
946
1130
|
].join(", ");
|
|
947
1131
|
const lines = [
|
|
948
1132
|
...clause ? [`import ${clause} from "react";`] : [],
|
|
949
|
-
`import { ${caches.map((specifier) => `${_nullishCoalesce(_optionalChain([specifier, 'access',
|
|
1133
|
+
`import { ${caches.map((specifier) => `${_nullishCoalesce(_optionalChain([specifier, 'access', _54 => _54.imported, 'optionalAccess', _55 => _55.name]), () => ( _optionalChain([specifier, 'access', _56 => _56.imported, 'optionalAccess', _57 => _57.value])))} as ${specifier.local.name}`).join(", ")} } from ${JSON.stringify(cacheModule)};`
|
|
950
1134
|
];
|
|
951
1135
|
edits.push({ start: node.start, end: node.end, text: lines.join("\n") });
|
|
952
1136
|
}
|
|
@@ -961,7 +1145,7 @@ function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_
|
|
|
961
1145
|
const current = node;
|
|
962
1146
|
if (typeof current.type !== "string") return;
|
|
963
1147
|
if (current.type === "ImportDeclaration") return;
|
|
964
|
-
if (current.type === "MemberExpression" && !current.computed && _optionalChain([current, 'access',
|
|
1148
|
+
if (current.type === "MemberExpression" && !current.computed && _optionalChain([current, 'access', _58 => _58.object, 'optionalAccess', _59 => _59.type]) === "Identifier" && namespaces.has(current.object.name) && Object.prototype.hasOwnProperty.call(REACT_CACHE_APIS, _nullishCoalesce(_optionalChain([current, 'access', _60 => _60.property, 'optionalAccess', _61 => _61.name]), () => ( "")))) {
|
|
965
1149
|
const name = current.property.name;
|
|
966
1150
|
edits.push({ start: current.start, end: current.end, text: REACT_CACHE_APIS[name] });
|
|
967
1151
|
used.add(name);
|
|
@@ -1032,13 +1216,13 @@ function reportOpenAPIDevGenerationResult(spec, output = _chunkQMNWKQL4cjs.logge
|
|
|
1032
1216
|
// src/vite.ts
|
|
1033
1217
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
1034
1218
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
1035
|
-
const llms =
|
|
1219
|
+
const llms = _chunkMKQ27TGWcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _62 => _62.agent, 'optionalAccess', _63 => _63.llmsTxt]));
|
|
1036
1220
|
if (!llms.enabled) return [];
|
|
1037
1221
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
1038
1222
|
}
|
|
1039
1223
|
function farmAgentGeneratedPaths(config) {
|
|
1040
|
-
const crawlers =
|
|
1041
|
-
const sitemap =
|
|
1224
|
+
const crawlers = _chunkF244KE2Dcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _64 => _64.agent, 'optionalAccess', _65 => _65.crawlers]));
|
|
1225
|
+
const sitemap = _chunkF244KE2Dcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _66 => _66.agent, 'optionalAccess', _67 => _67.sitemap]));
|
|
1042
1226
|
return [
|
|
1043
1227
|
...farmLlmsTxtGeneratedPaths(config),
|
|
1044
1228
|
...sitemap.enabled ? ["/sitemap.xml"] : [],
|
|
@@ -1077,13 +1261,13 @@ function loadFarmDocsSearchDevRuntime() {
|
|
|
1077
1261
|
return import("./search-client-ZZLKVO5R.cjs");
|
|
1078
1262
|
}
|
|
1079
1263
|
function loadFarmOpenAPIDevRuntime() {
|
|
1080
|
-
return import("./manager-
|
|
1264
|
+
return import("./manager-S77ZARTC.cjs");
|
|
1081
1265
|
}
|
|
1082
1266
|
function loadFarmWorkflowsDevRuntime() {
|
|
1083
1267
|
return import("./workflows.cjs");
|
|
1084
1268
|
}
|
|
1085
1269
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1086
|
-
return import("./devtools-
|
|
1270
|
+
return import("./devtools-YMDS7PUA.cjs");
|
|
1087
1271
|
}
|
|
1088
1272
|
function loadFarmDevtoolsUIRuntime() {
|
|
1089
1273
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -1096,7 +1280,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
1096
1280
|
name: "farm:i18n-client-bridge",
|
|
1097
1281
|
enforce: "pre",
|
|
1098
1282
|
resolveId(id, _importer, options) {
|
|
1099
|
-
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess',
|
|
1283
|
+
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _68 => _68.ssr])) {
|
|
1100
1284
|
return FARM_I18N_CLIENT_BRIDGE_ID;
|
|
1101
1285
|
}
|
|
1102
1286
|
return null;
|
|
@@ -1114,16 +1298,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
|
1114
1298
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
1115
1299
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
1116
1300
|
var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
|
|
1117
|
-
|
|
1118
|
-
new RegExp(`^${
|
|
1301
|
+
_chunk56HHUSR5cjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
|
|
1302
|
+
new RegExp(`^${_chunkNXGQIXR7cjs.FARM_RESOLVE_FROM_PREFIX}`),
|
|
1119
1303
|
// What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
|
|
1120
1304
|
// included.
|
|
1121
1305
|
/^node:/,
|
|
1122
|
-
|
|
1306
|
+
_chunk56HHUSR5cjs.exactIdPattern.call(void 0, _module.builtinModules)
|
|
1123
1307
|
];
|
|
1124
1308
|
var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
|
|
1125
|
-
|
|
1126
|
-
new RegExp(`^${
|
|
1309
|
+
_chunk56HHUSR5cjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
|
|
1310
|
+
new RegExp(`^${_chunkNXGQIXR7cjs.FARM_BROWSER_BUILTIN_PREFIX}`)
|
|
1127
1311
|
];
|
|
1128
1312
|
function createFarmPlatformClientModule(platform) {
|
|
1129
1313
|
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
@@ -1153,24 +1337,24 @@ function farmIslandContainersPlugin(config) {
|
|
|
1153
1337
|
root = config.root || resolved.root;
|
|
1154
1338
|
},
|
|
1155
1339
|
transform(code, id) {
|
|
1156
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
1340
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _69 => _69.experimental, 'optionalAccess', _70 => _70.serverComponents])) !== "islands") {
|
|
1157
1341
|
return null;
|
|
1158
1342
|
}
|
|
1159
1343
|
if (id.startsWith("\0") || id.includes("/node_modules/") || !/\.[jt]sx(?:$|\?)/.test(id)) {
|
|
1160
1344
|
return null;
|
|
1161
1345
|
}
|
|
1162
|
-
if (
|
|
1346
|
+
if (_chunkNXGQIXR7cjs.hasUseClientDirective.call(void 0, code)) return null;
|
|
1163
1347
|
const file = id.split("?", 1)[0];
|
|
1164
|
-
const bindings =
|
|
1348
|
+
const bindings = _chunkNXGQIXR7cjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
|
|
1165
1349
|
if (bindings.length === 0) return null;
|
|
1166
|
-
const grown =
|
|
1350
|
+
const grown = _chunkNXGQIXR7cjs.wrapFarmIslandContainers.call(void 0, {
|
|
1167
1351
|
code,
|
|
1168
1352
|
file,
|
|
1169
1353
|
bindings,
|
|
1170
|
-
reference:
|
|
1354
|
+
reference: _chunkNXGQIXR7cjs.farmIslandContainerReferencePath.call(void 0, root)
|
|
1171
1355
|
});
|
|
1172
1356
|
if (grown === null) return null;
|
|
1173
|
-
|
|
1357
|
+
_chunkNXGQIXR7cjs.ensureFarmIslandContainerReference.call(void 0, root);
|
|
1174
1358
|
return { code: grown, map: null };
|
|
1175
1359
|
}
|
|
1176
1360
|
};
|
|
@@ -1182,11 +1366,11 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1182
1366
|
name: "farm:server-only-entries",
|
|
1183
1367
|
enforce: "pre",
|
|
1184
1368
|
config(config) {
|
|
1185
|
-
const bundledPackages =
|
|
1369
|
+
const bundledPackages = _chunkNXGQIXR7cjs.collectFarmServerBundledPackageInfo.call(void 0,
|
|
1186
1370
|
path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())))
|
|
1187
1371
|
);
|
|
1188
1372
|
return {
|
|
1189
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
1373
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunkNXGQIXR7cjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
1190
1374
|
ssr: {
|
|
1191
1375
|
noExternal: [
|
|
1192
1376
|
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
@@ -1204,19 +1388,26 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1204
1388
|
resolveId: {
|
|
1205
1389
|
filter: { id: FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER },
|
|
1206
1390
|
handler(id, importer, options2) {
|
|
1207
|
-
if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess',
|
|
1391
|
+
if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess', _71 => _71.ssr]) ? null : FARM_PLATFORM_CLIENT_ID;
|
|
1208
1392
|
if (id === SERVER_ONLY_PACKAGE) {
|
|
1209
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
1393
|
+
if (_optionalChain([options2, 'optionalAccess', _72 => _72.ssr]) || _optionalChain([options2, 'optionalAccess', _73 => _73.scan])) {
|
|
1210
1394
|
return FARM_SERVER_ONLY_PACKAGE_ID;
|
|
1211
1395
|
}
|
|
1212
1396
|
this.error(
|
|
1213
|
-
|
|
1397
|
+
_chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
|
|
1398
|
+
_chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
|
|
1399
|
+
"CLIENT_SERVER_ONLY_IMPORT",
|
|
1400
|
+
_nullishCoalesce(importer, () => ( "<unknown module>")),
|
|
1401
|
+
`${importer ? "This module" : "A module"} imports "server-only", so it must not reach the browser, but client code imports it.`
|
|
1402
|
+
),
|
|
1403
|
+
root
|
|
1404
|
+
)
|
|
1214
1405
|
);
|
|
1215
1406
|
}
|
|
1216
|
-
if (!_optionalChain([options2, 'optionalAccess',
|
|
1217
|
-
return
|
|
1407
|
+
if (!_optionalChain([options2, 'optionalAccess', _74 => _74.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
1408
|
+
return _chunkNXGQIXR7cjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
1218
1409
|
}
|
|
1219
|
-
const resolveFrom = importer ?
|
|
1410
|
+
const resolveFrom = importer ? _chunkNXGQIXR7cjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
|
|
1220
1411
|
if (resolveFrom) {
|
|
1221
1412
|
const directory = path6.dirname(resolveFrom.importer);
|
|
1222
1413
|
return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
|
|
@@ -1231,9 +1422,16 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1231
1422
|
}
|
|
1232
1423
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
1233
1424
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
1234
|
-
if (!_optionalChain([options2, 'optionalAccess',
|
|
1425
|
+
if (!_optionalChain([options2, 'optionalAccess', _75 => _75.ssr])) {
|
|
1235
1426
|
this.error(
|
|
1236
|
-
|
|
1427
|
+
_chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
|
|
1428
|
+
_chunkNXGQIXR7cjs.createFarmDiagnostic.call(void 0,
|
|
1429
|
+
"CLIENT_SERVER_ONLY_ENTRY",
|
|
1430
|
+
_nullishCoalesce(importer, () => ( id)),
|
|
1431
|
+
`${id} is server-only and cannot be imported into client code.`
|
|
1432
|
+
),
|
|
1433
|
+
root
|
|
1434
|
+
)
|
|
1237
1435
|
);
|
|
1238
1436
|
}
|
|
1239
1437
|
vercelOgInstalled || (vercelOgInstalled = _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, root, "@vercel/og"));
|
|
@@ -1252,7 +1450,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1252
1450
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
1253
1451
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
1254
1452
|
}
|
|
1255
|
-
return _nullishCoalesce(
|
|
1453
|
+
return _nullishCoalesce(_chunkNXGQIXR7cjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
1256
1454
|
}
|
|
1257
1455
|
}
|
|
1258
1456
|
};
|
|
@@ -1285,10 +1483,10 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
1285
1483
|
if (!snapshot) return "";
|
|
1286
1484
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
1287
1485
|
if (snapshot.routing === "none") return runtime;
|
|
1288
|
-
return `${
|
|
1486
|
+
return `${_chunkO2A6HE76cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
1289
1487
|
}
|
|
1290
1488
|
function getPublicEnvDefine(config) {
|
|
1291
|
-
const publicEnv = _optionalChain([config, 'access',
|
|
1489
|
+
const publicEnv = _optionalChain([config, 'access', _76 => _76.env, 'optionalAccess', _77 => _77.public]);
|
|
1292
1490
|
if (!isResolvedEnvScope(publicEnv)) {
|
|
1293
1491
|
return {};
|
|
1294
1492
|
}
|
|
@@ -1309,7 +1507,7 @@ function createRequestFromNodeRequest(req, url, signal) {
|
|
|
1309
1507
|
signal
|
|
1310
1508
|
});
|
|
1311
1509
|
}
|
|
1312
|
-
function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request) =>
|
|
1510
|
+
function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request) => _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, request)) {
|
|
1313
1511
|
const middleware = _chunkP2355C6Ecjs._withAfterNodeMiddleware.call(void 0, handler);
|
|
1314
1512
|
return (req, res, next) => {
|
|
1315
1513
|
const traceUrl = resolveTraceUrl(req);
|
|
@@ -1327,12 +1525,12 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
|
|
|
1327
1525
|
return;
|
|
1328
1526
|
}
|
|
1329
1527
|
if (res.headersSent) {
|
|
1330
|
-
_optionalChain([res, 'access',
|
|
1528
|
+
_optionalChain([res, 'access', _78 => _78.destroy, 'optionalCall', _79 => _79(error instanceof Error ? error : new Error(String(error)))]);
|
|
1331
1529
|
return;
|
|
1332
1530
|
}
|
|
1333
1531
|
res.statusCode = 500;
|
|
1334
1532
|
res.setHeader("Content-Type", "application/json");
|
|
1335
|
-
res.end(
|
|
1533
|
+
res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
1336
1534
|
});
|
|
1337
1535
|
};
|
|
1338
1536
|
}
|
|
@@ -1340,10 +1538,10 @@ function sendFarmDevErrorJSON(res) {
|
|
|
1340
1538
|
res.statusCode = 500;
|
|
1341
1539
|
res.setHeader("Content-Type", "application/json");
|
|
1342
1540
|
res.setHeader("Cache-Control", "private, no-store");
|
|
1343
|
-
res.end(
|
|
1541
|
+
res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
1344
1542
|
}
|
|
1345
1543
|
function createFarmDevMiddlewareErrorResponse() {
|
|
1346
|
-
return new Response(
|
|
1544
|
+
return new Response(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY, {
|
|
1347
1545
|
status: 500,
|
|
1348
1546
|
headers: { "Content-Type": "application/json", "Cache-Control": "private, no-store" }
|
|
1349
1547
|
});
|
|
@@ -1355,15 +1553,15 @@ function setFarmDevRuntimeHookErrorHead(res, json) {
|
|
|
1355
1553
|
}
|
|
1356
1554
|
function sendFarmDevRuntimeHookError(res, json) {
|
|
1357
1555
|
setFarmDevRuntimeHookErrorHead(res, json);
|
|
1358
|
-
res.end(json ?
|
|
1556
|
+
res.end(json ? _chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1359
1557
|
}
|
|
1360
1558
|
function opensFarmDevRuntimeSession(pm) {
|
|
1361
|
-
return pm.hasRuntimeRequestHooks() ||
|
|
1559
|
+
return pm.hasRuntimeRequestHooks() || _chunkENYBDM4Ucjs.hasFarmServerRuntimePlugins.call(void 0, pm.getPlugins());
|
|
1362
1560
|
}
|
|
1363
1561
|
var FARM_CONFIG_ROUTE_PLUGIN_NAMES = /* @__PURE__ */ new Set([
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1562
|
+
_chunkXZPI44Q7cjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
1563
|
+
_chunkXZPI44Q7cjs.FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
|
|
1564
|
+
_chunkXZPI44Q7cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME
|
|
1367
1565
|
]);
|
|
1368
1566
|
function isFarmConfigRoutePlugin(plugin) {
|
|
1369
1567
|
return FARM_CONFIG_ROUTE_PLUGIN_NAMES.has(plugin.name);
|
|
@@ -1463,7 +1661,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1463
1661
|
const originalWrite = res.write.bind(res);
|
|
1464
1662
|
const originalEnd = res.end.bind(res);
|
|
1465
1663
|
const originalWriteHead = res.writeHead.bind(res);
|
|
1466
|
-
const originalFlushHeaders = _optionalChain([res, 'access',
|
|
1664
|
+
const originalFlushHeaders = _optionalChain([res, 'access', _80 => _80.flushHeaders, 'optionalAccess', _81 => _81.bind, 'call', _82 => _82(res)]);
|
|
1467
1665
|
let afterResponseCalled = false;
|
|
1468
1666
|
let interceptedEnd = false;
|
|
1469
1667
|
const restore = () => {
|
|
@@ -1485,7 +1683,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1485
1683
|
const writeRuntimeHookFailure = () => {
|
|
1486
1684
|
setFarmDevRuntimeHookErrorHead(res, Boolean(options.jsonError));
|
|
1487
1685
|
originalWriteHead(500);
|
|
1488
|
-
originalWrite(options.jsonError ?
|
|
1686
|
+
originalWrite(options.jsonError ? _chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1489
1687
|
};
|
|
1490
1688
|
const htmlChunks = [];
|
|
1491
1689
|
const responseChunks = [];
|
|
@@ -1525,7 +1723,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1525
1723
|
).then(async (runtimeResponse) => {
|
|
1526
1724
|
applyWebResponseToNodeResponse(runtimeResponse, res);
|
|
1527
1725
|
if (!res.headersSent) originalWriteHead(res.statusCode);
|
|
1528
|
-
_optionalChain([originalFlushHeaders, 'optionalCall',
|
|
1726
|
+
_optionalChain([originalFlushHeaders, 'optionalCall', _83 => _83()]);
|
|
1529
1727
|
if (!runtimeResponse.body) return;
|
|
1530
1728
|
const reader = runtimeResponse.body.getReader();
|
|
1531
1729
|
for (; ; ) {
|
|
@@ -1574,7 +1772,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1574
1772
|
if (streamsThroughRuntime()) {
|
|
1575
1773
|
streamRuntimeChunk(bufferChunk);
|
|
1576
1774
|
const callback = args.find((arg) => typeof arg === "function");
|
|
1577
|
-
_optionalChain([callback, 'optionalCall',
|
|
1775
|
+
_optionalChain([callback, 'optionalCall', _84 => _84()]);
|
|
1578
1776
|
return true;
|
|
1579
1777
|
}
|
|
1580
1778
|
if (isHtmlResponse && bufferChunk) {
|
|
@@ -1586,7 +1784,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1586
1784
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1587
1785
|
if (shouldBufferResponse) {
|
|
1588
1786
|
const callback = args.find((arg) => typeof arg === "function");
|
|
1589
|
-
_optionalChain([callback, 'optionalCall',
|
|
1787
|
+
_optionalChain([callback, 'optionalCall', _85 => _85()]);
|
|
1590
1788
|
return true;
|
|
1591
1789
|
}
|
|
1592
1790
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -1738,13 +1936,13 @@ function getEnvDefines(config, configEnv) {
|
|
|
1738
1936
|
)
|
|
1739
1937
|
)
|
|
1740
1938
|
};
|
|
1741
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
1939
|
+
if (_optionalChain([configEnv, 'optionalAccess', _86 => _86.isSsrBuild])) {
|
|
1742
1940
|
defines.__FARM_ENV__ = JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
1743
1941
|
}
|
|
1744
1942
|
return defines;
|
|
1745
1943
|
}
|
|
1746
1944
|
function getFarmAPIBaseURLDefine(config) {
|
|
1747
|
-
const baseURL = _optionalChain([config, 'access',
|
|
1945
|
+
const baseURL = _optionalChain([config, 'access', _87 => _87.api, 'optionalAccess', _88 => _88.baseURL]);
|
|
1748
1946
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkPMJSG4JScjs.DEFAULT_FARM_API_BASE_PATH;
|
|
1749
1947
|
}
|
|
1750
1948
|
function isResolvedEnvScope(value) {
|
|
@@ -1866,7 +2064,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1866
2064
|
return null;
|
|
1867
2065
|
}
|
|
1868
2066
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
1869
|
-
const everyExportIsComponent = options.code.includes(
|
|
2067
|
+
const everyExportIsComponent = options.code.includes(_chunkNXGQIXR7cjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkNXGQIXR7cjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
1870
2068
|
const replacements = [];
|
|
1871
2069
|
const wrapperStatements = [];
|
|
1872
2070
|
const originalEntries = [];
|
|
@@ -1885,9 +2083,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1885
2083
|
transformedExports++;
|
|
1886
2084
|
};
|
|
1887
2085
|
for (const node of body) {
|
|
1888
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
2086
|
+
if (_optionalChain([node, 'optionalAccess', _89 => _89.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
1889
2087
|
const declaration2 = node.declaration;
|
|
1890
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
2088
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _90 => _90.id, 'optionalAccess', _91 => _91.name])) {
|
|
1891
2089
|
replacements.push({
|
|
1892
2090
|
start: node.start,
|
|
1893
2091
|
end: node.end,
|
|
@@ -1905,11 +2103,11 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1905
2103
|
}
|
|
1906
2104
|
continue;
|
|
1907
2105
|
}
|
|
1908
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
2106
|
+
if (_optionalChain([node, 'optionalAccess', _92 => _92.type]) === "ExportNamedDeclaration" && !node.declaration && node.exportKind !== "type") {
|
|
1909
2107
|
const specifiers = (node.specifiers || []).filter(
|
|
1910
2108
|
(specifier) => specifier.type === "ExportSpecifier" && specifier.exportKind !== "type"
|
|
1911
2109
|
);
|
|
1912
|
-
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess',
|
|
2110
|
+
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess', _93 => _93.name]), () => ( String(_nullishCoalesce(_optionalChain([name, 'optionalAccess', _94 => _94.value]), () => ( "")))));
|
|
1913
2111
|
const isComponentExport = (specifier) => {
|
|
1914
2112
|
const exported = specifierName(specifier.exported);
|
|
1915
2113
|
return everyExportIsComponent || exported === "default" || /^[A-Z]/.test(exported);
|
|
@@ -1936,14 +2134,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1936
2134
|
if (kept.length > 0) wrapperStatements.push(`export { ${kept.join(", ")} };`);
|
|
1937
2135
|
continue;
|
|
1938
2136
|
}
|
|
1939
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
2137
|
+
if (_optionalChain([node, 'optionalAccess', _95 => _95.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
1940
2138
|
const declaration = node.declaration;
|
|
1941
2139
|
const declaredNames = [];
|
|
1942
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
2140
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _96 => _96.id, 'optionalAccess', _97 => _97.name])) {
|
|
1943
2141
|
declaredNames.push(declaration.id.name);
|
|
1944
2142
|
} else if (declaration.type === "VariableDeclaration") {
|
|
1945
2143
|
for (const declarator of declaration.declarations || []) {
|
|
1946
|
-
if (_optionalChain([declarator, 'access',
|
|
2144
|
+
if (_optionalChain([declarator, 'access', _98 => _98.id, 'optionalAccess', _99 => _99.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
1947
2145
|
}
|
|
1948
2146
|
}
|
|
1949
2147
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -2004,7 +2202,7 @@ function isFarmConfigFile(file, root) {
|
|
|
2004
2202
|
return FARM_CONFIG_FILENAMES.has(relative4);
|
|
2005
2203
|
}
|
|
2006
2204
|
var warnedClientBoundaryIds = /* @__PURE__ */ new Set();
|
|
2007
|
-
function warnClientBoundaryOnce(context, id, code, config) {
|
|
2205
|
+
async function warnClientBoundaryOnce(context, id, code, config) {
|
|
2008
2206
|
if (warnedClientBoundaryIds.has(id)) return;
|
|
2009
2207
|
let program;
|
|
2010
2208
|
try {
|
|
@@ -2012,13 +2210,26 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
2012
2210
|
} catch (e20) {
|
|
2013
2211
|
return;
|
|
2014
2212
|
}
|
|
2015
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
2016
|
-
const findings =
|
|
2017
|
-
|
|
2018
|
-
|
|
2213
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _100 => _100.env, 'optionalAccess', _101 => _101.public]), () => ( {}))));
|
|
2214
|
+
const findings = [];
|
|
2215
|
+
for (const finding of analyzeClientBoundary(program, publicKeys)) {
|
|
2216
|
+
if (finding.kind === "builtin" && !finding.name.startsWith("node:")) {
|
|
2217
|
+
const resolved = await context.resolve(finding.name, id).catch(() => null);
|
|
2218
|
+
if (!_optionalChain([resolved, 'optionalAccess', _102 => _102.id, 'access', _103 => _103.startsWith, 'call', _104 => _104(_chunkNXGQIXR7cjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
|
|
2219
|
+
}
|
|
2220
|
+
findings.push(finding);
|
|
2019
2221
|
}
|
|
2222
|
+
if (findings.length === 0) return;
|
|
2020
2223
|
warnedClientBoundaryIds.add(id);
|
|
2021
|
-
|
|
2224
|
+
const locate = _chunkNXGQIXR7cjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
|
|
2225
|
+
_chunkQMNWKQL4cjs.logger.warn(
|
|
2226
|
+
findings.map(
|
|
2227
|
+
(finding) => _chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
|
|
2228
|
+
createClientBoundaryDiagnostic(id, finding, locate(finding.start)),
|
|
2229
|
+
config.root
|
|
2230
|
+
)
|
|
2231
|
+
).join("\n")
|
|
2232
|
+
);
|
|
2022
2233
|
}
|
|
2023
2234
|
function shouldEmitFarmClientRootHmr(renderer) {
|
|
2024
2235
|
return _chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
|
|
@@ -2054,21 +2265,21 @@ function hasFarmSourceAliasOverride(alias) {
|
|
|
2054
2265
|
function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
2055
2266
|
const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, options.renderer);
|
|
2056
2267
|
const imageImports = farmImageImportsPlugin();
|
|
2057
|
-
const fontImports =
|
|
2268
|
+
const fontImports = _chunk56HHUSR5cjs.farmFontImportsPlugin.call(void 0, {
|
|
2058
2269
|
root: options.root,
|
|
2059
2270
|
basePath: options.basePath,
|
|
2060
2271
|
publicDir: options.publicDir
|
|
2061
2272
|
});
|
|
2062
2273
|
let farmApp;
|
|
2063
2274
|
const isFarmGeneratedOutput = (file) => {
|
|
2064
|
-
const root = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2275
|
+
const root = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _105 => _105.getConfig, 'call', _106 => _106(), 'access', _107 => _107.root]), () => ( options.root));
|
|
2065
2276
|
if (!root) return file.includes("/.farm/");
|
|
2066
2277
|
const output = _chunkQMNWKQL4cjs.toPosixPath.call(void 0, path6.resolve(root, options.distDir || ".farm"));
|
|
2067
2278
|
return file === output || file.startsWith(`${output}/`);
|
|
2068
2279
|
};
|
|
2069
2280
|
let serverFnTransformActive = false;
|
|
2070
2281
|
const getFarmRenderedServerModules = () => {
|
|
2071
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
2282
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _108 => _108.getRouteManager, 'call', _109 => _109()]);
|
|
2072
2283
|
if (!routeManager) return /* @__PURE__ */ new Set();
|
|
2073
2284
|
const files = /* @__PURE__ */ new Set();
|
|
2074
2285
|
for (const entries of [
|
|
@@ -2089,8 +2300,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2089
2300
|
return files;
|
|
2090
2301
|
};
|
|
2091
2302
|
const islandsServerFns = () => {
|
|
2092
|
-
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2093
|
-
return _optionalChain([config, 'access',
|
|
2303
|
+
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _110 => _110.getConfig, 'call', _111 => _111()]), () => ( options));
|
|
2304
|
+
return _optionalChain([config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.serverActions]) === true && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "islands";
|
|
2094
2305
|
};
|
|
2095
2306
|
let reactRefreshActive = false;
|
|
2096
2307
|
let server;
|
|
@@ -2119,9 +2330,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2119
2330
|
].join(" ");
|
|
2120
2331
|
console.log(log);
|
|
2121
2332
|
};
|
|
2122
|
-
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
2333
|
+
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _116 => _116.getRouteManager, 'call', _117 => _117(), 'access', _118 => _118.getProgrammaticClientRoutes, 'call', _119 => _119()])));
|
|
2123
2334
|
const isOutsideAppRoot = (file) => {
|
|
2124
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
2335
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _120 => _120.getConfig, 'call', _121 => _121(), 'access', _122 => _122.root]) || _optionalChain([server, 'optionalAccess', _123 => _123.config, 'access', _124 => _124.root]) || options.root;
|
|
2125
2336
|
if (!root) return false;
|
|
2126
2337
|
const relative4 = path6.relative(root, file.split("?", 1)[0]);
|
|
2127
2338
|
return relative4.startsWith("..") || path6.isAbsolute(relative4);
|
|
@@ -2133,14 +2344,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2133
2344
|
isBuild = configEnv.command === "build";
|
|
2134
2345
|
const farmAliases = {
|
|
2135
2346
|
..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, options.layers),
|
|
2136
|
-
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access',
|
|
2347
|
+
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _125 => _125.resolve, 'optionalAccess', _126 => _126.alias])) ? {} : _chunk56HHUSR5cjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
|
|
2137
2348
|
};
|
|
2138
2349
|
if (Object.keys(farmAliases).length > 0) {
|
|
2139
2350
|
_nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
|
|
2140
|
-
userConfig.resolve.alias =
|
|
2351
|
+
userConfig.resolve.alias = _chunk56HHUSR5cjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
|
|
2141
2352
|
}
|
|
2142
2353
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
2143
|
-
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access',
|
|
2354
|
+
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _127 => _127.server, 'optionalAccess', _128 => _128.cors]) === void 0;
|
|
2144
2355
|
return {
|
|
2145
2356
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
2146
2357
|
// directory the production client build emits.
|
|
@@ -2153,13 +2364,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2153
2364
|
...farmOwnsDevCors ? { cors: false } : {},
|
|
2154
2365
|
fs: {
|
|
2155
2366
|
...layerRoots.length ? { allow: [path6.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
2156
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
2367
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _129 => _129.server, 'optionalAccess', _130 => _130.fs, 'optionalAccess', _131 => _131.deny]), options)
|
|
2157
2368
|
}
|
|
2158
2369
|
}
|
|
2159
2370
|
};
|
|
2160
2371
|
},
|
|
2161
2372
|
configEnvironment(name, environmentConfig, env) {
|
|
2162
|
-
if (env.command !== "serve" || name !== "ssr" && name !== "rsc" || _optionalChain([environmentConfig, 'access',
|
|
2373
|
+
if (env.command !== "serve" || name !== "ssr" && name !== "rsc" || _optionalChain([environmentConfig, 'access', _132 => _132.dev, 'optionalAccess', _133 => _133.createEnvironment])) {
|
|
2163
2374
|
return;
|
|
2164
2375
|
}
|
|
2165
2376
|
return {
|
|
@@ -2178,7 +2389,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2178
2389
|
(plugin2) => plugin2.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
2179
2390
|
);
|
|
2180
2391
|
reactRefreshActive = _chunk3QM74STYcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
2181
|
-
if (_optionalChain([options, 'access',
|
|
2392
|
+
if (_optionalChain([options, 'access', _134 => _134.experimental, 'optionalAccess', _135 => _135.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
2182
2393
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
2183
2394
|
"experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
|
|
2184
2395
|
);
|
|
@@ -2187,21 +2398,21 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2187
2398
|
async configureServer(viteServer) {
|
|
2188
2399
|
viteServer.middlewares.use(
|
|
2189
2400
|
createFarmDevPreviewGuard(viteServer, {
|
|
2190
|
-
getSourceRoots: () => _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2401
|
+
getSourceRoots: () => _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _136 => _136.getConfig, 'call', _137 => _137()]), () => ( options)))
|
|
2191
2402
|
})
|
|
2192
2403
|
);
|
|
2193
2404
|
if (typeof fontImports.configureServer === "function") {
|
|
2194
2405
|
await fontImports.configureServer.call(this, viteServer);
|
|
2195
2406
|
}
|
|
2196
2407
|
server = viteServer;
|
|
2197
|
-
const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess',
|
|
2198
|
-
const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess',
|
|
2408
|
+
const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _138 => _138.pre, 'access', _139 => _139.target]), () => ( viteServer.middlewares));
|
|
2409
|
+
const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _140 => _140.post, 'access', _141 => _141.target]), () => ( viteServer.middlewares));
|
|
2199
2410
|
const pm = initialPluginManager;
|
|
2200
2411
|
const configRoutePlugins = new Set(
|
|
2201
|
-
_optionalChain([pm, 'optionalAccess',
|
|
2412
|
+
_optionalChain([pm, 'optionalAccess', _142 => _142.getPlugins, 'call', _143 => _143(), 'access', _144 => _144.filter, 'call', _145 => _145(isFarmConfigRoutePlugin), 'access', _146 => _146.map, 'call', _147 => _147((plugin2) => plugin2.name)])
|
|
2202
2413
|
);
|
|
2203
|
-
const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
2204
|
-
const matcher =
|
|
2414
|
+
const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _148 => _148.getPlugins, 'call', _149 => _149()]), () => ( []))).flatMap((plugin2) => {
|
|
2415
|
+
const matcher = _chunkXZPI44Q7cjs.getConfigRedirectMatcher.call(void 0, plugin2);
|
|
2205
2416
|
return matcher ? [matcher] : [];
|
|
2206
2417
|
});
|
|
2207
2418
|
const emitPluginError = async (phase, error, meta) => {
|
|
@@ -2211,7 +2422,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2211
2422
|
} catch (e21) {
|
|
2212
2423
|
}
|
|
2213
2424
|
};
|
|
2214
|
-
farmApp = new (0,
|
|
2425
|
+
farmApp = new (0, _chunk56HHUSR5cjs.FarmApp)(
|
|
2215
2426
|
{
|
|
2216
2427
|
...options,
|
|
2217
2428
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -2219,7 +2430,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2219
2430
|
server
|
|
2220
2431
|
);
|
|
2221
2432
|
farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
|
|
2222
|
-
|
|
2433
|
+
_chunkNXGQIXR7cjs.resolvePackageClientBoundaryCacheFile.call(void 0,
|
|
2223
2434
|
farmApp.getConfig().root,
|
|
2224
2435
|
options.distDir || ".farm"
|
|
2225
2436
|
)
|
|
@@ -2228,17 +2439,17 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2228
2439
|
await farmApp.initialize();
|
|
2229
2440
|
const farmConfig = farmApp.getConfig();
|
|
2230
2441
|
let farmAppPackages;
|
|
2231
|
-
if (_optionalChain([farmConfig, 'access',
|
|
2442
|
+
if (_optionalChain([farmConfig, 'access', _150 => _150.agent, 'optionalAccess', _151 => _151.noindexPreviews])) {
|
|
2232
2443
|
farmMiddlewares.use((_req, res, next) => {
|
|
2233
|
-
if (
|
|
2234
|
-
res.setHeader("X-Robots-Tag",
|
|
2444
|
+
if (_chunkD4TYE6MYcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
2445
|
+
res.setHeader("X-Robots-Tag", _chunkF244KE2Dcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
2235
2446
|
}
|
|
2236
2447
|
next();
|
|
2237
2448
|
});
|
|
2238
2449
|
}
|
|
2239
2450
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
2240
2451
|
const devBuiltInRoutePaths = new Set(
|
|
2241
|
-
|
|
2452
|
+
_chunkDM2YGTRHcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
2242
2453
|
agent: {
|
|
2243
2454
|
apiCatalog: true,
|
|
2244
2455
|
mcp: true,
|
|
@@ -2260,7 +2471,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2260
2471
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
2261
2472
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
2262
2473
|
// a caller-controlled Host header.
|
|
2263
|
-
trustedLocalOrigin: () => _optionalChain([server, 'access',
|
|
2474
|
+
trustedLocalOrigin: () => _optionalChain([server, 'access', _152 => _152.resolvedUrls, 'optionalAccess', _153 => _153.local, 'access', _154 => _154[0]]),
|
|
2264
2475
|
onError(error) {
|
|
2265
2476
|
_chunkQMNWKQL4cjs.logger.error(
|
|
2266
2477
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -2280,15 +2491,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2280
2491
|
const workflowConfig = farmConfig.workflows;
|
|
2281
2492
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
2282
2493
|
const getExtraRouteTypes = () => [
|
|
2283
|
-
..._optionalChain([options, 'access',
|
|
2284
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2494
|
+
..._optionalChain([options, 'access', _155 => _155.openapi, 'optionalAccess', _156 => _156.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
2495
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _157 => _157.getFarmDocsRouteTypeEntries, 'call', _158 => _158(farmConfig.docs)]), () => ( []))
|
|
2285
2496
|
];
|
|
2286
2497
|
const appDirSlugs = sourceRoots.map(
|
|
2287
2498
|
(source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
2288
2499
|
);
|
|
2289
2500
|
const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
2290
2501
|
try {
|
|
2291
|
-
const result = await
|
|
2502
|
+
const result = await _chunkACAEFEOHcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
2292
2503
|
root: farmConfig.root,
|
|
2293
2504
|
srcDir: farmConfig.srcDir,
|
|
2294
2505
|
layers: farmConfig.layers,
|
|
@@ -2328,7 +2539,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2328
2539
|
(source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
2329
2540
|
);
|
|
2330
2541
|
const layerConfigFiles = new Set(
|
|
2331
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
2542
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _159 => _159.configFile, 'optionalAccess', _160 => _160.replace, 'call', _161 => _161(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
2332
2543
|
);
|
|
2333
2544
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
2334
2545
|
..._chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -2407,7 +2618,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2407
2618
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
2408
2619
|
}
|
|
2409
2620
|
if (isI18nCatalogFile(file)) {
|
|
2410
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2621
|
+
_optionalChain([farmApp, 'optionalAccess', _162 => _162.getI18nRuntime, 'call', _163 => _163(), 'access', _164 => _164.reload, 'call', _165 => _165(), 'access', _166 => _166.then, 'call', _167 => _167(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _168 => _168.catch, 'call', _169 => _169((error) => _chunkQMNWKQL4cjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
2411
2622
|
}
|
|
2412
2623
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2413
2624
|
if (isRouteRefreshEvent) {
|
|
@@ -2420,8 +2631,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2420
2631
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
2421
2632
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
2422
2633
|
Promise.all([
|
|
2423
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
2424
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
2634
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _170 => _170(`${ev} ${file}`)]),
|
|
2635
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _171 => _171.reload, 'call', _172 => _172()]) : void 0
|
|
2425
2636
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkQMNWKQL4cjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
2426
2637
|
}, 50);
|
|
2427
2638
|
}
|
|
@@ -2460,14 +2671,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2460
2671
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
2461
2672
|
const load = (file) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
2462
2673
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
2463
|
-
_optionalChain([server, 'access',
|
|
2674
|
+
_optionalChain([server, 'access', _173 => _173.httpServer, 'optionalAccess', _174 => _174.once, 'call', _175 => _175("close", () => {
|
|
2464
2675
|
const globals = globalThis;
|
|
2465
2676
|
if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
|
|
2466
2677
|
delete globals[FARM_DEV_SERVER_MODULE_LOADER];
|
|
2467
2678
|
}
|
|
2468
2679
|
})]);
|
|
2469
2680
|
}
|
|
2470
|
-
apiRouteManager = new (0,
|
|
2681
|
+
apiRouteManager = new (0, _chunk2TZ3F6TNcjs.APIRouteManager)(appDirs, server, {
|
|
2471
2682
|
plugins: farmConfig.plugins,
|
|
2472
2683
|
i18n: farmApp.getI18nRuntime(),
|
|
2473
2684
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -2513,7 +2724,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2513
2724
|
});
|
|
2514
2725
|
}
|
|
2515
2726
|
}
|
|
2516
|
-
middlewareManager = new (0,
|
|
2727
|
+
middlewareManager = new (0, _chunkY4FEQBKYcjs.MiddlewareManager)(
|
|
2517
2728
|
appDirs,
|
|
2518
2729
|
server,
|
|
2519
2730
|
farmConfig.middleware,
|
|
@@ -2534,11 +2745,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2534
2745
|
});
|
|
2535
2746
|
}
|
|
2536
2747
|
}
|
|
2537
|
-
if (_optionalChain([options, 'access',
|
|
2748
|
+
if (_optionalChain([options, 'access', _176 => _176.openapi, 'optionalAccess', _177 => _177.enabled])) {
|
|
2538
2749
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
2539
2750
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
2540
2751
|
mode: "development",
|
|
2541
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
2752
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _178 => _178.api, 'optionalAccess', _179 => _179.baseURL]) === "string" ? options.api.baseURL : void 0,
|
|
2753
|
+
routes: () => apiRouteManager.getRoutes().values(),
|
|
2542
2754
|
loadModule: (filePath) => apiRouteManager.loadModule(filePath)
|
|
2543
2755
|
});
|
|
2544
2756
|
const spec = await openAPIManager.generateSpec();
|
|
@@ -2568,7 +2780,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2568
2780
|
return _chunk7EPYN7GWcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
2569
2781
|
};
|
|
2570
2782
|
releaseDocsMCPServers();
|
|
2571
|
-
const isFarmDocsPathGuarded = (href) =>
|
|
2783
|
+
const isFarmDocsPathGuarded = (href) => _chunkO2A6HE76cjs.farmPathGuardCoversPage.call(void 0,
|
|
2572
2784
|
{
|
|
2573
2785
|
config: farmConfig,
|
|
2574
2786
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2581,20 +2793,20 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2581
2793
|
clientEntry: "/@farm/client.js",
|
|
2582
2794
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2583
2795
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2584
|
-
globalStylesheetHref:
|
|
2796
|
+
globalStylesheetHref: _chunk56HHUSR5cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2585
2797
|
farmConfig.root,
|
|
2586
2798
|
farmConfig.srcDir
|
|
2587
2799
|
),
|
|
2588
2800
|
loadModule: async (specifier) => {
|
|
2589
2801
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
2590
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
2802
|
+
if (specifier === _optionalChain([farmConfig, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && _optionalChain([resolved, 'optionalAccess', _183 => _183.id])) {
|
|
2591
2803
|
const file = resolved.id.split("?", 1)[0];
|
|
2592
2804
|
return import(
|
|
2593
2805
|
/* @vite-ignore */
|
|
2594
2806
|
_url.pathToFileURL.call(void 0, file).href
|
|
2595
2807
|
);
|
|
2596
2808
|
}
|
|
2597
|
-
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
2809
|
+
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _184 => _184.id]), () => ( specifier)));
|
|
2598
2810
|
},
|
|
2599
2811
|
registerMCPServer: (mcpServer) => {
|
|
2600
2812
|
const dispose = _chunkLRB5OVRTcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -2612,7 +2824,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2612
2824
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2613
2825
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2614
2826
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2615
|
-
globalStylesheetHref:
|
|
2827
|
+
globalStylesheetHref: _chunk56HHUSR5cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2616
2828
|
farmConfig.root,
|
|
2617
2829
|
farmConfig.srcDir
|
|
2618
2830
|
),
|
|
@@ -2620,7 +2832,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2620
2832
|
basePath: farmConfig.basePath
|
|
2621
2833
|
}) : null;
|
|
2622
2834
|
const farmDocsListsPages = Boolean(
|
|
2623
|
-
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess',
|
|
2835
|
+
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _185 => _185.getPlugins, 'call', _186 => _186(), 'access', _187 => _187.some, 'call', _188 => _188((plugin2) => plugin2.name === "farm:infra-analytics")])
|
|
2624
2836
|
);
|
|
2625
2837
|
let farmDocsPagePaths;
|
|
2626
2838
|
const getFarmDocsPagePaths = () => {
|
|
@@ -2648,14 +2860,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2648
2860
|
}
|
|
2649
2861
|
}
|
|
2650
2862
|
const wrapFarmDocsResponseWithLayouts = async (request, response) => {
|
|
2651
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
2863
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _189 => _189.headers, 'access', _190 => _190.get, 'call', _191 => _191("content-type"), 'optionalAccess', _192 => _192.toLowerCase, 'call', _193 => _193(), 'access', _194 => _194.includes, 'call', _195 => _195("text/html")])) {
|
|
2652
2864
|
return response;
|
|
2653
2865
|
}
|
|
2654
2866
|
const pathname = new URL(request.url).pathname;
|
|
2655
2867
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
2656
2868
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
2657
2869
|
...layout,
|
|
2658
|
-
metadata:
|
|
2870
|
+
metadata: _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
2659
2871
|
}));
|
|
2660
2872
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
2661
2873
|
return response;
|
|
@@ -2669,7 +2881,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2669
2881
|
headers: response.headers
|
|
2670
2882
|
});
|
|
2671
2883
|
}
|
|
2672
|
-
const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2884
|
+
const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _196 => _196.getConfig, 'call', _197 => _197()]), () => ( options))).renderer);
|
|
2673
2885
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
2674
2886
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
2675
2887
|
Promise.all(
|
|
@@ -2698,7 +2910,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2698
2910
|
])
|
|
2699
2911
|
);
|
|
2700
2912
|
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
2701
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
2913
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _198 => _198.route, 'optionalAccess', _199 => _199.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
2702
2914
|
const bootstrapScript = `<script>
|
|
2703
2915
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
2704
2916
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -2795,9 +3007,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2795
3007
|
}
|
|
2796
3008
|
},
|
|
2797
3009
|
(request) => {
|
|
2798
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3010
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _200 => _200.getConfig, 'call', _201 => _201()]), () => ( options));
|
|
2799
3011
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2800
|
-
return
|
|
3012
|
+
return _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2801
3013
|
trustProxy: currentServerConfig.trustProxy
|
|
2802
3014
|
});
|
|
2803
3015
|
}
|
|
@@ -2811,9 +3023,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2811
3023
|
withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
|
|
2812
3024
|
const requestUrl = req.url || "/";
|
|
2813
3025
|
const requestMethod = req.method || "GET";
|
|
2814
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3026
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _202 => _202.getConfig, 'call', _203 => _203()]), () => ( options));
|
|
2815
3027
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2816
|
-
const parsedRequestUrl =
|
|
3028
|
+
const parsedRequestUrl = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2817
3029
|
trustProxy: currentServerConfig.trustProxy
|
|
2818
3030
|
});
|
|
2819
3031
|
const fullUrl = parsedRequestUrl.toString();
|
|
@@ -2905,7 +3117,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2905
3117
|
openapi: options.openapi
|
|
2906
3118
|
},
|
|
2907
3119
|
workflows: discoveredWorkflows,
|
|
2908
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
3120
|
+
plugins: _optionalChain([pm, 'optionalAccess', _204 => _204.getSortedPlugins, 'call', _205 => _205()])
|
|
2909
3121
|
});
|
|
2910
3122
|
res.statusCode = 200;
|
|
2911
3123
|
res.setHeader(
|
|
@@ -2929,7 +3141,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2929
3141
|
}
|
|
2930
3142
|
const isViteOwnedRequest = () => requestUrl.startsWith("/@") || requestUrl.startsWith("/node_modules/") || requestUrl.startsWith("/__farm/") || isViteModuleRequest(parsedRequestUrl, req.headers) || (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname.includes(".") && (devServableFileExists(requestPathname, [server.config.publicDir]) || isViteDevClientRequest(parsedRequestUrl, req.headers) && devServableFileExists(requestPathname, [server.config.root]));
|
|
2931
3143
|
const configRewriteSource = req[FARM_DEV_CONFIG_REWRITE_SOURCE];
|
|
2932
|
-
const runtimeHookErrorAnswersJSON = rendererDisabled ||
|
|
3144
|
+
const runtimeHookErrorAnswersJSON = rendererDisabled || _chunkKMYOKQPPcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath);
|
|
2933
3145
|
const requestedPagePathname = configRewriteSource === void 0 ? requestPathname : new URL(configRewriteSource).pathname;
|
|
2934
3146
|
let pageHookRouteMatch;
|
|
2935
3147
|
const pageHookRoute = () => {
|
|
@@ -2940,10 +3152,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2940
3152
|
render: {
|
|
2941
3153
|
pathname: pathname2,
|
|
2942
3154
|
method: requestMethod,
|
|
2943
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
2944
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3155
|
+
routePattern: _optionalChain([match, 'optionalAccess', _206 => _206.route, 'optionalAccess', _207 => _207.pattern]) || null,
|
|
3156
|
+
params: _optionalChain([match, 'optionalAccess', _208 => _208.params]) || {}
|
|
2945
3157
|
},
|
|
2946
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3158
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _209 => _209.layouts]) || []).map((layout) => layout.pattern)
|
|
2947
3159
|
};
|
|
2948
3160
|
return pageHookRouteMatch;
|
|
2949
3161
|
};
|
|
@@ -2978,13 +3190,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2978
3190
|
};
|
|
2979
3191
|
const meetsRequestedURLRoutes = configRewriteSource === void 0 && !deferredDottedRequests.has(req);
|
|
2980
3192
|
const routeRedirect = meetsRequestedURLRoutes ? farmApp.getRouteManager().matchRedirect(requestPathname, parsedRequestUrl.search) : null;
|
|
2981
|
-
if (meetsRequestedURLRoutes && (routeRedirect || pm && (configRoutePlugins.has(
|
|
3193
|
+
if (meetsRequestedURLRoutes && (routeRedirect || pm && (configRoutePlugins.has(_chunkXZPI44Q7cjs.FARM_CONFIG_HEADERS_PLUGIN_NAME) || configRedirectMatchers.length > 0)) && !isViteOwnedRequest()) {
|
|
2982
3194
|
let redirect = routeRedirect;
|
|
2983
3195
|
try {
|
|
2984
3196
|
if (pm) {
|
|
2985
3197
|
await pm.runHookParallelFiltered(
|
|
2986
3198
|
"beforeRequest",
|
|
2987
|
-
(plugin2) => plugin2.name ===
|
|
3199
|
+
(plugin2) => plugin2.name === _chunkXZPI44Q7cjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
2988
3200
|
req,
|
|
2989
3201
|
res
|
|
2990
3202
|
);
|
|
@@ -3010,7 +3222,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3010
3222
|
const redirectResponse = response;
|
|
3011
3223
|
try {
|
|
3012
3224
|
const metadataRoute = matchAppMetadataRoute(requestPathname);
|
|
3013
|
-
const kind = metadataRoute ? "asset" :
|
|
3225
|
+
const kind = metadataRoute ? "asset" : _chunkKMYOKQPPcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath) ? "api" : requestMethod === "GET" || requestMethod === "HEAD" ? "page" : "request";
|
|
3014
3226
|
response = await pm.runRuntimeRequest(
|
|
3015
3227
|
createRequestFromNodeRequest(req, parsedRequestUrl),
|
|
3016
3228
|
async () => {
|
|
@@ -3031,7 +3243,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3031
3243
|
}
|
|
3032
3244
|
}
|
|
3033
3245
|
const runAppMiddlewareForContentRoute = async () => {
|
|
3034
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
3246
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _210 => _210.hasMiddleware, 'call', _211 => _211()])) return false;
|
|
3035
3247
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3036
3248
|
return runFarmMiddlewareWithNavigation(
|
|
3037
3249
|
farmApp.getServerRenderer(),
|
|
@@ -3069,7 +3281,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3069
3281
|
return response.status;
|
|
3070
3282
|
};
|
|
3071
3283
|
const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
|
|
3072
|
-
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess',
|
|
3284
|
+
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _212 => _212.hasRuntimeHook, 'call', _213 => _213("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _214 => _214.hasMiddleware, 'call', _215 => _215()]) ? interceptFarmDevPageResponse({
|
|
3073
3285
|
req,
|
|
3074
3286
|
res,
|
|
3075
3287
|
pm,
|
|
@@ -3082,7 +3294,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3082
3294
|
urlPath: requestUrl,
|
|
3083
3295
|
pathname: requestPathname,
|
|
3084
3296
|
startTime: Date.now(),
|
|
3085
|
-
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall',
|
|
3297
|
+
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _216 => _216(status)]),
|
|
3086
3298
|
// The runtime reports a runtime.after failure itself.
|
|
3087
3299
|
emitError: async () => {
|
|
3088
3300
|
},
|
|
@@ -3093,7 +3305,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3093
3305
|
handled = await runAppMiddlewareForContentRoute();
|
|
3094
3306
|
} catch (error) {
|
|
3095
3307
|
if (runtimeHookErrorAnswersJSON || res.headersSent) {
|
|
3096
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3308
|
+
_optionalChain([interceptor, 'optionalAccess', _217 => _217.release, 'call', _218 => _218()]);
|
|
3097
3309
|
throw error;
|
|
3098
3310
|
}
|
|
3099
3311
|
if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
|
|
@@ -3101,10 +3313,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3101
3313
|
return true;
|
|
3102
3314
|
}
|
|
3103
3315
|
if (!handled) {
|
|
3104
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3316
|
+
_optionalChain([interceptor, 'optionalAccess', _219 => _219.release, 'call', _220 => _220()]);
|
|
3105
3317
|
return false;
|
|
3106
3318
|
}
|
|
3107
|
-
if (!_optionalChain([interceptor, 'optionalAccess',
|
|
3319
|
+
if (!_optionalChain([interceptor, 'optionalAccess', _221 => _221.isEnded, 'call', _222 => _222()])) _optionalChain([logResponse2, 'optionalCall', _223 => _223(res.statusCode || 200)]);
|
|
3108
3320
|
return true;
|
|
3109
3321
|
};
|
|
3110
3322
|
const serveBuiltInRoute = async (respond, {
|
|
@@ -3113,7 +3325,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3113
3325
|
label
|
|
3114
3326
|
} = {}) => {
|
|
3115
3327
|
const discard = async () => {
|
|
3116
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
3328
|
+
await _optionalChain([computed, 'optionalAccess', _224 => _224.body, 'optionalAccess', _225 => _225.cancel, 'call', _226 => _226(), 'access', _227 => _227.catch, 'call', _228 => _228(() => {
|
|
3117
3329
|
})]);
|
|
3118
3330
|
};
|
|
3119
3331
|
const sendRuntimeResponse = async (runtimeSession3, response2) => {
|
|
@@ -3130,9 +3342,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3130
3342
|
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
3131
3343
|
try {
|
|
3132
3344
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
3133
|
-
const route =
|
|
3345
|
+
const route = _chunkDM2YGTRHcjs.setFarmRouteLabel.call(void 0,
|
|
3134
3346
|
{ pathname: requestPathname },
|
|
3135
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
3347
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkDM2YGTRHcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
3136
3348
|
);
|
|
3137
3349
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
3138
3350
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -3170,7 +3382,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3170
3382
|
}
|
|
3171
3383
|
responding = true;
|
|
3172
3384
|
response = await respond(
|
|
3173
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
3385
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _229 => _229.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
3174
3386
|
);
|
|
3175
3387
|
} catch (error) {
|
|
3176
3388
|
if (!responding && !res.headersSent) {
|
|
@@ -3190,7 +3402,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3190
3402
|
else await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3191
3403
|
};
|
|
3192
3404
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
3193
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
3405
|
+
if (openAPIManager && _optionalChain([options, 'access', _230 => _230.openapi, 'optionalAccess', _231 => _231.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
3194
3406
|
const specManager = openAPIManager;
|
|
3195
3407
|
await serveBuiltInRoute(async () => {
|
|
3196
3408
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -3210,7 +3422,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3210
3422
|
});
|
|
3211
3423
|
return;
|
|
3212
3424
|
}
|
|
3213
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
3425
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _232 => _232.openapi, 'optionalAccess', _233 => _233.route])) {
|
|
3214
3426
|
const docsManager = openAPIManager;
|
|
3215
3427
|
await serveBuiltInRoute(
|
|
3216
3428
|
async () => {
|
|
@@ -3221,42 +3433,50 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3221
3433
|
);
|
|
3222
3434
|
return;
|
|
3223
3435
|
}
|
|
3224
|
-
if (_optionalChain([options, 'access',
|
|
3436
|
+
if (_optionalChain([options, 'access', _234 => _234.agent, 'optionalAccess', _235 => _235.manifest]) !== false && _chunkDM2YGTRHcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
3437
|
+
const manifestGuardCoversPath = (path7) => _chunkO2A6HE76cjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
3438
|
+
{
|
|
3439
|
+
config: farmConfig,
|
|
3440
|
+
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
3441
|
+
},
|
|
3442
|
+
path7,
|
|
3443
|
+
apiServerBasePath
|
|
3444
|
+
);
|
|
3225
3445
|
await serveBuiltInRoute(async () => {
|
|
3226
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
3227
|
-
const manifest = await
|
|
3446
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunk56HHUSR5cjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
3447
|
+
const manifest = await _chunkDM2YGTRHcjs.createFarmAppManifestResponse.call(void 0,
|
|
3228
3448
|
new Request(parsedRequestUrl, {
|
|
3229
3449
|
method: requestMethod,
|
|
3230
3450
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
3231
3451
|
}),
|
|
3232
3452
|
{
|
|
3233
|
-
...
|
|
3453
|
+
..._chunkDM2YGTRHcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
3234
3454
|
build: "development",
|
|
3235
3455
|
packages: farmAppPackages,
|
|
3236
3456
|
// Read again on each request; unchanged files come from a cache.
|
|
3237
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
3457
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _236 => _236.plugins, 'optionalAccess', _237 => _237.some, 'call', _238 => _238(({ name }) => name === "farm:webmcp")]) ? _chunk56HHUSR5cjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
3238
3458
|
}),
|
|
3239
3459
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
3240
3460
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
3241
|
-
guardCoversPath:
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3461
|
+
guardCoversPath: manifestGuardCoversPath,
|
|
3462
|
+
// A docs runtime's MCP server lists its tools when asked, read on each request.
|
|
3463
|
+
...farmDocsHandler ? {
|
|
3464
|
+
registeredMCP: (request) => _chunk2DOI6HLJcjs._listFarmRegisteredMCPServerTools.call(void 0, farmDocsHandler, request, {
|
|
3465
|
+
basePath: farmConfig.basePath,
|
|
3466
|
+
guardCoversPath: manifestGuardCoversPath
|
|
3467
|
+
})
|
|
3468
|
+
} : {}
|
|
3249
3469
|
}
|
|
3250
3470
|
);
|
|
3251
3471
|
return manifest;
|
|
3252
3472
|
});
|
|
3253
3473
|
return;
|
|
3254
3474
|
}
|
|
3255
|
-
if (_optionalChain([options, 'access',
|
|
3475
|
+
if (_optionalChain([options, 'access', _239 => _239.agent, 'optionalAccess', _240 => _240.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkDM2YGTRHcjs.FARM_API_CATALOG_PATH) {
|
|
3256
3476
|
await serveBuiltInRoute(
|
|
3257
|
-
() =>
|
|
3477
|
+
() => _chunkDM2YGTRHcjs.createFarmApiCatalogResponse.call(void 0,
|
|
3258
3478
|
requestMethod,
|
|
3259
|
-
|
|
3479
|
+
_chunkDM2YGTRHcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
3260
3480
|
new Request(parsedRequestUrl, {
|
|
3261
3481
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
3262
3482
|
})
|
|
@@ -3264,8 +3484,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3264
3484
|
);
|
|
3265
3485
|
return;
|
|
3266
3486
|
}
|
|
3267
|
-
if (_optionalChain([options, 'access',
|
|
3268
|
-
const aiCatalog =
|
|
3487
|
+
if (_optionalChain([options, 'access', _241 => _241.agent, 'optionalAccess', _242 => _242.aiCatalog]) !== false) {
|
|
3488
|
+
const aiCatalog = _chunkDM2YGTRHcjs.createFarmAiCatalogResponse.call(void 0,
|
|
3269
3489
|
new Request(parsedRequestUrl, {
|
|
3270
3490
|
method: requestMethod,
|
|
3271
3491
|
headers: {
|
|
@@ -3306,18 +3526,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3306
3526
|
headers: docsHeaders
|
|
3307
3527
|
});
|
|
3308
3528
|
const docsBodyInit = requestMethod === "GET" || requestMethod === "HEAD" ? {} : { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" };
|
|
3309
|
-
const
|
|
3529
|
+
const docsHandlerRequest = new Request(docsRequest, docsBodyInit);
|
|
3530
|
+
const registeredMCPCalls = await _chunk2DOI6HLJcjs._readFarmRegisteredMCPCalls.call(void 0,
|
|
3531
|
+
docsHandlerRequest,
|
|
3532
|
+
farmConfig.basePath
|
|
3533
|
+
);
|
|
3534
|
+
const docsResponse = await farmDocsHandler(docsHandlerRequest);
|
|
3310
3535
|
if (docsResponse) {
|
|
3311
|
-
const docsPage = _optionalChain([docsResponse, 'access',
|
|
3536
|
+
const docsPage = _optionalChain([docsResponse, 'access', _243 => _243.headers, 'access', _244 => _244.get, 'call', _245 => _245("content-type"), 'optionalAccess', _246 => _246.toLowerCase, 'call', _247 => _247(), 'access', _248 => _248.includes, 'call', _249 => _249("text/html")]);
|
|
3312
3537
|
await serveBuiltInRoute(
|
|
3313
3538
|
async (request) => {
|
|
3314
|
-
if (!docsPage)
|
|
3539
|
+
if (!docsPage) {
|
|
3540
|
+
const response = await wrapFarmDocsResponseWithLayouts(
|
|
3541
|
+
docsRequest,
|
|
3542
|
+
docsResponse
|
|
3543
|
+
);
|
|
3544
|
+
return _chunk4M5ESTJ2cjs._runWithCurrentRequest.call(void 0,
|
|
3545
|
+
request,
|
|
3546
|
+
() => _chunk2DOI6HLJcjs._observeFarmRegisteredMCPResponse.call(void 0, response, registeredMCPCalls)
|
|
3547
|
+
);
|
|
3548
|
+
}
|
|
3315
3549
|
const deploymentMismatch = _chunkNLBHLPEOcjs.getFarmDeploymentMismatch.call(void 0,
|
|
3316
3550
|
request,
|
|
3317
3551
|
farmConfig.deploymentId
|
|
3318
3552
|
);
|
|
3319
3553
|
if (deploymentMismatch) {
|
|
3320
|
-
await _optionalChain([docsResponse, 'access',
|
|
3554
|
+
await _optionalChain([docsResponse, 'access', _250 => _250.body, 'optionalAccess', _251 => _251.cancel, 'call', _252 => _252()]);
|
|
3321
3555
|
return _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
|
|
3322
3556
|
}
|
|
3323
3557
|
return _chunkNLBHLPEOcjs.withFarmDeploymentResponse.call(void 0,
|
|
@@ -3333,11 +3567,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3333
3567
|
{
|
|
3334
3568
|
kind: "docs",
|
|
3335
3569
|
computed: docsResponse,
|
|
3336
|
-
label:
|
|
3570
|
+
label: _chunkDM2YGTRHcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
3337
3571
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
3338
3572
|
{
|
|
3339
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3340
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3573
|
+
path: _optionalChain([farmConfig, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.entry]) || "/docs",
|
|
3574
|
+
roots: _optionalChain([farmConfig, 'access', _255 => _255.docs, 'optionalAccess', _256 => _256.roots, 'optionalAccess', _257 => _257.map, 'call', _258 => _258((root) => root.entry)]),
|
|
3341
3575
|
pages: await getFarmDocsPagePaths()
|
|
3342
3576
|
}
|
|
3343
3577
|
)
|
|
@@ -3346,8 +3580,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3346
3580
|
return;
|
|
3347
3581
|
}
|
|
3348
3582
|
}
|
|
3349
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
3350
|
-
const { createFarmNativeTreeResponse } = await import("./native-tree-
|
|
3583
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _259 => _259.headers, 'access', _260 => _260.accept, 'optionalAccess', _261 => _261.includes, 'call', _262 => _262(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
3584
|
+
const { createFarmNativeTreeResponse } = await import("./native-tree-TAPKR7QJ.cjs");
|
|
3351
3585
|
const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
3352
3586
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
3353
3587
|
request: new Request(fullUrl, {
|
|
@@ -3364,18 +3598,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3364
3598
|
});
|
|
3365
3599
|
await serveBuiltInRoute(() => treeResponse, {
|
|
3366
3600
|
computed: treeResponse,
|
|
3367
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
3601
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _263 => _263.getRouteManager, 'call', _264 => _264(), 'access', _265 => _265.matchRoute, 'call', _266 => _266(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _267 => _267.route, 'optionalAccess', _268 => _268.pattern]), () => ( null))
|
|
3368
3602
|
});
|
|
3369
3603
|
return;
|
|
3370
3604
|
}
|
|
3371
3605
|
const markdownRouteLabel = () => (
|
|
3372
3606
|
// On the route path, as production labels it: /fr/index.md is /index.md.
|
|
3373
|
-
|
|
3607
|
+
_chunkDM2YGTRHcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
3374
3608
|
toRoutePathname(requestPathname),
|
|
3375
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
3609
|
+
(page) => _optionalChain([farmApp, 'access', _269 => _269.getRouteManager, 'call', _270 => _270(), 'access', _271 => _271.matchRoute, 'call', _272 => _272(page), 'access', _273 => _273.route, 'optionalAccess', _274 => _274.pattern])
|
|
3376
3610
|
)
|
|
3377
3611
|
);
|
|
3378
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
3612
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunkVZKCGHWCcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
3379
3613
|
request: new Request(fullUrl, {
|
|
3380
3614
|
method: requestMethod,
|
|
3381
3615
|
headers: docsHeaders
|
|
@@ -3384,7 +3618,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3384
3618
|
routePathname: toRoutePathname,
|
|
3385
3619
|
resolveSource: async (pathname2) => {
|
|
3386
3620
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
3387
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
3621
|
+
const sourcePath = _optionalChain([match, 'access', _275 => _275.route, 'optionalAccess', _276 => _276.markdownSourcePath]) || (match.route && _chunkVZKCGHWCcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
3388
3622
|
if (!sourcePath) {
|
|
3389
3623
|
return null;
|
|
3390
3624
|
}
|
|
@@ -3416,7 +3650,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3416
3650
|
});
|
|
3417
3651
|
return;
|
|
3418
3652
|
}
|
|
3419
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
3653
|
+
const markdownResponse = viteModuleRequest ? null : await _chunkPG6ZIHKEcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
3420
3654
|
request: new Request(fullUrl, {
|
|
3421
3655
|
method: requestMethod,
|
|
3422
3656
|
headers: docsHeaders
|
|
@@ -3455,16 +3689,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3455
3689
|
});
|
|
3456
3690
|
return;
|
|
3457
3691
|
}
|
|
3458
|
-
if (!viteModuleRequest &&
|
|
3459
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
3692
|
+
if (!viteModuleRequest && _chunkPG6ZIHKEcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
3693
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkVZKCGHWCcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname, toRoutePathname));
|
|
3460
3694
|
if (!markdownRoute.route) {
|
|
3461
3695
|
await serveBuiltInRoute(
|
|
3462
3696
|
() => new Response(
|
|
3463
|
-
|
|
3697
|
+
_chunkPG6ZIHKEcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/"),
|
|
3464
3698
|
{
|
|
3465
3699
|
status: 404,
|
|
3466
3700
|
headers: {
|
|
3467
|
-
"Content-Type":
|
|
3701
|
+
"Content-Type": _chunkPG6ZIHKEcjs.FARM_MARKDOWN_CONTENT_TYPE,
|
|
3468
3702
|
"X-Farm-Markdown-Error": "404",
|
|
3469
3703
|
"Cache-Control": "no-store"
|
|
3470
3704
|
}
|
|
@@ -3474,7 +3708,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3474
3708
|
return;
|
|
3475
3709
|
}
|
|
3476
3710
|
}
|
|
3477
|
-
const markdownPageTarget =
|
|
3711
|
+
const markdownPageTarget = _chunkPG6ZIHKEcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
3478
3712
|
farmApp.getConfig().md,
|
|
3479
3713
|
requestPathname,
|
|
3480
3714
|
{
|
|
@@ -3525,7 +3759,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3525
3759
|
}
|
|
3526
3760
|
const configuredIntegrations = currentConfig.integrations;
|
|
3527
3761
|
const tryConfiguredIntegrationRoute = async () => {
|
|
3528
|
-
const matchedRoute =
|
|
3762
|
+
const matchedRoute = _chunk65OS2TOTcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3529
3763
|
pathname: requestPathname,
|
|
3530
3764
|
method: requestMethod
|
|
3531
3765
|
});
|
|
@@ -3539,8 +3773,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3539
3773
|
await pm.runHookParallelFiltered(
|
|
3540
3774
|
"beforeRequest",
|
|
3541
3775
|
(plugin2) => {
|
|
3542
|
-
const owner =
|
|
3543
|
-
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess',
|
|
3776
|
+
const owner = _chunk65OS2TOTcjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
|
|
3777
|
+
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _277 => _277.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
3544
3778
|
},
|
|
3545
3779
|
req,
|
|
3546
3780
|
res
|
|
@@ -3569,7 +3803,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3569
3803
|
});
|
|
3570
3804
|
const dispatchIntegration = async (request, runtime) => {
|
|
3571
3805
|
try {
|
|
3572
|
-
const result = await
|
|
3806
|
+
const result = await _chunk65OS2TOTcjs.dispatchIntegrationRequest.call(void 0,
|
|
3573
3807
|
{
|
|
3574
3808
|
integration: matchedRoute.integration,
|
|
3575
3809
|
config: currentConfig,
|
|
@@ -3577,7 +3811,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3577
3811
|
isProd: false
|
|
3578
3812
|
},
|
|
3579
3813
|
request,
|
|
3580
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
3814
|
+
{ clientAddress: _optionalChain([req, 'access', _278 => _278.socket, 'optionalAccess', _279 => _279.remoteAddress]) }
|
|
3581
3815
|
);
|
|
3582
3816
|
if (!result) {
|
|
3583
3817
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -3585,8 +3819,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3585
3819
|
return result;
|
|
3586
3820
|
} catch (error) {
|
|
3587
3821
|
_chunkQMNWKQL4cjs.logger.error(`Integration route error: ${error}`);
|
|
3588
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3589
|
-
return
|
|
3822
|
+
await _optionalChain([runtime, 'optionalAccess', _280 => _280.reportError, 'call', _281 => _281(error)]);
|
|
3823
|
+
return _chunkKMYOKQPPcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3590
3824
|
}
|
|
3591
3825
|
};
|
|
3592
3826
|
runtimeReportsErrors = Boolean(pm);
|
|
@@ -3627,25 +3861,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3627
3861
|
} else if (!res.writableEnded) {
|
|
3628
3862
|
res.statusCode = 500;
|
|
3629
3863
|
res.setHeader("Content-Type", "application/json");
|
|
3630
|
-
res.end(
|
|
3864
|
+
res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3631
3865
|
}
|
|
3632
3866
|
return true;
|
|
3633
3867
|
}
|
|
3634
3868
|
};
|
|
3635
|
-
if (pm && configRewriteSource === void 0 && configRoutePlugins.has(
|
|
3869
|
+
if (pm && configRewriteSource === void 0 && configRoutePlugins.has(_chunkXZPI44Q7cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME)) {
|
|
3636
3870
|
const hasLocalDevRoute = () => {
|
|
3637
3871
|
const routeManager3 = farmApp.getRouteManager();
|
|
3638
3872
|
return Boolean(
|
|
3639
|
-
|
|
3873
|
+
_chunk65OS2TOTcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3640
3874
|
pathname: requestPathname,
|
|
3641
3875
|
method: requestMethod
|
|
3642
|
-
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3876
|
+
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _282 => _282.isFarmDocsAPIRequest, 'call', _283 => _283(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
|
|
3643
3877
|
);
|
|
3644
3878
|
};
|
|
3645
3879
|
try {
|
|
3646
3880
|
await pm.runHookParallelFiltered(
|
|
3647
3881
|
"beforeRequest",
|
|
3648
|
-
(plugin2) => plugin2.name ===
|
|
3882
|
+
(plugin2) => plugin2.name === _chunkXZPI44Q7cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3649
3883
|
req,
|
|
3650
3884
|
res
|
|
3651
3885
|
);
|
|
@@ -3673,11 +3907,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3673
3907
|
}
|
|
3674
3908
|
const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
|
|
3675
3909
|
const hasMatchedApiRoute = Boolean(matchedApiRoute);
|
|
3676
|
-
if (hasMatchedApiRoute ||
|
|
3910
|
+
if (hasMatchedApiRoute || _chunkKMYOKQPPcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
|
|
3677
3911
|
const startTime2 = Date.now();
|
|
3678
3912
|
const method2 = req.method || "GET";
|
|
3679
3913
|
const urlPath2 = req.url || "/";
|
|
3680
|
-
const pathname2 =
|
|
3914
|
+
const pathname2 = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3681
3915
|
trustProxy: currentServerConfig.trustProxy
|
|
3682
3916
|
}).pathname;
|
|
3683
3917
|
try {
|
|
@@ -3702,7 +3936,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3702
3936
|
_chunkQMNWKQL4cjs.logger.error(`Request hook error: ${error}`);
|
|
3703
3937
|
res.statusCode = 500;
|
|
3704
3938
|
res.setHeader("Content-Type", "application/json");
|
|
3705
|
-
res.end(
|
|
3939
|
+
res.end(_chunkKMYOKQPPcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3706
3940
|
return;
|
|
3707
3941
|
}
|
|
3708
3942
|
const createAPIRequest = async () => {
|
|
@@ -3716,23 +3950,28 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3716
3950
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
3717
3951
|
body = await _chunkCFG4QERRcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
|
|
3718
3952
|
}
|
|
3719
|
-
return new Request(
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3953
|
+
return new Request(
|
|
3954
|
+
_chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3955
|
+
trustProxy: currentServerConfig.trustProxy
|
|
3956
|
+
}),
|
|
3957
|
+
{
|
|
3958
|
+
method: req.method,
|
|
3959
|
+
headers,
|
|
3960
|
+
body: toRequestBody(body),
|
|
3961
|
+
signal: _chunkCFG4QERRcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
3962
|
+
}
|
|
3963
|
+
);
|
|
3725
3964
|
};
|
|
3726
3965
|
const isDocsAPIRequest = Boolean(
|
|
3727
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3966
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _284 => _284.isFarmDocsAPIRequest, 'call', _285 => _285(pathname2)])
|
|
3728
3967
|
);
|
|
3729
3968
|
const docsRuntimeOptions = () => ({
|
|
3730
3969
|
kind: "docs",
|
|
3731
|
-
route:
|
|
3970
|
+
route: _chunkDM2YGTRHcjs.setFarmRouteLabel.call(void 0,
|
|
3732
3971
|
{ pathname: pathname2, pattern: urlPath2 },
|
|
3733
|
-
|
|
3734
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3735
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3972
|
+
_chunkDM2YGTRHcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
3973
|
+
path: _optionalChain([farmConfig, 'access', _286 => _286.docs, 'optionalAccess', _287 => _287.entry]) || "/docs",
|
|
3974
|
+
roots: _optionalChain([farmConfig, 'access', _288 => _288.docs, 'optionalAccess', _289 => _289.roots, 'optionalAccess', _290 => _290.map, 'call', _291 => _291((root) => root.entry)])
|
|
3736
3975
|
})
|
|
3737
3976
|
)
|
|
3738
3977
|
});
|
|
@@ -3807,14 +4046,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3807
4046
|
(_request, runtime) => handler(request, runtime)
|
|
3808
4047
|
) : pm ? pm.runRuntimeRequest(request, handler, options2) : handler(request);
|
|
3809
4048
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
3810
|
-
const routedPathname =
|
|
4049
|
+
const routedPathname = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3811
4050
|
trustProxy: currentServerConfig.trustProxy
|
|
3812
4051
|
}).pathname;
|
|
3813
4052
|
const rewritten = routedPathname !== pathname2;
|
|
3814
4053
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
3815
4054
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
3816
4055
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
3817
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
4056
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _292 => _292.route, 'access', _293 => _293.path]) || urlPath2;
|
|
3818
4057
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
3819
4058
|
type: "route.matched",
|
|
3820
4059
|
pathname: pathname2,
|
|
@@ -3864,8 +4103,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3864
4103
|
error
|
|
3865
4104
|
});
|
|
3866
4105
|
_chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
|
|
3867
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3868
|
-
response =
|
|
4106
|
+
await _optionalChain([runtime, 'optionalAccess', _294 => _294.reportError, 'call', _295 => _295(error)]);
|
|
4107
|
+
response = _chunkKMYOKQPPcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3869
4108
|
}
|
|
3870
4109
|
return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
|
|
3871
4110
|
};
|
|
@@ -3969,12 +4208,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3969
4208
|
}
|
|
3970
4209
|
return;
|
|
3971
4210
|
}
|
|
3972
|
-
if (_optionalChain([req, 'access',
|
|
4211
|
+
if (_optionalChain([req, 'access', _296 => _296.url, 'optionalAccess', _297 => _297.startsWith, 'call', _298 => _298("/@")]) || _optionalChain([req, 'access', _299 => _299.url, 'optionalAccess', _300 => _300.startsWith, 'call', _301 => _301("/node_modules")])) {
|
|
3973
4212
|
return next();
|
|
3974
4213
|
}
|
|
3975
4214
|
if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
|
|
3976
4215
|
requestPathname,
|
|
3977
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4216
|
+
_optionalChain([farmApp, 'optionalAccess', _302 => _302.getRouteManager, 'call', _303 => _303()]),
|
|
3978
4217
|
[server.config.publicDir, server.config.root],
|
|
3979
4218
|
farmAgentGeneratedPaths(farmConfig),
|
|
3980
4219
|
requestMethod
|
|
@@ -3982,7 +4221,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3982
4221
|
if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
|
|
3983
4222
|
return next();
|
|
3984
4223
|
}
|
|
3985
|
-
if (_optionalChain([req, 'access',
|
|
4224
|
+
if (_optionalChain([req, 'access', _304 => _304.url, 'optionalAccess', _305 => _305.startsWith, 'call', _306 => _306("/__farm/page-data")])) {
|
|
3986
4225
|
const urlObj = parsedRequestUrl;
|
|
3987
4226
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
3988
4227
|
let renderedRequest;
|
|
@@ -4012,7 +4251,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4012
4251
|
renderedRequest = targetRequest;
|
|
4013
4252
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
4014
4253
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
4015
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4254
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _307 => _307.hasMiddleware, 'call', _308 => _308()])) {
|
|
4016
4255
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
4017
4256
|
const targetNodeResponse = createPageDataMiddlewareResponse(res);
|
|
4018
4257
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
@@ -4046,10 +4285,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4046
4285
|
if (pm) {
|
|
4047
4286
|
await pm.runHookParallel("afterRouteMatch", {
|
|
4048
4287
|
pathname: targetPath,
|
|
4049
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
4050
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
4051
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4052
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
4288
|
+
matched: !!_optionalChain([match, 'optionalAccess', _309 => _309.route]),
|
|
4289
|
+
routePattern: _optionalChain([match, 'optionalAccess', _310 => _310.route, 'optionalAccess', _311 => _311.pattern]) || null,
|
|
4290
|
+
params: _optionalChain([match, 'optionalAccess', _312 => _312.params]) || {},
|
|
4291
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _313 => _313.layouts]) || []).map((l) => l.pattern)
|
|
4053
4292
|
});
|
|
4054
4293
|
}
|
|
4055
4294
|
if (!match) {
|
|
@@ -4072,7 +4311,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4072
4311
|
);
|
|
4073
4312
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
4074
4313
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
4075
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
4314
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
4076
4315
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
4077
4316
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
4078
4317
|
let mergedMetadata = {};
|
|
@@ -4080,7 +4319,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4080
4319
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
4081
4320
|
);
|
|
4082
4321
|
const layoutHydrationMetadata = layouts.map(
|
|
4083
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
4322
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
4084
4323
|
);
|
|
4085
4324
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
4086
4325
|
(metadata) => metadata.shouldHydrate
|
|
@@ -4092,17 +4331,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4092
4331
|
)
|
|
4093
4332
|
];
|
|
4094
4333
|
const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
|
|
4095
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4096
|
-
) === "islands" ?
|
|
4334
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _314 => _314.getConfig, 'call', _315 => _315()]), () => ( options))), 'access', _316 => _316.experimental, 'optionalAccess', _317 => _317.serverComponents])
|
|
4335
|
+
) === "islands" ? _chunk56HHUSR5cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
4097
4336
|
route,
|
|
4098
4337
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
4099
4338
|
layouts.map((layout, index) => ({
|
|
4100
4339
|
pattern: layout.pattern,
|
|
4101
4340
|
modulePath: layout.modulePath,
|
|
4102
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4341
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _318 => _318[index], 'optionalAccess', _319 => _319.shouldHydrate]) === true,
|
|
4103
4342
|
// Manifest entries carry it; metadata read from source does not.
|
|
4104
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4105
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
4343
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _320 => _320[index], 'optionalAccess', _321 => _321.hasIsolatedClientBoundaries]) === true,
|
|
4344
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _322 => _322[index], 'optionalAccess', _323 => _323.islandStrategy]), () => ( null))
|
|
4106
4345
|
})),
|
|
4107
4346
|
server.config.root,
|
|
4108
4347
|
true
|
|
@@ -4150,7 +4389,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4150
4389
|
mergedMetadata = await _chunk6IOZPJ3Icjs.mergeModuleViewport.call(void 0, mergedMetadata, routeModule, routeProps);
|
|
4151
4390
|
mergedMetadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
|
|
4152
4391
|
mergedMetadata,
|
|
4153
|
-
|
|
4392
|
+
_chunkPG6ZIHKEcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname, {
|
|
4154
4393
|
routePathname: (pathname2) => routeManager3.toRoutePathname(pathname2)
|
|
4155
4394
|
})
|
|
4156
4395
|
);
|
|
@@ -4159,7 +4398,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4159
4398
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
4160
4399
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
4161
4400
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
4162
|
-
), () => (
|
|
4401
|
+
), () => ( _chunkNXGQIXR7cjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
4163
4402
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
4164
4403
|
request: targetRequest,
|
|
4165
4404
|
params: slot.params,
|
|
@@ -4205,15 +4444,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4205
4444
|
);
|
|
4206
4445
|
const projectRoot = server.config.root;
|
|
4207
4446
|
const toUrlPath = (absolutePath) => _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
|
|
4208
|
-
const renderPlan =
|
|
4447
|
+
const renderPlan = _chunkO2A6HE76cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
4209
4448
|
pageShouldHydrate: shouldHydrate,
|
|
4210
4449
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
4211
4450
|
islandStrategy: hydrationIslandStrategy,
|
|
4212
|
-
rendering:
|
|
4451
|
+
rendering: _chunkACAEFEOHcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
4213
4452
|
});
|
|
4214
4453
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
4215
|
-
const layoutStartIndex =
|
|
4216
|
-
|
|
4454
|
+
const layoutStartIndex = _chunkO2A6HE76cjs.getSharedLayoutPrefixLength.call(void 0,
|
|
4455
|
+
_chunkO2A6HE76cjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
4217
4456
|
destinationLayoutPatterns
|
|
4218
4457
|
);
|
|
4219
4458
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -4223,7 +4462,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4223
4462
|
middlewareContext,
|
|
4224
4463
|
() => renderer.renderNavigationFragment({
|
|
4225
4464
|
PageComponent: routeModule.default,
|
|
4226
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
4465
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _324 => _324.default]),
|
|
4227
4466
|
pageProps: routeProps,
|
|
4228
4467
|
params,
|
|
4229
4468
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -4294,7 +4533,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4294
4533
|
{
|
|
4295
4534
|
status: 200,
|
|
4296
4535
|
headers: {
|
|
4297
|
-
"Cache-Control":
|
|
4536
|
+
"Cache-Control": _chunkO2A6HE76cjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
4298
4537
|
"X-Farm-Navigation": "html-fragment",
|
|
4299
4538
|
Vary: "X-Farm-Layout-Chain",
|
|
4300
4539
|
[_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -4332,33 +4571,33 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4332
4571
|
const startTime = Date.now();
|
|
4333
4572
|
const method = req.method || "GET";
|
|
4334
4573
|
const urlPath = req.url || "/";
|
|
4335
|
-
const requestedPathname =
|
|
4574
|
+
const requestedPathname = _chunk4M5ESTJ2cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
4336
4575
|
trustProxy: currentServerConfig.trustProxy
|
|
4337
4576
|
}).pathname;
|
|
4338
4577
|
const routeManager2 = farmApp.getRouteManager();
|
|
4339
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4340
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4341
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4578
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _325 => _325.hasHook, 'call', _326 => _326("beforeRequest")]), () => ( false));
|
|
4579
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _327 => _327.hasHook, 'call', _328 => _328("afterResponse")]), () => ( false));
|
|
4580
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _329 => _329.hasHook, 'call', _330 => _330("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _331 => _331.hasHook, 'call', _332 => _332("afterRender")]), () => ( false)));
|
|
4342
4581
|
const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
|
|
4343
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4582
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _333 => _333.hasRuntimeHook, 'call', _334 => _334("after")]), () => ( false));
|
|
4344
4583
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
4345
4584
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
4346
|
-
const mcpLabel =
|
|
4585
|
+
const mcpLabel = _chunkDM2YGTRHcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
4347
4586
|
if (mcpLabel) return mcpLabel;
|
|
4348
4587
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
4349
|
-
return routePathname ===
|
|
4588
|
+
return routePathname === _chunkVKRMO3EZcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkVKRMO3EZcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
4350
4589
|
};
|
|
4351
4590
|
const pageRuntimeOptions = (pathname2) => {
|
|
4352
4591
|
const match = routeManager2.matchRoute(pathname2);
|
|
4353
4592
|
return {
|
|
4354
4593
|
kind: "page",
|
|
4355
|
-
route:
|
|
4594
|
+
route: _chunkDM2YGTRHcjs.setFarmRouteLabel.call(void 0,
|
|
4356
4595
|
{
|
|
4357
4596
|
pathname: pathname2,
|
|
4358
|
-
pattern: _optionalChain([match, 'optionalAccess',
|
|
4359
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4597
|
+
pattern: _optionalChain([match, 'optionalAccess', _335 => _335.route, 'optionalAccess', _336 => _336.pattern]) || null,
|
|
4598
|
+
params: _optionalChain([match, 'optionalAccess', _337 => _337.params]) || {}
|
|
4360
4599
|
},
|
|
4361
|
-
_optionalChain([match, 'optionalAccess',
|
|
4600
|
+
_optionalChain([match, 'optionalAccess', _338 => _338.route]) ? null : pageBuiltInRouteLabel(pathname2)
|
|
4362
4601
|
)
|
|
4363
4602
|
};
|
|
4364
4603
|
};
|
|
@@ -4438,7 +4677,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4438
4677
|
}) : void 0;
|
|
4439
4678
|
let middlewareFailed = false;
|
|
4440
4679
|
try {
|
|
4441
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4680
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _339 => _339.hasMiddleware, 'call', _340 => _340()])) {
|
|
4442
4681
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
4443
4682
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
4444
4683
|
farmApp.getServerRenderer(),
|
|
@@ -4451,7 +4690,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4451
4690
|
throw error;
|
|
4452
4691
|
});
|
|
4453
4692
|
if (handled) {
|
|
4454
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4693
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _341 => _341.isEnded, 'call', _342 => _342()])) {
|
|
4455
4694
|
const duration = Date.now() - startTime;
|
|
4456
4695
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4457
4696
|
}
|
|
@@ -4466,8 +4705,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4466
4705
|
res
|
|
4467
4706
|
);
|
|
4468
4707
|
}
|
|
4469
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
4470
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4708
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _343 => _343.isEnded, 'call', _344 => _344()])) {
|
|
4709
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _345 => _345.isEnded, 'call', _346 => _346()])) {
|
|
4471
4710
|
const duration = Date.now() - startTime;
|
|
4472
4711
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4473
4712
|
}
|
|
@@ -4486,8 +4725,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4486
4725
|
await pm.reportRuntimeRequestError(runtimeSession, error);
|
|
4487
4726
|
} else {
|
|
4488
4727
|
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4489
|
-
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4490
|
-
_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4728
|
+
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _347 => _347.isEnded, 'call', _348 => _348()])) {
|
|
4729
|
+
_optionalChain([responseInterceptor, 'optionalAccess', _349 => _349.release, 'call', _350 => _350()]);
|
|
4491
4730
|
console.error("[FARM] Page error:", error);
|
|
4492
4731
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4493
4732
|
return;
|
|
@@ -4504,7 +4743,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4504
4743
|
}
|
|
4505
4744
|
})
|
|
4506
4745
|
);
|
|
4507
|
-
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access',
|
|
4746
|
+
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _351 => _351.stack, 'access', _352 => _352.at, 'call', _353 => _353(-1), 'optionalAccess', _354 => _354.handle]);
|
|
4508
4747
|
if (farmOwnsDevCors && viteServer.config.server.cors === false) {
|
|
4509
4748
|
farmMiddlewares.use(createFarmDevViteCorsMiddleware());
|
|
4510
4749
|
}
|
|
@@ -4518,7 +4757,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4518
4757
|
}
|
|
4519
4758
|
if (!rendererDisabled) return next();
|
|
4520
4759
|
const requested = _nullishCoalesce(_nullishCoalesce(req.originalUrl, () => ( req.url)), () => ( "/"));
|
|
4521
|
-
const pathname =
|
|
4760
|
+
const pathname = _chunk4M5ESTJ2cjs.parseFarmRequestTarget.call(void 0, requested, "http://localhost").pathname;
|
|
4522
4761
|
res.statusCode = 404;
|
|
4523
4762
|
res.setHeader("Content-Type", "application/json");
|
|
4524
4763
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
@@ -4533,7 +4772,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4533
4772
|
});
|
|
4534
4773
|
}
|
|
4535
4774
|
if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
|
|
4536
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
4775
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _355 => _355.getConfig, 'call', _356 => _356(), 'access', _357 => _357.root]) || _optionalChain([server, 'optionalAccess', _358 => _358.config, 'access', _359 => _359.root]) || options.root;
|
|
4537
4776
|
return this.resolve(id, path6.join(root, "package.json"), {
|
|
4538
4777
|
...resolveOptions,
|
|
4539
4778
|
skipSelf: true
|
|
@@ -4561,7 +4800,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4561
4800
|
}
|
|
4562
4801
|
},
|
|
4563
4802
|
async load(id, loadOptions) {
|
|
4564
|
-
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess',
|
|
4803
|
+
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _360 => _360.ssr]) && !farmSetupContext.getStore()) {
|
|
4565
4804
|
await pendingClientSetup;
|
|
4566
4805
|
}
|
|
4567
4806
|
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
@@ -4579,8 +4818,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4579
4818
|
if (imageModule) return imageModule;
|
|
4580
4819
|
}
|
|
4581
4820
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4582
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
4583
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
4821
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _361 => _361.getConfig, 'call', _362 => _362(), 'access', _363 => _363.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4822
|
+
const root = _optionalChain([server, 'optionalAccess', _364 => _364.config, 'access', _365 => _365.root]) || options.root;
|
|
4584
4823
|
if (isClientEnvironment(this, loadOptions)) {
|
|
4585
4824
|
return generateProgrammaticClientRouteModuleForId(
|
|
4586
4825
|
id,
|
|
@@ -4596,65 +4835,65 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4596
4835
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
4597
4836
|
}
|
|
4598
4837
|
if (isFarmClientVirtualId(id)) {
|
|
4599
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4600
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4601
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4602
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4603
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4838
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _366 => _366.getConfig, 'call', _367 => _367()]);
|
|
4839
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _368 => _368.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4840
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _369 => _369.integrations]) || options.integrations;
|
|
4841
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _370 => _370.root]) || _optionalChain([server, 'optionalAccess', _371 => _371.config, 'access', _372 => _372.root]) || process.cwd();
|
|
4842
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _373 => _373.docs]);
|
|
4604
4843
|
const adapterOwnsDocsRuntime = Boolean(
|
|
4605
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
4844
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _374 => _374.adapter, 'optionalAccess', _375 => _375.server]) && docs.adapter.react
|
|
4606
4845
|
);
|
|
4607
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4846
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _376 => _376.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4608
4847
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
4609
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4610
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4848
|
+
_optionalChain([docs, 'optionalAccess', _377 => _377.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
4849
|
+
_optionalChain([docs, 'optionalAccess', _378 => _378.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
4611
4850
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
4612
4851
|
]);
|
|
4613
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
4852
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _379 => _379.isFarmDocsSearchEnabled, 'call', _380 => _380(docs)]), () => ( false));
|
|
4614
4853
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
4615
4854
|
docsSearchEnabled,
|
|
4616
4855
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
4617
4856
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
4618
4857
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
4619
4858
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
4620
|
-
const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ?
|
|
4621
|
-
const isolatedHydrationMode =
|
|
4622
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4859
|
+
const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunk65OS2TOTcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
4860
|
+
const isolatedHydrationMode = _chunkNXGQIXR7cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
4861
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _381 => _381.experimental, 'optionalAccess', _382 => _382.isolatedClientHydration]),
|
|
4623
4862
|
{
|
|
4624
|
-
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4863
|
+
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _383 => _383.experimental, 'optionalAccess', _384 => _384.serverComponents])) === "rsc",
|
|
4625
4864
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
4626
4865
|
}
|
|
4627
4866
|
);
|
|
4628
4867
|
return generateClientCode(
|
|
4629
4868
|
integrationProviders,
|
|
4630
4869
|
[
|
|
4631
|
-
...
|
|
4632
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
4870
|
+
..._chunk65OS2TOTcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
4871
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _385 => _385.getFarmDocsDocumentNavigationMatchers, 'call', _386 => _386(docs)]), () => ( []))
|
|
4633
4872
|
],
|
|
4634
4873
|
generatedDocsSearchRuntime,
|
|
4635
4874
|
`${generatedDevtoolsClientRuntime}
|
|
4636
4875
|
${generatedDevIndicatorsClientRuntime}`,
|
|
4637
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4876
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _387 => _387.plugins]) || [],
|
|
4638
4877
|
root,
|
|
4639
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4640
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4641
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
4878
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _388 => _388.srcDir]) || options.srcDir || "src",
|
|
4879
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _389 => _389.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
4880
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _390 => _390.adapter, 'optionalAccess', _391 => _391.react]) : void 0,
|
|
4642
4881
|
renderer,
|
|
4643
|
-
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4644
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4645
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4646
|
-
|
|
4647
|
-
|
|
4882
|
+
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _392 => _392.getRouteManager, 'call', _393 => _393(), 'access', _394 => _394.getIsolatedClientBoundaryModules, 'call', _395 => _395(root)])))), 'optionalAccess', _396 => _396.size]) > 0,
|
|
4883
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _397 => _397.trailingSlash]), () => ( false)),
|
|
4884
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _398 => _398.basePath]), () => ( "/")),
|
|
4885
|
+
_chunk56HHUSR5cjs.generateClientCachePersistenceCode.call(void 0,
|
|
4886
|
+
_chunk56HHUSR5cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _399 => _399.cache]))
|
|
4648
4887
|
),
|
|
4649
4888
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
4650
|
-
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4889
|
+
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _400 => _400.experimental, 'optionalAccess', _401 => _401.serverComponents])) === "islands"
|
|
4651
4890
|
);
|
|
4652
4891
|
}
|
|
4653
4892
|
if (id === "/@farm/server") {
|
|
4654
4893
|
return generateServerCode();
|
|
4655
4894
|
}
|
|
4656
4895
|
if (id === "/@farm/manifest") {
|
|
4657
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4896
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _402 => _402.getRouteManager, 'call', _403 => _403()]);
|
|
4658
4897
|
if (!routeManager) {
|
|
4659
4898
|
return `
|
|
4660
4899
|
export const getManifest = () => ({
|
|
@@ -4666,11 +4905,11 @@ export const getManifest = () => ({
|
|
|
4666
4905
|
});
|
|
4667
4906
|
`;
|
|
4668
4907
|
}
|
|
4669
|
-
const globalStylesheetHref =
|
|
4908
|
+
const globalStylesheetHref = _chunk56HHUSR5cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
4670
4909
|
server.config.root,
|
|
4671
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4910
|
+
_optionalChain([farmApp, 'optionalAccess', _404 => _404.getConfig, 'call', _405 => _405(), 'access', _406 => _406.srcDir])
|
|
4672
4911
|
);
|
|
4673
|
-
const fullManifest =
|
|
4912
|
+
const fullManifest = _chunk56HHUSR5cjs.createFarmDevClientManifest.call(void 0,
|
|
4674
4913
|
routeManager.generateClientManifest(server.config.root),
|
|
4675
4914
|
{
|
|
4676
4915
|
sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
|
|
@@ -4686,109 +4925,120 @@ export { manifest };
|
|
|
4686
4925
|
}
|
|
4687
4926
|
},
|
|
4688
4927
|
async transform(code, id, transformOptions) {
|
|
4689
|
-
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess',
|
|
4928
|
+
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _407 => _407.ssr]) && !farmSetupContext.getStore()) {
|
|
4690
4929
|
await pendingClientSetup;
|
|
4691
4930
|
}
|
|
4692
|
-
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess',
|
|
4693
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4931
|
+
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _408 => _408.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
|
|
4932
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _409 => _409.getConfig, 'call', _410 => _410()]), () => ( options));
|
|
4694
4933
|
let rewrotePackageImports = false;
|
|
4695
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4934
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _411 => _411.experimental, 'optionalAccess', _412 => _412.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _413 => _413.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkNXGQIXR7cjs.hasUseClientDirective.call(void 0, code)) {
|
|
4696
4935
|
const file = id.split("?", 1)[0];
|
|
4697
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4936
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _414 => _414.config, 'access', _415 => _415.root]) || process.cwd();
|
|
4937
|
+
const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
|
|
4938
|
+
const rewrite = () => {
|
|
4939
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _416 => _416.ssr]) === true) {
|
|
4940
|
+
if (farmReactServerFiles.has(file)) {
|
|
4941
|
+
for (const child of _chunkNXGQIXR7cjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
4942
|
+
farmReactServerFiles.add(child);
|
|
4943
|
+
}
|
|
4944
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkNXGQIXR7cjs.getFarmClientReachableModules.call(void 0,
|
|
4945
|
+
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
4946
|
+
projectRoot
|
|
4947
|
+
).has(path6.resolve(file));
|
|
4948
|
+
const reactServer = !serverModule ? null : _chunkNXGQIXR7cjs.rewriteFarmReactServerImports.call(void 0, {
|
|
4949
|
+
code,
|
|
4950
|
+
file,
|
|
4951
|
+
reference: (specifier, exportName) => _chunkNXGQIXR7cjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
|
|
4952
|
+
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
4953
|
+
});
|
|
4954
|
+
if (reactServer !== null) {
|
|
4955
|
+
code = reactServer;
|
|
4956
|
+
rewrotePackageImports = true;
|
|
4957
|
+
}
|
|
4958
|
+
const internal = farmReactServerFiles.has(file) ? _chunkNXGQIXR7cjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
|
|
4959
|
+
code,
|
|
4960
|
+
file,
|
|
4961
|
+
reference: (clientFile) => _chunkNXGQIXR7cjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
4962
|
+
}) : null;
|
|
4963
|
+
if (internal !== null) {
|
|
4964
|
+
code = internal;
|
|
4965
|
+
rewrotePackageImports = true;
|
|
4966
|
+
}
|
|
4702
4967
|
}
|
|
4703
|
-
const
|
|
4704
|
-
|
|
4705
|
-
projectRoot
|
|
4706
|
-
).has(path6.resolve(file));
|
|
4707
|
-
const reactServer = !serverModule ? null : _chunkHTXKSREFcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
4708
|
-
code,
|
|
4968
|
+
const rewritePackageImports = (source2) => _chunkNXGQIXR7cjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
4969
|
+
code: source2,
|
|
4709
4970
|
file,
|
|
4710
|
-
|
|
4711
|
-
|
|
4971
|
+
root: projectRoot,
|
|
4972
|
+
isClientPackage: (specifier) => _chunkNXGQIXR7cjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
4712
4973
|
});
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
code,
|
|
4719
|
-
file,
|
|
4720
|
-
reference: (clientFile) => _chunkHTXKSREFcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
4721
|
-
}) : null;
|
|
4722
|
-
if (internal !== null) {
|
|
4723
|
-
code = internal;
|
|
4974
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _417 => _417.getRouteManager, 'call', _418 => _418()]);
|
|
4975
|
+
const source = code;
|
|
4976
|
+
const referenced = routeManager ? routeManager.inspectPackages(() => rewritePackageImports(source)) : rewritePackageImports(source);
|
|
4977
|
+
if (referenced !== null) {
|
|
4978
|
+
code = referenced;
|
|
4724
4979
|
rewrotePackageImports = true;
|
|
4725
4980
|
}
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
if (referenced !== null) {
|
|
4737
|
-
code = referenced;
|
|
4738
|
-
rewrotePackageImports = true;
|
|
4739
|
-
}
|
|
4740
|
-
if (_optionalChain([transformOptions, 'optionalAccess', _411 => _411.ssr]) === true) {
|
|
4741
|
-
const cached = rewriteFarmReactCacheImport(
|
|
4742
|
-
code,
|
|
4743
|
-
file,
|
|
4744
|
-
_optionalChain([runtimeModule, 'optionalCall', _412 => _412(FARM_REACT_CACHE_MODULE)])
|
|
4745
|
-
);
|
|
4746
|
-
if (cached !== null) {
|
|
4747
|
-
code = cached;
|
|
4748
|
-
rewrotePackageImports = true;
|
|
4981
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _419 => _419.ssr]) === true) {
|
|
4982
|
+
const cached = rewriteFarmReactCacheImport(
|
|
4983
|
+
code,
|
|
4984
|
+
file,
|
|
4985
|
+
_optionalChain([runtimeModule, 'optionalCall', _420 => _420(FARM_REACT_CACHE_MODULE)])
|
|
4986
|
+
);
|
|
4987
|
+
if (cached !== null) {
|
|
4988
|
+
code = cached;
|
|
4989
|
+
rewrotePackageImports = true;
|
|
4990
|
+
}
|
|
4749
4991
|
}
|
|
4750
|
-
}
|
|
4992
|
+
};
|
|
4993
|
+
if (buildSnapshot) _chunkNXGQIXR7cjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
|
|
4994
|
+
else rewrite();
|
|
4751
4995
|
}
|
|
4752
4996
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4753
4997
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
4754
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
4998
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _421 => _421.ssr]) === true ? "rsc" : "client"
|
|
4755
4999
|
});
|
|
4756
5000
|
if (serverFns) {
|
|
4757
5001
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
4758
5002
|
code = serverFns.code;
|
|
4759
5003
|
}
|
|
4760
5004
|
}
|
|
4761
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
5005
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _422 => _422.experimental, 'optionalAccess', _423 => _423.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4762
5006
|
const file = id.split("?", 1)[0];
|
|
4763
5007
|
const actionModule = transformFarmFormActionModule({
|
|
4764
5008
|
code,
|
|
4765
5009
|
id,
|
|
4766
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4767
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
5010
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _424 => _424.config, 'access', _425 => _425.root]) || process.cwd(),
|
|
5011
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _426 => _426.ssr]) === true,
|
|
4768
5012
|
// Parsed by file type: page components are TSX.
|
|
4769
5013
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program,
|
|
4770
5014
|
runtimeModule
|
|
4771
5015
|
});
|
|
4772
5016
|
if (actionModule) return { code: actionModule, map: null };
|
|
4773
5017
|
}
|
|
4774
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4775
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
4776
|
-
if (
|
|
4777
|
-
const redacted =
|
|
5018
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _427 => _427.ssr])) {
|
|
5019
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _428 => _428.getConfig, 'call', _429 => _429(), 'optionalAccess', _430 => _430.docs]));
|
|
5020
|
+
if (_chunk56HHUSR5cjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
5021
|
+
const redacted = _chunk56HHUSR5cjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
4778
5022
|
if (redacted !== null) return { code: redacted, map: null };
|
|
4779
5023
|
}
|
|
4780
5024
|
}
|
|
4781
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4782
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4783
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
5025
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _431 => _431.ssr])) {
|
|
5026
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _432 => _432.getConfig, 'call', _433 => _433()]), () => ( options));
|
|
5027
|
+
if ((_optionalChain([currentConfig, 'access', _434 => _434.experimental, 'optionalAccess', _435 => _435.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
4784
5028
|
const violation = findClientServerFnViolation(code, id);
|
|
4785
5029
|
if (violation) {
|
|
4786
|
-
|
|
5030
|
+
const locate = _chunkNXGQIXR7cjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
|
|
5031
|
+
this.error(
|
|
5032
|
+
_chunkNXGQIXR7cjs.formatFarmDiagnostic.call(void 0,
|
|
5033
|
+
createServerFnBoundaryDiagnostic(violation, id, locate(violation.start)),
|
|
5034
|
+
currentConfig.root
|
|
5035
|
+
)
|
|
5036
|
+
);
|
|
4787
5037
|
}
|
|
4788
5038
|
}
|
|
4789
5039
|
}
|
|
4790
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4791
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5040
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _436 => _436.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
5041
|
+
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _437 => _437.getConfig, 'call', _438 => _438()]), () => ( options)));
|
|
4792
5042
|
}
|
|
4793
5043
|
if (typeof imageImports.transform === "function") {
|
|
4794
5044
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -4803,13 +5053,13 @@ export { manifest };
|
|
|
4803
5053
|
id,
|
|
4804
5054
|
transformOptions
|
|
4805
5055
|
);
|
|
4806
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
5056
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _439 => _439.code, 'optionalAccess', _440 => _440.toString, 'call', _441 => _441()]);
|
|
4807
5057
|
if (fontCode) {
|
|
4808
5058
|
transformedCode = fontCode;
|
|
4809
5059
|
transformed = true;
|
|
4810
5060
|
}
|
|
4811
5061
|
}
|
|
4812
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5062
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _442 => _442.ssr]) && server) {
|
|
4813
5063
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
4814
5064
|
code: transformedCode,
|
|
4815
5065
|
id,
|
|
@@ -4821,26 +5071,26 @@ export { manifest };
|
|
|
4821
5071
|
transformed = true;
|
|
4822
5072
|
}
|
|
4823
5073
|
}
|
|
4824
|
-
if (
|
|
5074
|
+
if (_chunkNXGQIXR7cjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
4825
5075
|
const clientBoundarySource = transformedCode;
|
|
4826
5076
|
const moduleInfo = this.getModuleInfo(id);
|
|
4827
5077
|
if (moduleInfo) {
|
|
4828
5078
|
moduleInfo.isClientComponent = true;
|
|
4829
5079
|
}
|
|
4830
|
-
transformedCode =
|
|
5080
|
+
transformedCode = _chunkNXGQIXR7cjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
4831
5081
|
transformed = true;
|
|
4832
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5082
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _443 => _443.getConfig, 'call', _444 => _444()]), () => ( options));
|
|
4833
5083
|
let isolatedModuleReference = null;
|
|
4834
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5084
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _445 => _445.config, 'access', _446 => _446.root]) || process.cwd();
|
|
4835
5085
|
const cleanId = id.split("?", 1)[0];
|
|
4836
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4837
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
4838
|
-
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (
|
|
4839
|
-
cleanId.replace(/\\/g, "/").includes(
|
|
5086
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _447 => _447.getRouteManager, 'call', _448 => _448(), 'access', _449 => _449.getIsolatedClientBoundaryModules, 'call', _450 => _450(root)])));
|
|
5087
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _451 => _451.has, 'call', _452 => _452(path6.resolve(cleanId))]) === true;
|
|
5088
|
+
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkNXGQIXR7cjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
5089
|
+
cleanId.replace(/\\/g, "/").includes(_chunkNXGQIXR7cjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
4840
5090
|
isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
|
|
4841
|
-
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
4842
|
-
const explicitStrategy =
|
|
4843
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
5091
|
+
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _453 => _453.experimental, 'optionalAccess', _454 => _454.serverComponents])) === "islands";
|
|
5092
|
+
const explicitStrategy = _chunkNXGQIXR7cjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
5093
|
+
const inference = islandsMode && explicitStrategy === null ? _chunk56HHUSR5cjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
4844
5094
|
if (inference) {
|
|
4845
5095
|
for (const file of inference.files) {
|
|
4846
5096
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -4853,8 +5103,8 @@ export { manifest };
|
|
|
4853
5103
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
4854
5104
|
parse: (source) => this.parse(source),
|
|
4855
5105
|
slots: islandsMode,
|
|
4856
|
-
browser: _optionalChain([transformOptions, 'optionalAccess',
|
|
4857
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
5106
|
+
browser: _optionalChain([transformOptions, 'optionalAccess', _455 => _455.ssr]) !== true,
|
|
5107
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _456 => _456.strategy]) === "interaction",
|
|
4858
5108
|
runtimeModule
|
|
4859
5109
|
});
|
|
4860
5110
|
if (!transformedBoundary) {
|
|
@@ -4885,7 +5135,7 @@ export { manifest };
|
|
|
4885
5135
|
);
|
|
4886
5136
|
return;
|
|
4887
5137
|
}` : "";
|
|
4888
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
5138
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _457 => _457.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
4889
5139
|
if (import.meta.hot) {
|
|
4890
5140
|
import.meta.hot.accept((newModule) => {
|
|
4891
5141
|
${isolatedHmrUpdate}
|
|
@@ -4941,14 +5191,14 @@ if (import.meta.hot) {
|
|
|
4941
5191
|
}
|
|
4942
5192
|
_chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
4943
5193
|
_chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
|
|
4944
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
5194
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _458 => _458.config, 'access', _459 => _459.root]) || process.cwd(), options.outDir || "dist");
|
|
4945
5195
|
const clientDir = path6.join(outDir, "client");
|
|
4946
5196
|
for (const page of ssgPages) {
|
|
4947
5197
|
try {
|
|
4948
5198
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
4949
5199
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
4950
5200
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
4951
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
5201
|
+
if (!_optionalChain([mod, 'optionalAccess', _460 => _460.default])) return;
|
|
4952
5202
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
4953
5203
|
const layoutModules = await Promise.all(
|
|
4954
5204
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -4980,7 +5230,7 @@ if (import.meta.hot) {
|
|
|
4980
5230
|
const i18nSnapshot = _chunkNLBK37HIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4981
5231
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
4982
5232
|
const fullHtml = `<!DOCTYPE html>
|
|
4983
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
5233
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _461 => _461.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
4984
5234
|
<head>
|
|
4985
5235
|
<meta charset="utf-8">
|
|
4986
5236
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -5025,12 +5275,12 @@ if (import.meta.hot) {
|
|
|
5025
5275
|
watchChange(id, change) {
|
|
5026
5276
|
const watched = _chunkQMNWKQL4cjs.toPosixPath.call(void 0, id);
|
|
5027
5277
|
if (!watched.includes("/node_modules/") && !isFarmGeneratedOutput(watched)) {
|
|
5028
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
5278
|
+
_optionalChain([farmApp, 'optionalAccess', _462 => _462.getRouteManager, 'call', _463 => _463(), 'access', _464 => _464.noteSourceChange, 'call', _465 => _465(id, change.event)]);
|
|
5029
5279
|
}
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5280
|
+
_chunkNXGQIXR7cjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
5281
|
+
_chunkNXGQIXR7cjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
5282
|
+
_chunk56HHUSR5cjs.invalidateFarmRouteRootInferences.call(void 0, );
|
|
5283
|
+
_chunkNXGQIXR7cjs.dropLatestPackageClientBoundaryCache.call(void 0, );
|
|
5034
5284
|
},
|
|
5035
5285
|
async handleHotUpdate(ctx) {
|
|
5036
5286
|
if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
|
|
@@ -5055,13 +5305,13 @@ if (import.meta.hot) {
|
|
|
5055
5305
|
server2.moduleGraph.invalidateModule(mod);
|
|
5056
5306
|
}
|
|
5057
5307
|
}
|
|
5058
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
5308
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _466 => _466.getConfig, 'call', _467 => _467()]);
|
|
5059
5309
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
5060
5310
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
5061
5311
|
(appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
5062
5312
|
)) {
|
|
5063
5313
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
5064
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5314
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _468 => _468(`updated ${file}`)]);
|
|
5065
5315
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5066
5316
|
return [];
|
|
5067
5317
|
}
|
|
@@ -5071,7 +5321,7 @@ if (import.meta.hot) {
|
|
|
5071
5321
|
for (const mod of modules) {
|
|
5072
5322
|
server2.moduleGraph.invalidateModule(mod);
|
|
5073
5323
|
}
|
|
5074
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5324
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _469 => _469(`updated ${file}`)]);
|
|
5075
5325
|
server2.ws.send({
|
|
5076
5326
|
type: "full-reload",
|
|
5077
5327
|
path: "*"
|
|
@@ -5084,7 +5334,7 @@ if (import.meta.hot) {
|
|
|
5084
5334
|
for (const mod of modules) {
|
|
5085
5335
|
server2.moduleGraph.invalidateModule(mod);
|
|
5086
5336
|
}
|
|
5087
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5337
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _470 => _470(`updated ${file}`)]);
|
|
5088
5338
|
server2.ws.send({
|
|
5089
5339
|
type: "full-reload",
|
|
5090
5340
|
path: "*"
|
|
@@ -5092,16 +5342,16 @@ if (import.meta.hot) {
|
|
|
5092
5342
|
return [];
|
|
5093
5343
|
}
|
|
5094
5344
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
5095
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5345
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _471 => _471(`updated ${file}`)]);
|
|
5096
5346
|
}
|
|
5097
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5098
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5347
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _472 => _472.experimental, 'optionalAccess', _473 => _473.isolatedClientHydration]);
|
|
5348
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _474 => _474.getRouteManager, 'call', _475 => _475()]);
|
|
5099
5349
|
const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
|
|
5100
|
-
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5350
|
+
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _476 => _476.renderer])) && planRouteManager !== void 0;
|
|
5101
5351
|
let clientPlanCurrent = false;
|
|
5102
5352
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
5103
5353
|
const routeManager = planRouteManager;
|
|
5104
|
-
if (_optionalChain([routeManager, 'optionalAccess',
|
|
5354
|
+
if (_optionalChain([routeManager, 'optionalAccess', _477 => _477.isEditPlanNeutral, 'call', _478 => _478(file)])) {
|
|
5105
5355
|
clientPlanCurrent = true;
|
|
5106
5356
|
} else if (routeManager) {
|
|
5107
5357
|
routeManager.noteSourceChange(file, "update");
|
|
@@ -5162,7 +5412,7 @@ if (import.meta.hot) {
|
|
|
5162
5412
|
}
|
|
5163
5413
|
return [];
|
|
5164
5414
|
}
|
|
5165
|
-
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess',
|
|
5415
|
+
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _479 => _479.getRouteManager, 'call', _480 => _480(), 'access', _481 => _481.invalidateClientManifest, 'call', _482 => _482()]);
|
|
5166
5416
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
5167
5417
|
if (manifestModule) {
|
|
5168
5418
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -5180,7 +5430,7 @@ if (import.meta.hot) {
|
|
|
5180
5430
|
return [];
|
|
5181
5431
|
}
|
|
5182
5432
|
}
|
|
5183
|
-
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access',
|
|
5433
|
+
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _483 => _483.environments, 'access', _484 => _484.client, 'optionalAccess', _485 => _485.moduleGraph, 'access', _486 => _486.getModulesByFile, 'call', _487 => _487(normalizedFile), 'optionalAccess', _488 => _488.size]) && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
|
|
5184
5434
|
logUpdate("PAGE", `updated ${path6.basename(file)}`);
|
|
5185
5435
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5186
5436
|
return [];
|
|
@@ -5278,7 +5528,7 @@ function createPageDataMiddlewareResponse(res) {
|
|
|
5278
5528
|
return (...args) => {
|
|
5279
5529
|
if (captures(target.statusCode, target.getHeader("location"))) {
|
|
5280
5530
|
const callback = args.find((arg) => typeof arg === "function");
|
|
5281
|
-
_optionalChain([callback, 'optionalCall',
|
|
5531
|
+
_optionalChain([callback, 'optionalCall', _489 => _489()]);
|
|
5282
5532
|
return property === "write" ? true : response;
|
|
5283
5533
|
}
|
|
5284
5534
|
return target[property](...args);
|
|
@@ -5342,12 +5592,12 @@ function isFarmClientVirtualId(id) {
|
|
|
5342
5592
|
}
|
|
5343
5593
|
function isClientEnvironment(context, loadOptions) {
|
|
5344
5594
|
const environment = context.environment;
|
|
5345
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5346
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5347
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
5595
|
+
if (_optionalChain([environment, 'optionalAccess', _490 => _490.config, 'optionalAccess', _491 => _491.consumer])) return environment.config.consumer === "client";
|
|
5596
|
+
if (_optionalChain([environment, 'optionalAccess', _492 => _492.name])) return environment.name === "client";
|
|
5597
|
+
return _optionalChain([loadOptions, 'optionalAccess', _493 => _493.ssr]) !== true;
|
|
5348
5598
|
}
|
|
5349
5599
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
5350
|
-
const graph = _optionalChain([server, 'access',
|
|
5600
|
+
const graph = _optionalChain([server, 'access', _494 => _494.environments, 'optionalAccess', _495 => _495.client, 'optionalAccess', _496 => _496.moduleGraph]);
|
|
5351
5601
|
if (!graph) return;
|
|
5352
5602
|
for (const [id, module] of graph.idToModuleMap) {
|
|
5353
5603
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -5357,19 +5607,19 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
5357
5607
|
const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5358
5608
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
5359
5609
|
watchFile(routesFile);
|
|
5360
|
-
return
|
|
5610
|
+
return _chunkNXGQIXR7cjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
5361
5611
|
kind: parsed.kind,
|
|
5362
5612
|
routePath: parsed.routePath,
|
|
5363
5613
|
routesFile,
|
|
5364
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
5365
|
-
|
|
5614
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _497 => _497.routes, 'access', _498 => _498.get, 'call', _499 => _499(
|
|
5615
|
+
_chunkNXGQIXR7cjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
5366
5616
|
)]),
|
|
5367
5617
|
rendererServer: renderer.server,
|
|
5368
5618
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
5369
5619
|
});
|
|
5370
5620
|
}
|
|
5371
5621
|
function resolveRealModuleFile(filePath, root) {
|
|
5372
|
-
const resolved = _nullishCoalesce(
|
|
5622
|
+
const resolved = _nullishCoalesce(_chunkNXGQIXR7cjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
5373
5623
|
try {
|
|
5374
5624
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
5375
5625
|
} catch (e28) {
|
|
@@ -5683,12 +5933,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
5683
5933
|
}
|
|
5684
5934
|
const schemas = routeModule.__farmRouteSchemas;
|
|
5685
5935
|
const params = parseRouteModuleSchema(
|
|
5686
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
5936
|
+
_optionalChain([schemas, 'optionalAccess', _500 => _500.params]),
|
|
5687
5937
|
input.props.params,
|
|
5688
5938
|
"params",
|
|
5689
5939
|
input.routePath
|
|
5690
5940
|
);
|
|
5691
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
5941
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _501 => _501.search]), input.search, "search", input.routePath);
|
|
5692
5942
|
return {
|
|
5693
5943
|
...input.props,
|
|
5694
5944
|
params,
|
|
@@ -5708,12 +5958,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
5708
5958
|
}
|
|
5709
5959
|
}
|
|
5710
5960
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunk67MZTLTFcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
5711
|
-
const providerClientCode =
|
|
5961
|
+
const providerClientCode = _chunk56HHUSR5cjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5712
5962
|
integrationProviders,
|
|
5713
5963
|
root,
|
|
5714
5964
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
5715
5965
|
);
|
|
5716
|
-
const clientPluginEntry =
|
|
5966
|
+
const clientPluginEntry = _chunkENYBDM4Ucjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
5717
5967
|
plugins,
|
|
5718
5968
|
root,
|
|
5719
5969
|
srcDir,
|
|
@@ -5762,7 +6012,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
5762
6012
|
return null;
|
|
5763
6013
|
}
|
|
5764
6014
|
}
|
|
5765
|
-
${islandValues ? `${
|
|
6015
|
+
${islandValues ? `${_chunk56HHUSR5cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5766
6016
|
let farmLastRouteState = null;
|
|
5767
6017
|
|
|
5768
6018
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -5782,7 +6032,7 @@ ${isolatedHydrationImport}
|
|
|
5782
6032
|
import { installChunkErrorRecovery, SPARouter } from '@farm.js/core/client'
|
|
5783
6033
|
import { createClientPluginManager } from '@farm.js/core/plugin/client'
|
|
5784
6034
|
import { isFarmRouteActive } from '@farm.js/core/router'
|
|
5785
|
-
import { isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
6035
|
+
import { installFarmLinkPrefetch, isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
5786
6036
|
import { reviveDeferredData } from '@farm.js/core/deferred'
|
|
5787
6037
|
import {
|
|
5788
6038
|
createFarmDeploymentMismatchError,
|
|
@@ -6602,7 +6852,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
6602
6852
|
return loadedLayouts;
|
|
6603
6853
|
}
|
|
6604
6854
|
|
|
6605
|
-
${
|
|
6855
|
+
${_chunk56HHUSR5cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6606
6856
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
6607
6857
|
let wrapped = element;
|
|
6608
6858
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -6887,7 +7137,7 @@ function readActiveLayoutPatterns() {
|
|
|
6887
7137
|
.filter(Boolean);
|
|
6888
7138
|
}
|
|
6889
7139
|
|
|
6890
|
-
${
|
|
7140
|
+
${_chunk56HHUSR5cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6891
7141
|
|
|
6892
7142
|
function activateFragmentScripts(root) {
|
|
6893
7143
|
for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
|
|
@@ -6946,7 +7196,7 @@ function getLayoutShell(root, patterns, index, find) {
|
|
|
6946
7196
|
return shell.innerHTML;
|
|
6947
7197
|
}
|
|
6948
7198
|
|
|
6949
|
-
${islandValues ?
|
|
7199
|
+
${islandValues ? _chunk56HHUSR5cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
|
|
6950
7200
|
container,
|
|
6951
7201
|
fragment,
|
|
6952
7202
|
currentPatterns,
|
|
@@ -7019,7 +7269,7 @@ ${islandValues ? `
|
|
|
7019
7269
|
return nextTarget;
|
|
7020
7270
|
}
|
|
7021
7271
|
|
|
7022
|
-
${islandValues ? `${
|
|
7272
|
+
${islandValues ? `${_chunk56HHUSR5cjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
7023
7273
|
|
|
7024
7274
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
7025
7275
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -7688,6 +7938,9 @@ document.addEventListener('click', function(event) {
|
|
|
7688
7938
|
spaRouter.navigate(href, { replace, scroll, viewTransition });
|
|
7689
7939
|
});
|
|
7690
7940
|
|
|
7941
|
+
// Link anchors on a page that does not hydrate prefetch through the router as Link would.
|
|
7942
|
+
installFarmLinkPrefetch();
|
|
7943
|
+
|
|
7691
7944
|
if (import.meta.hot) {
|
|
7692
7945
|
import.meta.hot.on('vite:beforeUpdate', () => {
|
|
7693
7946
|
// Clear module cache on HMR to pick up changes
|
|
@@ -7718,9 +7971,9 @@ function generateClientManifest(bundle) {
|
|
|
7718
7971
|
return manifest;
|
|
7719
7972
|
}
|
|
7720
7973
|
async function defineConfig(config = {}) {
|
|
7721
|
-
const tailwindVitePlugin = await
|
|
7974
|
+
const tailwindVitePlugin = await _chunkENYBDM4Ucjs.loadTailwindVitePlugin.call(void 0, );
|
|
7722
7975
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
7723
|
-
if (_optionalChain([config, 'access',
|
|
7976
|
+
if (_optionalChain([config, 'access', _502 => _502.extends, 'optionalAccess', _503 => _503.length])) {
|
|
7724
7977
|
const { config: layeredConfig } = await import("./layers-7P4RLKVX.cjs").then(
|
|
7725
7978
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
7726
7979
|
root: appRoot,
|
|
@@ -7730,7 +7983,7 @@ async function defineConfig(config = {}) {
|
|
|
7730
7983
|
config = layeredConfig;
|
|
7731
7984
|
}
|
|
7732
7985
|
config.renderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
7733
|
-
config.images =
|
|
7986
|
+
config.images = _chunk56HHUSR5cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
7734
7987
|
const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
7735
7988
|
ssr: true
|
|
7736
7989
|
});
|
|
@@ -7822,13 +8075,13 @@ async function defineConfig(config = {}) {
|
|
|
7822
8075
|
if (!serverStarted) {
|
|
7823
8076
|
serverStarted = true;
|
|
7824
8077
|
const elapsed = Date.now() - startTime;
|
|
7825
|
-
const address = _optionalChain([server, 'access',
|
|
8078
|
+
const address = _optionalChain([server, 'access', _504 => _504.httpServer, 'optionalAccess', _505 => _505.address, 'call', _506 => _506()]);
|
|
7826
8079
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
7827
8080
|
const hostConfig = server.config.server.host;
|
|
7828
8081
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
7829
8082
|
console.log("");
|
|
7830
8083
|
console.log(
|
|
7831
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
8084
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkRSL3YFJGcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
7832
8085
|
);
|
|
7833
8086
|
console.log("");
|
|
7834
8087
|
console.log(
|
|
@@ -7862,7 +8115,7 @@ async function defineConfig(config = {}) {
|
|
|
7862
8115
|
plugins: [
|
|
7863
8116
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
7864
8117
|
_chunk3QM74STYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
7865
|
-
|
|
8118
|
+
_chunk56HHUSR5cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7866
8119
|
tailwindVitePlugin,
|
|
7867
8120
|
...rendererVitePlugins,
|
|
7868
8121
|
...reactRefreshPlugins,
|
|
@@ -7871,14 +8124,14 @@ async function defineConfig(config = {}) {
|
|
|
7871
8124
|
farmServerOnlyEntriesPlugin(),
|
|
7872
8125
|
farmIslandContainersPlugin(config),
|
|
7873
8126
|
farmPlugin(config),
|
|
7874
|
-
|
|
8127
|
+
_chunkNXGQIXR7cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7875
8128
|
farmBrandingPlugin
|
|
7876
8129
|
],
|
|
7877
8130
|
customLogger: farmLogger,
|
|
7878
8131
|
clearScreen: false,
|
|
7879
8132
|
optimizeDeps: {
|
|
7880
|
-
...
|
|
7881
|
-
|
|
8133
|
+
..._chunk56HHUSR5cjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
8134
|
+
_chunk56HHUSR5cjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
7882
8135
|
appRoot,
|
|
7883
8136
|
_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
7884
8137
|
),
|
|
@@ -7921,7 +8174,7 @@ async function defineConfig(config = {}) {
|
|
|
7921
8174
|
// Stub out problematic server-only modules during dev mode
|
|
7922
8175
|
alias: {
|
|
7923
8176
|
..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
7924
|
-
...
|
|
8177
|
+
..._chunk56HHUSR5cjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
7925
8178
|
// Nitro internals that should not be resolved in browser
|
|
7926
8179
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
7927
8180
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|