@farm.js/core 0.1.42 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-ssVy_tea.d.mts → agent-mcp-3KDz4hr9.d.mts} +1 -1
- package/dist/{agent-mcp-SSD6L3VZ.d.ts → agent-mcp-6yRebHk7.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +2 -2
- package/dist/api.d.mts +8 -3
- package/dist/api.d.ts +8 -3
- package/dist/api.mjs +1 -1
- package/dist/{app-KjFzdCqy.d.ts → app-8Db1zR-2.d.ts} +8 -4
- package/dist/{app-1h3lVT4a.d.mts → app-DlTWv4cn.d.mts} +8 -4
- package/dist/{app-manifest-D3RkVNuS.d.mts → app-manifest-TRzS7ZZ9.d.mts} +1 -1
- package/dist/{app-manifest-DaW8-tvX.d.ts → app-manifest-cO2jkG1F.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{chunk-ECKF2BAM.cjs → chunk-2GVF3C2F.cjs} +255 -42
- package/dist/chunk-2NXO5SBY.mjs +57 -0
- package/dist/chunk-3BROEWFY.cjs +39 -0
- package/dist/{chunk-NU25TRIO.mjs → chunk-4MRQ5OKQ.mjs} +11 -7
- package/dist/{chunk-375K2ZVU.mjs → chunk-4OCEMK72.mjs} +259 -48
- package/dist/{chunk-6PKXK4TY.mjs → chunk-53ZV6K65.mjs} +1 -1
- package/dist/{chunk-LYIZHJTK.cjs → chunk-5LPHJZSI.cjs} +14 -14
- package/dist/chunk-5NIWBWDD.mjs +97 -0
- package/dist/{chunk-NRDBW4MP.mjs → chunk-7IQQIPRZ.mjs} +10 -0
- package/dist/{chunk-QTEJGB5A.mjs → chunk-7SCCY6SI.mjs} +79 -176
- package/dist/chunk-APDGOKKE.cjs +148 -0
- package/dist/chunk-AZBSVLRM.cjs +132 -0
- package/dist/{chunk-ZS6HDNOM.cjs → chunk-BKPXWRTT.cjs} +6 -6
- package/dist/chunk-CEDPEDNW.cjs +98 -0
- package/dist/chunk-D5RFPV2H.mjs +148 -0
- package/dist/{chunk-724JLMS4.mjs → chunk-F646BZ4Y.mjs} +4 -2
- package/dist/{chunk-C5KVWHIH.cjs → chunk-G2Z5DGMS.cjs} +5 -3
- package/dist/{chunk-7YHSD3Z6.cjs → chunk-GVNCWSQV.cjs} +83 -29
- package/dist/{chunk-24SP5TGU.mjs → chunk-H4LXPWI2.mjs} +2 -2
- package/dist/chunk-H7BLEEAE.cjs +57 -0
- package/dist/{chunk-QKZMB7LY.cjs → chunk-HUMEHX24.cjs} +2 -2
- package/dist/{chunk-BD3D7EZV.cjs → chunk-IXFOBGLQ.cjs} +9 -3
- package/dist/{chunk-JG3MEQUH.cjs → chunk-JDJAPCR2.cjs} +420 -209
- package/dist/{chunk-MHN4UR5U.cjs → chunk-KFZZFZ7J.cjs} +7 -7
- package/dist/chunk-LRJRXXQZ.cjs +109 -0
- package/dist/{chunk-BXJ5HJTJ.cjs → chunk-LVABUXLA.cjs} +15 -11
- package/dist/{chunk-HCSVR4YZ.mjs → chunk-M3BXTWJM.mjs} +18 -0
- package/dist/{chunk-2JZHQDUY.mjs → chunk-NXO75WY4.mjs} +1 -1
- package/dist/{chunk-TUL355PH.mjs → chunk-OYSGGV6O.mjs} +135 -160
- package/dist/{chunk-JR4QCLJY.cjs → chunk-PDU4P2IC.cjs} +19 -1
- package/dist/chunk-PJEHUSHA.mjs +229 -0
- package/dist/chunk-QGH2RQVF.mjs +132 -0
- package/dist/{chunk-YWMZUGIS.mjs → chunk-R3ZFQJEF.mjs} +247 -34
- package/dist/{chunk-ZATTDMBW.cjs → chunk-RACQTC7K.cjs} +270 -367
- package/dist/{chunk-WSOBCAYO.cjs → chunk-RQYTOFQM.cjs} +23 -23
- package/dist/chunk-S34OBRMZ.mjs +109 -0
- package/dist/{chunk-TS4JHGUJ.mjs → chunk-S3ZEMCE6.mjs} +9 -3
- package/dist/{chunk-WWFTAUFG.cjs → chunk-SBH2JLLF.cjs} +12 -2
- package/dist/{chunk-YSLWRWWP.cjs → chunk-SKK6UF5P.cjs} +200 -46
- package/dist/chunk-T7J7E63D.cjs +144 -0
- package/dist/{chunk-PIZXONIS.mjs → chunk-TESO7EFU.mjs} +55 -1
- package/dist/{chunk-TCJ4A4A2.cjs → chunk-VIVQERJ5.cjs} +318 -344
- package/dist/{chunk-JIYYX7WU.mjs → chunk-VLXNGUKO.mjs} +1 -1
- package/dist/{chunk-OFZUJMCU.mjs → chunk-WPJQN64R.mjs} +195 -41
- package/dist/chunk-XARSG2TG.mjs +144 -0
- package/dist/chunk-XUGFRFD2.mjs +39 -0
- package/dist/{chunk-AHFRQMRX.cjs → chunk-YBDSTNMH.cjs} +1 -1
- package/dist/{chunk-U2UC7UGP.mjs → chunk-YGZH4T2X.mjs} +1 -1
- package/dist/chunk-YKUEJ3MG.cjs +229 -0
- package/dist/{chunk-IVQY6UTY.mjs → chunk-ZYWJIPKQ.mjs} +1 -1
- package/dist/{client-plugins-C9Py_50W.d.mts → client-plugins-Cv0OJtnM.d.mts} +21 -2
- package/dist/{client-plugins-DIem0I0W.d.ts → client-plugins-kwQuZcWq.d.ts} +21 -2
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +4 -3
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +3 -2
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-Q3LBNUJ7.mjs → devtools-M22FEFPK.mjs} +3 -3
- package/dist/{devtools-2RY3EKHL.cjs → devtools-MLB3JJMC.cjs} +4 -4
- package/dist/docs.cjs +5 -5
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +4 -4
- package/dist/index-CQOp8EmB.d.mts +48 -0
- package/dist/index-DAl0QTZS.d.ts +48 -0
- package/dist/index.cjs +40 -23
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.mjs +45 -28
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +28 -14
- package/dist/internal/build-runtime.d.mts +12 -16
- package/dist/internal/build-runtime.d.ts +12 -16
- package/dist/internal/build-runtime.mjs +27 -13
- package/dist/internal/cli-runtime.cjs +22 -10
- package/dist/internal/cli-runtime.mjs +22 -10
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +5 -1
- package/dist/internal/client-runtime.d.mts +1 -0
- package/dist/internal/client-runtime.d.ts +1 -0
- package/dist/internal/client-runtime.mjs +4 -0
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/form-actions-client.cjs +18 -0
- package/dist/internal/form-actions-client.d.mts +5 -0
- package/dist/internal/form-actions-client.d.ts +5 -0
- package/dist/internal/form-actions-client.mjs +18 -0
- package/dist/internal/form-actions.cjs +18 -0
- package/dist/internal/form-actions.d.mts +14 -0
- package/dist/internal/form-actions.d.ts +14 -0
- package/dist/internal/form-actions.mjs +18 -0
- package/dist/internal/island-codec.cjs +22 -0
- package/dist/internal/island-codec.d.mts +29 -0
- package/dist/internal/island-codec.d.ts +29 -0
- package/dist/internal/island-codec.mjs +22 -0
- package/dist/internal/island-value-store.cjs +13 -0
- package/dist/internal/island-value-store.d.mts +6 -0
- package/dist/internal/island-value-store.d.ts +6 -0
- package/dist/internal/island-value-store.mjs +13 -0
- package/dist/internal/islands-runtime.cjs +77 -0
- package/dist/internal/islands-runtime.d.mts +57 -0
- package/dist/internal/islands-runtime.d.ts +57 -0
- package/dist/internal/islands-runtime.mjs +77 -0
- package/dist/internal/islands-server.cjs +19 -0
- package/dist/internal/islands-server.d.mts +3 -0
- package/dist/internal/islands-server.d.ts +3 -0
- package/dist/internal/islands-server.mjs +19 -0
- package/dist/internal/islx-client.cjs +5 -0
- package/dist/internal/islx-client.d.mts +2 -0
- package/dist/internal/islx-client.d.ts +2 -0
- package/dist/internal/islx-client.mjs +3 -0
- package/dist/internal/islx-react.cjs +4 -0
- package/dist/internal/islx-react.d.mts +1 -0
- package/dist/internal/islx-react.d.ts +1 -0
- package/dist/internal/islx-react.mjs +2 -0
- package/dist/internal/islx-server.cjs +5 -0
- package/dist/internal/islx-server.d.mts +2 -0
- package/dist/internal/islx-server.d.ts +2 -0
- package/dist/internal/islx-server.mjs +3 -0
- package/dist/internal/isolated-boundary.cjs +4 -3
- package/dist/internal/isolated-boundary.d.mts +13 -1
- package/dist/internal/isolated-boundary.d.ts +13 -1
- package/dist/internal/isolated-boundary.mjs +3 -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 +23 -6
- package/dist/internal/production-runtime.d.mts +20 -10
- package/dist/internal/production-runtime.d.ts +20 -10
- package/dist/internal/production-runtime.mjs +23 -6
- package/dist/internal/server-tree.cjs +6 -3
- package/dist/internal/server-tree.d.mts +25 -2
- package/dist/internal/server-tree.d.ts +25 -2
- package/dist/internal/server-tree.mjs +7 -4
- package/dist/island-value-protocol-BRayRghM.d.mts +12 -0
- package/dist/island-value-protocol-BRayRghM.d.ts +12 -0
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/navigation.cjs +5 -4
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +4 -3
- package/dist/og.d.mts +5 -0
- package/dist/og.d.ts +5 -0
- package/dist/plugin.cjs +17 -11
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +16 -10
- package/dist/{production-runtime-bjjWq-DA.d.ts → production-runtime-5nArjFpn.d.ts} +1 -1
- package/dist/{production-runtime-CHFKIgpW.d.mts → production-runtime-BzsF2z5F.d.mts} +1 -1
- package/dist/query/client.cjs +6 -5
- package/dist/query/client.mjs +2 -1
- package/dist/{render-plan-DOHg6wdO.d.mts → render-plan-B9yQorV4.d.mts} +4 -2
- package/dist/{render-plan-B2UndB4x.d.ts → render-plan-fg6E_HvL.d.ts} +4 -2
- package/dist/renderer/react/server.cjs +7 -6
- package/dist/renderer/react/server.d.mts +3 -1
- package/dist/renderer/react/server.d.ts +3 -1
- package/dist/renderer/react/server.mjs +5 -4
- package/dist/renderer-client.cjs +5 -4
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +2 -1
- package/dist/renderer.d.mts +3 -1
- package/dist/renderer.d.ts +3 -1
- package/dist/{request-DQcGfdgQ.d.mts → request-C4j_g-BH.d.mts} +1 -1
- package/dist/{request-DVNXRQrI.d.ts → request-gz8vFK0n.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering-B_6fj-GG.d.ts → route-rendering-DamyKVi3.d.ts} +1 -1
- package/dist/{route-rendering-CEX4mFn-.d.mts → route-rendering-iTTOwz1f.d.mts} +1 -1
- package/dist/{router-CKHPBKXX.d.mts → router-EoSzHlos.d.mts} +1 -1
- package/dist/{router-CHEMHm1P.d.ts → router-OVjDqVo8.d.ts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/rsc-pipeline-LK4K5JFK.mjs +77 -0
- package/dist/rsc-pipeline-YCDRJME4.cjs +77 -0
- package/dist/{runtime-Br2ZDTAv.d.ts → runtime-CwiuozLd.d.ts} +1 -1
- package/dist/{runtime-jj8TKNsy.d.mts → runtime-DDH4tiuF.d.mts} +1 -1
- package/dist/{schema-dev-notice-5JPE67AI.cjs → schema-dev-notice-77ZL23PL.cjs} +4 -4
- package/dist/{schema-dev-notice-WLPZ6WKU.mjs → schema-dev-notice-BLXOS6U2.mjs} +2 -2
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +55 -37
- package/dist/server.d.mts +15 -10
- package/dist/server.d.ts +15 -10
- package/dist/server.mjs +35 -17
- package/dist/{spa-router-BEvS9Erj.d.mts → spa-router-Br4qFCWf.d.mts} +8 -3
- package/dist/{spa-router-DmCuH5B7.d.ts → spa-router-BsWUKH73.d.ts} +8 -3
- package/dist/{ssg-gT093ETk.d.ts → ssg-Csy2vwpi.d.ts} +2 -2
- package/dist/{ssg-57v6cZcW.d.mts → ssg-Donyfcxy.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils-CCTKvR-P.d.ts → utils-Luk72LXC.d.ts} +1 -1
- package/dist/{utils-raHHQVyL.d.mts → utils-d_k1ZZw0.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +17 -11
- package/dist/vite.d.mts +6 -4
- package/dist/vite.d.ts +6 -4
- package/dist/vite.mjs +16 -10
- package/package.json +53 -1
- package/dist/{chunk-35WS7P2V.mjs → chunk-26CXZR6L.mjs} +3 -3
- package/dist/{chunk-QEILRWVV.cjs → chunk-3XEMGDBF.cjs} +2 -2
- package/dist/{chunk-BPOTSHDO.cjs → chunk-IOAUK4OI.cjs} +2 -2
- package/dist/{chunk-BYR3RQPB.mjs → chunk-T76H22WI.mjs} +4 -4
|
@@ -11,13 +11,13 @@ var _chunkCGR525MJcjs = require('./chunk-CGR525MJ.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkBKPXWRTTcjs = require('./chunk-BKPXWRTT.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkHUMEHX24cjs = require('./chunk-HUMEHX24.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -45,7 +45,7 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkLVABUXLAcjs = require('./chunk-LVABUXLA.cjs');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var _chunkKCMTCM6Icjs = require('./chunk-KCMTCM6I.cjs');
|
|
@@ -82,18 +82,18 @@ var _chunk2SJ4RQ6Pcjs = require('./chunk-2SJ4RQ6P.cjs');
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
var _chunkZATTDMBWcjs = require('./chunk-ZATTDMBW.cjs');
|
|
85
|
+
var _chunkRACQTC7Kcjs = require('./chunk-RACQTC7K.cjs');
|
|
87
86
|
|
|
88
87
|
|
|
89
88
|
var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
|
|
90
89
|
|
|
91
90
|
|
|
91
|
+
var _chunkLRJRXXQZcjs = require('./chunk-LRJRXXQZ.cjs');
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
|
|
95
94
|
|
|
96
95
|
|
|
96
|
+
var _chunk3XEMGDBFcjs = require('./chunk-3XEMGDBF.cjs');
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
|
|
@@ -107,15 +107,17 @@ var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
var _chunk7YHSD3Z6cjs = require('./chunk-7YHSD3Z6.cjs');
|
|
111
110
|
|
|
112
111
|
|
|
112
|
+
var _chunkGVNCWSQVcjs = require('./chunk-GVNCWSQV.cjs');
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
var
|
|
115
|
+
var _chunkTI7UANHIcjs = require('./chunk-TI7UANHI.cjs');
|
|
116
116
|
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
var _chunkBMOBTMDRcjs = require('./chunk-BMOBTMDR.cjs');
|
|
119
121
|
|
|
120
122
|
|
|
121
123
|
var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
|
|
@@ -132,6 +134,9 @@ var _chunkCY2ZQ5C6cjs = require('./chunk-CY2ZQ5C6.cjs');
|
|
|
132
134
|
var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
|
|
133
135
|
|
|
134
136
|
|
|
137
|
+
var _chunkPDU4P2ICcjs = require('./chunk-PDU4P2IC.cjs');
|
|
138
|
+
|
|
139
|
+
|
|
135
140
|
var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
|
|
136
141
|
|
|
137
142
|
|
|
@@ -157,6 +162,9 @@ var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
|
|
|
157
162
|
var _chunk6EXBPJ24cjs = require('./chunk-6EXBPJ24.cjs');
|
|
158
163
|
|
|
159
164
|
|
|
165
|
+
var _chunkP4TYB4SFcjs = require('./chunk-P4TYB4SF.cjs');
|
|
166
|
+
|
|
167
|
+
|
|
160
168
|
var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
161
169
|
|
|
162
170
|
|
|
@@ -214,7 +222,7 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
|
214
222
|
var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
215
223
|
|
|
216
224
|
|
|
217
|
-
var
|
|
225
|
+
var _chunkYBDSTNMHcjs = require('./chunk-YBDSTNMH.cjs');
|
|
218
226
|
|
|
219
227
|
|
|
220
228
|
var _chunkC5GUTBZKcjs = require('./chunk-C5GUTBZK.cjs');
|
|
@@ -233,6 +241,9 @@ var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
|
233
241
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
234
242
|
var _fs = require('fs');
|
|
235
243
|
|
|
244
|
+
// src/nitro/universal-build.ts
|
|
245
|
+
var _crypto = require('crypto');
|
|
246
|
+
|
|
236
247
|
// src/nitro/client-css-href.ts
|
|
237
248
|
|
|
238
249
|
var FARM_CLIENT_CSS_HREF_PLACEHOLDER = "/__farm_client_css_href__";
|
|
@@ -364,7 +375,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
364
375
|
globalStylesheetHref: options.globalStylesheetHref,
|
|
365
376
|
isPathGuarded: options.isPathGuarded
|
|
366
377
|
});
|
|
367
|
-
const apiHandler =
|
|
378
|
+
const apiHandler = _chunkHUMEHX24cjs.createFarmDocsAPIHandler.call(void 0, {
|
|
368
379
|
rootDir: options.root,
|
|
369
380
|
srcDir: options.srcDir,
|
|
370
381
|
docs,
|
|
@@ -647,7 +658,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
647
658
|
const routes = [];
|
|
648
659
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
649
660
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
650
|
-
const rendering = await
|
|
661
|
+
const rendering = await _chunk3XEMGDBFcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
651
662
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
652
663
|
routes.push({
|
|
653
664
|
kind: "page",
|
|
@@ -1700,7 +1711,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1700
1711
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
1701
1712
|
const srcDir = config.srcDir || "src";
|
|
1702
1713
|
const distDir = config.distDir || ".farm";
|
|
1703
|
-
const deployOutputDir =
|
|
1714
|
+
const deployOutputDir = _chunkLVABUXLAcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
1704
1715
|
const lifecyclePluginManager = options.pluginManager;
|
|
1705
1716
|
const productionViteResultPromise = Promise.allSettled([
|
|
1706
1717
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkA6WIQH5Zcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -1952,7 +1963,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1952
1963
|
}
|
|
1953
1964
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
1954
1965
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
1955
|
-
await fs4.writeFile(clientCssPath,
|
|
1966
|
+
await fs4.writeFile(clientCssPath, _chunkRACQTC7Kcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
1956
1967
|
}
|
|
1957
1968
|
_chunkS3JO3N4Hcjs.__name.call(void 0, mergeBuiltFontCss, "mergeBuiltFontCss");
|
|
1958
1969
|
var _IncompleteClientBuildOutputError = class _IncompleteClientBuildOutputError extends Error {
|
|
@@ -1999,10 +2010,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
1999
2010
|
}
|
|
2000
2011
|
_chunkS3JO3N4Hcjs.__name.call(void 0, validateClientBuildOutput, "validateClientBuildOutput");
|
|
2001
2012
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
2002
|
-
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2013
|
+
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2003
2014
|
let plan = cache.get(key);
|
|
2004
2015
|
if (!plan) {
|
|
2005
|
-
plan =
|
|
2016
|
+
plan = _chunkRACQTC7Kcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2006
2017
|
cache.set(key, plan);
|
|
2007
2018
|
}
|
|
2008
2019
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2026,22 +2037,26 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2026
2037
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
2027
2038
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
2028
2039
|
);
|
|
2029
|
-
if (_optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]) === "enabled" && _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents]) !==
|
|
2040
|
+
if (_optionalChain([config, 'access', _35 => _35.experimental, 'optionalAccess', _36 => _36.isolatedClientHydration]) === "enabled" && _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _37 => _37.experimental, 'optionalAccess', _38 => _38.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
2030
2041
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
2031
2042
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2032
2043
|
);
|
|
2033
2044
|
}
|
|
2034
|
-
const isolatedMode =
|
|
2045
|
+
const isolatedMode = _chunkRACQTC7Kcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2035
2046
|
_optionalChain([config, 'access', _39 => _39.experimental, 'optionalAccess', _40 => _40.isolatedClientHydration]),
|
|
2036
2047
|
{
|
|
2037
|
-
serverComponents: _optionalChain([config, 'access', _41 => _41.experimental, 'optionalAccess', _42 => _42.serverComponents]) ===
|
|
2048
|
+
serverComponents: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _41 => _41.experimental, 'optionalAccess', _42 => _42.serverComponents])) === "rsc",
|
|
2038
2049
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2039
2050
|
}
|
|
2040
2051
|
);
|
|
2041
|
-
const planOptions =
|
|
2052
|
+
const planOptions = _chunkRACQTC7Kcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2042
2053
|
config.renderer,
|
|
2043
2054
|
Boolean(unsupportedIntegrationProvider)
|
|
2044
2055
|
);
|
|
2056
|
+
const pagePlanOptions = {
|
|
2057
|
+
...planOptions,
|
|
2058
|
+
serverOwners: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _43 => _43.experimental, 'optionalAccess', _44 => _44.serverComponents])) === "islands"
|
|
2059
|
+
};
|
|
2045
2060
|
const clientLayouts = layoutRoutes.map((layout) => {
|
|
2046
2061
|
try {
|
|
2047
2062
|
const metadata = getCachedClientModuleHydrationPlan(
|
|
@@ -2085,18 +2100,18 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2085
2100
|
};
|
|
2086
2101
|
}
|
|
2087
2102
|
});
|
|
2088
|
-
const layoutAppliesToRoute =
|
|
2103
|
+
const layoutAppliesToRoute = _chunkGVNCWSQVcjs.routeBoundaryCoversDirectory;
|
|
2089
2104
|
const routeDirectory = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (route) => _nullishCoalesce(route.directory, () => ( route.pattern)), "routeDirectory");
|
|
2090
2105
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2091
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
2106
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _45 => _45.docs, 'optionalAccess', _46 => _46.enabled]) && _optionalChain([config, 'access', _47 => _47.docs, 'access', _48 => _48.adapter, 'optionalAccess', _49 => _49.server]) && config.docs.adapter.react
|
|
2092
2107
|
);
|
|
2093
|
-
const adapterDocsEntry = _optionalChain([config, 'access',
|
|
2108
|
+
const adapterDocsEntry = _optionalChain([config, 'access', _50 => _50.docs, 'optionalAccess', _51 => _51.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
|
|
2094
2109
|
const isAdapterDocsRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (routePattern) => Boolean(
|
|
2095
2110
|
adapterOwnsDocsRuntime && adapterDocsEntry && (adapterDocsEntry === "/" || routePattern === adapterDocsEntry || routePattern.startsWith(`${adapterDocsEntry}/`))
|
|
2096
2111
|
), "isAdapterDocsRoute");
|
|
2097
|
-
const syntheticDocsEntry = _optionalChain([config, 'access',
|
|
2112
|
+
const syntheticDocsEntry = _optionalChain([config, 'access', _52 => _52.docs, 'optionalAccess', _53 => _53.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2098
2113
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2099
|
-
const markdownPagePlan =
|
|
2114
|
+
const markdownPagePlan = _chunkRACQTC7Kcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2100
2115
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2101
2116
|
root,
|
|
2102
2117
|
isolatedMode,
|
|
@@ -2109,10 +2124,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2109
2124
|
root,
|
|
2110
2125
|
isolatedMode,
|
|
2111
2126
|
hydrationPlanCache,
|
|
2112
|
-
|
|
2127
|
+
pagePlanOptions
|
|
2113
2128
|
)
|
|
2114
2129
|
}));
|
|
2115
|
-
|
|
2130
|
+
_chunkRACQTC7Kcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2116
2131
|
clientLayouts.map((layout) => ({
|
|
2117
2132
|
pattern: layout.pattern,
|
|
2118
2133
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2121,7 +2136,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2121
2136
|
[
|
|
2122
2137
|
...routePlans.map(({ route, metadata }) => ({
|
|
2123
2138
|
pattern: routeDirectory(route),
|
|
2124
|
-
depth:
|
|
2139
|
+
depth: _chunkGVNCWSQVcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2125
2140
|
metadata
|
|
2126
2141
|
})),
|
|
2127
2142
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -2144,7 +2159,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2144
2159
|
for (const layout of clientLayouts) {
|
|
2145
2160
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
|
|
2146
2161
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2147
|
-
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${
|
|
2162
|
+
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F ${_chunkRACQTC7Kcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2148
2163
|
}
|
|
2149
2164
|
}
|
|
2150
2165
|
if (isolatedMode === "analyze") {
|
|
@@ -2168,7 +2183,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2168
2183
|
);
|
|
2169
2184
|
if (metadata.suppressedAsyncHydration) {
|
|
2170
2185
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
2171
|
-
`\u26A0\uFE0F ${
|
|
2186
|
+
`\u26A0\uFE0F ${_chunkRACQTC7Kcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2172
2187
|
);
|
|
2173
2188
|
}
|
|
2174
2189
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
@@ -2193,7 +2208,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2193
2208
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries).flatMap((layout) => layout.isolatedBoundaries)
|
|
2194
2209
|
],
|
|
2195
2210
|
// The server renders a server tree only below a hydrating layout.
|
|
2196
|
-
...
|
|
2211
|
+
..._chunkRACQTC7Kcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2197
2212
|
});
|
|
2198
2213
|
_chunk5QIKR7RRcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2199
2214
|
}
|
|
@@ -2229,7 +2244,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2229
2244
|
}
|
|
2230
2245
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2231
2246
|
try {
|
|
2232
|
-
return
|
|
2247
|
+
return _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2233
2248
|
} catch (error) {
|
|
2234
2249
|
_chunk5QIKR7RRcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2235
2250
|
return false;
|
|
@@ -2250,8 +2265,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2250
2265
|
srcDir,
|
|
2251
2266
|
adapterOwnsDocsRuntime ? false : _chunkMWWVKDW3cjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
2252
2267
|
adapterOwnsDocsRuntime ? void 0 : _chunkMWWVKDW3cjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
2253
|
-
_optionalChain([config, 'access',
|
|
2254
|
-
adapterOwnsDocsRuntime ? _optionalChain([config, 'access',
|
|
2268
|
+
_optionalChain([config, 'access', _54 => _54.docs, 'optionalAccess', _55 => _55.enabled]) ? config.docs.entry : void 0,
|
|
2269
|
+
adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _56 => _56.docs, 'access', _57 => _57.adapter, 'optionalAccess', _58 => _58.react]) : void 0,
|
|
2255
2270
|
config.i18n,
|
|
2256
2271
|
config.plugins,
|
|
2257
2272
|
config.renderer,
|
|
@@ -2259,8 +2274,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2259
2274
|
config.trailingSlash,
|
|
2260
2275
|
_chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2261
2276
|
config.basePath,
|
|
2262
|
-
|
|
2263
|
-
adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2277
|
+
_chunkRACQTC7Kcjs.generateClientCachePersistenceCode.call(void 0, _chunkRACQTC7Kcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2278
|
+
adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2279
|
+
_chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.serverComponents])) === "islands"
|
|
2264
2280
|
);
|
|
2265
2281
|
await fs4.writeFile(clientEntryPath, clientHydrationCode);
|
|
2266
2282
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
@@ -2276,7 +2292,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2276
2292
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2277
2293
|
await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2278
2294
|
postcssSearchPath = clientEntryDir;
|
|
2279
|
-
tailwindVitePlugin = await
|
|
2295
|
+
tailwindVitePlugin = await _chunkLRJRXXQZcjs.loadTailwindVitePlugin.call(void 0, {
|
|
2280
2296
|
builder: productionVite.builder,
|
|
2281
2297
|
announce: true
|
|
2282
2298
|
});
|
|
@@ -2297,7 +2313,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2297
2313
|
outDir: outputDir,
|
|
2298
2314
|
emptyOutDir: true,
|
|
2299
2315
|
// Never public: see resolveFarmClientSourcemap.
|
|
2300
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
2316
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _61 => _61.vite, 'optionalAccess', _62 => _62.build, 'optionalAccess', _63 => _63.sourcemap])),
|
|
2301
2317
|
assetsInlineLimit: 0,
|
|
2302
2318
|
cssCodeSplit: false,
|
|
2303
2319
|
// Bundle all CSS into one file
|
|
@@ -2311,7 +2327,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2311
2327
|
hashCharacters: "hex",
|
|
2312
2328
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
2313
2329
|
assetFileNames: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (assetInfo) => {
|
|
2314
|
-
if (_optionalChain([assetInfo, 'access',
|
|
2330
|
+
if (_optionalChain([assetInfo, 'access', _64 => _64.name, 'optionalAccess', _65 => _65.endsWith, 'call', _66 => _66(".css")])) {
|
|
2315
2331
|
return "farm-client.css";
|
|
2316
2332
|
}
|
|
2317
2333
|
return "assets/[name]-h[hash][extname]";
|
|
@@ -2347,7 +2363,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2347
2363
|
}
|
|
2348
2364
|
},
|
|
2349
2365
|
plugins: [
|
|
2350
|
-
|
|
2366
|
+
_chunkRACQTC7Kcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2351
2367
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2352
2368
|
outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
|
|
2353
2369
|
}),
|
|
@@ -2372,7 +2388,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2372
2388
|
...rendererVitePlugins,
|
|
2373
2389
|
...config.vite.plugins || [],
|
|
2374
2390
|
farmServerOnlyEntriesPlugin(),
|
|
2375
|
-
|
|
2391
|
+
_chunkRACQTC7Kcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
2376
2392
|
adapterOwnsDocsRuntime ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2377
2393
|
),
|
|
2378
2394
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -2434,7 +2450,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2434
2450
|
} : void 0,
|
|
2435
2451
|
// Ensure React is bundled for client
|
|
2436
2452
|
resolve: {
|
|
2437
|
-
alias:
|
|
2453
|
+
alias: _chunkRACQTC7Kcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2438
2454
|
dedupe: [...config.renderer.dedupe || []]
|
|
2439
2455
|
},
|
|
2440
2456
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2447,7 +2463,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2447
2463
|
]
|
|
2448
2464
|
}
|
|
2449
2465
|
};
|
|
2450
|
-
await viteBuild(
|
|
2466
|
+
await viteBuild(_chunkRACQTC7Kcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2451
2467
|
await mergeBuiltFontCss(outputDir);
|
|
2452
2468
|
await validateClientBuildOutput(root, srcDir, outputDir);
|
|
2453
2469
|
} finally {
|
|
@@ -2975,13 +2991,17 @@ function generateUniversalRouterStateProperties() {
|
|
|
2975
2991
|
|
|
2976
2992
|
clearPrefetchedPath: function(url) {
|
|
2977
2993
|
const interceptionPrefix = url + "\\nintercept:";
|
|
2994
|
+
const partialPrefix = url + "\\npartial:";
|
|
2995
|
+
const matches = function(key) {
|
|
2996
|
+
return key === url || key.startsWith(interceptionPrefix) || key.startsWith(partialPrefix);
|
|
2997
|
+
};
|
|
2978
2998
|
for (const key of this.prefetchCache.keys()) {
|
|
2979
|
-
if (key
|
|
2999
|
+
if (matches(key)) {
|
|
2980
3000
|
this.prefetchCache.delete(key);
|
|
2981
3001
|
}
|
|
2982
3002
|
}
|
|
2983
3003
|
for (const [key, pending] of this.pendingPrefetches) {
|
|
2984
|
-
if (key
|
|
3004
|
+
if (matches(key)) {
|
|
2985
3005
|
pending.valid = false;
|
|
2986
3006
|
this.pendingPrefetches.delete(key);
|
|
2987
3007
|
}
|
|
@@ -2995,9 +3015,18 @@ function generateUniversalRouterStateProperties() {
|
|
|
2995
3015
|
this.pendingPrefetches.clear();
|
|
2996
3016
|
},
|
|
2997
3017
|
|
|
2998
|
-
|
|
3018
|
+
// Islands mode: a partial response (layouts kept, or only the page's payload) suits the page
|
|
3019
|
+
// that asked for it, so the cache keys it by what that page told the server.
|
|
3020
|
+
prefetchRequest: function(url, interceptFrom, layoutChain = true) {
|
|
3021
|
+
const base = interceptFrom ? url + "\\nintercept:" + interceptFrom : url;
|
|
3022
|
+
const partial = layoutChain && this.partialNavigationHeaders ? this.partialNavigationHeaders() : {};
|
|
3023
|
+
const identity = Object.keys(partial).length ? JSON.stringify(partial) : "";
|
|
3024
|
+
return { cacheKey: identity ? base + "\\npartial:" + identity : base, headers: partial };
|
|
3025
|
+
},
|
|
3026
|
+
|
|
3027
|
+
fetchPrefetchedDocument: async function(url, interceptFrom, fresh, recover, signal, cacheResult = true, layoutChain = true) {
|
|
2999
3028
|
signal?.throwIfAborted();
|
|
3000
|
-
const cacheKey
|
|
3029
|
+
const { cacheKey, headers: partialHeaders } = this.prefetchRequest(url, interceptFrom, layoutChain);
|
|
3001
3030
|
if (fresh) this.clearPrefetchedPath(url);
|
|
3002
3031
|
const cached = fresh ? undefined : this.readFreshPrefetch(cacheKey);
|
|
3003
3032
|
if (cached !== undefined) return cached;
|
|
@@ -3029,6 +3058,10 @@ function generateUniversalRouterStateProperties() {
|
|
|
3029
3058
|
const response = await fetchFarmNavigationDocument(url, {
|
|
3030
3059
|
"Accept": "text/html",
|
|
3031
3060
|
...(interceptFrom ? { "X-Farm-Intercept-From": interceptFrom } : {}),
|
|
3061
|
+
// Islands mode: the server leaves out island values this browser holds, and the
|
|
3062
|
+
// layouts it shows.
|
|
3063
|
+
...getFarmIslandValueHeaders(),
|
|
3064
|
+
...partialHeaders,
|
|
3032
3065
|
}, recover, signal);
|
|
3033
3066
|
if (!response.ok) throw new Error("Failed to fetch page");
|
|
3034
3067
|
const html = await response.text();
|
|
@@ -3186,6 +3219,25 @@ function generateUniversalRouterStateProperties() {
|
|
|
3186
3219
|
`.trim();
|
|
3187
3220
|
}
|
|
3188
3221
|
_chunkS3JO3N4Hcjs.__name.call(void 0, generateUniversalRouterStateProperties, "generateUniversalRouterStateProperties");
|
|
3222
|
+
var FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME = `
|
|
3223
|
+
function getFarmLayoutKey(pattern, params) {
|
|
3224
|
+
return pattern.replace(/\\[\\[?\\.\\.\\.([^\\]]+)\\]?\\]|\\[([^\\]]+)\\]/g, function(match, rest, name) {
|
|
3225
|
+
const value = params ? params[rest || name] : undefined;
|
|
3226
|
+
if (Array.isArray(value)) return value.map(encodeURIComponent).join("/");
|
|
3227
|
+
return value === undefined ? "" : encodeURIComponent(String(value));
|
|
3228
|
+
});
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
function countFarmKeptLayouts(request, layouts, params) {
|
|
3232
|
+
const chain = parseFarmLayoutChainHeader(request.headers.get("f-layouts"));
|
|
3233
|
+
if (chain.length === 0) return 0;
|
|
3234
|
+
const keys = layouts.map(function(layout) { return getFarmLayoutKey(layout.pattern, params); });
|
|
3235
|
+
if (chain[0] === keys[0]) return getSharedLayoutPrefixLength(chain, keys);
|
|
3236
|
+
// A root layout that renders the document itself leaves no boundary in the page, so the
|
|
3237
|
+
// browser's chain starts at the next layout.
|
|
3238
|
+
return keys.length > 1 ? 1 + getSharedLayoutPrefixLength(chain, keys.slice(1)) : 0;
|
|
3239
|
+
}
|
|
3240
|
+
`;
|
|
3189
3241
|
function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlots, root, srcDir, docsSearchEnabled, docsSearchModuleId, docsEntryPath, docsAdapterReact, i18nConfig = {
|
|
3190
3242
|
enabled: false,
|
|
3191
3243
|
basePath: "/",
|
|
@@ -3204,9 +3256,9 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3204
3256
|
secure: false
|
|
3205
3257
|
},
|
|
3206
3258
|
direction: {}
|
|
3207
|
-
}, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
|
|
3259
|
+
}, plugins = [], renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
3208
3260
|
const toImportPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (targetPath) => targetPath.replace(/\\/g, "/"), "toImportPath");
|
|
3209
|
-
const clientPluginEntry =
|
|
3261
|
+
const clientPluginEntry = _chunkRACQTC7Kcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3210
3262
|
plugins,
|
|
3211
3263
|
root,
|
|
3212
3264
|
srcDir,
|
|
@@ -3217,7 +3269,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3217
3269
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3218
3270
|
import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3219
3271
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3220
|
-
const providerClientCode =
|
|
3272
|
+
const providerClientCode = _chunkRACQTC7Kcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3221
3273
|
integrationProviders,
|
|
3222
3274
|
root,
|
|
3223
3275
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -3229,12 +3281,12 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
3229
3281
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
3230
3282
|
layoutRoutes.forEach((layout, index) => {
|
|
3231
3283
|
const relativePath = toImportPath(layout.modulePath);
|
|
3232
|
-
const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) =>
|
|
3284
|
+
const rendersOnClient = !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some((pattern) => _chunkBKPXWRTTcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern));
|
|
3233
3285
|
if (rendersOnClient) {
|
|
3234
3286
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
3235
3287
|
}
|
|
3236
|
-
const groupScope =
|
|
3237
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
3288
|
+
const groupScope = _chunkGVNCWSQVcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3289
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkGVNCWSQVcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
3238
3290
|
layoutRegistrations.push(
|
|
3239
3291
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)} }`
|
|
3240
3292
|
);
|
|
@@ -3293,7 +3345,7 @@ function isFarmDocsPath() {
|
|
|
3293
3345
|
// Farm.js Client Runtime (no client components)
|
|
3294
3346
|
${cssImport}
|
|
3295
3347
|
${layoutImports}
|
|
3296
|
-
import { createClientCancellation, createClientPluginManager, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3348
|
+
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3297
3349
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
3298
3350
|
${clientPluginEntry.imports}
|
|
3299
3351
|
${clientCachePersistence.imports}
|
|
@@ -3592,7 +3644,7 @@ document.addEventListener("click", function(e) {
|
|
|
3592
3644
|
});
|
|
3593
3645
|
const isolatedHydrationEnabled = isolatedBoundaryModules.size > 0;
|
|
3594
3646
|
const serverTreeEnabled = isolatedHydrationEnabled && clientPages.some((page) => page.serverTree);
|
|
3595
|
-
const isolatedHydrationImport = isolatedHydrationEnabled ?
|
|
3647
|
+
const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement } from "@farm.js/core/internal/islands-runtime";' : 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";'}${serverTreeEnabled && !islandValues ? '\nimport { createFarmServerTreeElement } from "@farm.js/core/internal/server-tree";' : ""}` : "";
|
|
3596
3648
|
const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedBoundaryLoaders = {
|
|
3597
3649
|
${Array.from(isolatedBoundaryModules.entries()).map(
|
|
3598
3650
|
([reference, modulePath]) => ` ${JSON.stringify(reference)}: () => import(${JSON.stringify(modulePath)}),`
|
|
@@ -3658,7 +3710,7 @@ ${layoutImports}
|
|
|
3658
3710
|
${rendererClientImports}
|
|
3659
3711
|
${isolatedHydrationImport}
|
|
3660
3712
|
${providerClientCode.imports}
|
|
3661
|
-
import { createClientCancellation, createClientPluginManager, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3713
|
+
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3662
3714
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
3663
3715
|
import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
|
|
3664
3716
|
${clientPluginEntry.imports}
|
|
@@ -3737,7 +3789,7 @@ function hasHydratableLayout(pathname) {
|
|
|
3737
3789
|
});
|
|
3738
3790
|
}
|
|
3739
3791
|
|
|
3740
|
-
${
|
|
3792
|
+
${_chunkRACQTC7Kcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
3741
3793
|
// Wrap a page element with applicable layouts
|
|
3742
3794
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
3743
3795
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -3835,6 +3887,10 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
|
|
|
3835
3887
|
const serverPage = document.getElementById("__farm_page__");
|
|
3836
3888
|
const pageSource = typeof serverHtml === "string" ? serverHtml : serverPage;
|
|
3837
3889
|
const serverTree = pageSource ? await createFarmServerTreePageElement(pageSource, pathname) : null;
|
|
3890
|
+
// A payload-only page (islands mode) has no HTML to fall back to: fetch the whole document.
|
|
3891
|
+
if (!serverTree && typeof serverHtml === "string" && serverHtml.includes('<script type="f/tree" partial')) {
|
|
3892
|
+
return null;
|
|
3893
|
+
}
|
|
3838
3894
|
pageElement = serverTree
|
|
3839
3895
|
? createLayoutPageBoundary(matched.route, serverTree)
|
|
3840
3896
|
: createLayoutPageBoundary(
|
|
@@ -4162,7 +4218,7 @@ async function hydrate() {
|
|
|
4162
4218
|
});
|
|
4163
4219
|
${isolatedHydrationEnabled ? `const isolatedHydration =
|
|
4164
4220
|
!hasHydratableLayout(pathname) &&
|
|
4165
|
-
document.querySelector('
|
|
4221
|
+
document.querySelector('f-island[src]')
|
|
4166
4222
|
? hydrateFarmIsolatedClientBoundaries(document, hydrationController.signal)
|
|
4167
4223
|
: Promise.resolve();
|
|
4168
4224
|
await Promise.all([pageHydration, isolatedHydration]);` : "await pageHydration;"}
|
|
@@ -4173,20 +4229,41 @@ async function hydrate() {
|
|
|
4173
4229
|
}
|
|
4174
4230
|
}
|
|
4175
4231
|
|
|
4232
|
+
// A layout boundary is the same layout when its key matches: islands mode keys it by pattern and
|
|
4233
|
+
// params, so a layout whose params change renders again. Other modes compare patterns.
|
|
4234
|
+
function getLayoutIdentity(boundary) {
|
|
4235
|
+
return boundary.getAttribute("data-farm-layout-key") || boundary.getAttribute("data-farm-layout-pattern");
|
|
4236
|
+
}
|
|
4237
|
+
|
|
4176
4238
|
function findLayoutBoundary(root, pattern) {
|
|
4177
4239
|
const boundaries = root?.querySelectorAll?.('[data-farm-layout-boundary="true"]') || [];
|
|
4178
4240
|
for (const boundary of boundaries) {
|
|
4179
|
-
if (boundary
|
|
4241
|
+
if (getLayoutIdentity(boundary) === pattern) return boundary;
|
|
4180
4242
|
}
|
|
4181
4243
|
return null;
|
|
4182
4244
|
}
|
|
4183
4245
|
|
|
4184
4246
|
function getLayoutPatterns(root) {
|
|
4185
4247
|
return Array.from(root?.querySelectorAll?.('[data-farm-layout-boundary="true"]') || [])
|
|
4186
|
-
.map(
|
|
4248
|
+
.map(getLayoutIdentity)
|
|
4187
4249
|
.filter(Boolean);
|
|
4188
4250
|
}
|
|
4189
4251
|
|
|
4252
|
+
${islandValues ? `// A segment response leaves out the layouts the browser said it shows. It fits this page only if
|
|
4253
|
+
// the page still shows each of them, at the same depth.
|
|
4254
|
+
function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
4255
|
+
const nextBoundaries = Array.from(nextRoot.querySelectorAll('[data-farm-layout-boundary="true"]'));
|
|
4256
|
+
const lastKept = nextBoundaries.map(function(boundary) {
|
|
4257
|
+
return boundary.getAttribute("data-farm-layout-kept") === "true";
|
|
4258
|
+
}).lastIndexOf(true);
|
|
4259
|
+
if (lastKept === -1) return true;
|
|
4260
|
+
const current = getLayoutPatterns(currentRoot);
|
|
4261
|
+
for (let index = 0; index <= lastKept; index++) {
|
|
4262
|
+
if (current[index] !== getLayoutIdentity(nextBoundaries[index])) return false;
|
|
4263
|
+
}
|
|
4264
|
+
return true;
|
|
4265
|
+
}` : ""}
|
|
4266
|
+
|
|
4190
4267
|
function activateNavigationScripts(root) {
|
|
4191
4268
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
4192
4269
|
const freshScript = document.createElement("script");
|
|
@@ -4198,7 +4275,7 @@ function activateNavigationScripts(root) {
|
|
|
4198
4275
|
}
|
|
4199
4276
|
}
|
|
4200
4277
|
|
|
4201
|
-
function replaceSharedLayoutBoundary(currentRoot, nextRoot) {
|
|
4278
|
+
function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
4202
4279
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
4203
4280
|
const nextPatterns = getLayoutPatterns(nextRoot);
|
|
4204
4281
|
let sharedCount = 0;
|
|
@@ -4219,7 +4296,9 @@ function replaceSharedLayoutBoundary(currentRoot, nextRoot) {
|
|
|
4219
4296
|
: nextRoot.querySelector("#__farm_page__");
|
|
4220
4297
|
|
|
4221
4298
|
if (!currentTarget || !nextTarget) return false;
|
|
4222
|
-
${isolatedHydrationEnabled ?
|
|
4299
|
+
${isolatedHydrationEnabled ? `${islandValues ? `// A refresh keeps the islands still on the page, with their state and new props.
|
|
4300
|
+
if (refresh) farmIsolatedHydrationRuntime.carryOver(currentTarget, nextTarget);
|
|
4301
|
+
` : ""}disposeFarmIsolatedClientBoundaries(currentTarget);` : ""}
|
|
4223
4302
|
currentTarget.replaceWith(nextTarget);
|
|
4224
4303
|
activateNavigationScripts(nextTarget);
|
|
4225
4304
|
if (nextTreeRoot && nextTreeRoot !== nextTarget) nextTreeRoot.remove();
|
|
@@ -4240,7 +4319,17 @@ function replaceSharedLayoutBoundary(currentRoot, nextRoot) {
|
|
|
4240
4319
|
const spaRouter = {
|
|
4241
4320
|
${generateUniversalRouterStateProperties()}
|
|
4242
4321
|
prefetchCache: new Map(),
|
|
4243
|
-
|
|
4322
|
+
${islandValues ? ` // Islands mode: navigations name the layouts on screen, and say when this page renders the
|
|
4323
|
+
// next one in its own React root; the server leaves out what the browser keeps or rebuilds.
|
|
4324
|
+
partialNavigationHeaders: function() {
|
|
4325
|
+
const root = document.getElementById("root") || document.body;
|
|
4326
|
+
const layouts = getLayoutPatterns(root);
|
|
4327
|
+
return {
|
|
4328
|
+
...(layouts.length ? { "F-Layouts": JSON.stringify(layouts) } : {}),
|
|
4329
|
+
...(reactRoot && reactRootContainer === root ? { "F-Render": "tree" } : {}),
|
|
4330
|
+
};
|
|
4331
|
+
},
|
|
4332
|
+
` : ""}
|
|
4244
4333
|
navigate: async function(href, options = {}) {
|
|
4245
4334
|
const url = new URL(href, window.location.href);
|
|
4246
4335
|
if (isFarmBlockedNavigationURL(url)) return;
|
|
@@ -4295,6 +4384,8 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4295
4384
|
cancelPendingPageHydration();
|
|
4296
4385
|
this.saveScrollPosition(window.location.pathname + window.location.search);
|
|
4297
4386
|
const navigation = this.startNavigation(from, url, action);
|
|
4387
|
+
// A refresh keeps the islands still on the page (islands mode).
|
|
4388
|
+
navigation.refresh = options.refresh === true;
|
|
4298
4389
|
let clientNavigation;
|
|
4299
4390
|
|
|
4300
4391
|
try {
|
|
@@ -4397,26 +4488,48 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4397
4488
|
this.currentPath = to;
|
|
4398
4489
|
});
|
|
4399
4490
|
} else {
|
|
4491
|
+
// A refresh renders every layout again; other navigations keep the ones on screen.
|
|
4400
4492
|
const html = await this.fetchPage(
|
|
4401
4493
|
url.pathname + url.search,
|
|
4402
4494
|
undefined,
|
|
4403
4495
|
options.refresh === true,
|
|
4404
4496
|
true,
|
|
4405
4497
|
navigation.controller.signal,
|
|
4498
|
+
options.refresh !== true,
|
|
4406
4499
|
);
|
|
4407
4500
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4408
4501
|
await farmClientRuntime.markNavigationLoaded(clientNavigation, html);
|
|
4409
4502
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4410
4503
|
await this.runViewTransition(options.viewTransition, async () => {
|
|
4411
4504
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4412
|
-
|
|
4505
|
+
let swapped = await this.swapContent(
|
|
4413
4506
|
html,
|
|
4414
4507
|
url.pathname + url.search,
|
|
4415
4508
|
navigation,
|
|
4416
4509
|
clientNavigation,
|
|
4417
4510
|
);
|
|
4418
4511
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4419
|
-
if (
|
|
4512
|
+
if (swapped === "segment-mismatch") {
|
|
4513
|
+
// The page changed since this segment was requested (a prefetch, a later
|
|
4514
|
+
// navigation): fetch the whole document instead.
|
|
4515
|
+
const documentHtml = await this.fetchPage(
|
|
4516
|
+
url.pathname + url.search,
|
|
4517
|
+
undefined,
|
|
4518
|
+
true,
|
|
4519
|
+
true,
|
|
4520
|
+
navigation.controller.signal,
|
|
4521
|
+
false,
|
|
4522
|
+
);
|
|
4523
|
+
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4524
|
+
swapped = await this.swapContent(
|
|
4525
|
+
documentHtml,
|
|
4526
|
+
url.pathname + url.search,
|
|
4527
|
+
navigation,
|
|
4528
|
+
clientNavigation,
|
|
4529
|
+
);
|
|
4530
|
+
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4531
|
+
}
|
|
4532
|
+
if (!swapped || swapped === "segment-mismatch") {
|
|
4420
4533
|
throw new Error("Farm could not swap the target document");
|
|
4421
4534
|
}
|
|
4422
4535
|
this.writeHistoryEntry(action, url.pathname + url.search, options.state, url);
|
|
@@ -4466,8 +4579,8 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4466
4579
|
});
|
|
4467
4580
|
},
|
|
4468
4581
|
|
|
4469
|
-
fetchPage: async function(url, interceptFrom, fresh = false, recover = true, signal) {
|
|
4470
|
-
return this.fetchPrefetchedDocument(url, interceptFrom, fresh, recover, signal);
|
|
4582
|
+
fetchPage: async function(url, interceptFrom, fresh = false, recover = true, signal, layoutChain = true) {
|
|
4583
|
+
return this.fetchPrefetchedDocument(url, interceptFrom, fresh, recover, signal, true, layoutChain);
|
|
4471
4584
|
},
|
|
4472
4585
|
|
|
4473
4586
|
swapContent: async function(html, targetPath, navigation, clientNavigation) {
|
|
@@ -4488,6 +4601,14 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4488
4601
|
// whole document (and remounting every isolated client boundary).
|
|
4489
4602
|
const newRoot = doc.getElementById("root") || doc.body;
|
|
4490
4603
|
const currentRoot = document.getElementById("root") || document.body;
|
|
4604
|
+
${islandValues ? `const isSegment = Boolean(newRoot?.querySelector('[data-farm-layout-kept="true"]'));
|
|
4605
|
+
// A segment needs this page's kept layouts in place, outside a React-owned root.
|
|
4606
|
+
if (
|
|
4607
|
+
isSegment &&
|
|
4608
|
+
(!currentRoot || reactRootContainer === currentRoot || !fitsSegmentResponse(currentRoot, newRoot))
|
|
4609
|
+
) {
|
|
4610
|
+
return "segment-mismatch";
|
|
4611
|
+
}` : ""}
|
|
4491
4612
|
if (!newRoot || !currentRoot) {
|
|
4492
4613
|
if (!isNavigationCurrent()) return false;
|
|
4493
4614
|
return this.swapDocument(doc);
|
|
@@ -4518,13 +4639,16 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4518
4639
|
}
|
|
4519
4640
|
}
|
|
4520
4641
|
|
|
4642
|
+
${islandValues ? `// A payload-only page renders only in a React root that rebuilds it.
|
|
4643
|
+
if (nextPage?.querySelector('script[type="f/tree"][partial]')) return "segment-mismatch";` : ""}
|
|
4521
4644
|
const rootWasReactOwned = reactRootContainer === currentRoot;
|
|
4522
4645
|
resetReactRoot();
|
|
4523
4646
|
resetRouteSlotRoots();
|
|
4524
4647
|
const replacedSharedBoundary = rootWasReactOwned
|
|
4525
4648
|
? null
|
|
4526
|
-
: replaceSharedLayoutBoundary(currentRoot, newRoot);
|
|
4649
|
+
: replaceSharedLayoutBoundary(currentRoot, newRoot, navigation?.refresh === true);
|
|
4527
4650
|
let isolatedHydrationScope = replacedSharedBoundary || currentRoot;
|
|
4651
|
+
${islandValues ? 'if (!replacedSharedBoundary && isSegment) return "segment-mismatch";' : ""}
|
|
4528
4652
|
if (!replacedSharedBoundary) {
|
|
4529
4653
|
${isolatedHydrationEnabled ? "disposeFarmIsolatedClientBoundaries(currentRoot);" : ""}
|
|
4530
4654
|
currentRoot.innerHTML = newRoot.innerHTML;
|
|
@@ -4607,7 +4731,7 @@ ${generateUniversalRouterStateProperties()}
|
|
|
4607
4731
|
// navigation (double fetch per prefetched link) and sent
|
|
4608
4732
|
// X-Farm-Intercept-From, which bypasses the shared cache server-side.
|
|
4609
4733
|
const pathname = url.pathname + url.search;
|
|
4610
|
-
if (this.readFreshPrefetch(pathname) !== undefined) return;
|
|
4734
|
+
if (this.readFreshPrefetch(this.prefetchRequest(pathname).cacheKey) !== undefined) return;
|
|
4611
4735
|
|
|
4612
4736
|
return this.fetchPage(pathname, undefined, false, false)
|
|
4613
4737
|
.catch(function(error) {
|
|
@@ -4716,7 +4840,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4716
4840
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
4717
4841
|
"module.exports = { plugins: [] };\n"
|
|
4718
4842
|
);
|
|
4719
|
-
tailwindVitePlugin = await
|
|
4843
|
+
tailwindVitePlugin = await _chunkLRJRXXQZcjs.loadTailwindVitePlugin.call(void 0, {
|
|
4720
4844
|
builder: productionVite.builder,
|
|
4721
4845
|
label: "for SSR"
|
|
4722
4846
|
});
|
|
@@ -4812,7 +4936,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4812
4936
|
}
|
|
4813
4937
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
4814
4938
|
const instrumentationPath = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
4815
|
-
const notFoundPath =
|
|
4939
|
+
const notFoundPath = _chunkRACQTC7Kcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
4816
4940
|
if (notFoundPath) _chunk5QIKR7RRcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
4817
4941
|
layoutRoutes.sort((a, b) => {
|
|
4818
4942
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -4833,9 +4957,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4833
4957
|
(provider) => provider.component || provider.type === "clerk"
|
|
4834
4958
|
);
|
|
4835
4959
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
4836
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
4837
|
-
const hasMiddlewareConfig =
|
|
4838
|
-
const hasRouteContextConfig =
|
|
4960
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _67 => _67.mdx, 'optionalAccess', _68 => _68.components]));
|
|
4961
|
+
const hasMiddlewareConfig = _chunkGVNCWSQVcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
4962
|
+
const hasRouteContextConfig = _chunkLVABUXLAcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
4839
4963
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
4840
4964
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
4841
4965
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -4845,18 +4969,18 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4845
4969
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
4846
4970
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
4847
4971
|
);
|
|
4848
|
-
if (
|
|
4972
|
+
if (_chunkHUMEHX24cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
4849
4973
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
4850
|
-
|
|
4974
|
+
_chunkHUMEHX24cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
4851
4975
|
config.docs,
|
|
4852
4976
|
{ root, srcDir: config.srcDir },
|
|
4853
4977
|
(pathname) => adapterGuardedPaths.has(pathname)
|
|
4854
4978
|
);
|
|
4855
4979
|
}
|
|
4856
4980
|
const farmDocsCspNonceMarker = _chunk25LPIZSXcjs.createFarmCspNonce.call(void 0, config.security);
|
|
4857
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
4981
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _69 => _69.docs, 'optionalAccess', _70 => _70.enabled]) && _chunkC5GUTBZKcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkZTP3BJG6cjs._runWithFarmCspNonce.call(void 0,
|
|
4858
4982
|
farmDocsCspNonceMarker,
|
|
4859
|
-
async () => _optionalChain([config, 'access',
|
|
4983
|
+
async () => _optionalChain([config, 'access', _71 => _71.docs, 'access', _72 => _72.adapter, 'optionalAccess', _73 => _73.server]) ? await _chunkHUMEHX24cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
4860
4984
|
root,
|
|
4861
4985
|
srcDir: config.srcDir,
|
|
4862
4986
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -4965,7 +5089,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
4965
5089
|
// Adapters can render provider scripts by serializing function source.
|
|
4966
5090
|
// keepNames injects helper calls into those functions; after Nitro
|
|
4967
5091
|
// minifies the server chunk the helper is no longer in script scope.
|
|
4968
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
5092
|
+
keepNames: !(_optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled]) && _optionalChain([config, 'access', _76 => _76.docs, 'access', _77 => _77.adapter, 'optionalAccess', _78 => _78.server])),
|
|
4969
5093
|
jsxDev: false
|
|
4970
5094
|
},
|
|
4971
5095
|
// SSR configuration to externalize problematic modules
|
|
@@ -5015,10 +5139,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5015
5139
|
define: {
|
|
5016
5140
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
5017
5141
|
__FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
|
|
5018
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
5142
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _79 => _79.env, 'optionalAccess', _80 => _80.public]) || {})
|
|
5019
5143
|
},
|
|
5020
5144
|
plugins: [
|
|
5021
|
-
|
|
5145
|
+
_chunkRACQTC7Kcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
5022
5146
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
5023
5147
|
...rendererVitePlugins,
|
|
5024
5148
|
...config.vite.plugins || [],
|
|
@@ -5071,7 +5195,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5071
5195
|
resolve: {
|
|
5072
5196
|
alias: [
|
|
5073
5197
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
5074
|
-
...Object.entries(
|
|
5198
|
+
...Object.entries(_chunkRACQTC7Kcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
5075
5199
|
([find, replacement]) => ({ find, replacement })
|
|
5076
5200
|
)
|
|
5077
5201
|
],
|
|
@@ -5079,7 +5203,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5079
5203
|
dedupe: [...config.renderer.dedupe || []]
|
|
5080
5204
|
}
|
|
5081
5205
|
};
|
|
5082
|
-
await viteBuild(
|
|
5206
|
+
await viteBuild(_chunkRACQTC7Kcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
5083
5207
|
} finally {
|
|
5084
5208
|
if (postcssConfigDir) {
|
|
5085
5209
|
try {
|
|
@@ -5118,7 +5242,7 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
5118
5242
|
}
|
|
5119
5243
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readFarmPageLastModified, "readFarmPageLastModified");
|
|
5120
5244
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
5121
|
-
if (!_optionalChain([config, 'access',
|
|
5245
|
+
if (!_optionalChain([config, 'access', _81 => _81.docs, 'optionalAccess', _82 => _82.enabled])) return [];
|
|
5122
5246
|
const contentDir = _chunkMY5PZYADcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
|
|
5123
5247
|
root: config.root,
|
|
5124
5248
|
srcDir: config.srcDir
|
|
@@ -5127,19 +5251,19 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
5127
5251
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
5128
5252
|
middlewareRoutes
|
|
5129
5253
|
};
|
|
5130
|
-
return _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkMY5PZYADcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) =>
|
|
5254
|
+
return _chunkMY5PZYADcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkMY5PZYADcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkGVNCWSQVcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
5131
5255
|
}
|
|
5132
5256
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmDocsGuardedPaths, "getFarmDocsGuardedPaths");
|
|
5133
5257
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
5134
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
5258
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _83 => _83.llmsTxt]);
|
|
5135
5259
|
const ownedByFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (kind) => applicationMetadataRoutes.some(
|
|
5136
5260
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
5137
5261
|
), "ownedByFile");
|
|
5138
5262
|
return [
|
|
5139
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5140
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5141
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5142
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5263
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _84 => _84.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
5264
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _85 => _85.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
5265
|
+
..._optionalChain([agent, 'optionalAccess', _86 => _86.sitemap, 'optionalAccess', _87 => _87.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
5266
|
+
..._optionalChain([agent, 'optionalAccess', _88 => _88.crawlers, 'optionalAccess', _89 => _89.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
5143
5267
|
];
|
|
5144
5268
|
}
|
|
5145
5269
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAppOwnedDocsEnginePaths, "getFarmAppOwnedDocsEnginePaths");
|
|
@@ -5181,7 +5305,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
|
|
|
5181
5305
|
}
|
|
5182
5306
|
_chunkS3JO3N4Hcjs.__name.call(void 0, toVirtualEntryImportSpecifier, "toVirtualEntryImportSpecifier");
|
|
5183
5307
|
function generateNativeAuthIntegrationSource(auth) {
|
|
5184
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
5308
|
+
if (_optionalChain([auth, 'optionalAccess', _90 => _90.enabled]) !== true) {
|
|
5185
5309
|
return { importSource: "", registerSource: "" };
|
|
5186
5310
|
}
|
|
5187
5311
|
return {
|
|
@@ -5479,20 +5603,21 @@ ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
|
5479
5603
|
}
|
|
5480
5604
|
_chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmRendererAppSetupServerCode, "generateFarmRendererAppSetupServerCode");
|
|
5481
5605
|
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache) {
|
|
5606
|
+
const farmIslandsMode = _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverComponents])) === "islands";
|
|
5482
5607
|
const hasCompressionRuntime = config.compress && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5483
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
5608
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _93 => _93.agent, 'optionalAccess', _94 => _94.crawlers, 'optionalAccess', _95 => _95.enabled])) && !applicationMetadataRoutes.some(
|
|
5484
5609
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
5485
5610
|
);
|
|
5486
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
5611
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _96 => _96.agent, 'optionalAccess', _97 => _97.sitemap, 'optionalAccess', _98 => _98.enabled])) && !applicationMetadataRoutes.some(
|
|
5487
5612
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
5488
5613
|
);
|
|
5489
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
5490
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
5614
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _99 => _99.agent, 'optionalAccess', _100 => _100.mcp]) === true && !_chunkBMOBTMDRcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
5615
|
+
const servesAiCatalog = _optionalChain([config, 'access', _101 => _101.agent, 'optionalAccess', _102 => _102.aiCatalog]) !== false;
|
|
5491
5616
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
5492
5617
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunk2SJ4RQ6Pcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5493
5618
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
5494
5619
|
const adapterOwnsDocsRuntime = Boolean(
|
|
5495
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
5620
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) && _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.server]) && config.docs.adapter.react
|
|
5496
5621
|
);
|
|
5497
5622
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
5498
5623
|
const hasIsolatedClientGraphRuntime = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
@@ -5502,7 +5627,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
5502
5627
|
);
|
|
5503
5628
|
const hasReactSyncRender = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer);
|
|
5504
5629
|
const rendererServerImports = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
|
|
5505
|
-
import * as ReactDOMServer from "react-dom/server";${hasIsolatedClientGraphRuntime ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};${generateFarmRendererAppSetupServerCode(config)}`;
|
|
5630
|
+
import * as ReactDOMServer from "react-dom/server";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};${generateFarmRendererAppSetupServerCode(config)}`;
|
|
5506
5631
|
const routeClientGraphServerRuntime = hasIsolatedClientGraphRuntime ? `function wrapFarmRouteClientGraph(element) {
|
|
5507
5632
|
return wrapFarmIsolatedClientGraph(React, element);
|
|
5508
5633
|
}
|
|
@@ -5515,18 +5640,21 @@ function isolateFarmRouteServerPage(element) {
|
|
|
5515
5640
|
|
|
5516
5641
|
// An async page below a hydrating layout renders as a serialized tree the browser rebuilds in
|
|
5517
5642
|
// the layout's React root, so its client components read the layout's context.
|
|
5518
|
-
function renderFarmRouteServerTree(element) {
|
|
5519
|
-
return renderFarmServerTreePage(React, element, {
|
|
5643
|
+
function renderFarmRouteServerTree(element, extra) {
|
|
5644
|
+
return renderFarmServerTreePage(React, element, {
|
|
5645
|
+
isolate: isolateFarmRouteServerPage,${farmIslandsMode ? "\n values: true," : ""}
|
|
5646
|
+
...extra,
|
|
5647
|
+
});
|
|
5520
5648
|
}` : `function wrapFarmRouteClientGraph(element) { return element; }
|
|
5521
5649
|
|
|
5522
5650
|
function isolateFarmRouteServerPage(element) { return element; }
|
|
5523
5651
|
|
|
5524
|
-
function renderFarmRouteServerTree(element) { return element; }`;
|
|
5652
|
+
function renderFarmRouteServerTree(element, extra) { return element; }`;
|
|
5525
5653
|
const hasGeneratedMetadataImages = metadataImageRoutes.some(
|
|
5526
5654
|
(image) => image.sourceType === "module"
|
|
5527
5655
|
);
|
|
5528
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
5529
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
5656
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkGVNCWSQVcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5657
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ? _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkHREOKQWTcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
5530
5658
|
const integrationProviders = _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
5531
5659
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
5532
5660
|
(provider) => provider.component || provider.type === "clerk"
|
|
@@ -5536,16 +5664,16 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5536
5664
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
5537
5665
|
);
|
|
5538
5666
|
}
|
|
5539
|
-
const providerServerModules =
|
|
5667
|
+
const providerServerModules = _chunkRACQTC7Kcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
5540
5668
|
renderedIntegrationProviders,
|
|
5541
5669
|
config.root,
|
|
5542
5670
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
5543
5671
|
);
|
|
5544
5672
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
5545
5673
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
5546
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
5674
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _110 => _110.providers]);
|
|
5547
5675
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
5548
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
5676
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _111 => _111.component]) === "function")) {
|
|
5549
5677
|
throw new Error(
|
|
5550
5678
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
5551
5679
|
);
|
|
@@ -5556,17 +5684,21 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5556
5684
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
5557
5685
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
5558
5686
|
);
|
|
5559
|
-
const isolatedHydrationMode =
|
|
5560
|
-
_optionalChain([config, 'access',
|
|
5687
|
+
const isolatedHydrationMode = _chunkRACQTC7Kcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
5688
|
+
_optionalChain([config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.isolatedClientHydration]),
|
|
5561
5689
|
{
|
|
5562
|
-
serverComponents: _optionalChain([config, 'access',
|
|
5690
|
+
serverComponents: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "rsc",
|
|
5563
5691
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
5564
5692
|
}
|
|
5565
5693
|
);
|
|
5566
|
-
const hydrationPlanOptions =
|
|
5694
|
+
const hydrationPlanOptions = _chunkRACQTC7Kcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
5567
5695
|
config.renderer,
|
|
5568
5696
|
Boolean(unsupportedIntegrationProvider)
|
|
5569
5697
|
);
|
|
5698
|
+
const pageHydrationPlanOptions = {
|
|
5699
|
+
...hydrationPlanOptions,
|
|
5700
|
+
serverOwners: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _116 => _116.experimental, 'optionalAccess', _117 => _117.serverComponents])) === "islands"
|
|
5701
|
+
};
|
|
5570
5702
|
const layoutHydrationPlans = layoutRoutes.map((layout) => ({
|
|
5571
5703
|
...layout,
|
|
5572
5704
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -5577,7 +5709,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5577
5709
|
hydrationPlanOptions
|
|
5578
5710
|
)
|
|
5579
5711
|
}));
|
|
5580
|
-
const markdownPagePlan =
|
|
5712
|
+
const markdownPagePlan = _chunkRACQTC7Kcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
5581
5713
|
_chunkOHY2ZWUGcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
5582
5714
|
config.root,
|
|
5583
5715
|
isolatedHydrationMode,
|
|
@@ -5591,11 +5723,11 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5591
5723
|
config.root,
|
|
5592
5724
|
isolatedHydrationMode,
|
|
5593
5725
|
hydrationPlanCache,
|
|
5594
|
-
|
|
5726
|
+
pageHydrationPlanOptions
|
|
5595
5727
|
)
|
|
5596
5728
|
])
|
|
5597
5729
|
);
|
|
5598
|
-
|
|
5730
|
+
_chunkRACQTC7Kcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
5599
5731
|
layoutHydrationPlans.map((layout) => ({
|
|
5600
5732
|
pattern: layout.pattern,
|
|
5601
5733
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -5604,10 +5736,10 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5604
5736
|
pageRoutes.map((route) => ({
|
|
5605
5737
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
5606
5738
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
5607
|
-
depth:
|
|
5739
|
+
depth: _chunkGVNCWSQVcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
5608
5740
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
5609
5741
|
})),
|
|
5610
|
-
|
|
5742
|
+
_chunkGVNCWSQVcjs.routeBoundaryCoversDirectory
|
|
5611
5743
|
);
|
|
5612
5744
|
const providerServerImports = [
|
|
5613
5745
|
providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
|
|
@@ -5624,7 +5756,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5624
5756
|
apiRegistrations.push(`
|
|
5625
5757
|
{
|
|
5626
5758
|
path: ${JSON.stringify(route.path)},
|
|
5627
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
5759
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _118 => _118.pluginMethods, 'optionalAccess', _119 => _119.includes, 'call', _120 => _120(method)])))},
|
|
5628
5760
|
endpoints: ${varName},
|
|
5629
5761
|
}`);
|
|
5630
5762
|
});
|
|
@@ -5661,7 +5793,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5661
5793
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
5662
5794
|
);
|
|
5663
5795
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
5664
|
-
const renderingDirective =
|
|
5796
|
+
const renderingDirective = _chunk3XEMGDBFcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
5665
5797
|
pageRegistrations.push(`
|
|
5666
5798
|
{
|
|
5667
5799
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -5669,7 +5801,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5669
5801
|
module: ${varName},
|
|
5670
5802
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
5671
5803
|
clientModule: ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
5672
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
5804
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkRACQTC7Kcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
|
|
5673
5805
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
5674
5806
|
${route.source !== void 0 ? `markdownSource: {
|
|
5675
5807
|
source: ${JSON.stringify(route.source)},
|
|
@@ -5726,12 +5858,12 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5726
5858
|
errorImports.push(
|
|
5727
5859
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
5728
5860
|
);
|
|
5729
|
-
const groupScope =
|
|
5861
|
+
const groupScope = _chunkGVNCWSQVcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
5730
5862
|
errorRegistrations.push(`
|
|
5731
5863
|
{
|
|
5732
|
-
pattern: ${JSON.stringify(
|
|
5864
|
+
pattern: ${JSON.stringify(_chunkGVNCWSQVcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
5733
5865
|
groupScope: ${JSON.stringify(groupScope)},
|
|
5734
|
-
directoryDepth: ${
|
|
5866
|
+
directoryDepth: ${_chunkGVNCWSQVcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
5735
5867
|
module: ${varName},
|
|
5736
5868
|
}`);
|
|
5737
5869
|
});
|
|
@@ -5877,32 +6009,39 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5877
6009
|
withFarmRouteContext,
|
|
5878
6010
|
createLateNotFoundRecovery,
|
|
5879
6011
|
createLateRedirectRecovery,${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}
|
|
5880
|
-
} from "@farm.js/core/internal/production-runtime"
|
|
6012
|
+
} from "@farm.js/core/internal/production-runtime";${farmIslandsMode ? `
|
|
6013
|
+
import { getSharedLayoutPrefixLength, handleFarmFormActionRequest, ignoreFarmHeldValues, installFarmIslandValues, parseFarmLayoutChainHeader } from "@farm.js/core/internal/production-runtime";
|
|
6014
|
+
import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server";
|
|
6015
|
+
installFarmIslandsServer();
|
|
6016
|
+
const farmFormActionsConfig = ${JSON.stringify(_chunkP4TYB4SFcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
|
|
6017
|
+
installFarmIslandValues();
|
|
6018
|
+
${islandsActionKeyCode()}
|
|
6019
|
+
${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
|
|
5881
6020
|
const productionSiteTelemetryImport = config.telemetry ? `import { createFarmProductionSiteReporter } from "@farm.js/core/internal/product-telemetry-runtime";` : "";
|
|
5882
6021
|
const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse } from "@farm.js/core/internal/metadata-image-runtime";` : "";
|
|
5883
6022
|
const pluginRuntimeImport = hasPluginRuntime ? `import { PluginManager } from "@farm.js/core/plugin";` : "";
|
|
5884
6023
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
5885
6024
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
5886
6025
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
5887
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
6026
|
+
const docsHandlerImport = _optionalChain([config, 'access', _121 => _121.docs, 'optionalAccess', _122 => _122.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
5888
6027
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
5889
6028
|
const pathname = typeof requestOrPathname === "string"
|
|
5890
6029
|
? requestOrPathname
|
|
5891
6030
|
: new URL(requestOrPathname.url).pathname;
|
|
5892
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
6031
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _123 => _123.apiPath]) || "/api/docs")};
|
|
5893
6032
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
5894
6033
|
};` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
5895
6034
|
import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
|
|
5896
6035
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
5897
6036
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
5898
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
5899
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
6037
|
+
const docsFontImport = _optionalChain([config, 'access', _124 => _124.docs, 'optionalAccess', _125 => _125.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
6038
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _126 => _126.docs, 'optionalAccess', _127 => _127.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
5900
6039
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
5901
6040
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
5902
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
6041
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _128 => _128.md, 'optionalAccess', _129 => _129.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
5903
6042
|
const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
|
|
5904
6043
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
5905
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
6044
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _130 => _130.mdx, 'optionalAccess', _131 => _131.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
5906
6045
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
5907
6046
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
5908
6047
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -5920,7 +6059,7 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
5920
6059
|
const integrationRuntimeImport = integrationRuntimeExports.length ? `import { ${integrationRuntimeExports.join(", ")} } from "@farm.js/core/integrations";` : "";
|
|
5921
6060
|
const instrumentationImport = instrumentationPath ? `import * as FarmInstrumentationModule from ${toVirtualEntryImportSpecifier(instrumentationPath)};` : "";
|
|
5922
6061
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
5923
|
-
const nativeMCP =
|
|
6062
|
+
const nativeMCP = _chunkBKPXWRTTcjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
5924
6063
|
const integrationImports = `
|
|
5925
6064
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
5926
6065
|
${layerConfigImports}
|
|
@@ -5928,7 +6067,7 @@ ${integrationRuntimeImport}
|
|
|
5928
6067
|
${nativeAuth.importSource}
|
|
5929
6068
|
${nativeMCP.importSource}
|
|
5930
6069
|
`;
|
|
5931
|
-
const imageRuntime =
|
|
6070
|
+
const imageRuntime = _chunkRACQTC7Kcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
5932
6071
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
5933
6072
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
5934
6073
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6107,7 +6246,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
6107
6246
|
|
|
6108
6247
|
function FarmDefault404Page() {
|
|
6109
6248
|
return React.createElement(React.Fragment, null,
|
|
6110
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
6249
|
+
React.createElement("style", null, ${JSON.stringify(_chunkRACQTC7Kcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
6111
6250
|
React.createElement("main", {
|
|
6112
6251
|
className: "farm-default-not-found",
|
|
6113
6252
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -6240,14 +6379,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
6240
6379
|
onError(error) { console.error("[Farm Image]", error); },
|
|
6241
6380
|
})`};
|
|
6242
6381
|
const farmMarkdownConfig = ${JSON.stringify(config.md)};
|
|
6243
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
6244
|
-
${_optionalChain([config, 'access',
|
|
6382
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _132 => _132.agent, 'optionalAccess', _133 => _133.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
6383
|
+
${_optionalChain([config, 'access', _134 => _134.agent, 'optionalAccess', _135 => _135.llmsTxt, 'optionalAccess', _136 => _136.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
6245
6384
|
const farmMdxConfig = ${JSON.stringify({
|
|
6246
6385
|
...config.mdx,
|
|
6247
|
-
components: typeof _optionalChain([config, 'access',
|
|
6386
|
+
components: typeof _optionalChain([config, 'access', _137 => _137.mdx, 'optionalAccess', _138 => _138.components]) === "string" ? config.mdx.components : void 0
|
|
6248
6387
|
})};
|
|
6249
6388
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
6250
|
-
${_optionalChain([config, 'access',
|
|
6389
|
+
${_optionalChain([config, 'access', _139 => _139.agent, 'optionalAccess', _140 => _140.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
6251
6390
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
6252
6391
|
// to the build.
|
|
6253
6392
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
@@ -6298,7 +6437,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
6298
6437
|
});
|
|
6299
6438
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
6300
6439
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
6301
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
6440
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _141 => _141.docs, 'optionalAccess', _142 => _142.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
6302
6441
|
try {
|
|
6303
6442
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
6304
6443
|
const candidates = [
|
|
@@ -6348,7 +6487,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
6348
6487
|
),
|
|
6349
6488
|
}
|
|
6350
6489
|
: undefined;
|
|
6351
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
6490
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
|
|
6352
6491
|
${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
|
|
6353
6492
|
entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
|
|
6354
6493
|
docsPath: farmDocsResolvedConfig.entry,
|
|
@@ -6385,7 +6524,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _135 => _135.docs, '
|
|
|
6385
6524
|
globalStylesheetHref: "/assets/globals.css",
|
|
6386
6525
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
6387
6526
|
})` : "null"};
|
|
6388
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
6527
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _145 => _145.docs, 'optionalAccess', _146 => _146.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
|
|
6389
6528
|
|
|
6390
6529
|
// API routes bundled at build time
|
|
6391
6530
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -6410,12 +6549,12 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
6410
6549
|
}
|
|
6411
6550
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
6412
6551
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
6413
|
-
${_optionalChain([config, 'access',
|
|
6414
|
-
` : ""}${_optionalChain([config, 'access',
|
|
6415
|
-
|
|
6552
|
+
${_optionalChain([config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkGVNCWSQVcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
6553
|
+
` : ""}${_optionalChain([config, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
6554
|
+
_chunkGVNCWSQVcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
6416
6555
|
build: config.deploymentId,
|
|
6417
|
-
packages:
|
|
6418
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
6556
|
+
packages: _chunkRACQTC7Kcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
6557
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkRACQTC7Kcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
6419
6558
|
})
|
|
6420
6559
|
)};
|
|
6421
6560
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -6890,7 +7029,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
6890
7029
|
let inner = markup.replace(/^\\s+/, "");
|
|
6891
7030
|
let hoisted = "";
|
|
6892
7031
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
6893
|
-
const hoistable = /${
|
|
7032
|
+
const hoistable = /${_chunkGVNCWSQVcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
6894
7033
|
let match;
|
|
6895
7034
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
6896
7035
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -7030,7 +7169,7 @@ const farmClientEntryPreloadTags = farmClientModulePreloads
|
|
|
7030
7169
|
: "";
|
|
7031
7170
|
// The client modules a document's markup loads: its islands' boundaries and the
|
|
7032
7171
|
// client references of its server tree.
|
|
7033
|
-
const FARM_CLIENT_MODULE_REFERENCE_PATTERN =
|
|
7172
|
+
const FARM_CLIENT_MODULE_REFERENCE_PATTERN = /<f-island src="([^"]+)"|"r":"(\\/[^"]+)"/g;
|
|
7034
7173
|
|
|
7035
7174
|
function renderFarmClientModulePreload(index) {
|
|
7036
7175
|
return '\\n <link rel="modulepreload" href="/' +
|
|
@@ -7421,7 +7560,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
7421
7560
|
// a route guard.
|
|
7422
7561
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
7423
7562
|
pageRoutes.map((route) => route.pattern).filter(
|
|
7424
|
-
(pattern) => !pattern.includes("[") &&
|
|
7563
|
+
(pattern) => !pattern.includes("[") && _chunkGVNCWSQVcjs.farmPathGuardCoversPage.call(void 0,
|
|
7425
7564
|
{
|
|
7426
7565
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
7427
7566
|
middlewareRoutes
|
|
@@ -7468,7 +7607,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
7468
7607
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
7469
7608
|
// registered at runtime, such as the docs engine's.
|
|
7470
7609
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
7471
|
-
_chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
7610
|
+
_chunkBMOBTMDRcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkYBDSTNMHcjs.FARM_VERSION)
|
|
7472
7611
|
)};
|
|
7473
7612
|
let farmDefaultMCPRouteFree;
|
|
7474
7613
|
function getFarmDefaultMCPServer() {
|
|
@@ -7768,7 +7907,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
7768
7907
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
7769
7908
|
return true;
|
|
7770
7909
|
}
|
|
7771
|
-
${_optionalChain([config, 'access',
|
|
7910
|
+
${_optionalChain([config, 'access', _151 => _151.docs, 'optionalAccess', _152 => _152.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
7772
7911
|
if (
|
|
7773
7912
|
isFarmDocsAPIRequest(pathname) ||
|
|
7774
7913
|
docsPath === "/" ||
|
|
@@ -7794,7 +7933,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
7794
7933
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
7795
7934
|
};
|
|
7796
7935
|
}
|
|
7797
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
7936
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _153 => _153.docs, 'optionalAccess', _154 => _154.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
7798
7937
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
7799
7938
|
pathname,
|
|
7800
7939
|
method: request.method,
|
|
@@ -7891,7 +8030,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
7891
8030
|
return applicable;
|
|
7892
8031
|
}
|
|
7893
8032
|
|
|
7894
|
-
${_optionalChain([config, 'access',
|
|
8033
|
+
${_optionalChain([config, 'access', _155 => _155.docs, 'optionalAccess', _156 => _156.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
7895
8034
|
if (request.method === "HEAD") return response;
|
|
7896
8035
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
7897
8036
|
|
|
@@ -7999,7 +8138,7 @@ ${_optionalChain([config, 'access', _147 => _147.docs, 'optionalAccess', _148 =>
|
|
|
7999
8138
|
|
|
8000
8139
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
8001
8140
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
8002
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
8141
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _157 => _157.experimental, 'optionalAccess', _158 => _158.ppr]) === true)};
|
|
8003
8142
|
|
|
8004
8143
|
function resolveRouteRenderingView(route) {
|
|
8005
8144
|
// The same merge development uses: baked directive config under the
|
|
@@ -8131,7 +8270,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
8131
8270
|
},
|
|
8132
8271
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
8133
8272
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
8134
|
-
${_optionalChain([config, 'access',
|
|
8273
|
+
${_optionalChain([config, 'access', _159 => _159.md, 'optionalAccess', _160 => _160.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
8135
8274
|
if (matchPageRoute(pathname)) {
|
|
8136
8275
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
8137
8276
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -8341,7 +8480,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8341
8480
|
}
|
|
8342
8481
|
` : ""}
|
|
8343
8482
|
|
|
8344
|
-
${_optionalChain([config, 'access',
|
|
8483
|
+
${_optionalChain([config, 'access', _161 => _161.docs, 'optionalAccess', _162 => _162.enabled]) ? `
|
|
8345
8484
|
// Docs responses are served after app middleware so route guards and
|
|
8346
8485
|
// middleware headers apply to the docs engine like any other page content.
|
|
8347
8486
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -8402,7 +8541,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8402
8541
|
}
|
|
8403
8542
|
` : ""}
|
|
8404
8543
|
|
|
8405
|
-
${_optionalChain([config, 'access',
|
|
8544
|
+
${_optionalChain([config, 'access', _163 => _163.md, 'optionalAccess', _164 => _164.enabled]) ? `
|
|
8406
8545
|
if (farmMarkdownConfig?.enabled) {
|
|
8407
8546
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
8408
8547
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -8501,11 +8640,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8501
8640
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
8502
8641
|
}
|
|
8503
8642
|
` : ""}
|
|
8504
|
-
${_optionalChain([config, 'access',
|
|
8643
|
+
${_optionalChain([config, 'access', _165 => _165.agent, 'optionalAccess', _166 => _166.manifest]) !== false ? `
|
|
8505
8644
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
8506
8645
|
// public manifest, the same document for every request.
|
|
8507
8646
|
if (
|
|
8508
|
-
[${JSON.stringify(
|
|
8647
|
+
[${JSON.stringify(_chunkGVNCWSQVcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkGVNCWSQVcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
8509
8648
|
normalizeRuntimePath(routePathname),
|
|
8510
8649
|
)
|
|
8511
8650
|
) {
|
|
@@ -8515,9 +8654,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8515
8654
|
);
|
|
8516
8655
|
}
|
|
8517
8656
|
` : ""}
|
|
8518
|
-
${_optionalChain([config, 'access',
|
|
8657
|
+
${_optionalChain([config, 'access', _167 => _167.agent, 'optionalAccess', _168 => _168.apiCatalog]) ? `
|
|
8519
8658
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
8520
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
8659
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkGVNCWSQVcjs.FARM_API_CATALOG_PATH)}) {
|
|
8521
8660
|
return applyProductionMiddlewareHeaders(
|
|
8522
8661
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
8523
8662
|
middlewareHeaders,
|
|
@@ -8542,11 +8681,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8542
8681
|
);
|
|
8543
8682
|
}
|
|
8544
8683
|
` : ""}
|
|
8545
|
-
${_optionalChain([config, 'access',
|
|
8684
|
+
${_optionalChain([config, 'access', _169 => _169.agent, 'optionalAccess', _170 => _170.llmsTxt, 'optionalAccess', _171 => _171.enabled]) ? `
|
|
8546
8685
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
8547
8686
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
8548
8687
|
? "llms"
|
|
8549
|
-
: ${_optionalChain([config, 'access',
|
|
8688
|
+
: ${_optionalChain([config, 'access', _172 => _172.agent, 'optionalAccess', _173 => _173.llmsTxt, 'optionalAccess', _174 => _174.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
8550
8689
|
if (farmGeneratedLlmsKind) {
|
|
8551
8690
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
8552
8691
|
const llmsOrigin = new URL(request.url).origin;
|
|
@@ -8581,7 +8720,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8581
8720
|
}
|
|
8582
8721
|
` : ""}
|
|
8583
8722
|
|
|
8584
|
-
${_optionalChain([config, 'access',
|
|
8723
|
+
${_optionalChain([config, 'access', _175 => _175.docs, 'optionalAccess', _176 => _176.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
8585
8724
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
8586
8725
|
if (docsAPIResponse) {
|
|
8587
8726
|
return applyProductionMiddlewareHeaders(
|
|
@@ -8602,6 +8741,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8602
8741
|
// Handle page routes (SSR)
|
|
8603
8742
|
emitFarmEvent({ type: "render.start", route: pathname, pathname });
|
|
8604
8743
|
const matchedRoute = matchPageRoute(routePathname);
|
|
8744
|
+
${farmIslandsMode ? `// Islands mode: a form or client component posting a server action to this page.
|
|
8745
|
+
if (matchedRoute && request.method === "POST") {
|
|
8746
|
+
const actionResponse = await handleFarmFormActionRequest(request, farmFormActionsConfig);
|
|
8747
|
+
if (actionResponse) return applyProductionMiddlewareHeaders(actionResponse, middlewareHeaders);
|
|
8748
|
+
}` : ""}
|
|
8605
8749
|
if (matchedRoute) {
|
|
8606
8750
|
const trailingSlashLocation = resolveFarmTrailingSlashRedirect(
|
|
8607
8751
|
url,
|
|
@@ -8620,6 +8764,21 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8620
8764
|
emitFarmEvent({ type: "route.matched", pathname, route: route.pattern, params });
|
|
8621
8765
|
|
|
8622
8766
|
try {
|
|
8767
|
+
${farmIslandsMode ? `// Islands mode: the layouts the navigating browser keeps, decided before the shell cache
|
|
8768
|
+
// so a PPR route caches each segment under its own key. A static page, a layout that
|
|
8769
|
+
// hydrates as a root, or a route slot always renders whole.
|
|
8770
|
+
const farmSegmentLayouts = getApplicableLayouts(
|
|
8771
|
+
routePathname,
|
|
8772
|
+
route.directory || route.pattern,
|
|
8773
|
+
);
|
|
8774
|
+
const farmKeptLayoutCount =
|
|
8775
|
+
resolveRouteRenderingView(route).ssg ||
|
|
8776
|
+
farmSegmentLayouts.some((layout) => layout.shouldHydrate === true) ||
|
|
8777
|
+
matchRouteSlots(routePathname, request.headers.get("x-farm-intercept-from")).length > 0
|
|
8778
|
+
? 0
|
|
8779
|
+
: countFarmKeptLayouts(request, farmSegmentLayouts, params);
|
|
8780
|
+
// The root layout always renders, so keeping one layout keeps nothing.
|
|
8781
|
+
const farmKeptLayouts = farmKeptLayoutCount > 1 ? farmKeptLayoutCount : 0;` : `const farmKeptLayouts = 0;`}
|
|
8623
8782
|
const pprConfig = resolvePPRConfig(route);
|
|
8624
8783
|
const pprBypassReason = pprConfig.enabled
|
|
8625
8784
|
? getPPRShellBypassReason(request, middlewareData, middlewareContext)
|
|
@@ -8632,7 +8791,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8632
8791
|
farmLocaleResolution && farmI18nConfig.routing !== "none"
|
|
8633
8792
|
? resolveFarmI18nAlternateOrigin(request)
|
|
8634
8793
|
: ""
|
|
8635
|
-
)
|
|
8794
|
+
) + (farmKeptLayouts ? ":segment:" + farmKeptLayouts : "")
|
|
8636
8795
|
: null;
|
|
8637
8796
|
if (pprConfig.enabled && pprBypassReason) {
|
|
8638
8797
|
emitFarmEvent({ type: "ppr.shell.bypass", route: pathname, reason: pprBypassReason });
|
|
@@ -8659,6 +8818,10 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8659
8818
|
"x-farm-preload-buffered": getFarmBufferedPreloadMarker(cachedPPRShell),
|
|
8660
8819
|
...(farmFontPreloadHeader ? { "Link": farmFontPreloadHeader } : {}),
|
|
8661
8820
|
...getPPRHeaders("hit", pprConfig),
|
|
8821
|
+
// A segment is one navigation's answer, never a CDN entry: some CDNs ignore Vary.
|
|
8822
|
+
...(farmKeptLayouts
|
|
8823
|
+
? { "Cache-Control": "private, no-store", "Vary": "F-Layouts" }
|
|
8824
|
+
: {}),
|
|
8662
8825
|
},
|
|
8663
8826
|
}), middlewareHeaders), cachedPPRShell);
|
|
8664
8827
|
}
|
|
@@ -8885,6 +9048,21 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8885
9048
|
};
|
|
8886
9049
|
});
|
|
8887
9050
|
|
|
9051
|
+
${farmIslandsMode ? `// Islands mode: a route a shared cache may store (a PPR shell, a static page) renders
|
|
9052
|
+
// whole for every request, so a cache hit stays a hit. Other routes leave out what the
|
|
9053
|
+
// navigating browser keeps: the layouts it shows and the values it holds.
|
|
9054
|
+
const farmSharedCacheableRoute = Boolean(getRouteSharedCacheControl(route, pprCanCache));
|
|
9055
|
+
if (farmSharedCacheableRoute) ignoreFarmHeldValues();
|
|
9056
|
+
const farmLayoutKeyOf = getFarmLayoutKey;
|
|
9057
|
+
// A navigation the browser renders in its layout's React root rebuilds a server-tree page
|
|
9058
|
+
// from its payload, so the page's rendered HTML would go unused.
|
|
9059
|
+
const farmPayloadOnlyNavigation =
|
|
9060
|
+
!farmSharedCacheableRoute &&
|
|
9061
|
+
shouldHydrateLayout &&
|
|
9062
|
+
route.serverTree === true &&
|
|
9063
|
+
!route.shouldHydrate &&
|
|
9064
|
+
request.headers.get("f-render") === "tree";` : `const farmLayoutKeyOf = null;
|
|
9065
|
+
const farmPayloadOnlyNavigation = false;`}
|
|
8888
9066
|
const renderPageElement = async () => {
|
|
8889
9067
|
// First, render the page content
|
|
8890
9068
|
let pageElement;
|
|
@@ -8911,7 +9089,10 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8911
9089
|
pageElement = wrapFarmRouteClientGraph(pageElement);
|
|
8912
9090
|
} else if (shouldHydrateLayout && !route.shouldHydrate) {
|
|
8913
9091
|
pageElement = route.serverTree
|
|
8914
|
-
? await renderFarmRouteServerTree(
|
|
9092
|
+
? await renderFarmRouteServerTree(
|
|
9093
|
+
pageElement,
|
|
9094
|
+
farmPayloadOnlyNavigation ? { payloadOnly: true } : undefined,
|
|
9095
|
+
)
|
|
8915
9096
|
: isolateFarmRouteServerPage(pageElement);
|
|
8916
9097
|
}
|
|
8917
9098
|
|
|
@@ -8936,6 +9117,22 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8936
9117
|
for (let i = applicableLayouts.length - 1; i >= 0; i--) {
|
|
8937
9118
|
const layout = applicableLayouts[i];
|
|
8938
9119
|
const LayoutComponent = layout.module.default;
|
|
9120
|
+
// Islands mode: a layout the browser keeps sends only its boundary, so the client
|
|
9121
|
+
// knows where the rest goes. The root layout always renders: it may own the document.
|
|
9122
|
+
if (LayoutComponent && i > 0 && i < farmKeptLayouts) {
|
|
9123
|
+
wrappedElement = React.createElement(
|
|
9124
|
+
"div",
|
|
9125
|
+
{
|
|
9126
|
+
"data-farm-layout-boundary": "true",
|
|
9127
|
+
"data-farm-layout-pattern": layout.pattern,
|
|
9128
|
+
"data-farm-layout-key": farmLayoutKeyOf(layout.pattern, params),
|
|
9129
|
+
"data-farm-layout-kept": "true",
|
|
9130
|
+
style: { display: "contents" },
|
|
9131
|
+
},
|
|
9132
|
+
wrappedElement,
|
|
9133
|
+
);
|
|
9134
|
+
continue;
|
|
9135
|
+
}
|
|
8939
9136
|
if (LayoutComponent) {
|
|
8940
9137
|
const slotProps = {};
|
|
8941
9138
|
for (const slot of renderedRouteSlots) {
|
|
@@ -8962,6 +9159,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8962
9159
|
{
|
|
8963
9160
|
"data-farm-layout-boundary": "true",
|
|
8964
9161
|
"data-farm-layout-pattern": layout.pattern,
|
|
9162
|
+
"data-farm-layout-key": farmLayoutKeyOf
|
|
9163
|
+
? farmLayoutKeyOf(layout.pattern, params)
|
|
9164
|
+
: undefined,
|
|
8965
9165
|
style: { display: "contents" },
|
|
8966
9166
|
},
|
|
8967
9167
|
wrappedElement,
|
|
@@ -9042,7 +9242,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9042
9242
|
);
|
|
9043
9243
|
}
|
|
9044
9244
|
}
|
|
9045
|
-
${_optionalChain([config, 'access',
|
|
9245
|
+
${_optionalChain([config, 'access', _177 => _177.md, 'optionalAccess', _178 => _178.enabled]) ? `
|
|
9046
9246
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
9047
9247
|
// using the public path the .md request will be resolved against.
|
|
9048
9248
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -9061,7 +9261,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9061
9261
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
|
|
9062
9262
|
}
|
|
9063
9263
|
|
|
9064
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9264
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _179 => _179.agent, 'optionalAccess', _180 => _180.jsonLd]), () => ( false)))} });
|
|
9065
9265
|
const title = renderedMetadata.title;
|
|
9066
9266
|
const metaTags = renderedMetadata.tags;
|
|
9067
9267
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -9072,7 +9272,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9072
9272
|
farmLocaleResolution,
|
|
9073
9273
|
);
|
|
9074
9274
|
const hasRequestScopedRender = Boolean(
|
|
9075
|
-
pageStatus >= 400 ||
|
|
9275
|
+
pageStatus >= 400 ||${farmIslandsMode ? "\n farmKeptLayouts > 0 ||\n farmPayloadOnlyNavigation ||" : ""}
|
|
9076
9276
|
renderReadRequest ||
|
|
9077
9277
|
request.headers.get("x-farm-intercept-from") ||
|
|
9078
9278
|
hasPrivateRequestHeaders ||
|
|
@@ -9092,7 +9292,12 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9092
9292
|
if (renderedPage.stream || hasRequestScopedRender || !sharedCacheControl) {
|
|
9093
9293
|
responseHeaders["Cache-Control"] = "private, no-store";
|
|
9094
9294
|
}
|
|
9095
|
-
const farmI18nSnapshot = getFarmI18nSnapshot()
|
|
9295
|
+
const farmI18nSnapshot = getFarmI18nSnapshot();${farmIslandsMode ? `
|
|
9296
|
+
// Islands mode: a navigation that names the values it holds, or the layouts it shows,
|
|
9297
|
+
// gets HTML without them.
|
|
9298
|
+
responseHeaders["Vary"] = farmSharedCacheableRoute
|
|
9299
|
+
? "F-Layouts"
|
|
9300
|
+
: "F-Values, F-Layouts, F-Render";` : ""}
|
|
9096
9301
|
let html = renderedPage.html;
|
|
9097
9302
|
|
|
9098
9303
|
// Check if the layout already rendered a full HTML document
|
|
@@ -9704,11 +9909,11 @@ ${generatePreloadResponseRuntimeSource()}
|
|
|
9704
9909
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
9705
9910
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
9706
9911
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
9707
|
-
${_optionalChain([config, 'access',
|
|
9912
|
+
${_optionalChain([config, 'access', _181 => _181.agent, 'optionalAccess', _182 => _182.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
9708
9913
|
basePath: farmLocalAPIBasePath,
|
|
9709
9914
|
dispatch: async (localRequest) =>
|
|
9710
9915
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
9711
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
9916
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _183 => _183.agent, 'optionalAccess', _184 => _184.noindexPreviews]) ? `
|
|
9712
9917
|
// Keep every response of a preview deployment out of search indexes.
|
|
9713
9918
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
9714
9919
|
}
|
|
@@ -9902,13 +10107,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
9902
10107
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
9903
10108
|
return "rewrite";
|
|
9904
10109
|
}
|
|
9905
|
-
if (
|
|
9906
|
-
if (
|
|
9907
|
-
if (
|
|
10110
|
+
if (_chunkGVNCWSQVcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
10111
|
+
if (_chunkGVNCWSQVcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
10112
|
+
if (_chunkLVABUXLAcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
9908
10113
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
9909
10114
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
9910
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
9911
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
10115
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _185 => _185.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
10116
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _186 => _186.regions, 'optionalAccess', _187 => _187.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
9912
10117
|
return "route runtime controls";
|
|
9913
10118
|
}
|
|
9914
10119
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -9923,9 +10128,9 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
9923
10128
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getPhysicalPrerenderBypassReason, "getPhysicalPrerenderBypassReason");
|
|
9924
10129
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
9925
10130
|
return Object.values(routeRules || {}).some((rule) => {
|
|
9926
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
9927
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
9928
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
10131
|
+
const swr = _optionalChain([rule, 'optionalAccess', _188 => _188.swr]);
|
|
10132
|
+
const cache = _optionalChain([rule, 'optionalAccess', _189 => _189.cache]);
|
|
10133
|
+
const headers = _optionalChain([rule, 'optionalAccess', _190 => _190.headers]);
|
|
9929
10134
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
9930
10135
|
});
|
|
9931
10136
|
}
|
|
@@ -9939,10 +10144,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
9939
10144
|
const nitroBuilder = nitroBuilderResult.value;
|
|
9940
10145
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
9941
10146
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
9942
|
-
const outputDir =
|
|
10147
|
+
const outputDir = _chunkLVABUXLAcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
9943
10148
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
9944
10149
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
9945
|
-
const imageRuntime =
|
|
10150
|
+
const imageRuntime = _chunkRACQTC7Kcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
9946
10151
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
9947
10152
|
(image) => image.sourceType === "module"
|
|
9948
10153
|
);
|
|
@@ -10402,20 +10607,20 @@ function toFarmNodeResponse(request, response) {
|
|
|
10402
10607
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
10403
10608
|
);
|
|
10404
10609
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
10405
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
10406
|
-
_optionalChain([nitroConfig, 'access',
|
|
10407
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
10610
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _191 => _191.rollupConfig, 'optionalAccess', _192 => _192.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _193 => _193.rollupConfig, 'optionalAccess', _194 => _194.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _195 => _195.output, 'optionalAccess', _196 => _196.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
|
|
10611
|
+
_optionalChain([nitroConfig, 'access', _197 => _197.handlers, 'optionalAccess', _198 => _198.some, 'call', _199 => _199(
|
|
10612
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _200 => _200.handler]) || "") === nitroEntryPath
|
|
10408
10613
|
)])
|
|
10409
10614
|
);
|
|
10410
10615
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
10411
10616
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
10412
10617
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
10413
10618
|
const shouldMinify = nitroConfig.minify !== false;
|
|
10414
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
10619
|
+
const keepServerNames = !(_optionalChain([config, 'access', _201 => _201.docs, 'optionalAccess', _202 => _202.enabled]) && _optionalChain([config, 'access', _203 => _203.docs, 'access', _204 => _204.adapter, 'optionalAccess', _205 => _205.server]));
|
|
10415
10620
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
10416
10621
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
10417
10622
|
if (canReusePrebuiltSSR) {
|
|
10418
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
10623
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _206 => _206.rollupConfig, 'optionalAccess', _207 => _207.plugins]);
|
|
10419
10624
|
nitroConfig.rollupConfig = {
|
|
10420
10625
|
...nitroConfig.rollupConfig,
|
|
10421
10626
|
plugins: [
|
|
@@ -10426,9 +10631,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
10426
10631
|
}
|
|
10427
10632
|
nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
|
|
10428
10633
|
const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
|
|
10429
|
-
if (_optionalChain([config, 'access',
|
|
10634
|
+
if (_optionalChain([config, 'access', _208 => _208.md, 'optionalAccess', _209 => _209.enabled])) {
|
|
10430
10635
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
10431
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
10636
|
+
if (!route.contents || !_optionalChain([route, 'access', _210 => _210.contentType, 'optionalAccess', _211 => _211.toLowerCase, 'call', _212 => _212(), 'access', _213 => _213.includes, 'call', _214 => _214("html")])) return;
|
|
10432
10637
|
const alternatePath = _chunkD4ROBNTKcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
|
|
10433
10638
|
if (!alternatePath) return;
|
|
10434
10639
|
const routeRule = nitroInstance.options.routeRules[route.route] || {};
|
|
@@ -10449,7 +10654,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
10449
10654
|
}
|
|
10450
10655
|
if (config.security.csp && config.security.csp.nonce) {
|
|
10451
10656
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
10452
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
10657
|
+
if (!route.contents || !_optionalChain([route, 'access', _215 => _215.contentType, 'optionalAccess', _216 => _216.toLowerCase, 'call', _217 => _217(), 'access', _218 => _218.includes, 'call', _219 => _219("html")])) return;
|
|
10453
10658
|
const staticCsp = await _chunk25LPIZSXcjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
10454
10659
|
if (!staticCsp) return;
|
|
10455
10660
|
route.contents = staticCsp.html;
|
|
@@ -10657,7 +10862,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
10657
10862
|
await fs4.rename(src, dest);
|
|
10658
10863
|
return;
|
|
10659
10864
|
} catch (error) {
|
|
10660
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
10865
|
+
const code = _optionalChain([error, 'optionalAccess', _220 => _220.code]);
|
|
10661
10866
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
10662
10867
|
throw error;
|
|
10663
10868
|
}
|
|
@@ -10684,7 +10889,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
10684
10889
|
try {
|
|
10685
10890
|
await moveVercelOutputPath(publicDir, staticDir, fs4);
|
|
10686
10891
|
} catch (error) {
|
|
10687
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
10892
|
+
if (_optionalChain([error, 'optionalAccess', _221 => _221.code]) !== "ENOENT") throw error;
|
|
10688
10893
|
}
|
|
10689
10894
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
|
|
10690
10895
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
|
|
@@ -10804,7 +11009,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
10804
11009
|
try {
|
|
10805
11010
|
await copyPackage("sharp", sharpRequire);
|
|
10806
11011
|
if (!copiedPackages.has("sharp")) {
|
|
10807
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
11012
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkRACQTC7Kcjs.SHARP_INSTALL_HINT}`);
|
|
10808
11013
|
}
|
|
10809
11014
|
} catch (error) {
|
|
10810
11015
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -11004,6 +11209,12 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
|
|
|
11004
11209
|
await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
|
|
11005
11210
|
}
|
|
11006
11211
|
_chunkS3JO3N4Hcjs.__name.call(void 0, copyPrismaClientForVercel, "copyPrismaClientForVercel");
|
|
11212
|
+
function islandsActionKeyCode() {
|
|
11213
|
+
const key = _crypto.randomBytes.call(void 0, 32).toString("base64url");
|
|
11214
|
+
return `import { setBuildDefaults as __farmIslxBuildDefaults } from "@farm.js/core/internal/islx-server";
|
|
11215
|
+
__farmIslxBuildDefaults({ key: ${JSON.stringify(key)} });`;
|
|
11216
|
+
}
|
|
11217
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, islandsActionKeyCode, "islandsActionKeyCode");
|
|
11007
11218
|
|
|
11008
11219
|
// src/build/project-module-runner.ts
|
|
11009
11220
|
async function createFarmProjectModuleSsrEnvironment() {
|
|
@@ -11042,7 +11253,7 @@ function createBuildTargetBaseline(config) {
|
|
|
11042
11253
|
preset,
|
|
11043
11254
|
distDir,
|
|
11044
11255
|
outputDir,
|
|
11045
|
-
outputWasDerived: outputDir ===
|
|
11256
|
+
outputWasDerived: outputDir === _chunkLVABUXLAcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
11046
11257
|
};
|
|
11047
11258
|
}
|
|
11048
11259
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createBuildTargetBaseline, "createBuildTargetBaseline");
|
|
@@ -11052,8 +11263,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11052
11263
|
const distDir = config.distDir || ".farm";
|
|
11053
11264
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
11054
11265
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
11055
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
11056
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
11266
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkLVABUXLAcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
11267
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkLVABUXLAcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
11057
11268
|
return {
|
|
11058
11269
|
root,
|
|
11059
11270
|
preset,
|
|
@@ -11061,7 +11272,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11061
11272
|
distDir,
|
|
11062
11273
|
deployTarget,
|
|
11063
11274
|
outputDir,
|
|
11064
|
-
deployOutputDir:
|
|
11275
|
+
deployOutputDir: _chunkLVABUXLAcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
11065
11276
|
};
|
|
11066
11277
|
}
|
|
11067
11278
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveBuildTargets, "resolveBuildTargets");
|
|
@@ -11099,12 +11310,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11099
11310
|
};
|
|
11100
11311
|
config = {
|
|
11101
11312
|
...config,
|
|
11102
|
-
images:
|
|
11313
|
+
images: _chunkRACQTC7Kcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
11103
11314
|
root: targets.root,
|
|
11104
11315
|
preset: targets.preset
|
|
11105
11316
|
})
|
|
11106
11317
|
};
|
|
11107
|
-
if (_optionalChain([config, 'access',
|
|
11318
|
+
if (_optionalChain([config, 'access', _222 => _222.docs, 'optionalAccess', _223 => _223.enabled])) await _chunkIK6LVLKCcjs.loadFarmDocsEngine.call(void 0, );
|
|
11108
11319
|
pluginManager.updateContext({ config });
|
|
11109
11320
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
11110
11321
|
_chunk5QIKR7RRcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
@@ -11118,8 +11329,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11118
11329
|
});
|
|
11119
11330
|
_chunk5QIKR7RRcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
11120
11331
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
11121
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
11122
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
11332
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _224 => _224.status]) === "rejected") throw productionViteResult.reason;
|
|
11333
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _225 => _225.value]);
|
|
11123
11334
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
11124
11335
|
projectModuleServer = await createProjectModuleServer(
|
|
11125
11336
|
createViteServer,
|
|
@@ -11127,17 +11338,17 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11127
11338
|
root,
|
|
11128
11339
|
rendererBuild.signal
|
|
11129
11340
|
);
|
|
11130
|
-
const farmApp =
|
|
11341
|
+
const farmApp = _chunkRACQTC7Kcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
11131
11342
|
await farmApp.initialize();
|
|
11132
11343
|
const routeManager = farmApp.getRouteManager();
|
|
11133
11344
|
const serverRenderer = farmApp.getServerRenderer();
|
|
11134
|
-
const typeArtifacts =
|
|
11345
|
+
const typeArtifacts = _chunk3XEMGDBFcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
11135
11346
|
root,
|
|
11136
11347
|
srcDir,
|
|
11137
11348
|
layers: config.layers,
|
|
11138
11349
|
plugins: config.plugins,
|
|
11139
11350
|
extraRoutes: [
|
|
11140
|
-
..._optionalChain([config, 'access',
|
|
11351
|
+
..._optionalChain([config, 'access', _226 => _226.openapi, 'optionalAccess', _227 => _227.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
11141
11352
|
..._chunkMY5PZYADcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
11142
11353
|
],
|
|
11143
11354
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
@@ -11222,7 +11433,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11222
11433
|
throw error;
|
|
11223
11434
|
} finally {
|
|
11224
11435
|
try {
|
|
11225
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
11436
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _228 => _228.close, 'call', _229 => _229()]);
|
|
11226
11437
|
} finally {
|
|
11227
11438
|
rendererBuild.abort();
|
|
11228
11439
|
}
|
|
@@ -11234,7 +11445,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11234
11445
|
ssr: true,
|
|
11235
11446
|
buildLifetime
|
|
11236
11447
|
});
|
|
11237
|
-
const viteConfig =
|
|
11448
|
+
const viteConfig = _chunkRACQTC7Kcjs.mergeFarmViteConfig.call(void 0,
|
|
11238
11449
|
{
|
|
11239
11450
|
root,
|
|
11240
11451
|
appType: "custom",
|
|
@@ -11246,7 +11457,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11246
11457
|
},
|
|
11247
11458
|
plugins: [
|
|
11248
11459
|
...rendererVitePlugins,
|
|
11249
|
-
|
|
11460
|
+
_chunkRACQTC7Kcjs.farmFontImportsPlugin.call(void 0, {
|
|
11250
11461
|
root,
|
|
11251
11462
|
basePath: config.basePath,
|
|
11252
11463
|
publicDir: config.publicDir
|
|
@@ -11258,7 +11469,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11258
11469
|
hmr: false
|
|
11259
11470
|
},
|
|
11260
11471
|
resolve: {
|
|
11261
|
-
alias:
|
|
11472
|
+
alias: _chunkRACQTC7Kcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
11262
11473
|
dedupe: [...config.renderer.dedupe || []]
|
|
11263
11474
|
},
|
|
11264
11475
|
optimizeDeps: {
|
|
@@ -11291,10 +11502,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11291
11502
|
noDiscovery: true
|
|
11292
11503
|
},
|
|
11293
11504
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
11294
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
11505
|
+
environments: _optionalChain([viteConfig, 'access', _230 => _230.environments, 'optionalAccess', _231 => _231.ssr, 'optionalAccess', _232 => _232.dev, 'optionalAccess', _233 => _233.createEnvironment]) ? viteConfig.environments : {
|
|
11295
11506
|
...viteConfig.environments,
|
|
11296
11507
|
ssr: {
|
|
11297
|
-
..._optionalChain([viteConfig, 'access',
|
|
11508
|
+
..._optionalChain([viteConfig, 'access', _234 => _234.environments, 'optionalAccess', _235 => _235.ssr]),
|
|
11298
11509
|
...await createFarmProjectModuleSsrEnvironment()
|
|
11299
11510
|
}
|
|
11300
11511
|
}
|
|
@@ -11352,7 +11563,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
11352
11563
|
define: {
|
|
11353
11564
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
11354
11565
|
__FARM_ENV__: JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, config.env)),
|
|
11355
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
11566
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _236 => _236.env, 'optionalAccess', _237 => _237.public]) || {})
|
|
11356
11567
|
},
|
|
11357
11568
|
plugins: [
|
|
11358
11569
|
farmI18nClientBridgePlugin(),
|
|
@@ -11387,7 +11598,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
11387
11598
|
if (pluginManager) {
|
|
11388
11599
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
11389
11600
|
}
|
|
11390
|
-
const outputDir =
|
|
11601
|
+
const outputDir = _chunkLVABUXLAcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
11391
11602
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
11392
11603
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
11393
11604
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -11458,7 +11669,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
11458
11669
|
root,
|
|
11459
11670
|
preset,
|
|
11460
11671
|
distDir,
|
|
11461
|
-
outputDir:
|
|
11672
|
+
outputDir: _chunkLVABUXLAcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
11462
11673
|
});
|
|
11463
11674
|
}
|
|
11464
11675
|
}
|