@farm.js/core 0.1.30 → 0.1.34
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/README.md +1 -1
- package/dist/agent-runtime.cjs +69 -14
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +58 -3
- package/dist/api/route-manager.cjs +16 -13
- package/dist/api/route-manager.d.mts +1 -1
- package/dist/api/route-manager.d.ts +1 -1
- package/dist/api/route-manager.mjs +15 -12
- package/dist/api/runtime.cjs +9 -7
- package/dist/api/runtime.d.mts +1 -1
- package/dist/api/runtime.d.ts +1 -1
- package/dist/api/runtime.mjs +8 -6
- package/dist/api.cjs +19 -16
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.mjs +18 -15
- package/dist/{app-sUJ3jnTZ.d.ts → app-DgotYGbq.d.ts} +3 -3
- package/dist/app-markdown.cjs +8 -6
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +7 -5
- package/dist/{app-DAuUTIZf.d.mts → app-q4rmZlXK.d.mts} +3 -3
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +10 -1
- package/dist/cache.d.ts +10 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-YZTASLPQ.cjs → chunk-27ZWSI3W.cjs} +2 -2
- package/dist/{chunk-WBIH66JK.mjs → chunk-2ELDTQRN.mjs} +5 -2
- package/dist/{chunk-K7CELQLK.cjs → chunk-2F2ER724.cjs} +54 -29
- package/dist/{chunk-NRVGEI5I.mjs → chunk-2NNMOPDN.mjs} +4 -210
- package/dist/chunk-2NQQ5H5G.cjs +86 -0
- package/dist/{chunk-HPQC2LHF.cjs → chunk-36MK5YCW.cjs} +342 -163
- package/dist/chunk-3BU22U3M.cjs +237 -0
- package/dist/{chunk-MM5D6VLP.mjs → chunk-3KZS4SUS.mjs} +33 -14
- package/dist/chunk-3SDFA7UF.cjs +701 -0
- package/dist/{chunk-4IEPYMHF.mjs → chunk-3UEVPCGW.mjs} +1 -1
- package/dist/{chunk-6G3ZZ2IE.mjs → chunk-3VSKDFAT.mjs} +1 -1
- package/dist/{chunk-5HGR3W6O.mjs → chunk-5SJWVY6R.mjs} +8 -0
- package/dist/{chunk-X7WVQMIB.mjs → chunk-657WJNRY.mjs} +10 -4
- package/dist/{chunk-MKMBQSNQ.mjs → chunk-6VVL3MHY.mjs} +3 -3
- package/dist/{chunk-QZRVZSPN.cjs → chunk-77GNHH2Z.cjs} +3 -3
- package/dist/{chunk-KZLND3D2.cjs → chunk-7BT4H4P7.cjs} +7 -5
- package/dist/{chunk-A777V5WU.cjs → chunk-7M52YUMY.cjs} +2 -2
- package/dist/{chunk-VUMAE7NC.mjs → chunk-7Y6ZNFPX.mjs} +81 -30
- package/dist/{chunk-ZDILFMWN.cjs → chunk-A5FGU2WU.cjs} +74 -23
- package/dist/{chunk-BZ3CHOFX.mjs → chunk-AGC75XAE.mjs} +37 -1
- package/dist/{chunk-4ZQQL4IU.mjs → chunk-AHGECQEW.mjs} +1 -1
- package/dist/{chunk-RG3ZOTG5.cjs → chunk-AI7QMY7O.cjs} +10 -3
- package/dist/{chunk-O3DTUAX2.mjs → chunk-AQZFOP7S.mjs} +6 -77
- package/dist/{chunk-WNLBF77X.cjs → chunk-ATK2R4CH.cjs} +14 -12
- package/dist/{chunk-SORB3MAR.cjs → chunk-AWC4VUZL.cjs} +17 -17
- package/dist/{chunk-YMCXWPWK.mjs → chunk-BCMSYSN2.mjs} +4 -1
- package/dist/{chunk-BZAGKCKB.cjs → chunk-BTAG7LI7.cjs} +2 -2
- package/dist/{chunk-I6XDAKWQ.mjs → chunk-BTHHUD7Q.mjs} +14 -0
- package/dist/chunk-C4SPBWFM.cjs +26 -0
- package/dist/{chunk-JATSG2ZO.mjs → chunk-CLJYVZAD.mjs} +4 -2
- package/dist/{chunk-J3LOGE4T.cjs → chunk-DQQOKWYA.cjs} +5 -5
- package/dist/{chunk-JLRDISQL.cjs → chunk-DZ4DTRJ5.cjs} +7 -7
- package/dist/chunk-E5GNDG5F.mjs +701 -0
- package/dist/{chunk-E76XC6ZG.mjs → chunk-EZDQRNQ7.mjs} +2 -2
- package/dist/{chunk-TOVMYGYW.mjs → chunk-F2SE2VDO.mjs} +1 -1
- package/dist/{chunk-BSPQVJ4A.mjs → chunk-FDR64H6B.mjs} +13 -0
- package/dist/{chunk-5OVTOKGH.cjs → chunk-FFFW3OQ7.cjs} +2 -2
- package/dist/{chunk-D4JE5NNV.cjs → chunk-FNO7A7CM.cjs} +5 -5
- package/dist/chunk-FZ6YYU2W.mjs +65 -0
- package/dist/{chunk-PZNCMPJF.cjs → chunk-G26MUMKL.cjs} +14 -8
- package/dist/{chunk-IXUY2F5U.mjs → chunk-GCXWJJKH.mjs} +4 -7
- package/dist/{chunk-JLCQGPXE.mjs → chunk-GNSDTTWZ.mjs} +50 -61
- package/dist/{chunk-D234YWNA.mjs → chunk-GOABMOX3.mjs} +151 -3
- package/dist/{chunk-HBTUGXHS.cjs → chunk-HLJ6MBUZ.cjs} +7 -4
- package/dist/{chunk-GZYH4OER.mjs → chunk-HR5KPHC2.mjs} +1 -1
- package/dist/{chunk-ZCU4NZ3M.cjs → chunk-IE7XCHH3.cjs} +4 -4
- package/dist/{chunk-I26CZYPV.cjs → chunk-IHNIDL6H.cjs} +50 -7
- package/dist/{chunk-2FQHH5SC.mjs → chunk-IHNMMXHV.mjs} +49 -24
- package/dist/{chunk-VHJGDMCG.cjs → chunk-IWZKTWHZ.cjs} +2 -2
- package/dist/{chunk-DGXN3L4D.mjs → chunk-JDPAKVS4.mjs} +4 -4
- package/dist/chunk-JG6DJF5A.mjs +238 -0
- package/dist/{chunk-5TISYEQF.mjs → chunk-JM5XPKWH.mjs} +10 -3
- package/dist/{chunk-BJJATPEC.mjs → chunk-KN7K4VQN.mjs} +1 -1
- package/dist/{chunk-WPYFSQKK.cjs → chunk-KNBBQHO2.cjs} +15 -1
- package/dist/{chunk-XWAWFQFS.cjs → chunk-KXWRO25S.cjs} +7 -4
- package/dist/{chunk-QG5HNS7P.mjs → chunk-LHODW25H.mjs} +2 -2
- package/dist/{chunk-BXFWA23T.mjs → chunk-LMJ7VRHZ.mjs} +3 -3
- package/dist/{chunk-IVLUJUT4.mjs → chunk-LR5QSC2P.mjs} +388 -209
- package/dist/chunk-LSKZMJMP.cjs +65 -0
- package/dist/{chunk-2N5PX3LS.mjs → chunk-LYV44OIR.mjs} +7 -1
- package/dist/{chunk-5MKEDGLD.cjs → chunk-M64YUMA4.cjs} +11 -6
- package/dist/{chunk-EXLKRR4U.cjs → chunk-MIDIZJZC.cjs} +12 -12
- package/dist/{chunk-ES4B2IXW.cjs → chunk-MOKLYNHV.cjs} +2 -2
- package/dist/{chunk-IV6CQY7O.mjs → chunk-MSSFIQGM.mjs} +63 -13
- package/dist/{chunk-KH7BN726.cjs → chunk-N4UOK6ZI.cjs} +8 -2
- package/dist/{chunk-YMUE7L3D.mjs → chunk-NGVORZVZ.mjs} +1 -1
- package/dist/{chunk-JNGIWIY6.mjs → chunk-NPC7VWJE.mjs} +2 -2
- package/dist/{chunk-ILWLPEVO.mjs → chunk-NRSN7G7E.mjs} +2 -2
- package/dist/{chunk-PQD2AI3B.mjs → chunk-O27L4YAA.mjs} +1 -1
- package/dist/{chunk-X5TXZFMN.cjs → chunk-ODBZYBAB.cjs} +1 -1
- package/dist/{chunk-NPPL5YDT.cjs → chunk-P64MIF5B.cjs} +154 -6
- package/dist/{chunk-JFHKNFEO.cjs → chunk-PQDFUSXD.cjs} +14 -14
- package/dist/{chunk-F6XEGFHO.mjs → chunk-PXKIEXZD.mjs} +10 -0
- package/dist/{chunk-S5GDHOE4.mjs → chunk-PZNL3WEG.mjs} +48 -5
- package/dist/{chunk-FV45CKBC.mjs → chunk-QCFBDFRS.mjs} +1 -1
- package/dist/{chunk-75BRBIFP.cjs → chunk-QCVE2OCI.cjs} +5 -8
- package/dist/{chunk-6ZCMSZ5U.mjs → chunk-QE6VAKLT.mjs} +1 -1
- package/dist/{chunk-75DYEVXI.cjs → chunk-QGYRXFU2.cjs} +9 -9
- package/dist/{chunk-CTV2TTNP.cjs → chunk-QJ3J6MZT.cjs} +16 -87
- package/dist/{chunk-O6XNAMBV.mjs → chunk-QLQ32WC4.mjs} +8 -3
- package/dist/{chunk-GIWC4CFJ.cjs → chunk-SJVKK4JE.cjs} +839 -420
- package/dist/{chunk-3FCFQP5V.cjs → chunk-TA5G2HWD.cjs} +21 -21
- package/dist/{chunk-Z5HIWVDP.cjs → chunk-TDFPACVX.cjs} +62 -73
- package/dist/{chunk-ND224OE2.cjs → chunk-TKSCR644.cjs} +34 -15
- package/dist/{chunk-2UABTL3Y.mjs → chunk-U4PTAHW3.mjs} +64 -13
- package/dist/{chunk-ZHVYQL3H.cjs → chunk-U74I55WB.cjs} +86 -35
- package/dist/chunk-UBO4SGH4.mjs +86 -0
- package/dist/{chunk-IQXFRNY2.cjs → chunk-UFDAAQFX.cjs} +2 -2
- package/dist/{chunk-NXG66MR7.cjs → chunk-UX5S4JEO.cjs} +40 -4
- package/dist/{chunk-5ZSWG4UX.cjs → chunk-UXFQ3UDA.cjs} +14 -1
- package/dist/{chunk-L4DVIHOC.mjs → chunk-VCCUOMQN.mjs} +1 -1
- package/dist/{chunk-4V7GIE2U.mjs → chunk-VHANUNEG.mjs} +2 -2
- package/dist/{chunk-FXUUWYAX.cjs → chunk-VKNHTSAP.cjs} +10 -0
- package/dist/{chunk-2AKFKCHA.mjs → chunk-W7LF2J2S.mjs} +1 -1
- package/dist/{chunk-MNUGPHLN.mjs → chunk-WNNYOOIB.mjs} +5 -3
- package/dist/{chunk-K6V52QMI.mjs → chunk-X242HVD5.mjs} +1 -1
- package/dist/{chunk-UJ2C4ICS.cjs → chunk-XJXBIP67.cjs} +4 -4
- package/dist/{chunk-S4K74WI4.mjs → chunk-XV5DJTBX.mjs} +539 -121
- package/dist/{chunk-6CNX6Q3K.cjs → chunk-XXJU7FCC.cjs} +9 -5
- package/dist/{chunk-DYEJQTDN.cjs → chunk-YSCV4SJF.cjs} +4 -4
- package/dist/{chunk-2SDO73HK.cjs → chunk-YWN746US.cjs} +64 -14
- package/dist/chunk-Z2HLU4IX.cjs +238 -0
- package/dist/{chunk-Q5JFU33Q.cjs → chunk-Z2YLTERK.cjs} +4 -4
- package/dist/{chunk-XLTV4VOG.cjs → chunk-ZHPHJPQP.cjs} +4 -4
- package/dist/{chunk-7CXKSRKL.mjs → chunk-ZKP7C2B6.mjs} +4 -4
- package/dist/{chunk-ATXI6LGT.mjs → chunk-ZUSJDQ2Q.mjs} +8 -4
- package/dist/{client-plugins-BX2ptm4H.d.mts → client-plugins-CLObcuCq.d.mts} +26 -2
- package/dist/{client-plugins-BmxM5KW_.d.ts → client-plugins-DZjHC4Mi.d.ts} +26 -2
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -8
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-GGVPZHJX.cjs → devtools-HU6Y2MNV.cjs} +11 -9
- package/dist/{devtools-THVNPI2M.mjs → devtools-RNXCTS4R.mjs} +10 -8
- package/dist/docs.cjs +13 -11
- package/dist/docs.d.mts +5 -0
- package/dist/docs.d.ts +5 -0
- package/dist/docs.mjs +12 -10
- package/dist/environment/vite.cjs +2 -2
- package/dist/environment/vite.mjs +1 -1
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +14 -13
- package/dist/i18n/client.mjs +5 -4
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.mjs +5 -4
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +67 -55
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +70 -58
- package/dist/integrations.cjs +6 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +7 -4
- package/dist/internal/app-markdown-runtime.cjs +7 -5
- package/dist/internal/app-markdown-runtime.d.mts +14 -3
- package/dist/internal/app-markdown-runtime.d.ts +14 -3
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +38 -35
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +37 -34
- package/dist/internal/cli-runtime.cjs +20 -17
- package/dist/internal/cli-runtime.mjs +19 -16
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +4 -2
- package/dist/internal/client-runtime.d.mts +9 -1
- package/dist/internal/client-runtime.d.ts +9 -1
- package/dist/internal/client-runtime.mjs +3 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +11 -9
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +10 -8
- package/dist/internal/infra-analytics-runtime.cjs +4 -4
- package/dist/internal/infra-analytics-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +20 -14
- package/dist/internal/production-runtime.d.mts +115 -8
- package/dist/internal/production-runtime.d.ts +115 -8
- package/dist/internal/production-runtime.mjs +19 -13
- package/dist/internal/request-cookies.cjs +4 -2
- package/dist/internal/request-cookies.d.mts +9 -1
- package/dist/internal/request-cookies.d.ts +9 -1
- package/dist/internal/request-cookies.mjs +3 -1
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +3 -3
- package/dist/{metadata-DsEaK7mQ.d.mts → metadata-2HSU2i_w.d.mts} +1 -1
- package/dist/{metadata-fwZ3gfG6.d.ts → metadata-Cjs8JMRM.d.ts} +1 -1
- package/dist/middleware.cjs +18 -8
- package/dist/middleware.d.mts +24 -5
- package/dist/middleware.d.ts +24 -5
- package/dist/middleware.mjs +18 -8
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-NAKCRVHX.mjs → nitro-4XGPNIK4.mjs} +3 -3
- package/dist/{nitro-VYDZGYFY.cjs → nitro-HSAQFXSS.cjs} +4 -4
- package/dist/plugin.cjs +33 -30
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +32 -29
- package/dist/{production-runtime-DNkpFnmg.d.ts → production-runtime-BU5ETAK9.d.ts} +8 -1
- package/dist/{production-runtime-Baqgwtvc.d.mts → production-runtime-CysZl3EV.d.mts} +8 -1
- package/dist/query/client.cjs +7 -7
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-DhwQnmmX.d.mts → render-plan-CKr4ltOd.d.mts} +1 -1
- package/dist/{render-plan-rkIK9wd9.d.ts → render-plan-D72O1qm4.d.ts} +1 -1
- package/dist/renderer-client.cjs +39 -19
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +28 -8
- package/dist/{request-CFy1BltJ.d.mts → request-Be83WafN.d.mts} +7 -2
- package/dist/{request-BcY4RYPC.d.ts → request-DbyOYI2j.d.ts} +7 -2
- package/dist/request.cjs +2 -2
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering-BkS0TBlB.d.mts → route-rendering-BG56SzvJ.d.mts} +1 -1
- package/dist/{route-rendering-D4XpMjam.d.ts → route-rendering-CtVMpV-k.d.ts} +1 -1
- package/dist/{router-C4zPlC3V.d.mts → router-ALUvm8gC.d.mts} +1 -1
- package/dist/{router-Cq7BcZxg.d.ts → router-D94-SDlW.d.ts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +2 -2
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.cjs +3 -3
- package/dist/server-query-client.mjs +2 -2
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +60 -57
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +37 -34
- package/dist/{spa-router-B1HI3X9k.d.ts → spa-router-CxK3USIz.d.ts} +2 -2
- package/dist/{spa-router-DzPZH-AO.d.mts → spa-router-DbxNRKOB.d.mts} +2 -2
- package/dist/testing.cjs +19 -17
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +16 -14
- package/dist/theme/server.cjs +4 -3
- package/dist/theme/server.mjs +3 -2
- package/dist/{utils-DMD1Hzta.d.ts → utils-311Y8eoK.d.ts} +1 -1
- package/dist/{utils-CEBktlBG.d.mts → utils-4wVRcpOw.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +33 -30
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +32 -29
- package/package.json +2 -2
- package/dist/chunk-22GUSVNJ.cjs +0 -351
- package/dist/chunk-SWN467MP.cjs +0 -18
- package/dist/chunk-XGC343EY.cjs +0 -443
- package/dist/chunk-ZSH2Y4LN.mjs +0 -351
- /package/dist/{chunk-SUIBNSNO.cjs → chunk-SJNMVDDF.cjs} +0 -0
- /package/dist/{chunk-LNZ7JZUS.mjs → chunk-UDNPLXW7.mjs} +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkCTV2TTNPcjs = require('./chunk-CTV2TTNP.cjs');
|
|
7
|
+
var _chunkQJ3J6MZTcjs = require('./chunk-QJ3J6MZT.cjs');
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
|
|
@@ -27,7 +25,10 @@ var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
|
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
var _chunkP64MIF5Bcjs = require('./chunk-P64MIF5B.cjs');
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
|
|
@@ -36,7 +37,7 @@ var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
|
|
|
36
37
|
var _chunkK3F2E6GScjs = require('./chunk-K3F2E6GS.cjs');
|
|
37
38
|
|
|
38
39
|
|
|
39
|
-
var
|
|
40
|
+
var _chunkVKNHTSAPcjs = require('./chunk-VKNHTSAP.cjs');
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
|
|
@@ -46,11 +47,11 @@ var _chunkMWSK6C4Jcjs = require('./chunk-MWSK6C4J.cjs');
|
|
|
46
47
|
var _chunkAMDMVWMIcjs = require('./chunk-AMDMVWMI.cjs');
|
|
47
48
|
|
|
48
49
|
|
|
49
|
-
var
|
|
50
|
+
var _chunk3SDFA7UFcjs = require('./chunk-3SDFA7UF.cjs');
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
var
|
|
54
|
+
var _chunkKXWRO25Scjs = require('./chunk-KXWRO25S.cjs');
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
|
|
@@ -108,7 +109,7 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
|
108
109
|
|
|
109
110
|
|
|
110
111
|
|
|
111
|
-
var
|
|
112
|
+
var _chunkZHPHJPQPcjs = require('./chunk-ZHPHJPQP.cjs');
|
|
112
113
|
|
|
113
114
|
|
|
114
115
|
|
|
@@ -126,12 +127,12 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
|
126
127
|
|
|
127
128
|
|
|
128
129
|
|
|
129
|
-
var
|
|
130
|
+
var _chunkBTAG7LI7cjs = require('./chunk-BTAG7LI7.cjs');
|
|
130
131
|
|
|
131
132
|
|
|
132
133
|
|
|
133
134
|
|
|
134
|
-
var
|
|
135
|
+
var _chunkUX5S4JEOcjs = require('./chunk-UX5S4JEO.cjs');
|
|
135
136
|
|
|
136
137
|
|
|
137
138
|
|
|
@@ -145,7 +146,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
|
|
|
145
146
|
|
|
146
147
|
|
|
147
148
|
|
|
148
|
-
var
|
|
149
|
+
var _chunkXXJU7FCCcjs = require('./chunk-XXJU7FCC.cjs');
|
|
149
150
|
|
|
150
151
|
|
|
151
152
|
var _chunkMPEYMSCFcjs = require('./chunk-MPEYMSCF.cjs');
|
|
@@ -168,16 +169,20 @@ var _chunk6QQDAAAZcjs = require('./chunk-6QQDAAAZ.cjs');
|
|
|
168
169
|
|
|
169
170
|
|
|
170
171
|
|
|
171
|
-
var
|
|
172
|
+
var _chunkTDFPACVXcjs = require('./chunk-TDFPACVX.cjs');
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
var _chunkU74I55WBcjs = require('./chunk-U74I55WB.cjs');
|
|
172
176
|
|
|
173
177
|
|
|
174
|
-
var _chunkZHVYQL3Hcjs = require('./chunk-ZHVYQL3H.cjs');
|
|
175
178
|
|
|
179
|
+
var _chunk2NQQ5H5Gcjs = require('./chunk-2NQQ5H5G.cjs');
|
|
176
180
|
|
|
177
181
|
|
|
178
182
|
|
|
179
183
|
|
|
180
|
-
|
|
184
|
+
|
|
185
|
+
var _chunk3BU22U3Mcjs = require('./chunk-3BU22U3M.cjs');
|
|
181
186
|
|
|
182
187
|
|
|
183
188
|
var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
@@ -186,17 +191,17 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
|
|
|
186
191
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
187
192
|
|
|
188
193
|
|
|
189
|
-
var
|
|
194
|
+
var _chunkMIDIZJZCcjs = require('./chunk-MIDIZJZC.cjs');
|
|
190
195
|
|
|
191
196
|
|
|
192
197
|
|
|
193
|
-
var
|
|
198
|
+
var _chunkSJNMVDDFcjs = require('./chunk-SJNMVDDF.cjs');
|
|
194
199
|
|
|
195
200
|
|
|
196
201
|
|
|
197
202
|
|
|
198
203
|
|
|
199
|
-
var
|
|
204
|
+
var _chunkXJXBIP67cjs = require('./chunk-XJXBIP67.cjs');
|
|
200
205
|
|
|
201
206
|
|
|
202
207
|
|
|
@@ -205,10 +210,7 @@ var _chunkUJ2C4ICScjs = require('./chunk-UJ2C4ICS.cjs');
|
|
|
205
210
|
var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
|
|
206
211
|
|
|
207
212
|
|
|
208
|
-
var
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var _chunkWPYFSQKKcjs = require('./chunk-WPYFSQKK.cjs');
|
|
213
|
+
var _chunkG26MUMKLcjs = require('./chunk-G26MUMKL.cjs');
|
|
212
214
|
|
|
213
215
|
|
|
214
216
|
|
|
@@ -228,7 +230,7 @@ var _chunkSOR334EBcjs = require('./chunk-SOR334EB.cjs');
|
|
|
228
230
|
|
|
229
231
|
|
|
230
232
|
|
|
231
|
-
var
|
|
233
|
+
var _chunkYWN746UScjs = require('./chunk-YWN746US.cjs');
|
|
232
234
|
|
|
233
235
|
|
|
234
236
|
|
|
@@ -255,7 +257,7 @@ var _chunkBMWDEBXOcjs = require('./chunk-BMWDEBXO.cjs');
|
|
|
255
257
|
|
|
256
258
|
|
|
257
259
|
|
|
258
|
-
var
|
|
260
|
+
var _chunkHLJ6MBUZcjs = require('./chunk-HLJ6MBUZ.cjs');
|
|
259
261
|
|
|
260
262
|
|
|
261
263
|
|
|
@@ -276,6 +278,9 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
|
276
278
|
var _chunkQNPEUFHQcjs = require('./chunk-QNPEUFHQ.cjs');
|
|
277
279
|
|
|
278
280
|
|
|
281
|
+
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
282
|
+
|
|
283
|
+
|
|
279
284
|
|
|
280
285
|
|
|
281
286
|
var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
|
|
@@ -285,7 +290,7 @@ var _chunkE3UK5IIBcjs = require('./chunk-E3UK5IIB.cjs');
|
|
|
285
290
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
286
291
|
|
|
287
292
|
|
|
288
|
-
var
|
|
293
|
+
var _chunkODBZYBABcjs = require('./chunk-ODBZYBAB.cjs');
|
|
289
294
|
|
|
290
295
|
|
|
291
296
|
|
|
@@ -297,7 +302,7 @@ var _chunkS3A45T7Fcjs = require('./chunk-S3A45T7F.cjs');
|
|
|
297
302
|
|
|
298
303
|
|
|
299
304
|
|
|
300
|
-
var
|
|
305
|
+
var _chunkQCVE2OCIcjs = require('./chunk-QCVE2OCI.cjs');
|
|
301
306
|
|
|
302
307
|
|
|
303
308
|
|
|
@@ -321,7 +326,7 @@ var _chunkQBK2AA4Ucjs = require('./chunk-QBK2AA4U.cjs');
|
|
|
321
326
|
var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
|
|
322
327
|
|
|
323
328
|
|
|
324
|
-
var
|
|
329
|
+
var _chunk27ZWSI3Wcjs = require('./chunk-27ZWSI3W.cjs');
|
|
325
330
|
|
|
326
331
|
|
|
327
332
|
var _chunkYX3DBN4Mcjs = require('./chunk-YX3DBN4M.cjs');
|
|
@@ -334,7 +339,11 @@ var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
|
334
339
|
|
|
335
340
|
|
|
336
341
|
|
|
337
|
-
|
|
342
|
+
|
|
343
|
+
var _chunkUXFQ3UDAcjs = require('./chunk-UXFQ3UDA.cjs');
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
var _chunkU4KT7QP3cjs = require('./chunk-U4KT7QP3.cjs');
|
|
338
347
|
|
|
339
348
|
|
|
340
349
|
|
|
@@ -357,13 +366,14 @@ var _chunkNO3WWW3Ncjs = require('./chunk-NO3WWW3N.cjs');
|
|
|
357
366
|
|
|
358
367
|
|
|
359
368
|
|
|
369
|
+
|
|
360
370
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
361
371
|
|
|
362
372
|
// src/routing/route-manager.ts
|
|
363
|
-
var _path = require('path'); var path9 = _interopRequireWildcard(_path); var path4 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path); var
|
|
373
|
+
var _path = require('path'); var path9 = _interopRequireWildcard(_path); var path4 = _interopRequireWildcard(_path); var path8 = _interopRequireWildcard(_path); var path16 = _interopRequireWildcard(_path); var path20 = _interopRequireWildcard(_path); var path17 = _interopRequireWildcard(_path);
|
|
364
374
|
|
|
365
375
|
// src/utils/client-component.ts
|
|
366
|
-
var _fs = require('fs'); var fs5 = _interopRequireWildcard(_fs); var fs2 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs); var
|
|
376
|
+
var _fs = require('fs'); var fs5 = _interopRequireWildcard(_fs); var fs2 = _interopRequireWildcard(_fs); var fs4 = _interopRequireWildcard(_fs); var fs11 = _interopRequireWildcard(_fs); var fs10 = _interopRequireWildcard(_fs);
|
|
367
377
|
|
|
368
378
|
var _url = require('url');
|
|
369
379
|
function readIfExists(filePath) {
|
|
@@ -1771,14 +1781,14 @@ function createFarmRouteRenderPlan(input = {}) {
|
|
|
1771
1781
|
const layoutShouldHydrate = input.layoutShouldHydrate === true;
|
|
1772
1782
|
const hydration = pageShouldHydrate ? layoutShouldHydrate ? "route-and-layout-islands" : "route-island" : layoutShouldHydrate ? "layout-island" : "none";
|
|
1773
1783
|
const rendering = input.rendering;
|
|
1774
|
-
const
|
|
1784
|
+
const cache2 = _optionalChain([rendering, 'optionalAccess', _103 => _103.ssg]) ? typeof rendering.revalidate === "number" && rendering.revalidate > 0 ? { mode: "revalidate", revalidate: rendering.revalidate } : { mode: "static" } : { mode: "dynamic" };
|
|
1775
1785
|
return {
|
|
1776
1786
|
version: 1,
|
|
1777
1787
|
output: "html",
|
|
1778
1788
|
navigation: "html-fragment",
|
|
1779
1789
|
hydration,
|
|
1780
1790
|
islandStrategy: hydration === "none" ? null : _nullishCoalesce(input.islandStrategy, () => ( "load")),
|
|
1781
|
-
cache
|
|
1791
|
+
cache: cache2
|
|
1782
1792
|
};
|
|
1783
1793
|
}
|
|
1784
1794
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmRouteRenderPlan, "createFarmRouteRenderPlan");
|
|
@@ -2203,7 +2213,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2203
2213
|
}
|
|
2204
2214
|
return absolutePath;
|
|
2205
2215
|
}, "toUrlPath");
|
|
2206
|
-
const integrationProviders =
|
|
2216
|
+
const integrationProviders = _chunkTDFPACVXcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
|
|
2207
2217
|
(provider) => provider.component || provider.type === "clerk"
|
|
2208
2218
|
);
|
|
2209
2219
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
@@ -2242,7 +2252,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2242
2252
|
);
|
|
2243
2253
|
const routeEntries = Array.from(this.routes.values()).map((entry) => ({
|
|
2244
2254
|
entry,
|
|
2245
|
-
metadata:
|
|
2255
|
+
metadata: _chunkUX5S4JEOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
|
|
2246
2256
|
entry.modulePath,
|
|
2247
2257
|
normalizedProjectRoot,
|
|
2248
2258
|
isolatedMode,
|
|
@@ -2250,7 +2260,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2250
2260
|
)
|
|
2251
2261
|
}));
|
|
2252
2262
|
const markdownFallback = routeEntries.find(
|
|
2253
|
-
({ entry, metadata }) =>
|
|
2263
|
+
({ entry, metadata }) => _chunkUX5S4JEOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
|
|
2254
2264
|
);
|
|
2255
2265
|
if (markdownFallback) {
|
|
2256
2266
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
@@ -2258,7 +2268,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2258
2268
|
);
|
|
2259
2269
|
}
|
|
2260
2270
|
const markdownStaticPackages = _optionalChain([routeEntries, 'access', _120 => _120.find, 'call', _121 => _121(
|
|
2261
|
-
({ entry, metadata }) =>
|
|
2271
|
+
({ entry, metadata }) => _chunkUX5S4JEOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
|
|
2262
2272
|
), 'optionalAccess', _122 => _122.metadata, 'access', _123 => _123.staticPackageBoundaries]);
|
|
2263
2273
|
if (markdownStaticPackages) {
|
|
2264
2274
|
_chunk5QIKR7RRcjs.logger.info(
|
|
@@ -2266,7 +2276,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2266
2276
|
);
|
|
2267
2277
|
}
|
|
2268
2278
|
for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
|
|
2269
|
-
if (
|
|
2279
|
+
if (_chunkUX5S4JEOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
|
|
2270
2280
|
_chunk5QIKR7RRcjs.logger.info(
|
|
2271
2281
|
`[Farm.js] ${entry.pattern} is async, so it renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
2272
2282
|
);
|
|
@@ -2418,13 +2428,13 @@ var _RouteManager = class _RouteManager {
|
|
|
2418
2428
|
const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
|
|
2419
2429
|
return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
|
|
2420
2430
|
}
|
|
2421
|
-
if (
|
|
2431
|
+
if (_chunkUX5S4JEOcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
|
|
2422
2432
|
const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
|
|
2423
|
-
const components = await
|
|
2433
|
+
const components = await _chunkBTAG7LI7cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
|
|
2424
2434
|
root: this.config.root,
|
|
2425
2435
|
loadModule: this.viteServer ? (componentModulePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
|
|
2426
2436
|
});
|
|
2427
|
-
return await
|
|
2437
|
+
return await _chunkBTAG7LI7cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
|
|
2428
2438
|
components,
|
|
2429
2439
|
config: mdxConfig
|
|
2430
2440
|
});
|
|
@@ -2517,7 +2527,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2517
2527
|
appDir
|
|
2518
2528
|
);
|
|
2519
2529
|
const canonicalPageGroups = /* @__PURE__ */ new Map();
|
|
2520
|
-
for (const file of pageFiles.filter((candidate) =>
|
|
2530
|
+
for (const file of pageFiles.filter((candidate) => _chunk2NQQ5H5Gcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
|
|
2521
2531
|
const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
|
|
2522
2532
|
const pattern = this.createRoutePattern(route);
|
|
2523
2533
|
const group = canonicalPageGroups.get(pattern);
|
|
@@ -2531,8 +2541,8 @@ var _RouteManager = class _RouteManager {
|
|
|
2531
2541
|
}
|
|
2532
2542
|
}
|
|
2533
2543
|
for (const [pattern, group] of canonicalPageGroups) {
|
|
2534
|
-
const componentFiles = group.files.filter((file) => !
|
|
2535
|
-
const markdownFiles = group.files.filter(
|
|
2544
|
+
const componentFiles = group.files.filter((file) => !_chunkUX5S4JEOcjs.isFarmMarkdownPageFile.call(void 0, file));
|
|
2545
|
+
const markdownFiles = group.files.filter(_chunkUX5S4JEOcjs.isFarmMarkdownPageFile);
|
|
2536
2546
|
if (componentFiles.length > 1) {
|
|
2537
2547
|
throw new Error(
|
|
2538
2548
|
`Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path9.default.join(appDir, file)).join(" and ")}.`
|
|
@@ -2590,7 +2600,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2590
2600
|
}
|
|
2591
2601
|
}
|
|
2592
2602
|
for (const file of [...pageFiles, ...slotDefaultFiles]) {
|
|
2593
|
-
const slot =
|
|
2603
|
+
const slot = _chunk2NQQ5H5Gcjs.parseRouteSlotFile.call(void 0, file);
|
|
2594
2604
|
if (!slot) continue;
|
|
2595
2605
|
const modulePath = path9.default.join(appDir, file);
|
|
2596
2606
|
const pattern = this.createRoutePattern(slot.route);
|
|
@@ -2612,7 +2622,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2612
2622
|
ownerPattern,
|
|
2613
2623
|
interception: slot.interception,
|
|
2614
2624
|
fallback: slot.fallback,
|
|
2615
|
-
containerId:
|
|
2625
|
+
containerId: _chunk2NQQ5H5Gcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
|
|
2616
2626
|
});
|
|
2617
2627
|
}
|
|
2618
2628
|
for (const file of metadataImageFiles) {
|
|
@@ -2669,7 +2679,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2669
2679
|
}
|
|
2670
2680
|
}
|
|
2671
2681
|
async discoverProgrammaticRoutes(source) {
|
|
2672
|
-
const manifests = await
|
|
2682
|
+
const manifests = await _chunkSJNMVDDFcjs.loadProgrammaticRouteManifests.call(void 0, {
|
|
2673
2683
|
root: source.root,
|
|
2674
2684
|
srcDir: source.srcDir,
|
|
2675
2685
|
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (filePath) => this.loadProgrammaticRoutesModule(filePath), "loadModule")
|
|
@@ -2850,7 +2860,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2850
2860
|
pattern: entry.pattern
|
|
2851
2861
|
}));
|
|
2852
2862
|
const i18n = this.getI18nConfig();
|
|
2853
|
-
const result = await
|
|
2863
|
+
const result = await _chunkQJ3J6MZTcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
2854
2864
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n)
|
|
2855
2865
|
});
|
|
2856
2866
|
if (!i18n) {
|
|
@@ -2895,7 +2905,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2895
2905
|
async isRouteSSG(modulePath) {
|
|
2896
2906
|
try {
|
|
2897
2907
|
const mod = await this.loadRouteModule(modulePath);
|
|
2898
|
-
const rendering = await
|
|
2908
|
+
const rendering = await _chunkQJ3J6MZTcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
2899
2909
|
return rendering.ssg;
|
|
2900
2910
|
} catch (e10) {
|
|
2901
2911
|
return false;
|
|
@@ -2907,7 +2917,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2907
2917
|
async hasRouteISR(modulePath) {
|
|
2908
2918
|
try {
|
|
2909
2919
|
const mod = await this.loadRouteModule(modulePath);
|
|
2910
|
-
const rendering = await
|
|
2920
|
+
const rendering = await _chunkQJ3J6MZTcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
2911
2921
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
2912
2922
|
} catch (e11) {
|
|
2913
2923
|
return false;
|
|
@@ -2919,7 +2929,7 @@ var _RouteManager = class _RouteManager {
|
|
|
2919
2929
|
async getRouteRevalidateInterval(modulePath) {
|
|
2920
2930
|
try {
|
|
2921
2931
|
const mod = await this.loadRouteModule(modulePath);
|
|
2922
|
-
const rendering = await
|
|
2932
|
+
const rendering = await _chunkQJ3J6MZTcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
2923
2933
|
return rendering.revalidate;
|
|
2924
2934
|
} catch (e12) {
|
|
2925
2935
|
return void 0;
|
|
@@ -3784,15 +3794,15 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readFontOptions, "readFontOptions");
|
|
|
3784
3794
|
function evaluateStaticObject(code, id, node) {
|
|
3785
3795
|
const result = {};
|
|
3786
3796
|
const properties = Array.isArray(node.properties) ? node.properties : [];
|
|
3787
|
-
for (const
|
|
3788
|
-
if (!isAstNode(
|
|
3797
|
+
for (const property2 of properties) {
|
|
3798
|
+
if (!isAstNode(property2) || property2.type !== "Property" || property2.computed === true) {
|
|
3789
3799
|
throw fontError(id, "font options do not support spreads or computed properties");
|
|
3790
3800
|
}
|
|
3791
|
-
const key = readPropertyName(
|
|
3792
|
-
if (!key || !isAstNode(
|
|
3801
|
+
const key = readPropertyName(property2.key);
|
|
3802
|
+
if (!key || !isAstNode(property2.value)) {
|
|
3793
3803
|
throw fontError(id, "font options must use static property names and values");
|
|
3794
3804
|
}
|
|
3795
|
-
result[key] = evaluateStaticValue(code, id,
|
|
3805
|
+
result[key] = evaluateStaticValue(code, id, property2.value);
|
|
3796
3806
|
}
|
|
3797
3807
|
return result;
|
|
3798
3808
|
}
|
|
@@ -4058,8 +4068,8 @@ function normalizePublicFontPath(source, moduleId) {
|
|
|
4058
4068
|
}
|
|
4059
4069
|
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizePublicFontPath, "normalizePublicFontPath");
|
|
4060
4070
|
function isPathInside(parent, child) {
|
|
4061
|
-
const
|
|
4062
|
-
return
|
|
4071
|
+
const relative4 = path9.default.relative(parent, child);
|
|
4072
|
+
return relative4 === "" || !relative4.startsWith("..") && !path9.default.isAbsolute(relative4);
|
|
4063
4073
|
}
|
|
4064
4074
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isPathInside, "isPathInside");
|
|
4065
4075
|
function normalizeBasePath(value) {
|
|
@@ -4410,7 +4420,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
|
|
|
4410
4420
|
let hasClerkProvider = false;
|
|
4411
4421
|
renderedProviders.forEach((provider, index) => {
|
|
4412
4422
|
let componentExpression = "null";
|
|
4413
|
-
if (
|
|
4423
|
+
if (_chunkTDFPACVXcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
4414
4424
|
const namespace = `FarmIntegrationProviderModule${index}`;
|
|
4415
4425
|
imports.push(
|
|
4416
4426
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -4469,7 +4479,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
|
|
|
4469
4479
|
const entries = [];
|
|
4470
4480
|
let needsMarkHelper = false;
|
|
4471
4481
|
providers.forEach((provider, index) => {
|
|
4472
|
-
if (!
|
|
4482
|
+
if (!_chunkTDFPACVXcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
|
|
4473
4483
|
const namespace = `FarmServerIntegrationProviderModule${index}`;
|
|
4474
4484
|
imports.push(
|
|
4475
4485
|
`import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
|
|
@@ -4513,8 +4523,8 @@ function redactErrorText(value) {
|
|
|
4513
4523
|
}
|
|
4514
4524
|
_chunkS3JO3N4Hcjs.__name.call(void 0, redactErrorText, "redactErrorText");
|
|
4515
4525
|
function isPathInsideRoot(root, filePath) {
|
|
4516
|
-
const
|
|
4517
|
-
return
|
|
4526
|
+
const relative4 = path8.relative(root, filePath);
|
|
4527
|
+
return relative4 === "" || !relative4.startsWith("..") && !path8.isAbsolute(relative4);
|
|
4518
4528
|
}
|
|
4519
4529
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isPathInsideRoot, "isPathInsideRoot");
|
|
4520
4530
|
function normalizeStackPath(value) {
|
|
@@ -4691,7 +4701,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, appendResponseVary, "appendResponseVary");
|
|
|
4691
4701
|
function renderI18nAlternateLinks(requestPath, snapshot, options) {
|
|
4692
4702
|
if (snapshot.routing === "none") return "";
|
|
4693
4703
|
const url = new URL(requestPath, "http://farm.local");
|
|
4694
|
-
return
|
|
4704
|
+
return _chunkP64MIF5Bcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
|
|
4695
4705
|
}
|
|
4696
4706
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderI18nAlternateLinks, "renderI18nAlternateLinks");
|
|
4697
4707
|
var PPR_REFRESH_MAX_ATTEMPTS = 3;
|
|
@@ -4733,7 +4743,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, toMiddlewareMap, "toMiddlewareMap");
|
|
|
4733
4743
|
function requestOwnHttpsServer(request2, address) {
|
|
4734
4744
|
const url = new URL(request2.url);
|
|
4735
4745
|
const hostname = url.hostname.replace(/^\[|\]$/g, "");
|
|
4736
|
-
return new Promise((
|
|
4746
|
+
return new Promise((resolve6, reject) => {
|
|
4737
4747
|
const outgoing = https.request(
|
|
4738
4748
|
{
|
|
4739
4749
|
host: address.host,
|
|
@@ -4755,7 +4765,7 @@ function requestOwnHttpsServer(request2, address) {
|
|
|
4755
4765
|
const status = _nullishCoalesce(incoming.statusCode, () => ( 502));
|
|
4756
4766
|
const hasBody = ![204, 205, 304].includes(status);
|
|
4757
4767
|
if (!hasBody) incoming.resume();
|
|
4758
|
-
|
|
4768
|
+
resolve6(
|
|
4759
4769
|
new Response(hasBody ? _stream.Readable.toWeb(incoming) : null, {
|
|
4760
4770
|
status,
|
|
4761
4771
|
headers
|
|
@@ -4825,12 +4835,12 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createRouteStateProps, "createRouteStatePr
|
|
|
4825
4835
|
var _ServerRenderer = class _ServerRenderer {
|
|
4826
4836
|
constructor(config, routeManager, i18nRuntime, viteServer) {
|
|
4827
4837
|
this.ssgManifest = [];
|
|
4828
|
-
this.dataCache =
|
|
4838
|
+
this.dataCache = _chunkYWN746UScjs.getFarmDataCache.call(void 0, );
|
|
4829
4839
|
this.config = config;
|
|
4830
4840
|
this.routeManager = routeManager;
|
|
4831
4841
|
this.i18nRuntime = i18nRuntime;
|
|
4832
4842
|
this.viteServer = viteServer;
|
|
4833
|
-
this.security =
|
|
4843
|
+
this.security = _chunkZHPHJPQPcjs.resolveFarmSecurityConfig.call(void 0, config.security);
|
|
4834
4844
|
this.loadSSGManifest();
|
|
4835
4845
|
}
|
|
4836
4846
|
async initialize() {
|
|
@@ -4951,7 +4961,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
4951
4961
|
const streaming = _chunkPSV6XKPOcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4952
4962
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4953
4963
|
if (renderToPipeableStream) {
|
|
4954
|
-
return await new Promise((
|
|
4964
|
+
return await new Promise((resolve6, reject) => {
|
|
4955
4965
|
const chunks = [];
|
|
4956
4966
|
let started = false;
|
|
4957
4967
|
const writable = new (0, _stream.Writable)({
|
|
@@ -4960,7 +4970,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
4960
4970
|
callback();
|
|
4961
4971
|
}
|
|
4962
4972
|
});
|
|
4963
|
-
writable.once("finish", () =>
|
|
4973
|
+
writable.once("finish", () => resolve6(Buffer.concat(chunks).toString("utf8")));
|
|
4964
4974
|
writable.once("error", reject);
|
|
4965
4975
|
const stream = renderToPipeableStream(element, {
|
|
4966
4976
|
onShellReady() {
|
|
@@ -5062,9 +5072,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5062
5072
|
return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element));
|
|
5063
5073
|
}
|
|
5064
5074
|
async runWithRequestContext(request2, fn) {
|
|
5065
|
-
return
|
|
5075
|
+
return _chunkUXFQ3UDAcjs._runWithCurrentRequest.call(void 0,
|
|
5066
5076
|
request2,
|
|
5067
|
-
() => _optionalChain([this, 'access', _158 => _158.i18nRuntime, 'optionalAccess', _159 => _159.config, 'access', _160 => _160.enabled]) ?
|
|
5077
|
+
() => _optionalChain([this, 'access', _158 => _158.i18nRuntime, 'optionalAccess', _159 => _159.config, 'access', _160 => _160.enabled]) ? _chunkXJXBIP67cjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
|
|
5068
5078
|
redirect: false
|
|
5069
5079
|
}) : fn()
|
|
5070
5080
|
);
|
|
@@ -5095,7 +5105,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5095
5105
|
* Check if a path should be served from SSG cache
|
|
5096
5106
|
*/
|
|
5097
5107
|
async shouldServeSSG(pathname) {
|
|
5098
|
-
const ssgPage =
|
|
5108
|
+
const ssgPage = _chunkQJ3J6MZTcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
5099
5109
|
if (!ssgPage) return null;
|
|
5100
5110
|
const cached = await this.getCachedSSGPage(pathname);
|
|
5101
5111
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -5104,10 +5114,10 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5104
5114
|
return ssgPage;
|
|
5105
5115
|
}
|
|
5106
5116
|
getSSGCacheKey(urlPath) {
|
|
5107
|
-
return _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["ssg",
|
|
5117
|
+
return _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, ["ssg", _chunkYWN746UScjs.normalizeRevalidatePath.call(void 0, urlPath)]);
|
|
5108
5118
|
}
|
|
5109
5119
|
getPPRCacheKey(pathname, search = "", locale = "", origin = "") {
|
|
5110
|
-
const key = ["ppr", locale,
|
|
5120
|
+
const key = ["ppr", locale, _chunkYWN746UScjs.normalizeRevalidatePath.call(void 0, pathname), search];
|
|
5111
5121
|
return _chunkNYJMY3JAcjs.createFarmCacheKey.call(void 0, origin ? [...key, origin] : key);
|
|
5112
5122
|
}
|
|
5113
5123
|
getCachedSSGPage(urlPath) {
|
|
@@ -5329,25 +5339,25 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5329
5339
|
if (this.viteServer) await this.applyRendererAppSetup();
|
|
5330
5340
|
_chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
|
|
5331
5341
|
_chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
|
|
5332
|
-
const cspNonce =
|
|
5342
|
+
const cspNonce = _chunkZHPHJPQPcjs.createFarmCspNonce.call(void 0, this.security);
|
|
5333
5343
|
if (cspNonce) {
|
|
5334
5344
|
req.__FARM_CSP_NONCE__ = cspNonce;
|
|
5335
|
-
const header =
|
|
5345
|
+
const header = _chunkZHPHJPQPcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
|
|
5336
5346
|
res.setHeader(header.key, header.value);
|
|
5337
5347
|
}
|
|
5338
|
-
const request2 =
|
|
5348
|
+
const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5339
5349
|
trustProxy: _optionalChain([this, 'access', _163 => _163.config, 'access', _164 => _164.server, 'optionalAccess', _165 => _165.trustProxy])
|
|
5340
5350
|
});
|
|
5341
5351
|
const runtime = this.i18nRuntime;
|
|
5342
5352
|
if (_optionalChain([runtime, 'optionalAccess', _166 => _166.config, 'access', _167 => _167.enabled])) {
|
|
5343
5353
|
const resolution = runtime.resolveRequest(request2);
|
|
5344
|
-
const varyHeaders =
|
|
5354
|
+
const varyHeaders = _chunkQCVE2OCIcjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
|
|
5345
5355
|
for (const header of varyHeaders) appendResponseVary(res, header);
|
|
5346
5356
|
if (resolution.persist) {
|
|
5347
5357
|
appendResponseHeader(
|
|
5348
5358
|
res,
|
|
5349
5359
|
"Set-Cookie",
|
|
5350
|
-
|
|
5360
|
+
_chunkQCVE2OCIcjs.createFarmLocaleCookie.call(void 0, resolution.locale, runtime.config)
|
|
5351
5361
|
);
|
|
5352
5362
|
}
|
|
5353
5363
|
if (resolution.redirect && (request2.method === "GET" || request2.method === "HEAD")) {
|
|
@@ -5382,7 +5392,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5382
5392
|
});
|
|
5383
5393
|
}, "completeRender");
|
|
5384
5394
|
try {
|
|
5385
|
-
const url =
|
|
5395
|
+
const url = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _168 => _168.config, 'access', _169 => _169.server, 'optionalAccess', _170 => _170.trustProxy]) });
|
|
5386
5396
|
pathname = url.pathname;
|
|
5387
5397
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
|
|
5388
5398
|
searchParamsObject = _chunkQNPEUFHQcjs.searchParamsToObject.call(void 0, url.searchParams);
|
|
@@ -5458,7 +5468,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5458
5468
|
pluginExposedContext = _chunkEM6SBQKMcjs.getRequestContextSnapshot.call(void 0, req, {
|
|
5459
5469
|
exposedOnly: true
|
|
5460
5470
|
});
|
|
5461
|
-
const currentRequest =
|
|
5471
|
+
const currentRequest = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5462
5472
|
trustProxy: _optionalChain([this, 'access', _171 => _171.config, 'access', _172 => _172.server, 'optionalAccess', _173 => _173.trustProxy])
|
|
5463
5473
|
});
|
|
5464
5474
|
const routeContext = await this.resolveRouteContext({
|
|
@@ -5485,6 +5495,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5485
5495
|
const programmaticRouteComponents = routeModule.__farmRouteComponents;
|
|
5486
5496
|
let PageComponent = routeModule.default;
|
|
5487
5497
|
let pageProps;
|
|
5498
|
+
let routeStateRejected = false;
|
|
5488
5499
|
try {
|
|
5489
5500
|
pageProps = await parseRouteModuleProps(routeModule, {
|
|
5490
5501
|
props: rawPageProps,
|
|
@@ -5493,6 +5504,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5493
5504
|
});
|
|
5494
5505
|
} catch (error) {
|
|
5495
5506
|
if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) throw error;
|
|
5507
|
+
routeStateRejected = true;
|
|
5496
5508
|
const routeStateProps = {
|
|
5497
5509
|
...rawPageProps,
|
|
5498
5510
|
search: searchParamsObject,
|
|
@@ -5511,14 +5523,14 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5511
5523
|
throw error;
|
|
5512
5524
|
}
|
|
5513
5525
|
}
|
|
5514
|
-
const renderingConfig = await
|
|
5526
|
+
const renderingConfig = await _chunkQJ3J6MZTcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5515
5527
|
routeModule,
|
|
5516
5528
|
route.modulePath,
|
|
5517
5529
|
{ experimentalPPR: _optionalChain([this, 'access', _176 => _176.config, 'access', _177 => _177.experimental, 'optionalAccess', _178 => _178.ppr]) === true }
|
|
5518
5530
|
);
|
|
5519
5531
|
const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
|
|
5520
5532
|
const canCachePPRShell = renderingConfig.ppr && !pprBypassReason;
|
|
5521
|
-
const pprI18nSnapshot = canCachePPRShell ?
|
|
5533
|
+
const pprI18nSnapshot = canCachePPRShell ? _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) : void 0;
|
|
5522
5534
|
const pprShellOptions = canCachePPRShell ? {
|
|
5523
5535
|
pathname,
|
|
5524
5536
|
search: url.search,
|
|
@@ -5571,6 +5583,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5571
5583
|
key: pprCacheKey
|
|
5572
5584
|
});
|
|
5573
5585
|
}
|
|
5586
|
+
const outerRequest = _chunkU4KT7QP3cjs._resolveCurrentRequest.call(void 0, );
|
|
5587
|
+
const countRequestReads = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => (outerRequest ? _chunkUXFQ3UDAcjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkUXFQ3UDAcjs._getRequestReadCount.call(void 0, currentRequest), "countRequestReads");
|
|
5588
|
+
const requestReadsBeforeRender = countRequestReads();
|
|
5574
5589
|
let LoadingFallbackComponent = null;
|
|
5575
5590
|
if (loadingBoundaryEntry) {
|
|
5576
5591
|
const loadingModule = await this.routeManager.loadRouteModule(
|
|
@@ -5746,13 +5761,14 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5746
5761
|
layoutModules,
|
|
5747
5762
|
routeModule,
|
|
5748
5763
|
pageProps,
|
|
5749
|
-
pathname
|
|
5764
|
+
pathname,
|
|
5765
|
+
skipGeneratedRouteMetadata: routeStateRejected
|
|
5750
5766
|
});
|
|
5751
5767
|
req.__FARM_METADATA__ = mergedMetadata;
|
|
5752
5768
|
const middlewareDataForContext = middlewareMap;
|
|
5753
|
-
await
|
|
5754
|
-
await
|
|
5755
|
-
await
|
|
5769
|
+
await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
|
|
5770
|
+
await _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
|
|
5771
|
+
await _chunkUXFQ3UDAcjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
|
|
5756
5772
|
let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
|
|
5757
5773
|
if (LoadingFallbackComponent) {
|
|
5758
5774
|
const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
|
|
@@ -5839,8 +5855,8 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5839
5855
|
req,
|
|
5840
5856
|
res,
|
|
5841
5857
|
() => {
|
|
5842
|
-
|
|
5843
|
-
|
|
5858
|
+
_chunk3BU22U3Mcjs._clearCurrentMiddlewareData.call(void 0, );
|
|
5859
|
+
_chunk3BU22U3Mcjs._clearCurrentMiddlewareContext.call(void 0, );
|
|
5844
5860
|
},
|
|
5845
5861
|
{
|
|
5846
5862
|
responseHeaders: pprHeaders,
|
|
@@ -5851,7 +5867,22 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5851
5867
|
type: "ppr.suspense.holeDetected",
|
|
5852
5868
|
route: pathname
|
|
5853
5869
|
}) : void 0,
|
|
5854
|
-
onComplete: pprShellOptions && req.method !== "HEAD" ? (html) =>
|
|
5870
|
+
onComplete: pprShellOptions && req.method !== "HEAD" ? (html) => {
|
|
5871
|
+
if (countRequestReads() !== requestReadsBeforeRender) {
|
|
5872
|
+
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
5873
|
+
type: "ppr.shell.bypass",
|
|
5874
|
+
route: pathname,
|
|
5875
|
+
reason: "request-read"
|
|
5876
|
+
});
|
|
5877
|
+
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
5878
|
+
type: "cache.bypass",
|
|
5879
|
+
route: pathname,
|
|
5880
|
+
reason: "request-read"
|
|
5881
|
+
});
|
|
5882
|
+
return;
|
|
5883
|
+
}
|
|
5884
|
+
return this.cachePPRShell(pprShellOptions, html);
|
|
5885
|
+
} : void 0
|
|
5855
5886
|
}
|
|
5856
5887
|
);
|
|
5857
5888
|
if (pprRefreshRoute) {
|
|
@@ -5878,7 +5909,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5878
5909
|
}
|
|
5879
5910
|
if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
|
|
5880
5911
|
const redirect = _chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error);
|
|
5881
|
-
const snapshot =
|
|
5912
|
+
const snapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5882
5913
|
const redirectUrl = snapshot && redirect.url.startsWith("/") && !redirect.url.startsWith("//") ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, redirect.url, snapshot.locale, snapshot) : redirect.url;
|
|
5883
5914
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
5884
5915
|
type: "route.redirect",
|
|
@@ -5915,7 +5946,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5915
5946
|
}
|
|
5916
5947
|
}
|
|
5917
5948
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
|
|
5918
|
-
const errorStatus =
|
|
5949
|
+
const errorStatus = _chunkP64MIF5Bcjs.resolveDefaultErrorStatus.call(void 0, error);
|
|
5919
5950
|
if (pprRefreshRoute) {
|
|
5920
5951
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
5921
5952
|
type: "ppr.refresh.error",
|
|
@@ -5951,7 +5982,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5951
5982
|
}
|
|
5952
5983
|
}
|
|
5953
5984
|
async wrapWithIntegrationProviders(element) {
|
|
5954
|
-
const providers =
|
|
5985
|
+
const providers = _chunkTDFPACVXcjs.getIntegrationProviders.call(void 0, this.config.integrations);
|
|
5955
5986
|
let wrapped = element;
|
|
5956
5987
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5957
5988
|
const provider = providers[i];
|
|
@@ -5969,7 +6000,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5969
6000
|
}
|
|
5970
6001
|
let ProviderComponent;
|
|
5971
6002
|
let providerSourceModule;
|
|
5972
|
-
if (
|
|
6003
|
+
if (_chunkTDFPACVXcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
|
|
5973
6004
|
providerSourceModule = provider.component.module;
|
|
5974
6005
|
const providerModuleId = provider.component.module.startsWith(".") ? _chunk5QIKR7RRcjs.toViteModuleId.call(void 0,
|
|
5975
6006
|
path9.resolve(this.config.root, provider.component.module),
|
|
@@ -6025,7 +6056,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6025
6056
|
}
|
|
6026
6057
|
}
|
|
6027
6058
|
metadata = _chunk3LUF2PE2cjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
|
|
6028
|
-
if (typeof options.routeModule.generateMetadata === "function") {
|
|
6059
|
+
if (!options.skipGeneratedRouteMetadata && typeof options.routeModule.generateMetadata === "function") {
|
|
6029
6060
|
metadata = _chunk3LUF2PE2cjs.mergeMetadata.call(void 0,
|
|
6030
6061
|
metadata,
|
|
6031
6062
|
await options.routeModule.generateMetadata(options.pageProps)
|
|
@@ -6041,7 +6072,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6041
6072
|
manifestMatch.metadata,
|
|
6042
6073
|
manifestMatch.params
|
|
6043
6074
|
);
|
|
6044
|
-
const snapshot2 =
|
|
6075
|
+
const snapshot2 = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6045
6076
|
const localizedHref = snapshot2 ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, rawHref, snapshot2.locale, snapshot2) : rawHref;
|
|
6046
6077
|
metadata.manifest = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
|
|
6047
6078
|
}
|
|
@@ -6052,14 +6083,14 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6052
6083
|
metadata = _chunk3LUF2PE2cjs.addMetadataImageReference.call(void 0, metadata, reference);
|
|
6053
6084
|
}
|
|
6054
6085
|
}
|
|
6055
|
-
const snapshot =
|
|
6086
|
+
const snapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6056
6087
|
const publicPathname = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0,
|
|
6057
6088
|
snapshot ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
|
|
6058
6089
|
this.config.basePath
|
|
6059
6090
|
);
|
|
6060
6091
|
metadata = _chunk3LUF2PE2cjs.addMetadataMarkdownAlternate.call(void 0,
|
|
6061
6092
|
metadata,
|
|
6062
|
-
|
|
6093
|
+
_chunkXXJU7FCCcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkXXJU7FCCcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
|
|
6063
6094
|
);
|
|
6064
6095
|
return metadata;
|
|
6065
6096
|
}
|
|
@@ -6067,7 +6098,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6067
6098
|
const match = this.routeManager.getMatchingMetadataImage(pathname, kind);
|
|
6068
6099
|
if (!match) return null;
|
|
6069
6100
|
const rawHref = this.routeManager.resolveMetadataImagePath(match.image, match.params);
|
|
6070
|
-
const snapshot =
|
|
6101
|
+
const snapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6071
6102
|
const localizedHref = snapshot ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, rawHref, snapshot.locale, snapshot) : rawHref;
|
|
6072
6103
|
const href = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, localizedHref, this.config.basePath);
|
|
6073
6104
|
const reference = {
|
|
@@ -6116,7 +6147,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6116
6147
|
`Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
|
|
6117
6148
|
);
|
|
6118
6149
|
}
|
|
6119
|
-
const request2 =
|
|
6150
|
+
const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6120
6151
|
trustProxy: _optionalChain([this, 'access', _197 => _197.config, 'access', _198 => _198.server, 'optionalAccess', _199 => _199.trustProxy])
|
|
6121
6152
|
});
|
|
6122
6153
|
const url = new URL(request2.url);
|
|
@@ -6131,11 +6162,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6131
6162
|
path: match.routePath,
|
|
6132
6163
|
...llmsContext
|
|
6133
6164
|
}) : routeModule.default;
|
|
6134
|
-
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await
|
|
6165
|
+
const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkZHPHJPQPcjs.renderFarmLlmsFullTxt.call(void 0, value, {
|
|
6135
6166
|
origin: url.origin,
|
|
6136
6167
|
readMarkdown: llmsContext.markdown
|
|
6137
6168
|
}) : value;
|
|
6138
|
-
const response =
|
|
6169
|
+
const response = _chunkP64MIF5Bcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
|
|
6139
6170
|
method,
|
|
6140
6171
|
request: request2
|
|
6141
6172
|
});
|
|
@@ -6153,25 +6184,25 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6153
6184
|
}
|
|
6154
6185
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
6155
6186
|
getGeneratedLlmsKind(pathname) {
|
|
6156
|
-
const config =
|
|
6187
|
+
const config = _chunkZHPHJPQPcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
|
|
6157
6188
|
if (!config.enabled) return null;
|
|
6158
6189
|
if (pathname === "/llms.txt") return "llms";
|
|
6159
6190
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
6160
6191
|
}
|
|
6161
6192
|
async renderGeneratedLlmsTxt(req, res, kind) {
|
|
6162
6193
|
try {
|
|
6163
|
-
const request2 =
|
|
6194
|
+
const request2 = _chunkUXFQ3UDAcjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6164
6195
|
trustProxy: _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.server, 'optionalAccess', _205 => _205.trustProxy])
|
|
6165
6196
|
});
|
|
6166
|
-
const config =
|
|
6197
|
+
const config = _chunkZHPHJPQPcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _206 => _206.config, 'access', _207 => _207.agent, 'optionalAccess', _208 => _208.llmsTxt]));
|
|
6167
6198
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
6168
|
-
const body = kind === "llms-full" ? await
|
|
6199
|
+
const body = kind === "llms-full" ? await _chunkZHPHJPQPcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
6169
6200
|
origin: new URL(request2.url).origin,
|
|
6170
6201
|
readMarkdown: context.markdown
|
|
6171
6202
|
}) : context.defaults;
|
|
6172
6203
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6173
6204
|
res,
|
|
6174
|
-
|
|
6205
|
+
_chunkP64MIF5Bcjs.createFarmMetadataRouteResponse.call(void 0,
|
|
6175
6206
|
kind,
|
|
6176
6207
|
body,
|
|
6177
6208
|
{ revalidate: config.revalidate },
|
|
@@ -6190,7 +6221,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6190
6221
|
}
|
|
6191
6222
|
}
|
|
6192
6223
|
getAgentCrawlers() {
|
|
6193
|
-
return
|
|
6224
|
+
return _chunkZHPHJPQPcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _209 => _209.config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.crawlers]));
|
|
6194
6225
|
}
|
|
6195
6226
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6196
6227
|
async renderGeneratedRobotsTxt(req, res) {
|
|
@@ -6198,7 +6229,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6198
6229
|
const sitemapPath = _optionalChain([this, 'access', _212 => _212.routeManager, 'access', _213 => _213.matchMetadataRoute, 'call', _214 => _214("/sitemap.xml"), 'optionalAccess', _215 => _215.metadata, 'access', _216 => _216.kind]) === "sitemap" ? "/sitemap.xml" : void 0;
|
|
6199
6230
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6200
6231
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6201
|
-
const robots =
|
|
6232
|
+
const robots = _chunkZHPHJPQPcjs.createFarmAgentRobots.call(void 0, {
|
|
6202
6233
|
crawlers: this.getAgentCrawlers(),
|
|
6203
6234
|
sitemapPath,
|
|
6204
6235
|
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _217 => _217.metadataBase]),
|
|
@@ -6206,7 +6237,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6206
6237
|
});
|
|
6207
6238
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
6208
6239
|
res,
|
|
6209
|
-
|
|
6240
|
+
_chunkP64MIF5Bcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
|
|
6210
6241
|
);
|
|
6211
6242
|
} catch (error) {
|
|
6212
6243
|
_chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
|
|
@@ -6221,7 +6252,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6221
6252
|
}
|
|
6222
6253
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6223
6254
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6224
|
-
const config =
|
|
6255
|
+
const config = _chunkZHPHJPQPcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _218 => _218.config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.llmsTxt]));
|
|
6225
6256
|
const origin = new URL(request2.url).origin;
|
|
6226
6257
|
const staticRoutes = [...this.routeManager.getRoutes()].filter(
|
|
6227
6258
|
([pattern]) => !pattern.includes("[")
|
|
@@ -6239,16 +6270,16 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6239
6270
|
);
|
|
6240
6271
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6241
6272
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6242
|
-
const pages =
|
|
6273
|
+
const pages = _chunkZHPHJPQPcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
|
|
6243
6274
|
origin,
|
|
6244
6275
|
basePath: this.config.basePath,
|
|
6245
|
-
markdown:
|
|
6276
|
+
markdown: _chunkXXJU7FCCcjs.resolveMarkdownConfig.call(void 0, this.config.md),
|
|
6246
6277
|
include: config.include,
|
|
6247
6278
|
exclude: config.exclude
|
|
6248
6279
|
});
|
|
6249
6280
|
return {
|
|
6250
6281
|
pages,
|
|
6251
|
-
defaults:
|
|
6282
|
+
defaults: _chunkZHPHJPQPcjs.createFarmDefaultLlmsTxt.call(void 0, { origin, pages, config, rootMetadata }),
|
|
6252
6283
|
...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
|
|
6253
6284
|
};
|
|
6254
6285
|
}
|
|
@@ -6268,11 +6299,11 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6268
6299
|
}
|
|
6269
6300
|
if (socket.encrypted) {
|
|
6270
6301
|
const address = { host: socket.localAddress, port: socket.localPort };
|
|
6271
|
-
return
|
|
6302
|
+
return _chunkZHPHJPQPcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
|
|
6272
6303
|
}
|
|
6273
6304
|
const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
|
|
6274
6305
|
const localOrigin = `http://${host}:${socket.localPort}`;
|
|
6275
|
-
const read =
|
|
6306
|
+
const read = _chunkZHPHJPQPcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
|
|
6276
6307
|
return (url) => {
|
|
6277
6308
|
const target = new URL(url);
|
|
6278
6309
|
return read(`${localOrigin}${target.pathname}${target.search}`);
|
|
@@ -6327,7 +6358,7 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6327
6358
|
return;
|
|
6328
6359
|
}
|
|
6329
6360
|
const etag = `"${image.staticInfo.hash}"`;
|
|
6330
|
-
const requestUrl =
|
|
6361
|
+
const requestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6331
6362
|
trustProxy: _optionalChain([this, 'access', _226 => _226.config, 'access', _227 => _227.server, 'optionalAccess', _228 => _228.trustProxy])
|
|
6332
6363
|
});
|
|
6333
6364
|
const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
|
|
@@ -6389,9 +6420,9 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
6389
6420
|
});
|
|
6390
6421
|
}
|
|
6391
6422
|
wrapped = await this.wrapWithIntegrationProviders(wrapped);
|
|
6392
|
-
const html = await
|
|
6423
|
+
const html = await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0,
|
|
6393
6424
|
options.middlewareMap,
|
|
6394
|
-
() =>
|
|
6425
|
+
() => _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0,
|
|
6395
6426
|
options.middlewareContext,
|
|
6396
6427
|
() => this.rendererRuntime.renderToString(wrapped)
|
|
6397
6428
|
)
|
|
@@ -6500,8 +6531,8 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
|
|
|
6500
6531
|
window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
|
|
6501
6532
|
window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
|
|
6502
6533
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6503
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6504
|
-
window.__FARM_I18N__ = ${
|
|
6534
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkTDFPACVXcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6535
|
+
window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6505
6536
|
</script>`;
|
|
6506
6537
|
const deferredScript = createDeferredHydrationScript(deferredProps.records);
|
|
6507
6538
|
const rendererHydrationScript = _optionalChain([this, 'access', _229 => _229.rendererRuntime, 'access', _230 => _230.generateHydrationScript, 'optionalCall', _231 => _231()]) || "";
|
|
@@ -6517,16 +6548,16 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6517
6548
|
});
|
|
6518
6549
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
6519
6550
|
const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
|
|
6520
|
-
const i18nSnapshot =
|
|
6551
|
+
const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6521
6552
|
const alternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
6522
6553
|
req.__FARM_ROUTE__ || req.url || "/",
|
|
6523
6554
|
i18nSnapshot,
|
|
6524
6555
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6525
6556
|
) : "";
|
|
6526
|
-
const themeDocument =
|
|
6557
|
+
const themeDocument = _chunkP64MIF5Bcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6527
6558
|
this.config.theme,
|
|
6528
6559
|
this.config.basePath,
|
|
6529
|
-
|
|
6560
|
+
_chunkKXWRO25Scjs.getTheme.call(void 0, )
|
|
6530
6561
|
);
|
|
6531
6562
|
const fullDocument = extractFarmFullDocument(content);
|
|
6532
6563
|
let html;
|
|
@@ -6642,7 +6673,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6642
6673
|
if (!renderToPipeableStream || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
|
|
6643
6674
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6644
6675
|
}
|
|
6645
|
-
return new Promise((
|
|
6676
|
+
return new Promise((resolve6, reject) => {
|
|
6646
6677
|
const streamStartTime = Date.now();
|
|
6647
6678
|
const observabilityRoute = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6648
6679
|
const deploymentId = this.getDeploymentId();
|
|
@@ -6741,8 +6772,8 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
|
|
|
6741
6772
|
req.__FARM_LOADING_MODULE_PATH__ || null
|
|
6742
6773
|
)};
|
|
6743
6774
|
window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
|
|
6744
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
6745
|
-
window.__FARM_I18N__ = ${
|
|
6775
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkTDFPACVXcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
6776
|
+
window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
|
|
6746
6777
|
</script>`;
|
|
6747
6778
|
const hydrationClickQueueScript = isClientComponent || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true ? createPreHydrationClickQueueScript() : "";
|
|
6748
6779
|
const {
|
|
@@ -6753,23 +6784,23 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6753
6784
|
pathname: getFarmMetadataPathname(req),
|
|
6754
6785
|
jsonLd: _optionalChain([this, 'access', _243 => _243.config, 'access', _244 => _244.agent, 'optionalAccess', _245 => _245.jsonLd])
|
|
6755
6786
|
});
|
|
6756
|
-
const i18nSnapshot =
|
|
6787
|
+
const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6757
6788
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
6758
6789
|
req.__FARM_ROUTE__ || req.url || "/",
|
|
6759
6790
|
i18nSnapshot,
|
|
6760
6791
|
this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
|
|
6761
6792
|
) : "";
|
|
6762
6793
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
6763
|
-
const themeDocument =
|
|
6794
|
+
const themeDocument = _chunkP64MIF5Bcjs.createFarmThemeDocumentParts.call(void 0,
|
|
6764
6795
|
this.config.theme,
|
|
6765
6796
|
this.config.basePath,
|
|
6766
|
-
|
|
6797
|
+
_chunkKXWRO25Scjs.getTheme.call(void 0, )
|
|
6767
6798
|
);
|
|
6768
6799
|
const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
|
|
6769
6800
|
const devStyleLinks = this.collectDevStyleLinks();
|
|
6770
6801
|
const globalStylesheetLink = this.devGlobalStylesheetLink(true);
|
|
6771
6802
|
const cspNonce = this.getCspNonce(req);
|
|
6772
|
-
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ?
|
|
6803
|
+
const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkZHPHJPQPcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
|
|
6773
6804
|
const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
|
|
6774
6805
|
const { pipe, abort } = renderToPipeableStream(streamRoot, {
|
|
6775
6806
|
nonce: cspNonce,
|
|
@@ -6816,7 +6847,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6816
6847
|
let firstChunk = true;
|
|
6817
6848
|
let checkedFullDocument = false;
|
|
6818
6849
|
let documentPrefix = "";
|
|
6819
|
-
const cspNonceRewriter = cspNonce ?
|
|
6850
|
+
const cspNonceRewriter = cspNonce ? _chunkZHPHJPQPcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
|
|
6820
6851
|
const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
|
|
6821
6852
|
const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
|
|
6822
6853
|
if (!chunkText) return;
|
|
@@ -6922,7 +6953,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6922
6953
|
route: observabilityRoute,
|
|
6923
6954
|
durationMs: Date.now() - streamStartTime
|
|
6924
6955
|
});
|
|
6925
|
-
|
|
6956
|
+
resolve6();
|
|
6926
6957
|
}, "finishStream");
|
|
6927
6958
|
res.write(securedShell);
|
|
6928
6959
|
if (typeof res.flush === "function") {
|
|
@@ -6983,7 +7014,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6983
7014
|
return false;
|
|
6984
7015
|
}
|
|
6985
7016
|
localizeRedirectUrl(url) {
|
|
6986
|
-
const snapshot =
|
|
7017
|
+
const snapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6987
7018
|
return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
|
|
6988
7019
|
}
|
|
6989
7020
|
/** The app's not-found component, or null when it relies on the built-in page. */
|
|
@@ -7019,9 +7050,9 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7019
7050
|
*/
|
|
7020
7051
|
async createLateNavigationRecoveryHTML(req, error) {
|
|
7021
7052
|
if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
|
|
7022
|
-
return
|
|
7053
|
+
return _chunkP64MIF5Bcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
|
|
7023
7054
|
}
|
|
7024
|
-
const pathname =
|
|
7055
|
+
const pathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7025
7056
|
trustProxy: _optionalChain([this, 'access', _253 => _253.config, 'access', _254 => _254.server, 'optionalAccess', _255 => _255.trustProxy])
|
|
7026
7057
|
}).pathname;
|
|
7027
7058
|
let content = this.defaultNotFoundContent();
|
|
@@ -7037,20 +7068,20 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7037
7068
|
_chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
|
|
7038
7069
|
}
|
|
7039
7070
|
}
|
|
7040
|
-
return
|
|
7071
|
+
return _chunkP64MIF5Bcjs.createLateNotFoundRecovery.call(void 0, content);
|
|
7041
7072
|
}
|
|
7042
7073
|
async render404(req, res) {
|
|
7043
7074
|
res.statusCode = 404;
|
|
7044
|
-
const pathname =
|
|
7075
|
+
const pathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7045
7076
|
trustProxy: _optionalChain([this, 'access', _256 => _256.config, 'access', _257 => _257.server, 'optionalAccess', _258 => _258.trustProxy])
|
|
7046
7077
|
}).pathname;
|
|
7047
7078
|
const acceptHeader = req.headers.accept;
|
|
7048
7079
|
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
7049
|
-
if (
|
|
7050
|
-
res.setHeader("Content-Type",
|
|
7080
|
+
if (_chunkXXJU7FCCcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
|
|
7081
|
+
res.setHeader("Content-Type", _chunkXXJU7FCCcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
7051
7082
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
7052
7083
|
res.setHeader("Cache-Control", "no-store");
|
|
7053
|
-
res.end(
|
|
7084
|
+
res.end(_chunkXXJU7FCCcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
|
|
7054
7085
|
return;
|
|
7055
7086
|
}
|
|
7056
7087
|
const appDir = path9.join(this.config.root, this.config.srcDir, "app");
|
|
@@ -7108,12 +7139,12 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7108
7139
|
}
|
|
7109
7140
|
res.statusCode = statusCode;
|
|
7110
7141
|
const isDev = process.env.NODE_ENV === "development";
|
|
7111
|
-
const requestUrl =
|
|
7142
|
+
const requestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7112
7143
|
trustProxy: _optionalChain([this, 'access', _261 => _261.config, 'access', _262 => _262.server, 'optionalAccess', _263 => _263.trustProxy])
|
|
7113
7144
|
});
|
|
7114
7145
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7115
|
-
const statusText =
|
|
7116
|
-
const content =
|
|
7146
|
+
const statusText = _chunkP64MIF5Bcjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
7147
|
+
const content = _chunkP64MIF5Bcjs.createDefaultErrorMarkup.call(void 0, {
|
|
7117
7148
|
statusCode,
|
|
7118
7149
|
statusText,
|
|
7119
7150
|
requestPath: requestUrl.pathname,
|
|
@@ -7123,7 +7154,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7123
7154
|
stack: _optionalChain([diagnostics, 'optionalAccess', _266 => _266.stack]),
|
|
7124
7155
|
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _267 => _267.sourceFrame]),
|
|
7125
7156
|
development: isDev,
|
|
7126
|
-
farmVersion:
|
|
7157
|
+
farmVersion: _chunkODBZYBABcjs.FARM_VERSION,
|
|
7127
7158
|
nodeVersion: process.version,
|
|
7128
7159
|
mode: isDev ? "development" : "production"
|
|
7129
7160
|
});
|
|
@@ -7149,15 +7180,15 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7149
7180
|
getI18nAlternateOptions(req, metadata) {
|
|
7150
7181
|
return {
|
|
7151
7182
|
metadataBase: _optionalChain([metadata, 'optionalAccess', _268 => _268.metadataBase]),
|
|
7152
|
-
origin: req ?
|
|
7183
|
+
origin: req ? _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _269 => _269.config, 'access', _270 => _270.server, 'optionalAccess', _271 => _271.trustProxy]) }).origin : void 0
|
|
7153
7184
|
};
|
|
7154
7185
|
}
|
|
7155
7186
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
7156
|
-
const i18nSnapshot =
|
|
7187
|
+
const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
7157
7188
|
const clientScript = isClientComponent ? ` <script type="module" src="/@farm/client.js"></script>` : "";
|
|
7158
7189
|
const integrationManifestScript = `<script>
|
|
7159
7190
|
window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
|
|
7160
|
-
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(
|
|
7191
|
+
window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkTDFPACVXcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
|
|
7161
7192
|
${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
|
|
7162
7193
|
</script>`;
|
|
7163
7194
|
const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -7166,10 +7197,10 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7166
7197
|
this.getI18nAlternateOptions(alternates.req, alternates.metadata)
|
|
7167
7198
|
) : "";
|
|
7168
7199
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
7169
|
-
const themeDocument =
|
|
7200
|
+
const themeDocument = _chunkP64MIF5Bcjs.createFarmThemeDocumentParts.call(void 0,
|
|
7170
7201
|
this.config.theme,
|
|
7171
7202
|
this.config.basePath,
|
|
7172
|
-
|
|
7203
|
+
_chunkKXWRO25Scjs.getTheme.call(void 0, )
|
|
7173
7204
|
);
|
|
7174
7205
|
const rendererHydrationScript = _optionalChain([this, 'access', _272 => _272.rendererRuntime, 'access', _273 => _273.generateHydrationScript, 'optionalCall', _274 => _274()]) || "";
|
|
7175
7206
|
const fullDocument = extractFarmFullDocument(content);
|
|
@@ -7226,7 +7257,7 @@ ${clientScript}
|
|
|
7226
7257
|
}
|
|
7227
7258
|
secureDocumentHTML(req, html) {
|
|
7228
7259
|
const nonce = this.getCspNonce(req);
|
|
7229
|
-
return nonce ?
|
|
7260
|
+
return nonce ? _chunkZHPHJPQPcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
|
|
7230
7261
|
}
|
|
7231
7262
|
applyDeploymentHeaders(req, res) {
|
|
7232
7263
|
const deploymentId = this.getDeploymentId();
|
|
@@ -7266,9 +7297,9 @@ var _FarmApp = class _FarmApp {
|
|
|
7266
7297
|
constructor(config = {}, viteServer) {
|
|
7267
7298
|
this.config = this.normalizeConfig(config);
|
|
7268
7299
|
_chunkE3UK5IIBcjs.configureFarmObservability.call(void 0, this.config.observability);
|
|
7269
|
-
|
|
7270
|
-
this.i18nRuntime =
|
|
7271
|
-
|
|
7300
|
+
_chunkKXWRO25Scjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
|
|
7301
|
+
this.i18nRuntime = _chunkXJXBIP67cjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
|
|
7302
|
+
_chunkXJXBIP67cjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
|
|
7272
7303
|
this.viteServer = viteServer;
|
|
7273
7304
|
this.routeManager = new RouteManager(this.config, viteServer);
|
|
7274
7305
|
this.serverRenderer = new ServerRenderer(
|
|
@@ -7283,7 +7314,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7283
7314
|
_chunk5QIKR7RRcjs.logger.info("Initializing Farm.js application...");
|
|
7284
7315
|
}
|
|
7285
7316
|
await _chunk4ZFL5GFNcjs.initStorage.call(void 0, this.config.storage);
|
|
7286
|
-
await
|
|
7317
|
+
await _chunkYWN746UScjs.configureFarmCache.call(void 0, this.config.cache);
|
|
7287
7318
|
await this.i18nRuntime.initialize();
|
|
7288
7319
|
await this.serverRenderer.initialize();
|
|
7289
7320
|
await this.verifyAppStructure();
|
|
@@ -7334,11 +7365,11 @@ var _FarmApp = class _FarmApp {
|
|
|
7334
7365
|
context: config.context || (() => void 0),
|
|
7335
7366
|
server: _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, config.server),
|
|
7336
7367
|
serverActions: _chunkT5CERMEHcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
|
|
7337
|
-
security:
|
|
7368
|
+
security: _chunkZHPHJPQPcjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7338
7369
|
images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
|
|
7339
|
-
performance:
|
|
7370
|
+
performance: _chunkZHPHJPQPcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7340
7371
|
theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
7341
|
-
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n :
|
|
7372
|
+
i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHLJ6MBUZcjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
|
|
7342
7373
|
root,
|
|
7343
7374
|
mode: process.env.NODE_ENV === "production" ? "production" : "development",
|
|
7344
7375
|
basePath
|
|
@@ -7348,7 +7379,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7348
7379
|
serverRuntimeConfig: config.serverRuntimeConfig || {},
|
|
7349
7380
|
publicRuntimeConfig: config.publicRuntimeConfig || {},
|
|
7350
7381
|
docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
|
|
7351
|
-
md:
|
|
7382
|
+
md: _chunkXXJU7FCCcjs.resolveMarkdownConfig.call(void 0, config.md),
|
|
7352
7383
|
mdx: _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx),
|
|
7353
7384
|
observability: _nullishCoalesce(config.observability, () => ( false)),
|
|
7354
7385
|
telemetry: config.telemetry !== false,
|
|
@@ -7381,7 +7412,7 @@ var _FarmApp = class _FarmApp {
|
|
|
7381
7412
|
);
|
|
7382
7413
|
if (!hasAppDirectory) {
|
|
7383
7414
|
const routeFiles = _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
|
|
7384
|
-
(source) =>
|
|
7415
|
+
(source) => _chunkSJNMVDDFcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
|
|
7385
7416
|
);
|
|
7386
7417
|
if (routeFiles.length > 0) {
|
|
7387
7418
|
return;
|
|
@@ -7470,9 +7501,9 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isVitePluginHook, "isVitePluginHook");
|
|
|
7470
7501
|
function withVite5TransformContext(handler) {
|
|
7471
7502
|
return function(...args) {
|
|
7472
7503
|
const context = new Proxy(this, {
|
|
7473
|
-
get(target,
|
|
7474
|
-
if (
|
|
7475
|
-
return Reflect.get(target,
|
|
7504
|
+
get(target, property2, receiver) {
|
|
7505
|
+
if (property2 === "environment") return void 0;
|
|
7506
|
+
return Reflect.get(target, property2, receiver);
|
|
7476
7507
|
}
|
|
7477
7508
|
});
|
|
7478
7509
|
return handler.apply(context, args);
|
|
@@ -7632,8 +7663,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, validateSchemaSteps, "validateSchemaSteps"
|
|
|
7632
7663
|
var _FarmPluginOptionsError = class _FarmPluginOptionsError extends TypeError {
|
|
7633
7664
|
constructor(issues) {
|
|
7634
7665
|
const lines = issues.map((issue) => {
|
|
7635
|
-
const
|
|
7636
|
-
return ` - ${
|
|
7666
|
+
const path21 = formatIssuePath(issue.path);
|
|
7667
|
+
return ` - ${path21 ? `${path21}: ` : ""}${issue.message}`;
|
|
7637
7668
|
});
|
|
7638
7669
|
super(`Invalid plugin options:
|
|
7639
7670
|
${lines.join("\n")}`);
|
|
@@ -7643,9 +7674,9 @@ ${lines.join("\n")}`);
|
|
|
7643
7674
|
};
|
|
7644
7675
|
_chunkS3JO3N4Hcjs.__name.call(void 0, _FarmPluginOptionsError, "FarmPluginOptionsError");
|
|
7645
7676
|
var FarmPluginOptionsError = _FarmPluginOptionsError;
|
|
7646
|
-
function formatIssuePath(
|
|
7647
|
-
if (!_optionalChain([
|
|
7648
|
-
return
|
|
7677
|
+
function formatIssuePath(path21) {
|
|
7678
|
+
if (!_optionalChain([path21, 'optionalAccess', _298 => _298.length])) return "";
|
|
7679
|
+
return path21.map((segment) => {
|
|
7649
7680
|
const key = typeof segment === "object" && segment !== null ? segment.key : segment;
|
|
7650
7681
|
return typeof key === "symbol" ? key.toString() : String(key);
|
|
7651
7682
|
}).join(".");
|
|
@@ -7816,7 +7847,7 @@ var _PluginManager = class _PluginManager {
|
|
|
7816
7847
|
};
|
|
7817
7848
|
}
|
|
7818
7849
|
createPluginHookContext(plugin, context = this.context) {
|
|
7819
|
-
const integration =
|
|
7850
|
+
const integration = _chunkTDFPACVXcjs.getFarmPluginIntegrationContext.call(void 0, plugin);
|
|
7820
7851
|
return integration ? { ...context, integration } : context;
|
|
7821
7852
|
}
|
|
7822
7853
|
createRequestHookContext(target, plugin) {
|
|
@@ -7881,23 +7912,23 @@ var _PluginManager = class _PluginManager {
|
|
|
7881
7912
|
`Farm plugin "${plugin.name}" runtime.endpoints must contain endpoint objects`
|
|
7882
7913
|
);
|
|
7883
7914
|
}
|
|
7884
|
-
const
|
|
7915
|
+
const path21 = normalizeFarmPluginRuntimeEndpointPath(
|
|
7885
7916
|
endpoint.path,
|
|
7886
7917
|
`Farm plugin "${plugin.name}" runtime endpoint`
|
|
7887
7918
|
);
|
|
7888
7919
|
if (typeof endpoint.handler !== "function") {
|
|
7889
7920
|
throw new TypeError(
|
|
7890
|
-
`Farm plugin "${plugin.name}" runtime endpoint ${
|
|
7921
|
+
`Farm plugin "${plugin.name}" runtime endpoint ${path21} requires a handler`
|
|
7891
7922
|
);
|
|
7892
7923
|
}
|
|
7893
|
-
const owner = owners.get(
|
|
7924
|
+
const owner = owners.get(path21);
|
|
7894
7925
|
if (owner) {
|
|
7895
7926
|
throw new Error(
|
|
7896
|
-
`Farm plugin runtime endpoint ${
|
|
7927
|
+
`Farm plugin runtime endpoint ${path21} from "${plugin.name}" conflicts with "${owner}"`
|
|
7897
7928
|
);
|
|
7898
7929
|
}
|
|
7899
|
-
owners.set(
|
|
7900
|
-
endpoints.push({ plugin, endpoint, path:
|
|
7930
|
+
owners.set(path21, plugin.name);
|
|
7931
|
+
endpoints.push({ plugin, endpoint, path: path21 });
|
|
7901
7932
|
}
|
|
7902
7933
|
}
|
|
7903
7934
|
this.runtimeEndpoints = endpoints;
|
|
@@ -8870,8 +8901,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isArrayIndex, "isArrayIndex");
|
|
|
8870
8901
|
|
|
8871
8902
|
|
|
8872
8903
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
8873
|
-
function resolveFarmClientCacheAdapterEntry(root,
|
|
8874
|
-
const client = _optionalChain([
|
|
8904
|
+
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
8905
|
+
const client = _optionalChain([cache2, 'optionalAccess', _409 => _409.client]);
|
|
8875
8906
|
const adapter = _optionalChain([client, 'optionalAccess', _410 => _410.adapter]);
|
|
8876
8907
|
if (adapter === void 0) return void 0;
|
|
8877
8908
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
@@ -8913,6 +8944,233 @@ function generateClientCachePersistenceCode(entry) {
|
|
|
8913
8944
|
}
|
|
8914
8945
|
_chunkS3JO3N4Hcjs.__name.call(void 0, generateClientCachePersistenceCode, "generateClientCachePersistenceCode");
|
|
8915
8946
|
|
|
8947
|
+
// src/app-manifest-packages.ts
|
|
8948
|
+
|
|
8949
|
+
|
|
8950
|
+
var FARM_PACKAGE = /^@(?:farm\.js|farming-labs)\/[a-z0-9._-]+$/;
|
|
8951
|
+
function resolveFarmAppPackages(root) {
|
|
8952
|
+
let manifest;
|
|
8953
|
+
try {
|
|
8954
|
+
manifest = JSON.parse(fs5.default.readFileSync(path9.default.join(root, "package.json"), "utf8"));
|
|
8955
|
+
} catch (e21) {
|
|
8956
|
+
return {};
|
|
8957
|
+
}
|
|
8958
|
+
const names = new Set(
|
|
8959
|
+
[
|
|
8960
|
+
...Object.keys(_nullishCoalesce(manifest.dependencies, () => ( {}))),
|
|
8961
|
+
...Object.keys(_nullishCoalesce(manifest.devDependencies, () => ( {})))
|
|
8962
|
+
].filter((name) => FARM_PACKAGE.test(name))
|
|
8963
|
+
);
|
|
8964
|
+
const versions = {};
|
|
8965
|
+
for (const name of [...names].sort()) {
|
|
8966
|
+
for (let dir = root; ; ) {
|
|
8967
|
+
try {
|
|
8968
|
+
const { version } = JSON.parse(
|
|
8969
|
+
fs5.default.readFileSync(path9.default.join(dir, "node_modules", name, "package.json"), "utf8")
|
|
8970
|
+
);
|
|
8971
|
+
if (typeof version === "string" && /^[0-9A-Za-z.+-]{1,64}$/.test(version))
|
|
8972
|
+
versions[name] = version;
|
|
8973
|
+
break;
|
|
8974
|
+
} catch (e22) {
|
|
8975
|
+
const parent = path9.default.dirname(dir);
|
|
8976
|
+
if (parent === dir) break;
|
|
8977
|
+
dir = parent;
|
|
8978
|
+
}
|
|
8979
|
+
}
|
|
8980
|
+
}
|
|
8981
|
+
return versions;
|
|
8982
|
+
}
|
|
8983
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppPackages, "resolveFarmAppPackages");
|
|
8984
|
+
|
|
8985
|
+
// src/app-manifest-webmcp.ts
|
|
8986
|
+
|
|
8987
|
+
|
|
8988
|
+
|
|
8989
|
+
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
8990
|
+
var WEBMCP_CLIENT = "@farm.js/webmcp/client";
|
|
8991
|
+
var DEFINERS = /* @__PURE__ */ new Set(["defineWebMCPTool", "registerWebMCPTool", "registerWebMCPTools"]);
|
|
8992
|
+
var HINTS = ["readOnlyHint", "destructiveHint", "idempotentHint", "openWorldHint"];
|
|
8993
|
+
var MAX_TOOLS = 500;
|
|
8994
|
+
var MAX_SCHEMA_BYTES = 64 * 1024;
|
|
8995
|
+
var NOT_STATIC = /* @__PURE__ */ Symbol("not static");
|
|
8996
|
+
var LANGS = {
|
|
8997
|
+
ts: "ts",
|
|
8998
|
+
mts: "ts",
|
|
8999
|
+
cts: "ts",
|
|
9000
|
+
tsx: "tsx",
|
|
9001
|
+
js: "jsx",
|
|
9002
|
+
mjs: "jsx",
|
|
9003
|
+
cjs: "jsx",
|
|
9004
|
+
jsx: "jsx"
|
|
9005
|
+
};
|
|
9006
|
+
var parseAst;
|
|
9007
|
+
function staticValue(node) {
|
|
9008
|
+
if (!node) return NOT_STATIC;
|
|
9009
|
+
switch (node.type) {
|
|
9010
|
+
case "Literal":
|
|
9011
|
+
return node.regex || typeof node.value === "bigint" ? NOT_STATIC : node.value;
|
|
9012
|
+
case "TemplateLiteral":
|
|
9013
|
+
return node.expressions.length ? NOT_STATIC : node.quasis[0].value.cooked;
|
|
9014
|
+
case "UnaryExpression":
|
|
9015
|
+
if (node.operator === "-" && node.argument.type === "Literal" && typeof node.argument.value === "number")
|
|
9016
|
+
return -node.argument.value;
|
|
9017
|
+
return NOT_STATIC;
|
|
9018
|
+
case "ArrayExpression": {
|
|
9019
|
+
const items = [];
|
|
9020
|
+
for (const element of node.elements) {
|
|
9021
|
+
const value = staticValue(element);
|
|
9022
|
+
if (value === NOT_STATIC) return NOT_STATIC;
|
|
9023
|
+
items.push(value);
|
|
9024
|
+
}
|
|
9025
|
+
return items;
|
|
9026
|
+
}
|
|
9027
|
+
case "ObjectExpression": {
|
|
9028
|
+
const object = {};
|
|
9029
|
+
for (const property2 of node.properties) {
|
|
9030
|
+
if (property2.type !== "Property" || property2.computed || property2.kind !== "init")
|
|
9031
|
+
return NOT_STATIC;
|
|
9032
|
+
const key = property2.key.type === "Identifier" ? property2.key.name : staticValue(property2.key);
|
|
9033
|
+
if (typeof key !== "string" || key === "__proto__") return NOT_STATIC;
|
|
9034
|
+
const value = staticValue(property2.value);
|
|
9035
|
+
if (value === NOT_STATIC) return NOT_STATIC;
|
|
9036
|
+
object[key] = value;
|
|
9037
|
+
}
|
|
9038
|
+
return object;
|
|
9039
|
+
}
|
|
9040
|
+
case "TSAsExpression":
|
|
9041
|
+
case "TSSatisfiesExpression":
|
|
9042
|
+
case "TSNonNullExpression":
|
|
9043
|
+
case "ParenthesizedExpression":
|
|
9044
|
+
return staticValue(node.expression);
|
|
9045
|
+
default:
|
|
9046
|
+
return NOT_STATIC;
|
|
9047
|
+
}
|
|
9048
|
+
}
|
|
9049
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, staticValue, "staticValue");
|
|
9050
|
+
function property(object, name) {
|
|
9051
|
+
return _optionalChain([object, 'access', _413 => _413.properties, 'access', _414 => _414.find, 'call', _415 => _415(
|
|
9052
|
+
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
9053
|
+
), 'optionalAccess', _416 => _416.value]);
|
|
9054
|
+
}
|
|
9055
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, property, "property");
|
|
9056
|
+
function toolFromObject(object) {
|
|
9057
|
+
const name = staticValue(property(object, "name"));
|
|
9058
|
+
if (typeof name !== "string" || !/^[A-Za-z0-9_.-]{1,128}$/.test(name)) return null;
|
|
9059
|
+
const text = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (key) => {
|
|
9060
|
+
const value = staticValue(property(object, key));
|
|
9061
|
+
return typeof value === "string" && value.length <= 2e3 ? value : void 0;
|
|
9062
|
+
}, "text");
|
|
9063
|
+
const annotations = staticValue(property(object, "annotations"));
|
|
9064
|
+
const hints = annotations && typeof annotations === "object" && !Array.isArray(annotations) ? Object.fromEntries(
|
|
9065
|
+
HINTS.filter(
|
|
9066
|
+
(hint) => typeof annotations[hint] === "boolean"
|
|
9067
|
+
).map((hint) => [hint, annotations[hint]])
|
|
9068
|
+
) : {};
|
|
9069
|
+
const schemaNode = property(object, "inputSchema");
|
|
9070
|
+
const schema = staticValue(schemaNode);
|
|
9071
|
+
const literal = schema !== NOT_STATIC && schema !== null && typeof schema === "object" && !Array.isArray(schema) && Buffer.byteLength(JSON.stringify(schema)) <= MAX_SCHEMA_BYTES;
|
|
9072
|
+
const title = text("title");
|
|
9073
|
+
const description = text("description");
|
|
9074
|
+
return {
|
|
9075
|
+
name,
|
|
9076
|
+
...title ? { title } : {},
|
|
9077
|
+
...description ? { description } : {},
|
|
9078
|
+
...hints,
|
|
9079
|
+
...literal ? { inputSchema: schema } : {},
|
|
9080
|
+
inputSchemaSource: literal ? "literal" : schemaNode ? "computed" : "none"
|
|
9081
|
+
};
|
|
9082
|
+
}
|
|
9083
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, toolFromObject, "toolFromObject");
|
|
9084
|
+
function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
9085
|
+
if (!code.includes(WEBMCP_CLIENT)) return [];
|
|
9086
|
+
const lang = _nullishCoalesce(LANGS[path9.default.extname(filename).slice(1)], () => ( "tsx"));
|
|
9087
|
+
_nullishCoalesce(parseAst, () => ( (parseAst = _module.createRequire.call(void 0, typeof __filename === "string" ? __filename : _chunkS3JO3N4Hcjs.define_import_meta_default.url)(
|
|
9088
|
+
"rolldown/parseAst"
|
|
9089
|
+
).parseAst)));
|
|
9090
|
+
let program;
|
|
9091
|
+
try {
|
|
9092
|
+
program = parseAst(code, { lang });
|
|
9093
|
+
} catch (e23) {
|
|
9094
|
+
return [];
|
|
9095
|
+
}
|
|
9096
|
+
const locals = /* @__PURE__ */ new Map();
|
|
9097
|
+
for (const statement of program.body) {
|
|
9098
|
+
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
9099
|
+
continue;
|
|
9100
|
+
for (const specifier of statement.specifiers) {
|
|
9101
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _417 => _417.imported, 'optionalAccess', _418 => _418.name]), () => ( _optionalChain([specifier, 'access', _419 => _419.imported, 'optionalAccess', _420 => _420.value])));
|
|
9102
|
+
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
9103
|
+
locals.set(specifier.local.name, imported);
|
|
9104
|
+
}
|
|
9105
|
+
}
|
|
9106
|
+
if (!locals.size) return [];
|
|
9107
|
+
const found = [];
|
|
9108
|
+
const visit = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (node) => {
|
|
9109
|
+
if (!node || typeof node !== "object") return;
|
|
9110
|
+
if (Array.isArray(node)) return node.forEach(visit);
|
|
9111
|
+
const current = node;
|
|
9112
|
+
if (current.type === "CallExpression" && current.callee.type === "Identifier") {
|
|
9113
|
+
const definer = locals.get(current.callee.name);
|
|
9114
|
+
const [argument] = current.arguments;
|
|
9115
|
+
if (definer && argument) {
|
|
9116
|
+
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
9117
|
+
(element) => _optionalChain([element, 'optionalAccess', _421 => _421.type]) === "ObjectExpression"
|
|
9118
|
+
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
9119
|
+
for (const object of objects) {
|
|
9120
|
+
const tool = toolFromObject(object);
|
|
9121
|
+
if (tool) found.push({ start: object.start, tool });
|
|
9122
|
+
}
|
|
9123
|
+
}
|
|
9124
|
+
}
|
|
9125
|
+
for (const [key, value] of Object.entries(current))
|
|
9126
|
+
if (key !== "type" && value && typeof value === "object") visit(value);
|
|
9127
|
+
}, "visit");
|
|
9128
|
+
visit(program.body);
|
|
9129
|
+
return found.sort((a, b) => a.start - b.start).map(({ tool }) => tool);
|
|
9130
|
+
}
|
|
9131
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, findFarmWebMCPTools, "findFarmWebMCPTools");
|
|
9132
|
+
var cache = /* @__PURE__ */ new Map();
|
|
9133
|
+
function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
9134
|
+
const base = path9.default.resolve(root, srcDir);
|
|
9135
|
+
let files;
|
|
9136
|
+
try {
|
|
9137
|
+
files = _fastglob2.default.sync("**/*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}", {
|
|
9138
|
+
cwd: base,
|
|
9139
|
+
absolute: true,
|
|
9140
|
+
ignore: ["**/node_modules/**", "**/*.d.ts", "**/*.{test,spec}.*", "**/__tests__/**"]
|
|
9141
|
+
});
|
|
9142
|
+
} catch (e24) {
|
|
9143
|
+
return [];
|
|
9144
|
+
}
|
|
9145
|
+
const seen = /* @__PURE__ */ new Set();
|
|
9146
|
+
const tools = [];
|
|
9147
|
+
for (const file of files.sort()) {
|
|
9148
|
+
let mtimeMs;
|
|
9149
|
+
try {
|
|
9150
|
+
mtimeMs = fs5.default.statSync(file).mtimeMs;
|
|
9151
|
+
} catch (e25) {
|
|
9152
|
+
continue;
|
|
9153
|
+
}
|
|
9154
|
+
let entry = cache.get(file);
|
|
9155
|
+
if (!entry || entry.mtimeMs !== mtimeMs) {
|
|
9156
|
+
let code = "";
|
|
9157
|
+
try {
|
|
9158
|
+
code = fs5.default.readFileSync(file, "utf8");
|
|
9159
|
+
} catch (e26) {
|
|
9160
|
+
}
|
|
9161
|
+
entry = { mtimeMs, tools: findFarmWebMCPTools(code, file) };
|
|
9162
|
+
cache.set(file, entry);
|
|
9163
|
+
}
|
|
9164
|
+
for (const tool of entry.tools) {
|
|
9165
|
+
if (seen.has(tool.name) || tools.length >= MAX_TOOLS) continue;
|
|
9166
|
+
seen.add(tool.name);
|
|
9167
|
+
tools.push(tool);
|
|
9168
|
+
}
|
|
9169
|
+
}
|
|
9170
|
+
return tools;
|
|
9171
|
+
}
|
|
9172
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, collectFarmWebMCPTools, "collectFarmWebMCPTools");
|
|
9173
|
+
|
|
8916
9174
|
// src/document-layout-client.ts
|
|
8917
9175
|
var FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = String.raw`
|
|
8918
9176
|
const farmLayoutComponentKeys = new WeakMap();
|
|
@@ -8979,6 +9237,128 @@ function createFarmLayoutElement(Component, pattern, children, params) {
|
|
|
8979
9237
|
}
|
|
8980
9238
|
`;
|
|
8981
9239
|
|
|
9240
|
+
// src/dev-preview-guard.ts
|
|
9241
|
+
|
|
9242
|
+
|
|
9243
|
+
var FARM_PREVIEW_REQUEST_HEADER = "x-farm-preview";
|
|
9244
|
+
function isFarmPreviewTunnelRequest(headers) {
|
|
9245
|
+
return headers[FARM_PREVIEW_REQUEST_HEADER] !== void 0;
|
|
9246
|
+
}
|
|
9247
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmPreviewTunnelRequest, "isFarmPreviewTunnelRequest");
|
|
9248
|
+
var VITE_DEFAULT_FS_DENY = [
|
|
9249
|
+
".env",
|
|
9250
|
+
".env.*",
|
|
9251
|
+
"*.{crt,pem,key,p12,pfx,cer,der}",
|
|
9252
|
+
".npmrc",
|
|
9253
|
+
".yarnrc.yml",
|
|
9254
|
+
"**/.git/**"
|
|
9255
|
+
];
|
|
9256
|
+
function getFarmDevFsDeny(userDeny, options) {
|
|
9257
|
+
const deny = ["**/.farm/**"];
|
|
9258
|
+
const root = path16.resolve(options.root || process.cwd());
|
|
9259
|
+
const distDir = options.distDir ? path16.resolve(root, options.distDir) : void 0;
|
|
9260
|
+
const relativeDistDir = distDir ? path16.relative(root, distDir) : "";
|
|
9261
|
+
if (distDir && relativeDistDir && relativeDistDir !== ".farm" && relativeDistDir !== ".." && !relativeDistDir.startsWith(`..${path16.sep}`) && !/[*?[\]{}()!+@]/.test(distDir)) {
|
|
9262
|
+
deny.push(`${distDir.replace(/\\/g, "/")}/**`);
|
|
9263
|
+
}
|
|
9264
|
+
return userDeny ? deny : [...VITE_DEFAULT_FS_DENY, ...deny];
|
|
9265
|
+
}
|
|
9266
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmDevFsDeny, "getFarmDevFsDeny");
|
|
9267
|
+
var SOURCE_QUERY_FLAGS = ["raw", "inline", "url"];
|
|
9268
|
+
var MODULE_EXTENSION = /\.(?:[cm]?[jt]sx?|vue|svelte|astro|mdx?|css|scss|sass|less|styl|stylus|pcss|postcss|sss)$/i;
|
|
9269
|
+
var ASSET_EXTENSION = /\.(?:apng|bmp|png|jpe?g|jfif|pjpeg|pjp|gif|svg|ico|webp|avif|cur|jxl|mp4|webm|ogg|mp3|wav|flac|aac|opus|mov|m4a|vtt|woff2?|eot|ttf|otf|webmanifest|pdf|txt|wasm)$/i;
|
|
9270
|
+
var INTERNAL_PREFIXES = ["/@vite/", "/@farm/", "/@react-refresh", "/__vite_ping"];
|
|
9271
|
+
var DEVELOPER_ONLY_PREFIXES = ["/__farm/devtools", "/__open-in-editor"];
|
|
9272
|
+
function createFarmDevPreviewGuard(server, options) {
|
|
9273
|
+
return /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async function farmDevPreviewGuard(req, res, next) {
|
|
9274
|
+
if (!isFarmPreviewTunnelRequest(req.headers)) return next();
|
|
9275
|
+
try {
|
|
9276
|
+
if (await isAllowedPreviewRequest(server, options, req)) return next();
|
|
9277
|
+
} catch (e27) {
|
|
9278
|
+
}
|
|
9279
|
+
res.statusCode = 403;
|
|
9280
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
9281
|
+
res.setHeader("Cache-Control", "no-store");
|
|
9282
|
+
res.end("This development file is not available through farm preview.");
|
|
9283
|
+
}, "farmDevPreviewGuard");
|
|
9284
|
+
}
|
|
9285
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmDevPreviewGuard, "createFarmDevPreviewGuard");
|
|
9286
|
+
async function isAllowedPreviewRequest(server, options, req) {
|
|
9287
|
+
const rawUrl = req.url || "/";
|
|
9288
|
+
const queryIndex = rawUrl.indexOf("?");
|
|
9289
|
+
const rawPath = queryIndex === -1 ? rawUrl : rawUrl.slice(0, queryIndex);
|
|
9290
|
+
const query = new URLSearchParams(queryIndex === -1 ? "" : rawUrl.slice(queryIndex + 1));
|
|
9291
|
+
let pathname = decodeURI(rawPath);
|
|
9292
|
+
const base = (server.config.base || "/").replace(/\/$/, "");
|
|
9293
|
+
if (base.startsWith("/") && (pathname === base || pathname.startsWith(`${base}/`))) {
|
|
9294
|
+
pathname = pathname.slice(base.length) || "/";
|
|
9295
|
+
}
|
|
9296
|
+
const url = `${pathname}${queryIndex === -1 ? "" : rawUrl.slice(queryIndex)}`;
|
|
9297
|
+
if (DEVELOPER_ONLY_PREFIXES.some((prefix) => pathname.startsWith(prefix))) return false;
|
|
9298
|
+
if (INTERNAL_PREFIXES.some((prefix) => pathname.startsWith(prefix))) return true;
|
|
9299
|
+
const method = (req.method || "GET").toUpperCase();
|
|
9300
|
+
if (method !== "GET" && method !== "HEAD") return true;
|
|
9301
|
+
const file = await resolveRequestedFile(server, pathname);
|
|
9302
|
+
if (!file) return true;
|
|
9303
|
+
const client = _optionalChain([server, 'access', _422 => _422.environments, 'optionalAccess', _423 => _423.client]);
|
|
9304
|
+
const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _424 => _424.moduleGraph, 'access', _425 => _425.getModuleByUrl, 'call', _426 => _426(url)])), "inClientGraph");
|
|
9305
|
+
if (SOURCE_QUERY_FLAGS.some((flag) => query.has(flag))) return inClientGraph();
|
|
9306
|
+
if (await inClientGraph()) return true;
|
|
9307
|
+
if (file.split(path16.sep).includes("node_modules")) return true;
|
|
9308
|
+
if (server.config.publicDir && isInside(await realpathOr(server.config.publicDir), file)) {
|
|
9309
|
+
return true;
|
|
9310
|
+
}
|
|
9311
|
+
const isModuleOrAsset = MODULE_EXTENSION.test(file) || ASSET_EXTENSION.test(file) || query.has("import");
|
|
9312
|
+
if (!isModuleOrAsset) return false;
|
|
9313
|
+
for (const source of options.getSourceRoots()) {
|
|
9314
|
+
const sourceRoot = await realpathOr(source.root);
|
|
9315
|
+
const sourceDir = await realpathOr(path16.resolve(source.root, source.srcDir));
|
|
9316
|
+
if (sourceRoot === sourceDir && path16.dirname(file) === sourceDir) continue;
|
|
9317
|
+
if (isInside(sourceDir, file)) return true;
|
|
9318
|
+
}
|
|
9319
|
+
return false;
|
|
9320
|
+
}
|
|
9321
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isAllowedPreviewRequest, "isAllowedPreviewRequest");
|
|
9322
|
+
async function resolveRequestedFile(server, pathname) {
|
|
9323
|
+
let candidate;
|
|
9324
|
+
if (pathname.startsWith("/@fs/")) {
|
|
9325
|
+
candidate = pathname.slice("/@fs".length);
|
|
9326
|
+
if (/^\/[A-Za-z]:/.test(candidate)) candidate = candidate.slice(1);
|
|
9327
|
+
} else {
|
|
9328
|
+
let id = pathname;
|
|
9329
|
+
if (id.startsWith("/@id/")) {
|
|
9330
|
+
id = id.slice("/@id/".length).replace(/^__x00__/, "\0");
|
|
9331
|
+
if (id.startsWith("\0")) return void 0;
|
|
9332
|
+
}
|
|
9333
|
+
const resolved = await _optionalChain([server, 'access', _427 => _427.environments, 'optionalAccess', _428 => _428.client, 'optionalAccess', _429 => _429.pluginContainer, 'access', _430 => _430.resolveId, 'call', _431 => _431(id, void 0)]);
|
|
9334
|
+
const resolvedId = _optionalChain([resolved, 'optionalAccess', _432 => _432.id, 'access', _433 => _433.replace, 'call', _434 => _434(/[?#].*$/, "")]);
|
|
9335
|
+
if (resolvedId && path16.isAbsolute(resolvedId)) candidate = resolvedId;
|
|
9336
|
+
else if (_optionalChain([resolvedId, 'optionalAccess', _435 => _435.startsWith, 'call', _436 => _436("\0")])) return void 0;
|
|
9337
|
+
else if (id.startsWith("/")) candidate = path16.join(server.config.root, id);
|
|
9338
|
+
}
|
|
9339
|
+
if (!candidate) return void 0;
|
|
9340
|
+
try {
|
|
9341
|
+
const real = await _fs.promises.realpath(candidate);
|
|
9342
|
+
return (await _fs.promises.stat(real)).isFile() ? real : void 0;
|
|
9343
|
+
} catch (e28) {
|
|
9344
|
+
return void 0;
|
|
9345
|
+
}
|
|
9346
|
+
}
|
|
9347
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveRequestedFile, "resolveRequestedFile");
|
|
9348
|
+
async function realpathOr(directory) {
|
|
9349
|
+
try {
|
|
9350
|
+
return await _fs.promises.realpath(directory);
|
|
9351
|
+
} catch (e29) {
|
|
9352
|
+
return path16.resolve(directory);
|
|
9353
|
+
}
|
|
9354
|
+
}
|
|
9355
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, realpathOr, "realpathOr");
|
|
9356
|
+
function isInside(directory, file) {
|
|
9357
|
+
const relative4 = path16.relative(directory, file);
|
|
9358
|
+
return relative4 !== "" && relative4 !== ".." && !relative4.startsWith(`..${path16.sep}`) && !path16.isAbsolute(relative4);
|
|
9359
|
+
}
|
|
9360
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isInside, "isInside");
|
|
9361
|
+
|
|
8982
9362
|
// src/vite.ts
|
|
8983
9363
|
|
|
8984
9364
|
|
|
@@ -8990,7 +9370,7 @@ function createFarmLayoutElement(Component, pattern, children, params) {
|
|
|
8990
9370
|
function shouldBypassFarmRouterForDottedPath(pathname, routeManager, baseDirs, generatedPaths = []) {
|
|
8991
9371
|
if (!pathname.includes(".") || pathname.endsWith(".html")) return false;
|
|
8992
9372
|
const matchesAppRoute = Boolean(
|
|
8993
|
-
_optionalChain([routeManager, 'optionalAccess',
|
|
9373
|
+
_optionalChain([routeManager, 'optionalAccess', _437 => _437.matchRoute, 'call', _438 => _438(pathname), 'optionalAccess', _439 => _439.route]) || _optionalChain([routeManager, 'optionalAccess', _440 => _440.matchMetadataRoute, 'call', _441 => _441(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _442 => _442.matchMetadataImage, 'call', _443 => _443(pathname)]) || generatedPaths.includes(pathname)
|
|
8994
9374
|
);
|
|
8995
9375
|
return !matchesAppRoute || devServableFileExists(pathname, baseDirs);
|
|
8996
9376
|
}
|
|
@@ -9019,28 +9399,28 @@ var DOCS_ENGINE_APP_OWNABLE_PATHS = /* @__PURE__ */ new Set([
|
|
|
9019
9399
|
]);
|
|
9020
9400
|
function farmAppOwnsDocsEnginePath(pathname, options) {
|
|
9021
9401
|
if (!DOCS_ENGINE_APP_OWNABLE_PATHS.has(pathname)) return false;
|
|
9022
|
-
return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access',
|
|
9402
|
+
return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _444 => _444.routeManager, 'optionalAccess', _445 => _445.matchMetadataRoute, 'call', _446 => _446(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
|
|
9023
9403
|
}
|
|
9024
9404
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmAppOwnsDocsEnginePath, "farmAppOwnsDocsEnginePath");
|
|
9025
9405
|
function devServableFileExists(pathname, baseDirs) {
|
|
9026
9406
|
let decodedPathname;
|
|
9027
9407
|
try {
|
|
9028
9408
|
decodedPathname = decodeURIComponent(pathname);
|
|
9029
|
-
} catch (
|
|
9409
|
+
} catch (e30) {
|
|
9030
9410
|
return false;
|
|
9031
9411
|
}
|
|
9032
9412
|
const relativePathname = decodedPathname.replace(/^\/+/, "");
|
|
9033
9413
|
if (!relativePathname) return false;
|
|
9034
9414
|
for (const baseDir of baseDirs) {
|
|
9035
9415
|
if (typeof baseDir !== "string" || baseDir.length === 0) continue;
|
|
9036
|
-
const resolvedBase =
|
|
9037
|
-
const candidate =
|
|
9038
|
-
if (!candidate.startsWith(resolvedBase +
|
|
9416
|
+
const resolvedBase = path17.resolve(baseDir);
|
|
9417
|
+
const candidate = path17.resolve(resolvedBase, relativePathname);
|
|
9418
|
+
if (!candidate.startsWith(resolvedBase + path17.sep)) continue;
|
|
9039
9419
|
try {
|
|
9040
|
-
if (
|
|
9420
|
+
if (fs10.existsSync(candidate) && fs10.statSync(candidate).isFile()) {
|
|
9041
9421
|
return true;
|
|
9042
9422
|
}
|
|
9043
|
-
} catch (
|
|
9423
|
+
} catch (e31) {
|
|
9044
9424
|
}
|
|
9045
9425
|
}
|
|
9046
9426
|
return false;
|
|
@@ -9126,14 +9506,14 @@ function analyzeClientBoundary(program, publicKeys) {
|
|
|
9126
9506
|
_chunkS3JO3N4Hcjs.__name.call(void 0, analyzeClientBoundary, "analyzeClientBoundary");
|
|
9127
9507
|
function readNodeBuiltinSource(node) {
|
|
9128
9508
|
if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
|
|
9129
|
-
const value = _optionalChain([node, 'access',
|
|
9509
|
+
const value = _optionalChain([node, 'access', _447 => _447.source, 'optionalAccess', _448 => _448.value]);
|
|
9130
9510
|
return typeof value === "string" && value.startsWith("node:") ? value : void 0;
|
|
9131
9511
|
}
|
|
9132
9512
|
if (node.type === "CallExpression") {
|
|
9133
9513
|
const callee = node.callee;
|
|
9134
|
-
if (_optionalChain([callee, 'optionalAccess',
|
|
9135
|
-
const arg = _optionalChain([node, 'access',
|
|
9136
|
-
const value = _optionalChain([arg, 'optionalAccess',
|
|
9514
|
+
if (_optionalChain([callee, 'optionalAccess', _449 => _449.type]) === "Identifier" && callee.name === "require") {
|
|
9515
|
+
const arg = _optionalChain([node, 'access', _450 => _450.arguments, 'optionalAccess', _451 => _451[0]]);
|
|
9516
|
+
const value = _optionalChain([arg, 'optionalAccess', _452 => _452.type]) === "Literal" ? arg.value : void 0;
|
|
9137
9517
|
return typeof value === "string" && value.startsWith("node:") ? value : void 0;
|
|
9138
9518
|
}
|
|
9139
9519
|
}
|
|
@@ -9143,16 +9523,16 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readNodeBuiltinSource, "readNodeBuiltinSou
|
|
|
9143
9523
|
function readProcessEnvKey(node) {
|
|
9144
9524
|
if (node.type !== "MemberExpression") return void 0;
|
|
9145
9525
|
const object = node.object;
|
|
9146
|
-
if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access',
|
|
9526
|
+
if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _453 => _453.object, 'optionalAccess', _454 => _454.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _455 => _455.property, 'optionalAccess', _456 => _456.name]) !== "env") {
|
|
9147
9527
|
return void 0;
|
|
9148
9528
|
}
|
|
9149
|
-
const
|
|
9150
|
-
if (!
|
|
9151
|
-
if (!node.computed &&
|
|
9152
|
-
return
|
|
9529
|
+
const property2 = node.property;
|
|
9530
|
+
if (!property2) return void 0;
|
|
9531
|
+
if (!node.computed && property2.type === "Identifier") {
|
|
9532
|
+
return property2.name;
|
|
9153
9533
|
}
|
|
9154
|
-
if (node.computed &&
|
|
9155
|
-
const value =
|
|
9534
|
+
if (node.computed && property2.type === "Literal") {
|
|
9535
|
+
const value = property2.value;
|
|
9156
9536
|
return typeof value === "string" ? value : void 0;
|
|
9157
9537
|
}
|
|
9158
9538
|
return void 0;
|
|
@@ -9208,7 +9588,7 @@ function farmImageImportsPlugin() {
|
|
|
9208
9588
|
async transform(code, id) {
|
|
9209
9589
|
const filePath = id.split("?", 1)[0];
|
|
9210
9590
|
if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
|
|
9211
|
-
const defaultExport = _optionalChain([code, 'access',
|
|
9591
|
+
const defaultExport = _optionalChain([code, 'access', _457 => _457.match, 'call', _458 => _458(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _459 => _459[1]]);
|
|
9212
9592
|
if (!defaultExport) return null;
|
|
9213
9593
|
return createStaticImageModule(filePath, `const src = ${defaultExport};`);
|
|
9214
9594
|
}
|
|
@@ -9243,7 +9623,7 @@ async function createBlurDataURL(bytes) {
|
|
|
9243
9623
|
const { default: sharp } = await import("sharp");
|
|
9244
9624
|
const placeholder = await sharp(bytes).rotate().resize({ width: 8, height: 8, fit: "inside", withoutEnlargement: true }).webp({ quality: 35 }).toBuffer();
|
|
9245
9625
|
return `data:image/webp;base64,${placeholder.toString("base64")}`;
|
|
9246
|
-
} catch (
|
|
9626
|
+
} catch (e32) {
|
|
9247
9627
|
return void 0;
|
|
9248
9628
|
}
|
|
9249
9629
|
}
|
|
@@ -9269,7 +9649,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
|
|
|
9269
9649
|
];
|
|
9270
9650
|
function getFarmClientOptimizeDepsInclude(renderer) {
|
|
9271
9651
|
return Array.from(
|
|
9272
|
-
/* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess',
|
|
9652
|
+
/* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _460 => _460.optimizeDeps]) || []])
|
|
9273
9653
|
);
|
|
9274
9654
|
}
|
|
9275
9655
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientOptimizeDepsInclude, "getFarmClientOptimizeDepsInclude");
|
|
@@ -9294,7 +9674,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
|
|
|
9294
9674
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
9295
9675
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
9296
9676
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
9297
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
9677
|
+
..._optionalChain([entries, 'optionalAccess', _461 => _461.length]) ? { entries: [...entries] } : {}
|
|
9298
9678
|
};
|
|
9299
9679
|
}
|
|
9300
9680
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientOptimizeDepsConfig, "createFarmClientOptimizeDepsConfig");
|
|
@@ -9324,8 +9704,8 @@ function mergeAlias(farmValue, userValue) {
|
|
|
9324
9704
|
}
|
|
9325
9705
|
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeAlias, "mergeAlias");
|
|
9326
9706
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
9327
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
9328
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
9707
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _462 => _462.optimizeDeps, 'optionalAccess', _463 => _463.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _464 => _464.optimizeDeps, 'optionalAccess', _465 => _465.noDiscovery])));
|
|
9708
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _466 => _466.optimizeDeps, 'optionalAccess', _467 => _467.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _468 => _468.optimizeDeps, 'optionalAccess', _469 => _469.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _470 => _470.optimizeDeps, 'optionalAccess', _471 => _471.holdUntilCrawlEnd]))));
|
|
9329
9709
|
return {
|
|
9330
9710
|
...farmConfig,
|
|
9331
9711
|
...userConfig,
|
|
@@ -9337,9 +9717,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
9337
9717
|
resolve: {
|
|
9338
9718
|
...farmConfig.resolve,
|
|
9339
9719
|
...userConfig.resolve,
|
|
9340
|
-
alias: mergeAlias(_optionalChain([farmConfig, 'access',
|
|
9720
|
+
alias: mergeAlias(_optionalChain([farmConfig, 'access', _472 => _472.resolve, 'optionalAccess', _473 => _473.alias]), _optionalChain([userConfig, 'access', _474 => _474.resolve, 'optionalAccess', _475 => _475.alias])),
|
|
9341
9721
|
dedupe: Array.from(
|
|
9342
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
9722
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _476 => _476.resolve, 'optionalAccess', _477 => _477.dedupe]) || [], ..._optionalChain([userConfig, 'access', _478 => _478.resolve, 'optionalAccess', _479 => _479.dedupe]) || []])
|
|
9343
9723
|
)
|
|
9344
9724
|
},
|
|
9345
9725
|
optimizeDeps: {
|
|
@@ -9349,21 +9729,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
9349
9729
|
holdUntilCrawlEnd,
|
|
9350
9730
|
include: Array.from(
|
|
9351
9731
|
/* @__PURE__ */ new Set([
|
|
9352
|
-
..._optionalChain([farmConfig, 'access',
|
|
9353
|
-
..._optionalChain([userConfig, 'access',
|
|
9732
|
+
..._optionalChain([farmConfig, 'access', _480 => _480.optimizeDeps, 'optionalAccess', _481 => _481.include]) || [],
|
|
9733
|
+
..._optionalChain([userConfig, 'access', _482 => _482.optimizeDeps, 'optionalAccess', _483 => _483.include]) || []
|
|
9354
9734
|
])
|
|
9355
9735
|
),
|
|
9356
9736
|
exclude: Array.from(
|
|
9357
9737
|
/* @__PURE__ */ new Set([
|
|
9358
|
-
..._optionalChain([farmConfig, 'access',
|
|
9359
|
-
..._optionalChain([userConfig, 'access',
|
|
9738
|
+
..._optionalChain([farmConfig, 'access', _484 => _484.optimizeDeps, 'optionalAccess', _485 => _485.exclude]) || [],
|
|
9739
|
+
..._optionalChain([userConfig, 'access', _486 => _486.optimizeDeps, 'optionalAccess', _487 => _487.exclude]) || []
|
|
9360
9740
|
])
|
|
9361
9741
|
)
|
|
9362
9742
|
},
|
|
9363
9743
|
ssr: {
|
|
9364
9744
|
...farmConfig.ssr,
|
|
9365
9745
|
...userConfig.ssr,
|
|
9366
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
9746
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _488 => _488.ssr, 'optionalAccess', _489 => _489.noExternal]), _optionalChain([userConfig, 'access', _490 => _490.ssr, 'optionalAccess', _491 => _491.noExternal]))
|
|
9367
9747
|
}
|
|
9368
9748
|
};
|
|
9369
9749
|
}
|
|
@@ -9417,7 +9797,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
9417
9797
|
...farmConfig.build,
|
|
9418
9798
|
rollupOptions: {
|
|
9419
9799
|
...userBundlerOptions,
|
|
9420
|
-
..._optionalChain([farmConfig, 'access',
|
|
9800
|
+
..._optionalChain([farmConfig, 'access', _492 => _492.build, 'optionalAccess', _493 => _493.rollupOptions])
|
|
9421
9801
|
}
|
|
9422
9802
|
},
|
|
9423
9803
|
css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
|
|
@@ -9425,7 +9805,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
|
|
|
9425
9805
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
9426
9806
|
ssr: {
|
|
9427
9807
|
...merged.ssr,
|
|
9428
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
9808
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _494 => _494.ssr, 'optionalAccess', _495 => _495.external]), _optionalChain([userConfig, 'access', _496 => _496.ssr, 'optionalAccess', _497 => _497.external]))
|
|
9429
9809
|
}
|
|
9430
9810
|
};
|
|
9431
9811
|
}
|
|
@@ -9498,13 +9878,13 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
|
|
|
9498
9878
|
// src/vite.ts
|
|
9499
9879
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
9500
9880
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
9501
|
-
const llms =
|
|
9881
|
+
const llms = _chunkZHPHJPQPcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _498 => _498.agent, 'optionalAccess', _499 => _499.llmsTxt]));
|
|
9502
9882
|
if (!llms.enabled) return [];
|
|
9503
9883
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
9504
9884
|
}
|
|
9505
9885
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
|
|
9506
9886
|
function farmAgentGeneratedPaths(config) {
|
|
9507
|
-
const crawlers =
|
|
9887
|
+
const crawlers = _chunkZHPHJPQPcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _500 => _500.agent, 'optionalAccess', _501 => _501.crawlers]));
|
|
9508
9888
|
return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
|
|
9509
9889
|
}
|
|
9510
9890
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
|
|
@@ -9550,7 +9930,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
9550
9930
|
}
|
|
9551
9931
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
9552
9932
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
9553
|
-
return import("./devtools-
|
|
9933
|
+
return import("./devtools-HU6Y2MNV.cjs");
|
|
9554
9934
|
}
|
|
9555
9935
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
9556
9936
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -9566,7 +9946,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
9566
9946
|
name: "farm:i18n-client-bridge",
|
|
9567
9947
|
enforce: "pre",
|
|
9568
9948
|
resolveId(id, _importer, options) {
|
|
9569
|
-
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess',
|
|
9949
|
+
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _502 => _502.ssr])) {
|
|
9570
9950
|
return FARM_I18N_CLIENT_BRIDGE_ID;
|
|
9571
9951
|
}
|
|
9572
9952
|
return null;
|
|
@@ -9591,7 +9971,7 @@ function farmServerOnlyEntriesPlugin() {
|
|
|
9591
9971
|
resolveId(id, importer, options) {
|
|
9592
9972
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
9593
9973
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
9594
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
9974
|
+
if (!_optionalChain([options, 'optionalAccess', _503 => _503.ssr])) {
|
|
9595
9975
|
this.error(
|
|
9596
9976
|
`${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
|
|
9597
9977
|
);
|
|
@@ -9637,11 +10017,11 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
9637
10017
|
if (!snapshot) return "";
|
|
9638
10018
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
9639
10019
|
if (snapshot.routing === "none") return runtime;
|
|
9640
|
-
return `${
|
|
10020
|
+
return `${_chunkP64MIF5Bcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
9641
10021
|
}
|
|
9642
10022
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
|
|
9643
10023
|
function getPublicEnvDefine(config) {
|
|
9644
|
-
const publicEnv = _optionalChain([config, 'access',
|
|
10024
|
+
const publicEnv = _optionalChain([config, 'access', _504 => _504.env, 'optionalAccess', _505 => _505.public]);
|
|
9645
10025
|
if (!isResolvedEnvScope(publicEnv)) {
|
|
9646
10026
|
return {};
|
|
9647
10027
|
}
|
|
@@ -9664,7 +10044,7 @@ function createRequestFromNodeRequest(req, url, signal) {
|
|
|
9664
10044
|
});
|
|
9665
10045
|
}
|
|
9666
10046
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createRequestFromNodeRequest, "createRequestFromNodeRequest");
|
|
9667
|
-
function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) =>
|
|
10047
|
+
function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) => _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, request2)) {
|
|
9668
10048
|
const middleware = _chunkMQ3H6LT5cjs._withAfterNodeMiddleware.call(void 0, handler);
|
|
9669
10049
|
return (req, res, next) => {
|
|
9670
10050
|
const traceUrl = resolveTraceUrl(req);
|
|
@@ -9682,7 +10062,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2
|
|
|
9682
10062
|
return;
|
|
9683
10063
|
}
|
|
9684
10064
|
if (res.headersSent) {
|
|
9685
|
-
_optionalChain([res, 'access',
|
|
10065
|
+
_optionalChain([res, 'access', _506 => _506.destroy, 'optionalCall', _507 => _507(error instanceof Error ? error : new Error(String(error)))]);
|
|
9686
10066
|
return;
|
|
9687
10067
|
}
|
|
9688
10068
|
res.statusCode = 500;
|
|
@@ -9781,7 +10161,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
9781
10161
|
const originalWrite = res.write.bind(res);
|
|
9782
10162
|
const originalEnd = res.end.bind(res);
|
|
9783
10163
|
const originalWriteHead = res.writeHead.bind(res);
|
|
9784
|
-
const originalFlushHeaders = _optionalChain([res, 'access',
|
|
10164
|
+
const originalFlushHeaders = _optionalChain([res, 'access', _508 => _508.flushHeaders, 'optionalAccess', _509 => _509.bind, 'call', _510 => _510(res)]);
|
|
9785
10165
|
let afterResponseCalled = false;
|
|
9786
10166
|
let interceptedEnd = false;
|
|
9787
10167
|
const htmlChunks = [];
|
|
@@ -9821,7 +10201,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
9821
10201
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
9822
10202
|
if (shouldBufferResponse) {
|
|
9823
10203
|
const callback = args.find((arg) => typeof arg === "function");
|
|
9824
|
-
_optionalChain([callback, 'optionalCall',
|
|
10204
|
+
_optionalChain([callback, 'optionalCall', _511 => _511()]);
|
|
9825
10205
|
return true;
|
|
9826
10206
|
}
|
|
9827
10207
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -9936,14 +10316,14 @@ function getEnvDefines(config, configEnv) {
|
|
|
9936
10316
|
_chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
|
|
9937
10317
|
)
|
|
9938
10318
|
};
|
|
9939
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
10319
|
+
if (_optionalChain([configEnv, 'optionalAccess', _512 => _512.isSsrBuild])) {
|
|
9940
10320
|
defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
9941
10321
|
}
|
|
9942
10322
|
return defines;
|
|
9943
10323
|
}
|
|
9944
10324
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
|
|
9945
10325
|
function getFarmAPIBaseURLDefine(config) {
|
|
9946
|
-
const baseURL = _optionalChain([config, 'access',
|
|
10326
|
+
const baseURL = _optionalChain([config, 'access', _513 => _513.api, 'optionalAccess', _514 => _514.baseURL]);
|
|
9947
10327
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
|
|
9948
10328
|
}
|
|
9949
10329
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
|
|
@@ -9961,26 +10341,26 @@ function isPotentialProgrammaticRouteSourceFile(normalizedFile, srcDirSlug) {
|
|
|
9961
10341
|
}
|
|
9962
10342
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isPotentialProgrammaticRouteSourceFile, "isPotentialProgrammaticRouteSourceFile");
|
|
9963
10343
|
function fileContainsProgrammaticPageRoute(file) {
|
|
9964
|
-
if (!
|
|
10344
|
+
if (!fs11.existsSync(file)) {
|
|
9965
10345
|
return false;
|
|
9966
10346
|
}
|
|
9967
10347
|
try {
|
|
9968
|
-
return _chunk6V4TDWECcjs.scanProgrammaticPagePaths.call(void 0,
|
|
9969
|
-
} catch (
|
|
10348
|
+
return _chunk6V4TDWECcjs.scanProgrammaticPagePaths.call(void 0, fs11.readFileSync(file, "utf8")).length > 0;
|
|
10349
|
+
} catch (e33) {
|
|
9970
10350
|
return false;
|
|
9971
10351
|
}
|
|
9972
10352
|
}
|
|
9973
10353
|
_chunkS3JO3N4Hcjs.__name.call(void 0, fileContainsProgrammaticPageRoute, "fileContainsProgrammaticPageRoute");
|
|
9974
10354
|
function rewriteEarlySsrRelativeImports(options) {
|
|
9975
10355
|
const cleanId = options.id.split("?", 1)[0];
|
|
9976
|
-
if (!
|
|
10356
|
+
if (!path20.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
|
|
9977
10357
|
return null;
|
|
9978
10358
|
}
|
|
9979
10359
|
const replacements = [];
|
|
9980
10360
|
let ast;
|
|
9981
10361
|
try {
|
|
9982
10362
|
ast = options.parse(options.code);
|
|
9983
|
-
} catch (
|
|
10363
|
+
} catch (e34) {
|
|
9984
10364
|
return null;
|
|
9985
10365
|
}
|
|
9986
10366
|
walkModuleAst(ast, (node) => {
|
|
@@ -9993,7 +10373,7 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
9993
10373
|
const suffixIndex = source.value.search(/[?#]/);
|
|
9994
10374
|
const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
|
|
9995
10375
|
const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
|
|
9996
|
-
const resolvedPath =
|
|
10376
|
+
const resolvedPath = path20.resolve(path20.dirname(cleanId), sourcePath);
|
|
9997
10377
|
replacements.push({
|
|
9998
10378
|
start: source.start,
|
|
9999
10379
|
end: source.end,
|
|
@@ -10012,7 +10392,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
10012
10392
|
let ast;
|
|
10013
10393
|
try {
|
|
10014
10394
|
ast = options.parse(options.code);
|
|
10015
|
-
} catch (
|
|
10395
|
+
} catch (e35) {
|
|
10016
10396
|
return null;
|
|
10017
10397
|
}
|
|
10018
10398
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
@@ -10033,9 +10413,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
10033
10413
|
transformedExports++;
|
|
10034
10414
|
}, "addWrapper");
|
|
10035
10415
|
for (const node of body) {
|
|
10036
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
10416
|
+
if (_optionalChain([node, 'optionalAccess', _515 => _515.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
10037
10417
|
const declaration2 = node.declaration;
|
|
10038
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
10418
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _516 => _516.id, 'optionalAccess', _517 => _517.name])) {
|
|
10039
10419
|
replacements.push({
|
|
10040
10420
|
start: node.start,
|
|
10041
10421
|
end: node.end,
|
|
@@ -10053,14 +10433,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
10053
10433
|
}
|
|
10054
10434
|
continue;
|
|
10055
10435
|
}
|
|
10056
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
10436
|
+
if (_optionalChain([node, 'optionalAccess', _518 => _518.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
10057
10437
|
const declaration = node.declaration;
|
|
10058
10438
|
const declaredNames = [];
|
|
10059
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
10439
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _519 => _519.id, 'optionalAccess', _520 => _520.name])) {
|
|
10060
10440
|
declaredNames.push(declaration.id.name);
|
|
10061
10441
|
} else if (declaration.type === "VariableDeclaration") {
|
|
10062
10442
|
for (const declarator of declaration.declarations || []) {
|
|
10063
|
-
if (_optionalChain([declarator, 'access',
|
|
10443
|
+
if (_optionalChain([declarator, 'access', _521 => _521.id, 'optionalAccess', _522 => _522.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
10064
10444
|
}
|
|
10065
10445
|
}
|
|
10066
10446
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -10111,8 +10491,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isFarmModuleAstNode, "isFarmModuleAstNode"
|
|
|
10111
10491
|
function isFarmConfigFile(file, root) {
|
|
10112
10492
|
const normalized = file.replace(/\\/g, "/");
|
|
10113
10493
|
const rootSlug = root.replace(/\\/g, "/").replace(/\/+$/, "");
|
|
10114
|
-
const
|
|
10115
|
-
return FARM_CONFIG_FILENAMES.has(
|
|
10494
|
+
const relative4 = normalized.startsWith(`${rootSlug}/`) ? normalized.slice(rootSlug.length + 1) : normalized;
|
|
10495
|
+
return FARM_CONFIG_FILENAMES.has(relative4);
|
|
10116
10496
|
}
|
|
10117
10497
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmConfigFile, "isFarmConfigFile");
|
|
10118
10498
|
var warnedClientBoundaryIds = /* @__PURE__ */ new Set();
|
|
@@ -10121,10 +10501,10 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
10121
10501
|
let program;
|
|
10122
10502
|
try {
|
|
10123
10503
|
program = context.parse(code);
|
|
10124
|
-
} catch (
|
|
10504
|
+
} catch (e36) {
|
|
10125
10505
|
return;
|
|
10126
10506
|
}
|
|
10127
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
10507
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _523 => _523.env, 'optionalAccess', _524 => _524.public]), () => ( {}))));
|
|
10128
10508
|
const findings = analyzeClientBoundary(program, publicKeys);
|
|
10129
10509
|
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
10130
10510
|
return;
|
|
@@ -10176,7 +10556,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10176
10556
|
config(userConfig, configEnv) {
|
|
10177
10557
|
isBuild = configEnv.command === "build";
|
|
10178
10558
|
const layerAliases = _chunkVPTDD5XFcjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
10179
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access',
|
|
10559
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _525 => _525.resolve, 'optionalAccess', _526 => _526.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
|
|
10180
10560
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
10181
10561
|
return {
|
|
10182
10562
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
@@ -10189,13 +10569,12 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10189
10569
|
resolve: {
|
|
10190
10570
|
alias: { ...layerAliases, ...sourceAlias }
|
|
10191
10571
|
},
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
}
|
|
10572
|
+
server: {
|
|
10573
|
+
fs: {
|
|
10574
|
+
...layerRoots.length ? { allow: [path20.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
10575
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _527 => _527.server, 'optionalAccess', _528 => _528.fs, 'optionalAccess', _529 => _529.deny]), options)
|
|
10197
10576
|
}
|
|
10198
|
-
}
|
|
10577
|
+
}
|
|
10199
10578
|
};
|
|
10200
10579
|
},
|
|
10201
10580
|
async configResolved(config) {
|
|
@@ -10205,13 +10584,18 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10205
10584
|
serverFnTransformActive = config.plugins.some(
|
|
10206
10585
|
(plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
10207
10586
|
);
|
|
10208
|
-
if (_optionalChain([options, 'access',
|
|
10587
|
+
if (_optionalChain([options, 'access', _530 => _530.experimental, 'optionalAccess', _531 => _531.serverActions]) === true && !serverFnTransformActive) {
|
|
10209
10588
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
10210
10589
|
"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."
|
|
10211
10590
|
);
|
|
10212
10591
|
}
|
|
10213
10592
|
},
|
|
10214
10593
|
async configureServer(viteServer) {
|
|
10594
|
+
viteServer.middlewares.use(
|
|
10595
|
+
createFarmDevPreviewGuard(viteServer, {
|
|
10596
|
+
getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _532 => _532.getConfig, 'call', _533 => _533()]), () => ( options))), "getSourceRoots")
|
|
10597
|
+
})
|
|
10598
|
+
);
|
|
10215
10599
|
if (typeof fontImports.configureServer === "function") {
|
|
10216
10600
|
await fontImports.configureServer.call(this, viteServer);
|
|
10217
10601
|
}
|
|
@@ -10221,7 +10605,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10221
10605
|
if (!pm) return;
|
|
10222
10606
|
try {
|
|
10223
10607
|
await pm.runHookParallel("onError", { phase, error, meta });
|
|
10224
|
-
} catch (
|
|
10608
|
+
} catch (e37) {
|
|
10225
10609
|
}
|
|
10226
10610
|
}, "emitPluginError");
|
|
10227
10611
|
farmApp = new FarmApp(
|
|
@@ -10233,27 +10617,28 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10233
10617
|
);
|
|
10234
10618
|
await farmApp.initialize();
|
|
10235
10619
|
const farmConfig = farmApp.getConfig();
|
|
10236
|
-
|
|
10620
|
+
let farmAppPackages;
|
|
10621
|
+
if (_optionalChain([farmConfig, 'access', _534 => _534.agent, 'optionalAccess', _535 => _535.noindexPreviews])) {
|
|
10237
10622
|
server.middlewares.use((_req, res, next) => {
|
|
10238
10623
|
if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
10239
|
-
res.setHeader("X-Robots-Tag",
|
|
10624
|
+
res.setHeader("X-Robots-Tag", _chunkZHPHJPQPcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
10240
10625
|
}
|
|
10241
10626
|
next();
|
|
10242
10627
|
});
|
|
10243
10628
|
}
|
|
10244
|
-
const apiServerBasePath =
|
|
10629
|
+
const apiServerBasePath = _chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
10245
10630
|
const serverConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, farmConfig.server);
|
|
10246
10631
|
globalThis.__FARM_IMAGE_CONFIG__ = _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, farmConfig.images);
|
|
10247
10632
|
let imageHandler = null;
|
|
10248
10633
|
if (farmConfig.images.provider !== "none") {
|
|
10249
10634
|
const { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } = await import("./image/sharp.cjs");
|
|
10250
|
-
imageHandler =
|
|
10635
|
+
imageHandler = _chunkVKNHTSAPcjs.createFarmImageHandler.call(void 0, farmConfig.images, {
|
|
10251
10636
|
transform: createSharpImageTransformer(),
|
|
10252
10637
|
fetchRemote: createNodeImageFetcher(farmConfig.images),
|
|
10253
10638
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
10254
10639
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
10255
10640
|
// a caller-controlled Host header.
|
|
10256
|
-
trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access',
|
|
10641
|
+
trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _536 => _536.resolvedUrls, 'optionalAccess', _537 => _537.local, 'access', _538 => _538[0]]), "trustedLocalOrigin"),
|
|
10257
10642
|
onError(error) {
|
|
10258
10643
|
_chunk5QIKR7RRcjs.logger.error(
|
|
10259
10644
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -10262,26 +10647,26 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10262
10647
|
});
|
|
10263
10648
|
}
|
|
10264
10649
|
const sourceRoots = _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, farmConfig);
|
|
10265
|
-
server.watcher.add(sourceRoots.map((source) =>
|
|
10650
|
+
server.watcher.add(sourceRoots.map((source) => path20.join(source.root, source.srcDir)));
|
|
10266
10651
|
if (farmConfig.i18n.enabled) {
|
|
10267
10652
|
server.watcher.add(
|
|
10268
10653
|
farmConfig.i18n.locales.map(
|
|
10269
|
-
(locale) =>
|
|
10654
|
+
(locale) => _chunkHLJ6MBUZcjs.resolveFarmI18nMessagePath.call(void 0, farmConfig.i18n, locale)
|
|
10270
10655
|
)
|
|
10271
10656
|
);
|
|
10272
10657
|
}
|
|
10273
10658
|
const workflowConfig = farmConfig.workflows;
|
|
10274
10659
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
10275
10660
|
const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
|
|
10276
|
-
..._optionalChain([options, 'access',
|
|
10277
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
10661
|
+
..._optionalChain([options, 'access', _539 => _539.openapi, 'optionalAccess', _540 => _540.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
10662
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _541 => _541.getFarmDocsRouteTypeEntries, 'call', _542 => _542(farmConfig.docs)]), () => ( []))
|
|
10278
10663
|
], "getExtraRouteTypes");
|
|
10279
10664
|
const appDirSlugs = sourceRoots.map(
|
|
10280
|
-
(source) =>
|
|
10665
|
+
(source) => path20.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
10281
10666
|
);
|
|
10282
10667
|
const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
10283
10668
|
try {
|
|
10284
|
-
const result = await
|
|
10669
|
+
const result = await _chunkQJ3J6MZTcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
10285
10670
|
root: farmConfig.root,
|
|
10286
10671
|
srcDir: farmConfig.srcDir,
|
|
10287
10672
|
layers: farmConfig.layers,
|
|
@@ -10318,10 +10703,10 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10318
10703
|
}, "generateTypeArtifacts");
|
|
10319
10704
|
await generateTypeArtifacts("startup");
|
|
10320
10705
|
const srcDirSlugs = sourceRoots.map(
|
|
10321
|
-
(source) =>
|
|
10706
|
+
(source) => path20.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
10322
10707
|
);
|
|
10323
10708
|
const layerConfigFiles = new Set(
|
|
10324
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
10709
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _543 => _543.configFile, 'optionalAccess', _544 => _544.replace, 'call', _545 => _545(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
10325
10710
|
);
|
|
10326
10711
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
10327
10712
|
..._chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -10356,7 +10741,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10356
10741
|
const isStaticMetadataImageFile2 = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (file) => /\/(?:opengraph-image|twitter-image)(?:\.(?:png|jpg|jpeg|gif|webp)|\.alt\.txt)$/.test(
|
|
10357
10742
|
file.replace(/\\/g, "/")
|
|
10358
10743
|
), "isStaticMetadataImageFile");
|
|
10359
|
-
const isI18nCatalogFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (file) =>
|
|
10744
|
+
const isI18nCatalogFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (file) => _chunkHLJ6MBUZcjs.isFarmI18nCatalogFile.call(void 0, farmConfig.i18n, file), "isI18nCatalogFile");
|
|
10360
10745
|
let typeArtifactGenScheduled = null;
|
|
10361
10746
|
let pendingTypeArtifacts = createEmptyTypeArtifactSelection();
|
|
10362
10747
|
let pendingTypeArtifactReason = "";
|
|
@@ -10400,7 +10785,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10400
10785
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
10401
10786
|
}
|
|
10402
10787
|
if (isI18nCatalogFile(file)) {
|
|
10403
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
10788
|
+
_optionalChain([farmApp, 'optionalAccess', _546 => _546.getI18nRuntime, 'call', _547 => _547(), 'access', _548 => _548.reload, 'call', _549 => _549(), 'access', _550 => _550.then, 'call', _551 => _551(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _552 => _552.catch, 'call', _553 => _553((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
10404
10789
|
}
|
|
10405
10790
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile2(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
10406
10791
|
if (isRouteRefreshEvent) {
|
|
@@ -10413,8 +10798,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10413
10798
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
10414
10799
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
10415
10800
|
Promise.all([
|
|
10416
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
10417
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
10801
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _554 => _554(`${ev} ${file}`)]),
|
|
10802
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _555 => _555.reload, 'call', _556 => _556()]) : void 0
|
|
10418
10803
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
10419
10804
|
}, 50);
|
|
10420
10805
|
}
|
|
@@ -10448,7 +10833,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10448
10833
|
layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
|
|
10449
10834
|
});
|
|
10450
10835
|
}
|
|
10451
|
-
apiRouteManager = new (0,
|
|
10836
|
+
apiRouteManager = new (0, _chunkMIDIZJZCcjs.APIRouteManager)(appDirs, server, {
|
|
10452
10837
|
plugins: farmConfig.plugins,
|
|
10453
10838
|
i18n: farmApp.getI18nRuntime(),
|
|
10454
10839
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -10457,7 +10842,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10457
10842
|
await apiRouteManager.discoverRoutes();
|
|
10458
10843
|
let discoveredWorkflows = [];
|
|
10459
10844
|
const hasWorkflowDirectory = workflowConfig.enabled && workflowConfig.dirs.some(
|
|
10460
|
-
(dir) =>
|
|
10845
|
+
(dir) => fs11.existsSync(path20.isAbsolute(dir) ? dir : path20.join(farmConfig.root, dir))
|
|
10461
10846
|
);
|
|
10462
10847
|
if (hasWorkflowDirectory) {
|
|
10463
10848
|
const { createFarmWorkflowRequestHandler, discoverFarmWorkflows } = await loadFarmWorkflowsDevRuntime();
|
|
@@ -10486,12 +10871,13 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10486
10871
|
});
|
|
10487
10872
|
}
|
|
10488
10873
|
}
|
|
10489
|
-
middlewareManager = new (0,
|
|
10874
|
+
middlewareManager = new (0, _chunkU74I55WBcjs.MiddlewareManager)(
|
|
10490
10875
|
appDirs,
|
|
10491
10876
|
server,
|
|
10492
10877
|
farmConfig.middleware,
|
|
10493
10878
|
farmConfig.i18n,
|
|
10494
|
-
farmConfig.server
|
|
10879
|
+
farmConfig.server,
|
|
10880
|
+
apiServerBasePath
|
|
10495
10881
|
);
|
|
10496
10882
|
await middlewareManager.discover();
|
|
10497
10883
|
if (pm) {
|
|
@@ -10503,11 +10889,11 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10503
10889
|
});
|
|
10504
10890
|
}
|
|
10505
10891
|
}
|
|
10506
|
-
if (_optionalChain([options, 'access',
|
|
10892
|
+
if (_optionalChain([options, 'access', _557 => _557.openapi, 'optionalAccess', _558 => _558.enabled])) {
|
|
10507
10893
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
10508
10894
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
10509
10895
|
mode: "development",
|
|
10510
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
10896
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _559 => _559.api, 'optionalAccess', _560 => _560.baseURL]) === "string" ? options.api.baseURL : void 0
|
|
10511
10897
|
});
|
|
10512
10898
|
const spec = await openAPIManager.generateSpec();
|
|
10513
10899
|
reportOpenAPIDevGenerationResult(spec);
|
|
@@ -10546,13 +10932,13 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10546
10932
|
),
|
|
10547
10933
|
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
|
|
10548
10934
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
10549
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
10935
|
+
if (specifier === _optionalChain([farmConfig, 'access', _561 => _561.docs, 'access', _562 => _562.adapter, 'optionalAccess', _563 => _563.server]) && _optionalChain([resolved, 'optionalAccess', _564 => _564.id])) {
|
|
10550
10936
|
return import(
|
|
10551
10937
|
/* @vite-ignore */
|
|
10552
10938
|
_url.pathToFileURL.call(void 0, resolved.id).href
|
|
10553
10939
|
);
|
|
10554
10940
|
}
|
|
10555
|
-
return _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
10941
|
+
return _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _565 => _565.id]), () => ( specifier)));
|
|
10556
10942
|
}, "loadModule")
|
|
10557
10943
|
}) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
|
|
10558
10944
|
root: farmConfig.root,
|
|
@@ -10567,7 +10953,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10567
10953
|
)
|
|
10568
10954
|
}) : null;
|
|
10569
10955
|
const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2, response) => {
|
|
10570
|
-
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
10956
|
+
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _566 => _566.headers, 'access', _567 => _567.get, 'call', _568 => _568("content-type"), 'optionalAccess', _569 => _569.toLowerCase, 'call', _570 => _570(), 'access', _571 => _571.includes, 'call', _572 => _572("text/html")])) {
|
|
10571
10957
|
return response;
|
|
10572
10958
|
}
|
|
10573
10959
|
const pathname = new URL(request2.url).pathname;
|
|
@@ -10588,7 +10974,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10588
10974
|
headers: response.headers
|
|
10589
10975
|
});
|
|
10590
10976
|
}
|
|
10591
|
-
const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
10977
|
+
const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _573 => _573.getConfig, 'call', _574 => _574()]), () => ( options))).renderer);
|
|
10592
10978
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
10593
10979
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
10594
10980
|
Promise.all(
|
|
@@ -10617,7 +11003,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
10617
11003
|
])
|
|
10618
11004
|
);
|
|
10619
11005
|
const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
|
|
10620
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
11006
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _575 => _575.route, 'optionalAccess', _576 => _576.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
10621
11007
|
const bootstrapScript = `<script>
|
|
10622
11008
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
10623
11009
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -10671,7 +11057,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10671
11057
|
const farmDocsAPIHandler = farmDocsDevRuntime && !farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs) ? farmDocsDevRuntime.createFarmDocsAPIHandler({
|
|
10672
11058
|
rootDir: farmConfig.root,
|
|
10673
11059
|
srcDir: farmConfig.srcDir,
|
|
10674
|
-
docs: farmConfig.docs
|
|
11060
|
+
docs: farmConfig.docs,
|
|
11061
|
+
diagnostics: true
|
|
10675
11062
|
}) : null;
|
|
10676
11063
|
const farmDocsFontAssets = new Map(
|
|
10677
11064
|
farmDocsFontAssetList.map(({ url, sourcePath }) => [url, sourcePath])
|
|
@@ -10711,9 +11098,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10711
11098
|
}, "dispatch")
|
|
10712
11099
|
},
|
|
10713
11100
|
(request2) => {
|
|
10714
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11101
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _577 => _577.getConfig, 'call', _578 => _578()]), () => ( options));
|
|
10715
11102
|
const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
10716
|
-
return
|
|
11103
|
+
return _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, request2, {
|
|
10717
11104
|
trustProxy: currentServerConfig.trustProxy
|
|
10718
11105
|
});
|
|
10719
11106
|
}
|
|
@@ -10722,9 +11109,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10722
11109
|
withAPIRequestTracing(async (req, res, next) => {
|
|
10723
11110
|
const requestUrl = req.url || "/";
|
|
10724
11111
|
const requestMethod = req.method || "GET";
|
|
10725
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11112
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _579 => _579.getConfig, 'call', _580 => _580()]), () => ( options));
|
|
10726
11113
|
const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
10727
|
-
const parsedRequestUrl =
|
|
11114
|
+
const parsedRequestUrl = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
10728
11115
|
trustProxy: currentServerConfig.trustProxy
|
|
10729
11116
|
});
|
|
10730
11117
|
const fullUrl = parsedRequestUrl.toString();
|
|
@@ -10739,12 +11126,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10739
11126
|
}
|
|
10740
11127
|
}
|
|
10741
11128
|
const farmDocsFontPath = farmDocsFontAssets.get(requestPathname);
|
|
10742
|
-
if ((requestMethod === "GET" || requestMethod === "HEAD") && farmDocsFontPath &&
|
|
11129
|
+
if ((requestMethod === "GET" || requestMethod === "HEAD") && farmDocsFontPath && fs11.existsSync(farmDocsFontPath)) {
|
|
10743
11130
|
res.statusCode = 200;
|
|
10744
11131
|
res.setHeader("Content-Type", "font/woff2");
|
|
10745
11132
|
res.setHeader("Cache-Control", "public, max-age=31536000, immutable");
|
|
10746
11133
|
if (requestMethod === "HEAD") res.end();
|
|
10747
|
-
else
|
|
11134
|
+
else fs11.createReadStream(farmDocsFontPath).pipe(res);
|
|
10748
11135
|
return;
|
|
10749
11136
|
}
|
|
10750
11137
|
if (requestMethod === "GET" && (requestPathname === _chunkYJRZR7VUcjs.FARM_DEVTOOLS_PATH || requestPathname === `${_chunkYJRZR7VUcjs.FARM_DEVTOOLS_PATH}.json`)) {
|
|
@@ -10764,7 +11151,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10764
11151
|
if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_PATH)) {
|
|
10765
11152
|
launchUrl = referrerUrl;
|
|
10766
11153
|
}
|
|
10767
|
-
} catch (
|
|
11154
|
+
} catch (e38) {
|
|
10768
11155
|
}
|
|
10769
11156
|
}
|
|
10770
11157
|
launchUrl.searchParams.set(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
|
|
@@ -10790,7 +11177,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10790
11177
|
openapi: options.openapi
|
|
10791
11178
|
},
|
|
10792
11179
|
workflows: discoveredWorkflows,
|
|
10793
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
11180
|
+
plugins: _optionalChain([pm, 'optionalAccess', _581 => _581.getSortedPlugins, 'call', _582 => _582()])
|
|
10794
11181
|
});
|
|
10795
11182
|
res.statusCode = 200;
|
|
10796
11183
|
res.setHeader(
|
|
@@ -10813,7 +11200,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10813
11200
|
return;
|
|
10814
11201
|
}
|
|
10815
11202
|
const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
10816
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
11203
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _583 => _583.hasMiddleware, 'call', _584 => _584()])) return false;
|
|
10817
11204
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
10818
11205
|
return runFarmMiddlewareWithNavigation(
|
|
10819
11206
|
farmApp.getServerRenderer(),
|
|
@@ -10824,7 +11211,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10824
11211
|
);
|
|
10825
11212
|
}, "runAppMiddlewareForContentRoute");
|
|
10826
11213
|
const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
10827
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
11214
|
+
if (openAPIManager && _optionalChain([options, 'access', _585 => _585.openapi, 'optionalAccess', _586 => _586.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
10828
11215
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10829
11216
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
10830
11217
|
res.statusCode = 405;
|
|
@@ -10841,18 +11228,35 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10841
11228
|
res.end(requestMethod === "HEAD" ? void 0 : body);
|
|
10842
11229
|
return;
|
|
10843
11230
|
}
|
|
10844
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
11231
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _587 => _587.openapi, 'optionalAccess', _588 => _588.route])) {
|
|
10845
11232
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10846
11233
|
const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
|
|
10847
11234
|
return docsHandler(req, res);
|
|
10848
11235
|
}
|
|
10849
|
-
if (
|
|
11236
|
+
if (_chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkP64MIF5Bcjs.FARM_APP_MANIFEST_PATH) {
|
|
11237
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = resolveFarmAppPackages(_nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
11238
|
+
const manifest = await _chunkP64MIF5Bcjs.createFarmAppManifestResponse.call(void 0,
|
|
11239
|
+
new Request(parsedRequestUrl, { method: requestMethod }),
|
|
11240
|
+
_chunkP64MIF5Bcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
11241
|
+
build: "development",
|
|
11242
|
+
packages: farmAppPackages,
|
|
11243
|
+
// Read again on each request; unchanged files come from a cache.
|
|
11244
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _589 => _589.plugins, 'optionalAccess', _590 => _590.some, 'call', _591 => _591(({ name }) => name === "farm:webmcp")]) ? collectFarmWebMCPTools(_nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
11245
|
+
}),
|
|
11246
|
+
{ development: true }
|
|
11247
|
+
);
|
|
11248
|
+
if (manifest) {
|
|
11249
|
+
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, manifest);
|
|
11250
|
+
return;
|
|
11251
|
+
}
|
|
11252
|
+
}
|
|
11253
|
+
if (_optionalChain([options, 'access', _592 => _592.agent, 'optionalAccess', _593 => _593.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkP64MIF5Bcjs.FARM_API_CATALOG_PATH) {
|
|
10850
11254
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10851
11255
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
10852
11256
|
res,
|
|
10853
|
-
|
|
11257
|
+
_chunkP64MIF5Bcjs.createFarmApiCatalogResponse.call(void 0,
|
|
10854
11258
|
requestMethod,
|
|
10855
|
-
|
|
11259
|
+
_chunkP64MIF5Bcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
10856
11260
|
new Request(parsedRequestUrl, {
|
|
10857
11261
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
10858
11262
|
})
|
|
@@ -10887,7 +11291,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10887
11291
|
return;
|
|
10888
11292
|
}
|
|
10889
11293
|
}
|
|
10890
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
11294
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunkUX5S4JEOcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
10891
11295
|
request: new Request(fullUrl, {
|
|
10892
11296
|
method: requestMethod,
|
|
10893
11297
|
headers: docsHeaders
|
|
@@ -10895,22 +11299,28 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10895
11299
|
config: farmApp.getConfig().mdx,
|
|
10896
11300
|
resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
|
|
10897
11301
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
10898
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
11302
|
+
const sourcePath = _optionalChain([match, 'access', _594 => _594.route, 'optionalAccess', _595 => _595.markdownSourcePath]) || (match.route && _chunkUX5S4JEOcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
10899
11303
|
if (!sourcePath) {
|
|
10900
11304
|
return null;
|
|
10901
11305
|
}
|
|
10902
11306
|
return {
|
|
10903
|
-
source: await
|
|
11307
|
+
source: await fs11.promises.readFile(sourcePath, "utf8"),
|
|
10904
11308
|
filePath: sourcePath
|
|
10905
11309
|
};
|
|
10906
|
-
}, "resolveSource")
|
|
11310
|
+
}, "resolveSource"),
|
|
11311
|
+
// The anonymous check goes through this server, so its guards and
|
|
11312
|
+
// middleware see the page's own path, as in production.
|
|
11313
|
+
renderPage: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => fetch(request2, {
|
|
11314
|
+
redirect: "manual",
|
|
11315
|
+
signal: res.destroyed ? AbortSignal.abort() : _chunkEM6SBQKMcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
11316
|
+
}), "renderPage")
|
|
10907
11317
|
});
|
|
10908
11318
|
if (markdownSourceResponse) {
|
|
10909
11319
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10910
11320
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownSourceResponse);
|
|
10911
11321
|
return;
|
|
10912
11322
|
}
|
|
10913
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
11323
|
+
const markdownResponse = viteModuleRequest ? null : await _chunkXXJU7FCCcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
10914
11324
|
request: new Request(fullUrl, {
|
|
10915
11325
|
method: requestMethod,
|
|
10916
11326
|
headers: docsHeaders
|
|
@@ -10932,21 +11342,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10932
11342
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownResponse);
|
|
10933
11343
|
return;
|
|
10934
11344
|
}
|
|
10935
|
-
if (!viteModuleRequest &&
|
|
10936
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
11345
|
+
if (!viteModuleRequest && _chunkXXJU7FCCcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
11346
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkUX5S4JEOcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
|
|
10937
11347
|
if (!markdownRoute.route) {
|
|
10938
11348
|
if (await runAppMiddlewareForContentRoute()) return;
|
|
10939
11349
|
res.statusCode = 404;
|
|
10940
|
-
res.setHeader("Content-Type",
|
|
11350
|
+
res.setHeader("Content-Type", _chunkXXJU7FCCcjs.FARM_MARKDOWN_CONTENT_TYPE);
|
|
10941
11351
|
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
10942
11352
|
res.setHeader("Cache-Control", "no-store");
|
|
10943
11353
|
res.end(
|
|
10944
|
-
|
|
11354
|
+
_chunkXXJU7FCCcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
|
|
10945
11355
|
);
|
|
10946
11356
|
return;
|
|
10947
11357
|
}
|
|
10948
11358
|
}
|
|
10949
|
-
const markdownPageTarget =
|
|
11359
|
+
const markdownPageTarget = _chunkXXJU7FCCcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
10950
11360
|
farmApp.getConfig().md,
|
|
10951
11361
|
requestPathname,
|
|
10952
11362
|
{
|
|
@@ -10959,7 +11369,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10959
11369
|
if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
|
|
10960
11370
|
res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
|
|
10961
11371
|
}
|
|
10962
|
-
const alternatePath =
|
|
11372
|
+
const alternatePath = _chunkXXJU7FCCcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
|
|
10963
11373
|
const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
|
|
10964
11374
|
const currentLink = res.getHeader("Link");
|
|
10965
11375
|
res.setHeader(
|
|
@@ -10997,7 +11407,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10997
11407
|
}
|
|
10998
11408
|
const configuredIntegrations = currentConfig.integrations;
|
|
10999
11409
|
const tryConfiguredIntegrationRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
11000
|
-
const matchedRoute =
|
|
11410
|
+
const matchedRoute = _chunkTDFPACVXcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
11001
11411
|
pathname: requestPathname,
|
|
11002
11412
|
method: requestMethod
|
|
11003
11413
|
});
|
|
@@ -11010,8 +11420,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11010
11420
|
await pm.runHookParallelFiltered(
|
|
11011
11421
|
"beforeRequest",
|
|
11012
11422
|
(plugin) => {
|
|
11013
|
-
const owner =
|
|
11014
|
-
return plugin.name !==
|
|
11423
|
+
const owner = _chunkTDFPACVXcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
11424
|
+
return plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _596 => _596.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
11015
11425
|
},
|
|
11016
11426
|
req,
|
|
11017
11427
|
res
|
|
@@ -11039,7 +11449,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11039
11449
|
signal: _chunkEM6SBQKMcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
11040
11450
|
});
|
|
11041
11451
|
const dispatchIntegration = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => {
|
|
11042
|
-
const result = await
|
|
11452
|
+
const result = await _chunkTDFPACVXcjs.dispatchIntegrationRequest.call(void 0,
|
|
11043
11453
|
{
|
|
11044
11454
|
integration: matchedRoute.integration,
|
|
11045
11455
|
config: currentConfig,
|
|
@@ -11102,11 +11512,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11102
11512
|
}
|
|
11103
11513
|
const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
|
|
11104
11514
|
const hasMatchedApiRoute = Boolean(matchedApiRoute);
|
|
11105
|
-
if (hasMatchedApiRoute ||
|
|
11515
|
+
if (hasMatchedApiRoute || _chunkG26MUMKLcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
|
|
11106
11516
|
const startTime2 = Date.now();
|
|
11107
11517
|
const method2 = req.method || "GET";
|
|
11108
11518
|
const urlPath2 = req.url || "/";
|
|
11109
|
-
const pathname2 =
|
|
11519
|
+
const pathname2 = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
11110
11520
|
trustProxy: currentServerConfig.trustProxy
|
|
11111
11521
|
}).pathname;
|
|
11112
11522
|
try {
|
|
@@ -11114,7 +11524,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11114
11524
|
if (hasMatchedApiRoute) {
|
|
11115
11525
|
await pm.runHookParallelFiltered(
|
|
11116
11526
|
"beforeRequest",
|
|
11117
|
-
(plugin) => plugin.name !==
|
|
11527
|
+
(plugin) => plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
11118
11528
|
req,
|
|
11119
11529
|
res
|
|
11120
11530
|
);
|
|
@@ -11141,7 +11551,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11141
11551
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
11142
11552
|
const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
|
|
11143
11553
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
11144
|
-
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess',
|
|
11554
|
+
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _597 => _597.route, 'access', _598 => _598.path]) || _optionalChain([apiRouteManager, 'access', _599 => _599.matchRoute, 'call', _600 => _600(pathname2), 'optionalAccess', _601 => _601.route, 'access', _602 => _602.path]) || urlPath2;
|
|
11145
11555
|
_chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
|
|
11146
11556
|
type: "route.matched",
|
|
11147
11557
|
pathname: pathname2,
|
|
@@ -11231,7 +11641,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11231
11641
|
return;
|
|
11232
11642
|
}
|
|
11233
11643
|
}
|
|
11234
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
11644
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _603 => _603.isFarmDocsAPIRequest, 'call', _604 => _604(pathname2)])) {
|
|
11235
11645
|
try {
|
|
11236
11646
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
11237
11647
|
const headers = new Headers();
|
|
@@ -11304,18 +11714,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11304
11714
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
11305
11715
|
return;
|
|
11306
11716
|
}
|
|
11307
|
-
if (_optionalChain([req, 'access',
|
|
11717
|
+
if (_optionalChain([req, 'access', _605 => _605.url, 'optionalAccess', _606 => _606.startsWith, 'call', _607 => _607("/@")]) || _optionalChain([req, 'access', _608 => _608.url, 'optionalAccess', _609 => _609.startsWith, 'call', _610 => _610("/node_modules")])) {
|
|
11308
11718
|
return next();
|
|
11309
11719
|
}
|
|
11310
11720
|
if (shouldBypassFarmRouterForDottedPath(
|
|
11311
11721
|
requestPathname,
|
|
11312
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
11722
|
+
_optionalChain([farmApp, 'optionalAccess', _611 => _611.getRouteManager, 'call', _612 => _612()]),
|
|
11313
11723
|
[server.config.publicDir, server.config.root],
|
|
11314
11724
|
farmAgentGeneratedPaths(farmConfig)
|
|
11315
11725
|
)) {
|
|
11316
11726
|
return next();
|
|
11317
11727
|
}
|
|
11318
|
-
if (_optionalChain([req, 'access',
|
|
11728
|
+
if (_optionalChain([req, 'access', _613 => _613.url, 'optionalAccess', _614 => _614.startsWith, 'call', _615 => _615("/__farm/page-data")])) {
|
|
11319
11729
|
const urlObj = parsedRequestUrl;
|
|
11320
11730
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
11321
11731
|
try {
|
|
@@ -11343,7 +11753,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11343
11753
|
});
|
|
11344
11754
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
11345
11755
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
11346
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
11756
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _616 => _616.hasMiddleware, 'call', _617 => _617()])) {
|
|
11347
11757
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
11348
11758
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11349
11759
|
farmApp.getServerRenderer(),
|
|
@@ -11371,10 +11781,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11371
11781
|
if (pm) {
|
|
11372
11782
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11373
11783
|
pathname: targetPath,
|
|
11374
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
11375
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
11376
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
11377
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
11784
|
+
matched: !!_optionalChain([match, 'optionalAccess', _618 => _618.route]),
|
|
11785
|
+
routePattern: _optionalChain([match, 'optionalAccess', _619 => _619.route, 'optionalAccess', _620 => _620.pattern]) || null,
|
|
11786
|
+
params: _optionalChain([match, 'optionalAccess', _621 => _621.params]) || {},
|
|
11787
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _622 => _622.layouts]) || []).map((l) => l.pattern)
|
|
11378
11788
|
});
|
|
11379
11789
|
}
|
|
11380
11790
|
if (!match) {
|
|
@@ -11455,7 +11865,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11455
11865
|
}
|
|
11456
11866
|
mergedMetadata = _chunk3LUF2PE2cjs.addMetadataMarkdownAlternate.call(void 0,
|
|
11457
11867
|
mergedMetadata,
|
|
11458
|
-
|
|
11868
|
+
_chunkXXJU7FCCcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
|
|
11459
11869
|
);
|
|
11460
11870
|
const routeSlots = await Promise.all(
|
|
11461
11871
|
slots.map(async (slot) => {
|
|
@@ -11511,7 +11921,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11511
11921
|
pageShouldHydrate: shouldHydrate,
|
|
11512
11922
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
11513
11923
|
islandStrategy: hydrationIslandStrategy,
|
|
11514
|
-
rendering:
|
|
11924
|
+
rendering: _chunkQJ3J6MZTcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
11515
11925
|
});
|
|
11516
11926
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
11517
11927
|
const layoutStartIndex = getSharedLayoutPrefixLength(
|
|
@@ -11519,13 +11929,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11519
11929
|
destinationLayoutPatterns
|
|
11520
11930
|
);
|
|
11521
11931
|
const renderer = farmApp.getServerRenderer();
|
|
11522
|
-
const fragmentHtml = await
|
|
11932
|
+
const fragmentHtml = await _chunk3BU22U3Mcjs._runWithMiddlewareData.call(void 0,
|
|
11523
11933
|
middlewareMap,
|
|
11524
|
-
() =>
|
|
11934
|
+
() => _chunk3BU22U3Mcjs._runWithMiddlewareContext.call(void 0,
|
|
11525
11935
|
middlewareContext,
|
|
11526
11936
|
() => renderer.renderNavigationFragment({
|
|
11527
11937
|
PageComponent: routeModule.default,
|
|
11528
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
11938
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _623 => _623.default]),
|
|
11529
11939
|
pageProps: routeProps,
|
|
11530
11940
|
params,
|
|
11531
11941
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -11585,7 +11995,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11585
11995
|
from: interceptFromHeader,
|
|
11586
11996
|
slots: routeSlots.filter((slot) => slot.interception).map((slot) => slot.name)
|
|
11587
11997
|
} : void 0,
|
|
11588
|
-
i18n:
|
|
11998
|
+
i18n: _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )
|
|
11589
11999
|
};
|
|
11590
12000
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
|
|
11591
12001
|
res,
|
|
@@ -11627,18 +12037,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11627
12037
|
const startTime = Date.now();
|
|
11628
12038
|
const method = req.method || "GET";
|
|
11629
12039
|
const urlPath = req.url || "/";
|
|
11630
|
-
const requestedPathname =
|
|
12040
|
+
const requestedPathname = _chunkUXFQ3UDAcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
11631
12041
|
trustProxy: currentServerConfig.trustProxy
|
|
11632
12042
|
}).pathname;
|
|
11633
12043
|
const routeManager2 = farmApp.getRouteManager();
|
|
11634
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11635
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11636
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11637
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11638
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11639
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11640
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
11641
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
12044
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _624 => _624.hasHook, 'call', _625 => _625("beforeRouteMatch")]), () => ( false));
|
|
12045
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _626 => _626.hasHook, 'call', _627 => _627("afterRouteMatch")]), () => ( false));
|
|
12046
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _628 => _628.hasHook, 'call', _629 => _629("beforeRequest")]), () => ( false));
|
|
12047
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _630 => _630.hasHook, 'call', _631 => _631("beforeRender")]), () => ( false));
|
|
12048
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _632 => _632.hasHook, 'call', _633 => _633("afterResponse")]), () => ( false));
|
|
12049
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _634 => _634.hasHook, 'call', _635 => _635("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _636 => _636.hasHook, 'call', _637 => _637("afterRender")]), () => ( false)));
|
|
12050
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _638 => _638.hasRuntimeRequestHooks, 'call', _639 => _639()]), () => ( false));
|
|
12051
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _640 => _640.hasRuntimeHook, 'call', _641 => _641("after")]), () => ( false));
|
|
11642
12052
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
11643
12053
|
let runtimeSession;
|
|
11644
12054
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -11649,8 +12059,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11649
12059
|
kind: "page",
|
|
11650
12060
|
route: {
|
|
11651
12061
|
pathname: requestedPathname,
|
|
11652
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
11653
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
12062
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _642 => _642.route, 'optionalAccess', _643 => _643.pattern]) || null,
|
|
12063
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _644 => _644.params]) || {}
|
|
11654
12064
|
}
|
|
11655
12065
|
}
|
|
11656
12066
|
);
|
|
@@ -11683,17 +12093,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11683
12093
|
if (pm && hasAfterRouteMatchHook) {
|
|
11684
12094
|
await pm.runHookParallel("afterRouteMatch", {
|
|
11685
12095
|
pathname,
|
|
11686
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
11687
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11688
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
11689
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
12096
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _645 => _645.route]),
|
|
12097
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _646 => _646.route, 'optionalAccess', _647 => _647.pattern]) || null,
|
|
12098
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _648 => _648.params]) || {},
|
|
12099
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _649 => _649.layouts]) || []).map((l) => l.pattern)
|
|
11690
12100
|
});
|
|
11691
12101
|
}
|
|
11692
12102
|
const renderPayload = {
|
|
11693
12103
|
pathname,
|
|
11694
12104
|
method,
|
|
11695
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
11696
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
12105
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _650 => _650.route, 'optionalAccess', _651 => _651.pattern]) || null,
|
|
12106
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _652 => _652.params]) || {}
|
|
11697
12107
|
};
|
|
11698
12108
|
const shouldInterceptResponse = Boolean(
|
|
11699
12109
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -11715,7 +12125,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11715
12125
|
emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
|
|
11716
12126
|
}) : void 0;
|
|
11717
12127
|
try {
|
|
11718
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
12128
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _653 => _653.hasMiddleware, 'call', _654 => _654()])) {
|
|
11719
12129
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
11720
12130
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
11721
12131
|
farmApp.getServerRenderer(),
|
|
@@ -11725,7 +12135,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11725
12135
|
() => middlewareManager.execute(req, res)
|
|
11726
12136
|
);
|
|
11727
12137
|
if (handled) {
|
|
11728
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
12138
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _655 => _655.isEnded, 'call', _656 => _656()])) {
|
|
11729
12139
|
const duration = Date.now() - startTime;
|
|
11730
12140
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11731
12141
|
}
|
|
@@ -11737,16 +12147,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11737
12147
|
req.url || "/",
|
|
11738
12148
|
`http://${req.headers.host || "localhost:3000"}`
|
|
11739
12149
|
).pathname;
|
|
11740
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
12150
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _657 => _657.matchRoute, 'call', _658 => _658(currentPathname), 'optionalAccess', _659 => _659.route]));
|
|
11741
12151
|
await pm.runHookParallelFiltered(
|
|
11742
12152
|
"beforeRequest",
|
|
11743
|
-
(plugin) => !hasLocalPageRoute || plugin.name !==
|
|
12153
|
+
(plugin) => !hasLocalPageRoute || plugin.name !== _chunk27ZWSI3Wcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
11744
12154
|
req,
|
|
11745
12155
|
res
|
|
11746
12156
|
);
|
|
11747
12157
|
}
|
|
11748
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
11749
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
12158
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _660 => _660.isEnded, 'call', _661 => _661()])) {
|
|
12159
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _662 => _662.isEnded, 'call', _663 => _663()])) {
|
|
11750
12160
|
const duration = Date.now() - startTime;
|
|
11751
12161
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
11752
12162
|
}
|
|
@@ -11804,59 +12214,59 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
11804
12214
|
if (imageModule) return imageModule;
|
|
11805
12215
|
}
|
|
11806
12216
|
if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
11807
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
11808
|
-
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess',
|
|
12217
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _664 => _664.getConfig, 'call', _665 => _665(), 'access', _666 => _666.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
12218
|
+
return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _667 => _667.config, 'access', _668 => _668.root]) || options.root, renderer);
|
|
11809
12219
|
}
|
|
11810
12220
|
if (isFarmClientVirtualId(id)) {
|
|
11811
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
11812
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11813
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11814
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
11815
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
12221
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _669 => _669.getConfig, 'call', _670 => _670()]);
|
|
12222
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _671 => _671.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
12223
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _672 => _672.integrations]) || options.integrations;
|
|
12224
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _673 => _673.root]) || _optionalChain([server, 'optionalAccess', _674 => _674.config, 'access', _675 => _675.root]) || process.cwd();
|
|
12225
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _676 => _676.docs]);
|
|
11816
12226
|
const adapterOwnsDocsRuntime = Boolean(
|
|
11817
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
12227
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _677 => _677.adapter, 'optionalAccess', _678 => _678.server]) && docs.adapter.react
|
|
11818
12228
|
);
|
|
11819
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
12229
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _679 => _679.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
11820
12230
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
11821
|
-
_optionalChain([docs, 'optionalAccess',
|
|
11822
|
-
_optionalChain([docs, 'optionalAccess',
|
|
12231
|
+
_optionalChain([docs, 'optionalAccess', _680 => _680.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
12232
|
+
_optionalChain([docs, 'optionalAccess', _681 => _681.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
11823
12233
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
11824
12234
|
]);
|
|
11825
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
12235
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _682 => _682.isFarmDocsSearchEnabled, 'call', _683 => _683(docs)]), () => ( false));
|
|
11826
12236
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
11827
12237
|
docsSearchEnabled,
|
|
11828
12238
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
11829
12239
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
11830
12240
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
11831
12241
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunk6MVFL3R5cjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
11832
|
-
const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ?
|
|
12242
|
+
const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkTDFPACVXcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
11833
12243
|
const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
|
|
11834
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
12244
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _684 => _684.experimental, 'optionalAccess', _685 => _685.isolatedClientHydration]),
|
|
11835
12245
|
{
|
|
11836
|
-
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess',
|
|
12246
|
+
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _686 => _686.experimental, 'optionalAccess', _687 => _687.serverComponents]) === true,
|
|
11837
12247
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
11838
12248
|
}
|
|
11839
12249
|
);
|
|
11840
12250
|
return generateClientCode(
|
|
11841
12251
|
integrationProviders,
|
|
11842
12252
|
[
|
|
11843
|
-
...
|
|
11844
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
12253
|
+
..._chunkTDFPACVXcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
12254
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _688 => _688.getFarmDocsDocumentNavigationMatchers, 'call', _689 => _689(docs)]), () => ( []))
|
|
11845
12255
|
],
|
|
11846
12256
|
generatedDocsSearchRuntime,
|
|
11847
12257
|
`${generatedDevtoolsClientRuntime}
|
|
11848
12258
|
${generatedDevIndicatorsClientRuntime}`,
|
|
11849
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
12259
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _690 => _690.plugins]) || [],
|
|
11850
12260
|
root,
|
|
11851
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11852
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11853
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
12261
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _691 => _691.srcDir]) || options.srcDir || "src",
|
|
12262
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _692 => _692.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
12263
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _693 => _693.adapter, 'optionalAccess', _694 => _694.react]) : void 0,
|
|
11854
12264
|
renderer,
|
|
11855
|
-
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11856
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
11857
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
12265
|
+
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _695 => _695.getRouteManager, 'call', _696 => _696(), 'access', _697 => _697.getIsolatedClientBoundaryModules, 'call', _698 => _698(root)])))), 'optionalAccess', _699 => _699.size]) > 0,
|
|
12266
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _700 => _700.trailingSlash]), () => ( false)),
|
|
12267
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _701 => _701.basePath]), () => ( "/")),
|
|
11858
12268
|
generateClientCachePersistenceCode(
|
|
11859
|
-
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
12269
|
+
resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _702 => _702.cache]))
|
|
11860
12270
|
),
|
|
11861
12271
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
|
|
11862
12272
|
);
|
|
@@ -11865,7 +12275,7 @@ ${generatedDevIndicatorsClientRuntime}`,
|
|
|
11865
12275
|
return generateServerCode();
|
|
11866
12276
|
}
|
|
11867
12277
|
if (id === "/@farm/manifest") {
|
|
11868
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
12278
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _703 => _703.getRouteManager, 'call', _704 => _704()]);
|
|
11869
12279
|
if (!routeManager) {
|
|
11870
12280
|
return `
|
|
11871
12281
|
export const getManifest = () => ({
|
|
@@ -11880,7 +12290,7 @@ export const getManifest = () => ({
|
|
|
11880
12290
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
11881
12291
|
const globalStylesheetHref = resolveDevGlobalStylesheetHref(
|
|
11882
12292
|
server.config.root,
|
|
11883
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
12293
|
+
_optionalChain([farmApp, 'optionalAccess', _705 => _705.getConfig, 'call', _706 => _706(), 'access', _707 => _707.srcDir])
|
|
11884
12294
|
);
|
|
11885
12295
|
const fullManifest = {
|
|
11886
12296
|
clientEntry: "/@farm/client.js",
|
|
@@ -11931,17 +12341,17 @@ export const manifest = getManifest();
|
|
|
11931
12341
|
}
|
|
11932
12342
|
},
|
|
11933
12343
|
async transform(code, id, transformOptions) {
|
|
11934
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11935
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
11936
|
-
if (_optionalChain([currentConfig, 'access',
|
|
12344
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _708 => _708.ssr])) {
|
|
12345
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _709 => _709.getConfig, 'call', _710 => _710()]), () => ( options));
|
|
12346
|
+
if (_optionalChain([currentConfig, 'access', _711 => _711.experimental, 'optionalAccess', _712 => _712.serverActions]) !== true || !serverFnTransformActive) {
|
|
11937
12347
|
const violation = findClientServerFnViolation(code, id);
|
|
11938
12348
|
if (violation) {
|
|
11939
12349
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
11940
12350
|
}
|
|
11941
12351
|
}
|
|
11942
12352
|
}
|
|
11943
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
11944
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
12353
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _713 => _713.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
12354
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _714 => _714.getConfig, 'call', _715 => _715()]), () => ( options)));
|
|
11945
12355
|
}
|
|
11946
12356
|
if (typeof imageImports.transform === "function") {
|
|
11947
12357
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -11956,13 +12366,13 @@ export const manifest = getManifest();
|
|
|
11956
12366
|
id,
|
|
11957
12367
|
transformOptions
|
|
11958
12368
|
);
|
|
11959
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
12369
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _716 => _716.code, 'optionalAccess', _717 => _717.toString, 'call', _718 => _718()]);
|
|
11960
12370
|
if (fontCode) {
|
|
11961
12371
|
transformedCode = fontCode;
|
|
11962
12372
|
transformed = true;
|
|
11963
12373
|
}
|
|
11964
12374
|
}
|
|
11965
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
12375
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _719 => _719.ssr]) && server) {
|
|
11966
12376
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
11967
12377
|
code: transformedCode,
|
|
11968
12378
|
id,
|
|
@@ -11982,12 +12392,12 @@ export const manifest = getManifest();
|
|
|
11982
12392
|
}
|
|
11983
12393
|
transformedCode = stripUseClientDirective(transformedCode);
|
|
11984
12394
|
transformed = true;
|
|
11985
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
12395
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _720 => _720.getConfig, 'call', _721 => _721()]), () => ( options));
|
|
11986
12396
|
let isolatedModuleReference = null;
|
|
11987
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
12397
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _722 => _722.config, 'access', _723 => _723.root]) || process.cwd();
|
|
11988
12398
|
const cleanId = id.split("?", 1)[0];
|
|
11989
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
11990
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
12399
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _724 => _724.getRouteManager, 'call', _725 => _725(), 'access', _726 => _726.getIsolatedClientBoundaryModules, 'call', _727 => _727(root)])));
|
|
12400
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _728 => _728.has, 'call', _729 => _729(path20.resolve(cleanId))]) === true;
|
|
11991
12401
|
if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
|
|
11992
12402
|
isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
11993
12403
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
@@ -12024,7 +12434,7 @@ export const manifest = getManifest();
|
|
|
12024
12434
|
);
|
|
12025
12435
|
return;
|
|
12026
12436
|
}` : "";
|
|
12027
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
12437
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _730 => _730.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
12028
12438
|
if (import.meta.hot) {
|
|
12029
12439
|
import.meta.hot.accept((newModule) => {
|
|
12030
12440
|
${isolatedHmrUpdate}
|
|
@@ -12078,14 +12488,14 @@ if (import.meta.hot) {
|
|
|
12078
12488
|
}
|
|
12079
12489
|
_chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
12080
12490
|
_chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
|
|
12081
|
-
const outDir =
|
|
12082
|
-
const clientDir =
|
|
12491
|
+
const outDir = path20.join(_optionalChain([server, 'optionalAccess', _731 => _731.config, 'access', _732 => _732.root]) || process.cwd(), options.outDir || "dist");
|
|
12492
|
+
const clientDir = path20.join(outDir, "client");
|
|
12083
12493
|
for (const page of ssgPages) {
|
|
12084
12494
|
try {
|
|
12085
12495
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
12086
12496
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
12087
12497
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
12088
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
12498
|
+
if (!_optionalChain([mod, 'optionalAccess', _733 => _733.default])) return;
|
|
12089
12499
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
12090
12500
|
const layoutModules = await Promise.all(
|
|
12091
12501
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -12114,10 +12524,10 @@ if (import.meta.hot) {
|
|
|
12114
12524
|
);
|
|
12115
12525
|
}
|
|
12116
12526
|
const html = renderToString(pageElement);
|
|
12117
|
-
const i18nSnapshot =
|
|
12527
|
+
const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
12118
12528
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
12119
12529
|
const fullHtml = `<!DOCTYPE html>
|
|
12120
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
12530
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _734 => _734.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
12121
12531
|
<head>
|
|
12122
12532
|
<meta charset="utf-8">
|
|
12123
12533
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -12131,9 +12541,9 @@ if (import.meta.hot) {
|
|
|
12131
12541
|
<script type="module" src="/assets/client.js"></script>
|
|
12132
12542
|
</body>
|
|
12133
12543
|
</html>`;
|
|
12134
|
-
const outputPath = page.urlPath === "/" ?
|
|
12135
|
-
|
|
12136
|
-
|
|
12544
|
+
const outputPath = page.urlPath === "/" ? path20.join(clientDir, "index.html") : path20.join(clientDir, page.urlPath + ".html");
|
|
12545
|
+
fs11.mkdirSync(path20.dirname(outputPath), { recursive: true });
|
|
12546
|
+
fs11.writeFileSync(outputPath, fullHtml);
|
|
12137
12547
|
const revalidateInfo = page.revalidate ? ` (revalidate: ${page.revalidate}s)` : "";
|
|
12138
12548
|
_chunk5QIKR7RRcjs.logger.success(` \u2713 ${page.urlPath}${revalidateInfo}`);
|
|
12139
12549
|
});
|
|
@@ -12141,8 +12551,8 @@ if (import.meta.hot) {
|
|
|
12141
12551
|
_chunk5QIKR7RRcjs.logger.error(` \u2717 ${page.urlPath}: ${error}`);
|
|
12142
12552
|
}
|
|
12143
12553
|
}
|
|
12144
|
-
const manifestPath =
|
|
12145
|
-
|
|
12554
|
+
const manifestPath = path20.join(outDir, "__ssg_manifest.json");
|
|
12555
|
+
fs11.writeFileSync(
|
|
12146
12556
|
manifestPath,
|
|
12147
12557
|
JSON.stringify(
|
|
12148
12558
|
ssgPages.map((p) => ({
|
|
@@ -12175,23 +12585,23 @@ if (import.meta.hot) {
|
|
|
12175
12585
|
});
|
|
12176
12586
|
}
|
|
12177
12587
|
}
|
|
12178
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
12588
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _735 => _735.getConfig, 'call', _736 => _736()]);
|
|
12179
12589
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
12180
12590
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
12181
12591
|
(appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
12182
12592
|
)) {
|
|
12183
12593
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
12184
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12594
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _737 => _737(`updated ${file}`)]);
|
|
12185
12595
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
12186
12596
|
return [];
|
|
12187
12597
|
}
|
|
12188
|
-
const currentSrcRoot = currentFarmConfig ? _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) =>
|
|
12598
|
+
const currentSrcRoot = currentFarmConfig ? _chunkVPTDD5XFcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path20.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
|
|
12189
12599
|
if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunk6V4TDWECcjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
|
|
12190
|
-
logUpdate("PAGE", `updated ${
|
|
12600
|
+
logUpdate("PAGE", `updated ${path20.basename(file)}`);
|
|
12191
12601
|
for (const mod of modules) {
|
|
12192
12602
|
server2.moduleGraph.invalidateModule(mod);
|
|
12193
12603
|
}
|
|
12194
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12604
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _738 => _738(`updated ${file}`)]);
|
|
12195
12605
|
server2.ws.send({
|
|
12196
12606
|
type: "full-reload",
|
|
12197
12607
|
path: "*"
|
|
@@ -12204,17 +12614,17 @@ if (import.meta.hot) {
|
|
|
12204
12614
|
for (const mod of modules) {
|
|
12205
12615
|
server2.moduleGraph.invalidateModule(mod);
|
|
12206
12616
|
}
|
|
12207
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
12617
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _739 => _739(`updated ${file}`)]);
|
|
12208
12618
|
server2.ws.send({
|
|
12209
12619
|
type: "full-reload",
|
|
12210
12620
|
path: "*"
|
|
12211
12621
|
});
|
|
12212
12622
|
return [];
|
|
12213
12623
|
}
|
|
12214
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12215
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
12624
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _740 => _740.experimental, 'optionalAccess', _741 => _741.isolatedClientHydration]);
|
|
12625
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _742 => _742.getRouteManager, 'call', _743 => _743()]);
|
|
12216
12626
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
12217
|
-
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
12627
|
+
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _744 => _744.renderer])) && planRouteManager !== void 0;
|
|
12218
12628
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
12219
12629
|
const routeManager = planRouteManager;
|
|
12220
12630
|
if (routeManager) {
|
|
@@ -12274,7 +12684,7 @@ if (import.meta.hot) {
|
|
|
12274
12684
|
}
|
|
12275
12685
|
return [];
|
|
12276
12686
|
}
|
|
12277
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
12687
|
+
_optionalChain([farmApp, 'optionalAccess', _745 => _745.getRouteManager, 'call', _746 => _746(), 'access', _747 => _747.invalidateClientManifest, 'call', _748 => _748()]);
|
|
12278
12688
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
12279
12689
|
if (manifestModule) {
|
|
12280
12690
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -12318,12 +12728,12 @@ function createPageDataMiddlewareRequest(req, target) {
|
|
|
12318
12728
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createPageDataMiddlewareRequest, "createPageDataMiddlewareRequest");
|
|
12319
12729
|
function resolveDevelopmentRoot(farmRoot, viteRoot) {
|
|
12320
12730
|
if (!farmRoot) return viteRoot;
|
|
12321
|
-
if (
|
|
12731
|
+
if (path20.resolve(farmRoot) === path20.resolve(viteRoot)) return farmRoot;
|
|
12322
12732
|
try {
|
|
12323
|
-
if (
|
|
12324
|
-
return
|
|
12733
|
+
if (fs11.realpathSync(farmRoot) === fs11.realpathSync(viteRoot)) {
|
|
12734
|
+
return path20.resolve(viteRoot);
|
|
12325
12735
|
}
|
|
12326
|
-
} catch (
|
|
12736
|
+
} catch (e39) {
|
|
12327
12737
|
}
|
|
12328
12738
|
return farmRoot;
|
|
12329
12739
|
}
|
|
@@ -12643,12 +13053,12 @@ async function parseRouteModuleProps2(routeModule, input) {
|
|
|
12643
13053
|
}
|
|
12644
13054
|
const schemas = routeModule.__farmRouteSchemas;
|
|
12645
13055
|
const params = parseRouteModuleSchema2(
|
|
12646
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
13056
|
+
_optionalChain([schemas, 'optionalAccess', _749 => _749.params]),
|
|
12647
13057
|
input.props.params,
|
|
12648
13058
|
"params",
|
|
12649
13059
|
input.routePath
|
|
12650
13060
|
);
|
|
12651
|
-
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess',
|
|
13061
|
+
const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _750 => _750.search]), input.search, "search", input.routePath);
|
|
12652
13062
|
return {
|
|
12653
13063
|
...input.props,
|
|
12654
13064
|
params,
|
|
@@ -12715,7 +13125,7 @@ ${isolatedHydrationImport}
|
|
|
12715
13125
|
import { installChunkErrorRecovery, SPARouter } from '@farm.js/core/client'
|
|
12716
13126
|
import { createClientPluginManager } from '@farm.js/core/plugin/client'
|
|
12717
13127
|
import { isFarmRouteActive } from '@farm.js/core/router'
|
|
12718
|
-
import { replayFarmQueuedInteraction, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
13128
|
+
import { isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
12719
13129
|
import { reviveDeferredData } from '@farm.js/core/deferred'
|
|
12720
13130
|
import {
|
|
12721
13131
|
createFarmDeploymentMismatchError,
|
|
@@ -12886,6 +13296,7 @@ class LegacyManifestSPARouter {
|
|
|
12886
13296
|
async navigate(href, options = {}) {
|
|
12887
13297
|
const { replace = false, scroll = true } = options;
|
|
12888
13298
|
const url = new URL(href, window.location.origin);
|
|
13299
|
+
if (isFarmBlockedNavigationURL(url)) return;
|
|
12889
13300
|
const pathname = url.pathname;
|
|
12890
13301
|
const search = url.search;
|
|
12891
13302
|
const fullPath = pathname + search;
|
|
@@ -13615,6 +14026,12 @@ async function tryHydrateImportedPage(
|
|
|
13615
14026
|
return false;
|
|
13616
14027
|
}
|
|
13617
14028
|
|
|
14029
|
+
if (PageComponent.__farmServerProps === true && existingProps?.__farmRoutePropsResolved !== true) {
|
|
14030
|
+
// This route's guard and data run only on the server, and it did not
|
|
14031
|
+
// resolve them (it rendered error or notFound UI): keep its HTML.
|
|
14032
|
+
return false;
|
|
14033
|
+
}
|
|
14034
|
+
|
|
13618
14035
|
currentPageComponent = PageComponent;
|
|
13619
14036
|
currentPageProps = await buildRouteComponentProps(
|
|
13620
14037
|
pageModule,
|
|
@@ -14243,8 +14660,8 @@ function generateClientManifest(bundle) {
|
|
|
14243
14660
|
_chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientManifest");
|
|
14244
14661
|
async function defineConfig(config = {}) {
|
|
14245
14662
|
const tailwindVitePlugin = await loadTailwindVitePlugin();
|
|
14246
|
-
const appRoot =
|
|
14247
|
-
if (_optionalChain([config, 'access',
|
|
14663
|
+
const appRoot = path20.resolve(config.root || process.cwd());
|
|
14664
|
+
if (_optionalChain([config, 'access', _751 => _751.extends, 'optionalAccess', _752 => _752.length])) {
|
|
14248
14665
|
const { config: layeredConfig } = await import("./layers-4PNE2HOY.cjs").then(
|
|
14249
14666
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
14250
14667
|
root: appRoot,
|
|
@@ -14345,13 +14762,13 @@ async function defineConfig(config = {}) {
|
|
|
14345
14762
|
if (!serverStarted) {
|
|
14346
14763
|
serverStarted = true;
|
|
14347
14764
|
const elapsed = Date.now() - startTime;
|
|
14348
|
-
const address = _optionalChain([server, 'access',
|
|
14765
|
+
const address = _optionalChain([server, 'access', _753 => _753.httpServer, 'optionalAccess', _754 => _754.address, 'call', _755 => _755()]);
|
|
14349
14766
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
14350
14767
|
const hostConfig = server.config.server.host;
|
|
14351
14768
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
14352
14769
|
console.log("");
|
|
14353
14770
|
console.log(
|
|
14354
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
14771
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkODBZYBABcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
14355
14772
|
);
|
|
14356
14773
|
console.log("");
|
|
14357
14774
|
console.log(
|
|
@@ -14390,7 +14807,7 @@ async function defineConfig(config = {}) {
|
|
|
14390
14807
|
farmI18nClientBridgePlugin(),
|
|
14391
14808
|
farmServerOnlyEntriesPlugin(),
|
|
14392
14809
|
farmPlugin(config),
|
|
14393
|
-
|
|
14810
|
+
_chunk3SDFA7UFcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
|
|
14394
14811
|
farmBrandingPlugin
|
|
14395
14812
|
],
|
|
14396
14813
|
customLogger: farmLogger,
|
|
@@ -14506,4 +14923,6 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, defineConfig, "defineConfig");
|
|
|
14506
14923
|
|
|
14507
14924
|
|
|
14508
14925
|
|
|
14509
|
-
|
|
14926
|
+
|
|
14927
|
+
|
|
14928
|
+
exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.RouteManager = RouteManager; exports.HOISTED_HEAD_ELEMENT = HOISTED_HEAD_ELEMENT; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.FarmPluginOptionsError = FarmPluginOptionsError; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports.loadTailwindVitePlugin = loadTailwindVitePlugin; exports.SHARP_INSTALL_HINT = SHARP_INSTALL_HINT; exports.resolveFarmImageProviderForRuntime = resolveFarmImageProviderForRuntime; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.resolveFarmAppPackages = resolveFarmAppPackages; exports.collectFarmWebMCPTools = collectFarmWebMCPTools; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig; exports.FARM_NODE_RESPONSE_END_PENDING = FARM_NODE_RESPONSE_END_PENDING; exports.FarmRuntimeShutdownError = FarmRuntimeShutdownError; exports.PluginManager = PluginManager; exports.definePlugin = definePlugin;
|