@farm.js/core 0.1.50 → 0.1.51-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -3
- package/dist/{agent-mcp-9BMbRgg_.d.ts → agent-mcp-BBMfNpsC.d.ts} +1 -1
- package/dist/{agent-mcp-CIMH324y.d.mts → agent-mcp-D44ip11f.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/{analyzer-DDW34OMC.mjs → analyzer-HOUCQR3K.mjs} +1 -1
- package/dist/{analyzer-CN7C74WX.cjs → analyzer-VKUDHNDF.cjs} +2 -2
- package/dist/api/route-manager.cjs +5 -5
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +4 -4
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +6 -6
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +5 -5
- package/dist/{app-BWibTHVT.d.ts → app-CourU3rQ.d.ts} +4 -4
- package/dist/{app-DVJ13FPA.d.mts → app-aeD4s_mg.d.mts} +4 -4
- package/dist/{app-manifest-CQDJOKL2.d.mts → app-manifest-BC6mFn5A.d.mts} +1 -1
- package/dist/{app-manifest-D0kaXdwu.d.ts → app-manifest-LzjoNPeq.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/base-path-BOUV5ozD.d.mts +10 -0
- package/dist/base-path-BOUV5ozD.d.ts +10 -0
- package/dist/{chunk-RWT2BTJT.cjs → chunk-2IAPKPEB.cjs} +6 -6
- package/dist/{chunk-2G63BIRL.mjs → chunk-2KVDHNQS.mjs} +8 -11
- package/dist/{chunk-76R5GJER.mjs → chunk-3HA7PP72.mjs} +2 -2
- package/dist/{chunk-NJVFPJ2Y.cjs → chunk-3OWVWZ6R.cjs} +28 -2
- package/dist/{chunk-KO2NWUKN.mjs → chunk-4GJJ65RB.mjs} +9 -1
- package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
- package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
- package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
- package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
- package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
- package/dist/{chunk-CPXDDWGL.mjs → chunk-AER5I65K.mjs} +1 -1
- package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
- package/dist/{chunk-WVBUXNBX.mjs → chunk-AMRK3P6W.mjs} +123 -47
- package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
- package/dist/chunk-CKPTIEDX.cjs +12 -0
- package/dist/{chunk-B5S2JS6M.cjs → chunk-DWW3AMJX.cjs} +288 -255
- package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
- package/dist/{chunk-3ATXWZPH.cjs → chunk-E36C43IX.cjs} +13 -16
- package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
- package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
- package/dist/{chunk-474FO3UE.cjs → chunk-F42U3R4F.cjs} +170 -163
- package/dist/{chunk-6QA2SXVH.cjs → chunk-FK25QSVC.cjs} +2 -1
- package/dist/{chunk-BW6SCVYX.mjs → chunk-FSQMN2MQ.mjs} +1 -0
- package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
- package/dist/chunk-GNZIAJGB.mjs +358 -0
- package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
- package/dist/{chunk-B6PREBN6.cjs → chunk-HASX6DC7.cjs} +8 -8
- package/dist/{chunk-ZLOQQ2UF.mjs → chunk-I2ZA5SXS.mjs} +60 -27
- package/dist/{chunk-X2EL3BLH.cjs → chunk-IOUOGRDX.cjs} +11 -3
- package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
- package/dist/{chunk-GOOK2J2W.cjs → chunk-J22JD5YJ.cjs} +2 -2
- package/dist/{chunk-2DEPNLXK.mjs → chunk-JF5CNHHF.mjs} +4 -4
- package/dist/{chunk-VOZ5DI7D.mjs → chunk-JWI5PUO2.mjs} +6 -2
- package/dist/{chunk-YAXOEAND.cjs → chunk-KHXAJ2KA.cjs} +6 -6
- package/dist/{chunk-WXHDVXJE.mjs → chunk-KY32FWK7.mjs} +2 -2
- package/dist/{chunk-EQWWOQTK.cjs → chunk-LEIXUFJN.cjs} +6 -2
- package/dist/{chunk-2GLQSIZD.mjs → chunk-LMFJCXDD.mjs} +1 -1
- package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
- package/dist/{chunk-5V4KZOZO.mjs → chunk-LZ4SB57H.mjs} +2 -2
- package/dist/{chunk-E2BMCNMJ.cjs → chunk-MMEEXMUQ.cjs} +2 -2
- package/dist/chunk-N4AQNEXR.cjs +17 -0
- package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
- package/dist/{chunk-LYWAGXXW.cjs → chunk-O3MMJPC2.cjs} +12 -12
- package/dist/{chunk-FACTMUPI.cjs → chunk-PDJSL7PL.cjs} +30 -19
- package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
- package/dist/chunk-PIUTGRDI.cjs +358 -0
- package/dist/{chunk-KGP76FSV.mjs → chunk-PPDHCRTC.mjs} +1 -1
- package/dist/{chunk-C73RIAEF.mjs → chunk-QI5AQMEE.mjs} +17 -6
- package/dist/{chunk-F5LERVY3.cjs → chunk-QK3HBOTG.cjs} +10 -10
- package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
- package/dist/{chunk-JJOWY3XD.mjs → chunk-R5P4KFPM.mjs} +1 -1
- package/dist/{chunk-IWJKJDNW.mjs → chunk-S5ZA2T2W.mjs} +35 -28
- package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
- package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
- package/dist/{chunk-KZH6YLND.cjs → chunk-SO3T6T4I.cjs} +427 -351
- package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
- package/dist/{chunk-7ONZDKVY.mjs → chunk-T4EW7AAD.mjs} +2 -2
- package/dist/{chunk-UY6HS5PF.cjs → chunk-USL2ANCB.cjs} +8 -8
- package/dist/{chunk-4T25YCZ5.cjs → chunk-VIFPE5RG.cjs} +14 -14
- package/dist/{chunk-HYN3LLG7.cjs → chunk-VO6NLTV4.cjs} +3 -3
- package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
- package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
- package/dist/{chunk-X3HOVNHI.mjs → chunk-WSY2JD7O.mjs} +6 -6
- package/dist/{chunk-SHJJM6OG.mjs → chunk-WVX3BUNJ.mjs} +1 -1
- package/dist/chunk-X3EFRVXY.mjs +12 -0
- package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
- package/dist/{chunk-RHOR2J6V.cjs → chunk-X5BCMLGP.cjs} +1 -1
- package/dist/{chunk-IQXGHGZF.cjs → chunk-XB24LZWI.cjs} +5 -5
- package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
- package/dist/{chunk-CGCJ2TJU.cjs → chunk-XPMC4E2G.cjs} +3 -3
- package/dist/{chunk-HWCHIBJZ.mjs → chunk-XWC5NAHV.mjs} +4 -4
- package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
- package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
- package/dist/{chunk-IUBDMDZZ.cjs → chunk-Y7TLL65B.cjs} +4 -4
- package/dist/{chunk-M7LKA632.mjs → chunk-YLNBWUVS.mjs} +1 -1
- package/dist/chunk-Z5A6CNV2.mjs +60 -0
- package/dist/chunk-Z64V4WZI.mjs +17 -0
- package/dist/{chunk-2VCC3GVC.mjs → chunk-ZF3GX4O7.mjs} +1 -1
- package/dist/{client-plugins-BPfltM5m.d.ts → client-plugins-CFBEfVPO.d.ts} +20 -3
- package/dist/{client-plugins-D4RO59f0.d.mts → client-plugins-cqy_dQd0.d.mts} +20 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +5 -4
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +4 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/cron.cjs +4 -4
- package/dist/cron.mjs +3 -3
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-STG7HPRV.mjs → devtools-4MLL3RAL.mjs} +6 -6
- package/dist/{devtools-N5XTOECL.cjs → devtools-4ZLMD454.cjs} +8 -8
- package/dist/docs.cjs +10 -10
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +9 -9
- package/dist/{index-k8o8eUOd.d.mts → index-BYkNbeQV.d.mts} +1 -1
- package/dist/{index-C-N3Pwg-.d.ts → index-BxjN_UDZ.d.ts} +1 -1
- package/dist/index.cjs +42 -40
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +41 -39
- 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 +32 -31
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +31 -30
- package/dist/internal/cli-runtime.cjs +15 -15
- package/dist/internal/cli-runtime.mjs +14 -14
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +4 -2
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/client-runtime.mjs +3 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/form-actions.cjs +4 -3
- package/dist/internal/form-actions.mjs +3 -2
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- package/dist/internal/islands-runtime.cjs +56 -0
- package/dist/internal/islands-runtime.mjs +57 -1
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +11 -8
- package/dist/internal/production-runtime.d.mts +24 -11
- package/dist/internal/production-runtime.d.ts +24 -11
- package/dist/internal/production-runtime.mjs +10 -7
- package/dist/internal/server-fn-transform.cjs +13 -0
- package/dist/internal/server-fn-transform.d.mts +24 -0
- package/dist/internal/server-fn-transform.d.ts +24 -0
- package/dist/internal/server-fn-transform.mjs +13 -0
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +7 -7
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/middleware.mjs +6 -6
- package/dist/mobile.d.mts +30 -3
- package/dist/mobile.d.ts +30 -3
- package/dist/{navigation-delegate-8xg3Zvp4.d.ts → navigation-delegate-BU4xqdnw.d.ts} +1 -1
- package/dist/{navigation-delegate-ji6elCKy.d.mts → navigation-delegate-DLhbfEN4.d.mts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{nitro-YPSZBYDK.cjs → nitro-CK7M4RMY.cjs} +11 -11
- package/dist/{nitro-2Q5NVY7L.mjs → nitro-R444AF3O.mjs} +7 -7
- package/dist/plugin.cjs +25 -23
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +24 -22
- package/dist/{production-runtime-TdKaYRj0.d.ts → production-runtime-C78A8YgK.d.ts} +1 -1
- package/dist/{production-runtime-DXnQQkQf.d.mts → production-runtime-DLA4J5WG.d.mts} +1 -1
- package/dist/{programmatic-routes-client-BwiTndEC.d.ts → programmatic-routes-client-CBqkNhBy.d.ts} +2 -2
- package/dist/{programmatic-routes-client-Dh1SDLSM.d.mts → programmatic-routes-client-NpqGBn-i.d.mts} +2 -2
- package/dist/{render-plan-BvCGXF6K.d.mts → render-plan-C9sWvDTv.d.mts} +1 -1
- package/dist/{render-plan-BPbwRbuN.d.ts → render-plan-CrqcBbnV.d.ts} +1 -1
- package/dist/renderer-client.cjs +8 -6
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/renderer-client.mjs +4 -2
- package/dist/{request-B8PGTZNR.d.ts → request-BizeuqD7.d.ts} +1 -1
- package/dist/{request-C_xTkJib.d.mts → request-WwB1-Uim.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering-RNtcj607.d.ts → route-rendering-BGhJN64l.d.ts} +1 -1
- package/dist/{route-rendering-DlddURL1.d.mts → route-rendering-S6NFjnx4.d.mts} +1 -1
- package/dist/{router-B97eB0Mq.d.mts → router-BIheIy9G.d.mts} +1 -1
- package/dist/{router-qUVaoEN8.d.ts → router-BUD_j2EL.d.ts} +1 -1
- package/dist/routes.cjs +3 -2
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.mjs +2 -1
- package/dist/{rsc-pipeline-L4XOZ2TE.cjs → rsc-pipeline-JRGUZBYM.cjs} +11 -11
- package/dist/{rsc-pipeline-T3775JUA.mjs → rsc-pipeline-OLAVIKI3.mjs} +10 -10
- package/dist/{runtime-C8GUnNeP.d.ts → runtime-CWP-21hP.d.ts} +1 -1
- package/dist/{runtime-CaDswfWi.d.mts → runtime-CgJwe6H_.d.mts} +1 -1
- package/dist/{runtime-BIBGJO7V.cjs → runtime-G23RSLEK.cjs} +14 -14
- package/dist/{runtime-HRSFC4ZC.mjs → runtime-OGCHDACZ.mjs} +12 -12
- package/dist/{schema-dev-notice-LZ5NXGLN.mjs → schema-dev-notice-F6QYSOAI.mjs} +2 -2
- package/dist/{schema-dev-notice-XV7GZ3QJ.cjs → schema-dev-notice-UU7DMZEU.cjs} +3 -3
- package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
- package/dist/search-client-ZZLKVO5R.cjs +15 -0
- package/dist/server-action-security.cjs +2 -2
- package/dist/server-action-security.mjs +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-query-client.cjs +4 -3
- package/dist/server-query-client.mjs +3 -2
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +57 -55
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +34 -32
- package/dist/{spa-router-Dlv5ofg0.d.mts → spa-router-CVOL0Vrq.d.mts} +2 -2
- package/dist/{spa-router-qapSboKz.d.ts → spa-router-Kytv4jSB.d.ts} +2 -2
- package/dist/testing.cjs +12 -11
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +9 -8
- package/dist/{utils-A-cYF81u.d.ts → utils-DbyXlzaj.d.ts} +1 -1
- package/dist/{utils-DyvlSxFk.d.mts → utils-Dsa1HZ7X.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +25 -23
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +24 -22
- package/dist/workflows.cjs +4 -4
- package/dist/workflows.mjs +3 -3
- package/package.json +8 -3
- package/dist/base-path-leyrqXbX.d.mts +0 -19
- package/dist/base-path-leyrqXbX.d.ts +0 -19
- package/dist/chunk-OTOOJIUB.mjs +0 -34
- package/dist/search-client-QCYAL6AY.cjs +0 -13
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
+
var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
@@ -18,7 +18,7 @@ var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkVIFPE5RGcjs = require('./chunk-VIFPE5RG.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -29,15 +29,15 @@ var _chunk4T25YCZ5cjs = require('./chunk-4T25YCZ5.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkIOUOGRDXcjs = require('./chunk-IOUOGRDX.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkVO6NLTV4cjs = require('./chunk-VO6NLTV4.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
|
|
@@ -52,7 +52,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
var
|
|
55
|
+
var _chunkO3MMJPC2cjs = require('./chunk-O3MMJPC2.cjs');
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
@@ -84,10 +84,10 @@ var _chunkLYWAGXXWcjs = require('./chunk-LYWAGXXW.cjs');
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
var
|
|
87
|
+
var _chunkF42U3R4Fcjs = require('./chunk-F42U3R4F.cjs');
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
var
|
|
90
|
+
var _chunkLNM57D3Hcjs = require('./chunk-LNM57D3H.cjs');
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
@@ -95,7 +95,7 @@ var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
var
|
|
98
|
+
var _chunkY7TLL65Bcjs = require('./chunk-Y7TLL65B.cjs');
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
@@ -108,7 +108,7 @@ var _chunkIUBDMDZZcjs = require('./chunk-IUBDMDZZ.cjs');
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
var
|
|
111
|
+
var _chunk76GHW3WIcjs = require('./chunk-76GHW3WI.cjs');
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
@@ -122,7 +122,7 @@ var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
|
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
|
|
125
|
-
var
|
|
125
|
+
var _chunkJ22JD5YJcjs = require('./chunk-J22JD5YJ.cjs');
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
|
|
@@ -174,16 +174,16 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
|
|
177
|
-
var
|
|
177
|
+
var _chunkXB24LZWIcjs = require('./chunk-XB24LZWI.cjs');
|
|
178
178
|
|
|
179
179
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
|
|
183
|
-
var
|
|
183
|
+
var _chunkXYL4HSVCcjs = require('./chunk-XYL4HSVC.cjs');
|
|
184
184
|
|
|
185
185
|
|
|
186
|
-
var
|
|
186
|
+
var _chunkFK25QSVCcjs = require('./chunk-FK25QSVC.cjs');
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
var _chunkWJFFPXCVcjs = require('./chunk-WJFFPXCV.cjs');
|
|
@@ -201,10 +201,10 @@ var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
|
|
|
201
201
|
|
|
202
202
|
|
|
203
203
|
|
|
204
|
-
var
|
|
204
|
+
var _chunkB3GZAQSCcjs = require('./chunk-B3GZAQSC.cjs');
|
|
205
205
|
|
|
206
206
|
|
|
207
|
-
var
|
|
207
|
+
var _chunkKHXAJ2KAcjs = require('./chunk-KHXAJ2KA.cjs');
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
|
|
@@ -224,14 +224,14 @@ var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
|
|
|
224
224
|
|
|
225
225
|
|
|
226
226
|
|
|
227
|
-
var
|
|
227
|
+
var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
|
|
232
232
|
|
|
233
233
|
|
|
234
|
-
var
|
|
234
|
+
var _chunkX5BCMLGPcjs = require('./chunk-X5BCMLGP.cjs');
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
|
|
@@ -338,7 +338,7 @@ function getDocsTitle(docs) {
|
|
|
338
338
|
return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
|
|
339
339
|
}
|
|
340
340
|
function loadPages(contentDir, docs) {
|
|
341
|
-
return
|
|
341
|
+
return _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkIOUOGRDXcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
|
|
342
342
|
}
|
|
343
343
|
function findSocialImagePath(html) {
|
|
344
344
|
const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
|
|
@@ -356,14 +356,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
|
|
|
356
356
|
return response;
|
|
357
357
|
}
|
|
358
358
|
async function compileFarmDocsManifest(docs, options) {
|
|
359
|
-
const contentDir =
|
|
359
|
+
const contentDir = _chunkIOUOGRDXcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
|
|
360
360
|
const pages = loadPages(contentDir, docs);
|
|
361
361
|
const absolutePaths = [
|
|
362
362
|
_path2.default.resolve(options.root),
|
|
363
363
|
_path2.default.resolve(contentDir),
|
|
364
364
|
docs.configPath || ""
|
|
365
365
|
];
|
|
366
|
-
const handler =
|
|
366
|
+
const handler = _chunkIOUOGRDXcjs.createFarmDocsHandler.call(void 0, docs, {
|
|
367
367
|
root: options.root,
|
|
368
368
|
srcDir: options.srcDir,
|
|
369
369
|
clientEntry: options.clientEntry,
|
|
@@ -372,7 +372,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
372
372
|
globalStylesheetHref: options.globalStylesheetHref,
|
|
373
373
|
isPathGuarded: options.isPathGuarded
|
|
374
374
|
});
|
|
375
|
-
const apiHandler =
|
|
375
|
+
const apiHandler = _chunkVIFPE5RGcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
376
376
|
rootDir: options.root,
|
|
377
377
|
srcDir: options.srcDir,
|
|
378
378
|
docs,
|
|
@@ -383,7 +383,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
383
383
|
const apiMarkdown = {};
|
|
384
384
|
for (const page of pages) {
|
|
385
385
|
const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
|
|
386
|
-
const markdownPath =
|
|
386
|
+
const markdownPath = _chunkIOUOGRDXcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
|
|
387
387
|
await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
|
|
388
388
|
if (htmlResponse) {
|
|
389
389
|
const socialImagePath = findSocialImagePath(await htmlResponse.text());
|
|
@@ -467,7 +467,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
467
467
|
post: await compileResponse(postResponse, absolutePaths),
|
|
468
468
|
search: {
|
|
469
469
|
pages: publicPages.map((page) => ({
|
|
470
|
-
...
|
|
470
|
+
..._chunkIOUOGRDXcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
471
471
|
sourcePath: `farm-docs:${page.slug || "index"}`
|
|
472
472
|
})),
|
|
473
473
|
search: _nullishCoalesce(searchConfig, () => ( true)),
|
|
@@ -520,7 +520,7 @@ function collectFarmClientModulePreloads(bundle, options) {
|
|
|
520
520
|
const moduleId = chunk.facadeModuleId.split("?")[0];
|
|
521
521
|
if (!_path2.default.isAbsolute(moduleId)) continue;
|
|
522
522
|
const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
|
|
523
|
-
modules[
|
|
523
|
+
modules[_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
|
|
524
524
|
chunk.fileName,
|
|
525
525
|
...staticImports(chunk, loaded, [])
|
|
526
526
|
].map(index);
|
|
@@ -645,7 +645,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
645
645
|
const routes = [];
|
|
646
646
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
647
647
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
648
|
-
const rendering = await
|
|
648
|
+
const rendering = await _chunkY7TLL65Bcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
649
649
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
650
650
|
routes.push({
|
|
651
651
|
kind: "page",
|
|
@@ -1083,6 +1083,75 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
|
|
|
1083
1083
|
};
|
|
1084
1084
|
}
|
|
1085
1085
|
|
|
1086
|
+
// src/middleware/static-config.ts
|
|
1087
|
+
function literalMatcher(node) {
|
|
1088
|
+
if (!node) return void 0;
|
|
1089
|
+
if (node.type === "Literal" && typeof node.value === "string") return node.value;
|
|
1090
|
+
if (node.type === "Literal" && node.regex)
|
|
1091
|
+
return new RegExp(node.regex.pattern, node.regex.flags);
|
|
1092
|
+
if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
|
|
1093
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _20 => _20.quasis, 'access', _21 => _21[0], 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.cooked]), () => ( void 0));
|
|
1094
|
+
}
|
|
1095
|
+
return void 0;
|
|
1096
|
+
}
|
|
1097
|
+
function literalMatchers(node) {
|
|
1098
|
+
const values = node.type === "ArrayExpression" ? node.elements : [node];
|
|
1099
|
+
const matchers = [];
|
|
1100
|
+
for (const value of values) {
|
|
1101
|
+
const matcher = literalMatcher(value);
|
|
1102
|
+
if (matcher === void 0) return void 0;
|
|
1103
|
+
matchers.push(matcher);
|
|
1104
|
+
}
|
|
1105
|
+
return matchers;
|
|
1106
|
+
}
|
|
1107
|
+
function unwrap(node) {
|
|
1108
|
+
while (node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "ParenthesizedExpression") {
|
|
1109
|
+
node = node.expression;
|
|
1110
|
+
}
|
|
1111
|
+
return node;
|
|
1112
|
+
}
|
|
1113
|
+
function readStaticMiddlewareConfig(program) {
|
|
1114
|
+
let found = null;
|
|
1115
|
+
for (const statement of program.body) {
|
|
1116
|
+
if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
|
|
1117
|
+
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _24 => _24.exported, 'optionalAccess', _25 => _25.name]) === "config")) {
|
|
1118
|
+
return "unknown";
|
|
1119
|
+
}
|
|
1120
|
+
continue;
|
|
1121
|
+
}
|
|
1122
|
+
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
|
|
1123
|
+
if (!declaration || declaration.type !== "VariableDeclaration") continue;
|
|
1124
|
+
for (const declarator of declaration.declarations) {
|
|
1125
|
+
if (_optionalChain([declarator, 'access', _26 => _26.id, 'optionalAccess', _27 => _27.type]) !== "Identifier" || declarator.id.name !== "config") continue;
|
|
1126
|
+
if (declaration.kind !== "const" || !declarator.init) return "unknown";
|
|
1127
|
+
const init = unwrap(declarator.init);
|
|
1128
|
+
if (init.type !== "ObjectExpression") return "unknown";
|
|
1129
|
+
const config = {};
|
|
1130
|
+
for (const property of init.properties) {
|
|
1131
|
+
if (property.type !== "Property" || property.computed) return "unknown";
|
|
1132
|
+
const key = _nullishCoalesce(_optionalChain([property, 'access', _28 => _28.key, 'optionalAccess', _29 => _29.name]), () => ( _optionalChain([property, 'access', _30 => _30.key, 'optionalAccess', _31 => _31.value])));
|
|
1133
|
+
if (key !== "matcher" && key !== "exclude") continue;
|
|
1134
|
+
const matchers = literalMatchers(unwrap(property.value));
|
|
1135
|
+
if (!matchers) return "unknown";
|
|
1136
|
+
if (key === "matcher") config.matcher = matchers;
|
|
1137
|
+
else config.exclude = matchers;
|
|
1138
|
+
}
|
|
1139
|
+
found = config;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return found;
|
|
1143
|
+
}
|
|
1144
|
+
async function readMiddlewareFileConfig(filePath) {
|
|
1145
|
+
try {
|
|
1146
|
+
const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
|
|
1147
|
+
const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
|
|
1148
|
+
if (_optionalChain([parsed, 'access', _32 => _32.errors, 'optionalAccess', _33 => _33.length])) return "unknown";
|
|
1149
|
+
return readStaticMiddlewareConfig(parsed.program);
|
|
1150
|
+
} catch (e7) {
|
|
1151
|
+
return "unknown";
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1086
1155
|
// src/nitro/universal-build.ts
|
|
1087
1156
|
function preloadFarmNitroBuilder() {
|
|
1088
1157
|
return import("nitro/builder").then(
|
|
@@ -1099,7 +1168,7 @@ function findFarmCoreRoot(from) {
|
|
|
1099
1168
|
if (_fs.existsSync.call(void 0, manifest)) {
|
|
1100
1169
|
try {
|
|
1101
1170
|
if (JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core") return dir;
|
|
1102
|
-
} catch (
|
|
1171
|
+
} catch (e8) {
|
|
1103
1172
|
}
|
|
1104
1173
|
}
|
|
1105
1174
|
dir = _path2.default.dirname(dir);
|
|
@@ -1117,7 +1186,7 @@ function findInstalledPackageDir(name, from) {
|
|
|
1117
1186
|
if (_fs.existsSync.call(void 0, _path2.default.join(candidate, "package.json"))) {
|
|
1118
1187
|
try {
|
|
1119
1188
|
return _fs.realpathSync.call(void 0, candidate);
|
|
1120
|
-
} catch (
|
|
1189
|
+
} catch (e9) {
|
|
1121
1190
|
return null;
|
|
1122
1191
|
}
|
|
1123
1192
|
}
|
|
@@ -1133,7 +1202,7 @@ function collectFarmDependencyDirs(root) {
|
|
|
1133
1202
|
let manifest;
|
|
1134
1203
|
try {
|
|
1135
1204
|
manifest = JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(dir, "package.json"), "utf8"));
|
|
1136
|
-
} catch (
|
|
1205
|
+
} catch (e10) {
|
|
1137
1206
|
return;
|
|
1138
1207
|
}
|
|
1139
1208
|
for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
|
|
@@ -1149,7 +1218,7 @@ function collectFarmDependencyDirs(root) {
|
|
|
1149
1218
|
if (name.startsWith("@farm.js/")) queue.push({ name, from: root });
|
|
1150
1219
|
}
|
|
1151
1220
|
}
|
|
1152
|
-
} catch (
|
|
1221
|
+
} catch (e11) {
|
|
1153
1222
|
}
|
|
1154
1223
|
for (let next = queue.pop(); next; next = queue.pop()) {
|
|
1155
1224
|
const dir = findInstalledPackageDir(next.name, next.from);
|
|
@@ -1239,14 +1308,14 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
|
|
|
1239
1308
|
return {
|
|
1240
1309
|
name: "farm-prerender-runtime-resolver",
|
|
1241
1310
|
async resolveId(id, _importer, options) {
|
|
1242
|
-
if (_optionalChain([options, 'access',
|
|
1311
|
+
if (_optionalChain([options, 'access', _34 => _34.custom, 'optionalAccess', _35 => _35.farmPrerenderRuntimeResolve])) return null;
|
|
1243
1312
|
if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
|
|
1244
1313
|
return null;
|
|
1245
1314
|
}
|
|
1246
1315
|
if (nitroEntry === void 0) {
|
|
1247
1316
|
try {
|
|
1248
1317
|
nitroEntry = resolveNitroEntry(root);
|
|
1249
|
-
} catch (
|
|
1318
|
+
} catch (e12) {
|
|
1250
1319
|
nitroEntry = null;
|
|
1251
1320
|
}
|
|
1252
1321
|
}
|
|
@@ -1267,7 +1336,7 @@ function createFarmStorageModuleRegistration(config) {
|
|
|
1267
1336
|
let runtimeRequire = projectRequire;
|
|
1268
1337
|
try {
|
|
1269
1338
|
runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
1270
|
-
} catch (
|
|
1339
|
+
} catch (e13) {
|
|
1271
1340
|
}
|
|
1272
1341
|
const loaders = [];
|
|
1273
1342
|
for (const specifier of modules) {
|
|
@@ -1276,7 +1345,7 @@ function createFarmStorageModuleRegistration(config) {
|
|
|
1276
1345
|
try {
|
|
1277
1346
|
resolved = require2.resolve(specifier);
|
|
1278
1347
|
break;
|
|
1279
|
-
} catch (
|
|
1348
|
+
} catch (e14) {
|
|
1280
1349
|
}
|
|
1281
1350
|
}
|
|
1282
1351
|
if (resolved) {
|
|
@@ -1294,7 +1363,7 @@ function resolveNitroPackageEntry(root) {
|
|
|
1294
1363
|
let runtimeRequire = projectRequire;
|
|
1295
1364
|
try {
|
|
1296
1365
|
runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
1297
|
-
} catch (
|
|
1366
|
+
} catch (e15) {
|
|
1298
1367
|
}
|
|
1299
1368
|
return runtimeRequire.resolve("nitro");
|
|
1300
1369
|
}
|
|
@@ -1348,7 +1417,7 @@ async function canUseRolldownBuilder() {
|
|
|
1348
1417
|
try {
|
|
1349
1418
|
await import("rolldown");
|
|
1350
1419
|
return true;
|
|
1351
|
-
} catch (
|
|
1420
|
+
} catch (e16) {
|
|
1352
1421
|
return false;
|
|
1353
1422
|
}
|
|
1354
1423
|
}
|
|
@@ -1362,7 +1431,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
1362
1431
|
try {
|
|
1363
1432
|
_module.createRequire.call(void 0, _path2.default.join(root, "package.json")).resolve("react-dom/server.edge");
|
|
1364
1433
|
return true;
|
|
1365
|
-
} catch (
|
|
1434
|
+
} catch (e17) {
|
|
1366
1435
|
return false;
|
|
1367
1436
|
}
|
|
1368
1437
|
}
|
|
@@ -1400,7 +1469,7 @@ function isFarmCoreModule(file) {
|
|
|
1400
1469
|
if (_fs.existsSync.call(void 0, manifest)) {
|
|
1401
1470
|
try {
|
|
1402
1471
|
return JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core";
|
|
1403
|
-
} catch (
|
|
1472
|
+
} catch (e18) {
|
|
1404
1473
|
return false;
|
|
1405
1474
|
}
|
|
1406
1475
|
}
|
|
@@ -1433,7 +1502,7 @@ function createMetadataImageWasmPlugin() {
|
|
|
1433
1502
|
return {
|
|
1434
1503
|
name: "farm-metadata-image-wasm",
|
|
1435
1504
|
resolveId(source, importer) {
|
|
1436
|
-
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
1505
|
+
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _36 => _36.replace, 'call', _37 => _37(/\\/g, "/"), 'access', _38 => _38.includes, 'call', _39 => _39("/@vercel/og/")])) {
|
|
1437
1506
|
return null;
|
|
1438
1507
|
}
|
|
1439
1508
|
const requestPath = source.slice(0, -"?module".length);
|
|
@@ -1509,9 +1578,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
|
|
|
1509
1578
|
return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
|
|
1510
1579
|
}
|
|
1511
1580
|
function nameCodeSplittingGroups(bundlerConfig) {
|
|
1512
|
-
const outputs = _optionalChain([bundlerConfig, 'optionalAccess',
|
|
1581
|
+
const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _40 => _40.output]);
|
|
1513
1582
|
for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
|
|
1514
|
-
const groups = _optionalChain([output, 'optionalAccess',
|
|
1583
|
+
const groups = _optionalChain([output, 'optionalAccess', _41 => _41.codeSplitting, 'optionalAccess', _42 => _42.groups]);
|
|
1515
1584
|
if (!Array.isArray(groups)) continue;
|
|
1516
1585
|
groups.forEach((group, index) => {
|
|
1517
1586
|
if (group && typeof group.name === "function" && !group.debugName) {
|
|
@@ -1567,9 +1636,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
|
|
|
1567
1636
|
if (needsAst) {
|
|
1568
1637
|
replacements.length = 0;
|
|
1569
1638
|
const restore = (node) => {
|
|
1570
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1639
|
+
if (_optionalChain([node, 'optionalAccess', _43 => _43.type]) !== "TemplateLiteral") return;
|
|
1571
1640
|
const template = node;
|
|
1572
|
-
const value = _optionalChain([template, 'access',
|
|
1641
|
+
const value = _optionalChain([template, 'access', _44 => _44.quasis, 'access', _45 => _45[0], 'optionalAccess', _46 => _46.value, 'access', _47 => _47.cooked]);
|
|
1573
1642
|
if (template.expressions.length > 0 || typeof value !== "string") return;
|
|
1574
1643
|
replacements.push({
|
|
1575
1644
|
start: template.start,
|
|
@@ -1617,7 +1686,7 @@ function trimSlashes(value) {
|
|
|
1617
1686
|
return value.replace(/^\/+|\/+$/g, "");
|
|
1618
1687
|
}
|
|
1619
1688
|
function resolveBuildDocsContentDir(config, root) {
|
|
1620
|
-
if (!_optionalChain([config, 'access',
|
|
1689
|
+
if (!_optionalChain([config, 'access', _48 => _48.docs, 'optionalAccess', _49 => _49.enabled])) return null;
|
|
1621
1690
|
const configuredContentDir = config.docs.contentDir || config.docs.config.contentDir;
|
|
1622
1691
|
if (typeof configuredContentDir === "string" && configuredContentDir.trim()) {
|
|
1623
1692
|
const contentDir = _path2.default.isAbsolute(configuredContentDir) ? configuredContentDir : _path2.default.join(root, configuredContentDir);
|
|
@@ -1648,7 +1717,7 @@ function hasProjectPostcssConfig(root) {
|
|
|
1648
1717
|
try {
|
|
1649
1718
|
projectRequire.resolve(`./${file}`);
|
|
1650
1719
|
return true;
|
|
1651
|
-
} catch (
|
|
1720
|
+
} catch (e19) {
|
|
1652
1721
|
return false;
|
|
1653
1722
|
}
|
|
1654
1723
|
});
|
|
@@ -1670,7 +1739,7 @@ async function findFarmConfigPath(root) {
|
|
|
1670
1739
|
try {
|
|
1671
1740
|
await fs4.access(resolvedPath);
|
|
1672
1741
|
return resolvedPath;
|
|
1673
|
-
} catch (
|
|
1742
|
+
} catch (e20) {
|
|
1674
1743
|
}
|
|
1675
1744
|
}
|
|
1676
1745
|
return null;
|
|
@@ -1699,7 +1768,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
1699
1768
|
let entries;
|
|
1700
1769
|
try {
|
|
1701
1770
|
entries = await fs4.readdir(dir, { withFileTypes: true });
|
|
1702
|
-
} catch (
|
|
1771
|
+
} catch (e21) {
|
|
1703
1772
|
return;
|
|
1704
1773
|
}
|
|
1705
1774
|
const middlewareFile = entries.find(
|
|
@@ -1718,8 +1787,8 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
1718
1787
|
}
|
|
1719
1788
|
await walk(
|
|
1720
1789
|
_path2.default.join(dir, entry.name),
|
|
1721
|
-
|
|
1722
|
-
|
|
1790
|
+
_chunkB3GZAQSCcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
|
|
1791
|
+
_chunkB3GZAQSCcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
|
|
1723
1792
|
discovered
|
|
1724
1793
|
);
|
|
1725
1794
|
}
|
|
@@ -1731,10 +1800,10 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
1731
1800
|
routes.set(route.directory, route);
|
|
1732
1801
|
}
|
|
1733
1802
|
}
|
|
1734
|
-
return Array.from(routes.values()).sort(
|
|
1803
|
+
return Array.from(routes.values()).sort(_chunkB3GZAQSCcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
1735
1804
|
}
|
|
1736
1805
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
1737
|
-
if (!_optionalChain([config, 'access',
|
|
1806
|
+
if (!_optionalChain([config, 'access', _50 => _50.docs, 'optionalAccess', _51 => _51.enabled]) || !_optionalChain([config, 'access', _52 => _52.docs, 'access', _53 => _53.adapter, 'optionalAccess', _54 => _54.server]) || _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
1738
1807
|
return;
|
|
1739
1808
|
}
|
|
1740
1809
|
throw new Error(
|
|
@@ -1747,13 +1816,13 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1747
1816
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
1748
1817
|
const srcDir = config.srcDir || "src";
|
|
1749
1818
|
const distDir = config.distDir || ".farm";
|
|
1750
|
-
const deployOutputDir =
|
|
1819
|
+
const deployOutputDir = _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
1751
1820
|
const lifecyclePluginManager = options.pluginManager;
|
|
1752
1821
|
const productionViteResultPromise = Promise.allSettled([
|
|
1753
1822
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
1754
1823
|
]);
|
|
1755
1824
|
const nitroBuilderResultPromise = preloadFarmNitroBuilder();
|
|
1756
|
-
|
|
1825
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
|
|
1757
1826
|
const rendererBuild = options.rendererBuildLifetime ? void 0 : new AbortController();
|
|
1758
1827
|
const rendererBuildLifetime = _nullishCoalesce(options.rendererBuildLifetime, () => ( rendererBuild.signal));
|
|
1759
1828
|
try {
|
|
@@ -1790,7 +1859,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1790
1859
|
fallback: entry.fallback
|
|
1791
1860
|
})
|
|
1792
1861
|
);
|
|
1793
|
-
|
|
1862
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
|
|
1794
1863
|
const fs4 = await import("fs/promises");
|
|
1795
1864
|
const layoutRoutes = [];
|
|
1796
1865
|
const appDir = _path2.default.join(root, srcDir, "app");
|
|
@@ -1808,7 +1877,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1808
1877
|
await findLayoutsForClient(_path2.default.join(dir, entry.name), childPrefix);
|
|
1809
1878
|
}
|
|
1810
1879
|
}
|
|
1811
|
-
} catch (
|
|
1880
|
+
} catch (e22) {
|
|
1812
1881
|
}
|
|
1813
1882
|
}
|
|
1814
1883
|
await findLayoutsForClient(appDir);
|
|
@@ -1818,7 +1887,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1818
1887
|
seenLayoutPatterns.add(pattern);
|
|
1819
1888
|
layoutRoutes.push({ pattern, modulePath: entry.modulePath });
|
|
1820
1889
|
}
|
|
1821
|
-
|
|
1890
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
|
|
1822
1891
|
const isolatedClientBoundaryModules = routeManager.getIsolatedClientBoundaryModules(root);
|
|
1823
1892
|
const islandsErrors = routeManager.getIslandsErrors(root);
|
|
1824
1893
|
if (islandsErrors.length > 0) {
|
|
@@ -1836,7 +1905,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1836
1905
|
throw productionViteResult.reason;
|
|
1837
1906
|
}
|
|
1838
1907
|
const productionVite = productionViteResult.value;
|
|
1839
|
-
|
|
1908
|
+
_chunkVQJYGZNXcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
|
|
1840
1909
|
const buildClientBundle = () => buildClient(
|
|
1841
1910
|
productionVite,
|
|
1842
1911
|
config,
|
|
@@ -1869,11 +1938,11 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1869
1938
|
let clientBuildResult;
|
|
1870
1939
|
let ssrBuildResult;
|
|
1871
1940
|
if (config.renderer.buildConcurrency === "serial") {
|
|
1872
|
-
|
|
1941
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
|
|
1873
1942
|
[clientBuildResult] = await Promise.allSettled([buildClientBundle()]);
|
|
1874
1943
|
[ssrBuildResult] = await Promise.allSettled([buildSSRBundle()]);
|
|
1875
1944
|
} else {
|
|
1876
|
-
|
|
1945
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client and SSR bundles in parallel...");
|
|
1877
1946
|
[clientBuildResult, ssrBuildResult] = await Promise.allSettled([
|
|
1878
1947
|
buildClientBundle(),
|
|
1879
1948
|
buildSSRBundle()
|
|
@@ -1888,7 +1957,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1888
1957
|
if (productionVite.builder !== "rolldown" || !(clientBuildResult.reason instanceof IncompleteClientBuildOutputError)) {
|
|
1889
1958
|
throw clientBuildResult.reason;
|
|
1890
1959
|
}
|
|
1891
|
-
|
|
1960
|
+
_chunkVQJYGZNXcjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
|
|
1892
1961
|
try {
|
|
1893
1962
|
await buildClient(
|
|
1894
1963
|
productionVite,
|
|
@@ -1915,14 +1984,14 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1915
1984
|
const routeRuntimeManifest = routeRuntimeManifestResult.value;
|
|
1916
1985
|
const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
|
|
1917
1986
|
for (const warning of runtimeValidation.warnings) {
|
|
1918
|
-
|
|
1987
|
+
_chunkVQJYGZNXcjs.logger.warn(warning);
|
|
1919
1988
|
}
|
|
1920
1989
|
const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
|
|
1921
1990
|
await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
|
|
1922
1991
|
if (config.docs.enabled) {
|
|
1923
1992
|
await copyFarmDocsFontAssetsToClient(root, clientOutputDir);
|
|
1924
1993
|
}
|
|
1925
|
-
|
|
1994
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
|
|
1926
1995
|
await buildNitroUniversal(
|
|
1927
1996
|
config,
|
|
1928
1997
|
routeManager,
|
|
@@ -1943,7 +2012,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1943
2012
|
_path2.default.join(root, distDir),
|
|
1944
2013
|
routeRuntimeManifest
|
|
1945
2014
|
);
|
|
1946
|
-
|
|
2015
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
|
|
1947
2016
|
} catch (error) {
|
|
1948
2017
|
if (lifecyclePluginManager) {
|
|
1949
2018
|
await lifecyclePluginManager.runHookParallel("onError", {
|
|
@@ -1955,10 +2024,10 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1955
2024
|
}
|
|
1956
2025
|
});
|
|
1957
2026
|
}
|
|
1958
|
-
|
|
2027
|
+
_chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
1959
2028
|
throw error;
|
|
1960
2029
|
} finally {
|
|
1961
|
-
_optionalChain([rendererBuild, 'optionalAccess',
|
|
2030
|
+
_optionalChain([rendererBuild, 'optionalAccess', _55 => _55.abort, 'call', _56 => _56()]);
|
|
1962
2031
|
}
|
|
1963
2032
|
}
|
|
1964
2033
|
async function writeSSRAssetsToClient(bundle, outputDir) {
|
|
@@ -1991,7 +2060,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1991
2060
|
if (fontCss === void 0) {
|
|
1992
2061
|
try {
|
|
1993
2062
|
fontCss = await fs4.readFile(fontCssPath);
|
|
1994
|
-
} catch (
|
|
2063
|
+
} catch (e23) {
|
|
1995
2064
|
return;
|
|
1996
2065
|
}
|
|
1997
2066
|
}
|
|
@@ -1999,11 +2068,11 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1999
2068
|
let clientCss = "";
|
|
2000
2069
|
try {
|
|
2001
2070
|
clientCss = await fs4.readFile(clientCssPath, "utf8");
|
|
2002
|
-
} catch (
|
|
2071
|
+
} catch (e24) {
|
|
2003
2072
|
}
|
|
2004
2073
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
2005
2074
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
2006
|
-
await fs4.writeFile(clientCssPath,
|
|
2075
|
+
await fs4.writeFile(clientCssPath, _chunkF42U3R4Fcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
2007
2076
|
}
|
|
2008
2077
|
var IncompleteClientBuildOutputError = class extends Error {
|
|
2009
2078
|
constructor(detail) {
|
|
@@ -2019,7 +2088,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
2019
2088
|
try {
|
|
2020
2089
|
const clientEntry = await fs4.stat(clientEntryPath);
|
|
2021
2090
|
if (clientEntry.isFile()) clientEntrySize = clientEntry.size;
|
|
2022
|
-
} catch (
|
|
2091
|
+
} catch (e25) {
|
|
2023
2092
|
}
|
|
2024
2093
|
if (clientEntrySize === 0) {
|
|
2025
2094
|
throw new IncompleteClientBuildOutputError("farm-client.js is missing or empty");
|
|
@@ -2030,7 +2099,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
2030
2099
|
try {
|
|
2031
2100
|
const globalsCss = await fs4.readFile(globalsCssPath, "utf8");
|
|
2032
2101
|
expectsCss = globalsCss.replace(/\/\*[\s\S]*?\*\//g, "").trim().length > 0;
|
|
2033
|
-
} catch (
|
|
2102
|
+
} catch (e26) {
|
|
2034
2103
|
}
|
|
2035
2104
|
try {
|
|
2036
2105
|
const clientCss = await fs4.stat(clientCssPath);
|
|
@@ -2049,7 +2118,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2049
2118
|
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2050
2119
|
let plan = cache.get(key);
|
|
2051
2120
|
if (!plan) {
|
|
2052
|
-
plan =
|
|
2121
|
+
plan = _chunkF42U3R4Fcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2053
2122
|
cache.set(key, plan);
|
|
2054
2123
|
}
|
|
2055
2124
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2072,25 +2141,25 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2072
2141
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
2073
2142
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
2074
2143
|
);
|
|
2075
|
-
if (_optionalChain([config, 'access',
|
|
2076
|
-
|
|
2144
|
+
if (_optionalChain([config, 'access', _57 => _57.experimental, 'optionalAccess', _58 => _58.isolatedClientHydration]) === "enabled" && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
2145
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
2077
2146
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2078
2147
|
);
|
|
2079
2148
|
}
|
|
2080
|
-
const isolatedMode =
|
|
2081
|
-
_optionalChain([config, 'access',
|
|
2149
|
+
const isolatedMode = _chunkF42U3R4Fcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2150
|
+
_optionalChain([config, 'access', _61 => _61.experimental, 'optionalAccess', _62 => _62.isolatedClientHydration]),
|
|
2082
2151
|
{
|
|
2083
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2152
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.serverComponents])) === "rsc",
|
|
2084
2153
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2085
2154
|
}
|
|
2086
2155
|
);
|
|
2087
|
-
const planOptions =
|
|
2156
|
+
const planOptions = _chunkF42U3R4Fcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2088
2157
|
config.renderer,
|
|
2089
2158
|
Boolean(unsupportedIntegrationProvider)
|
|
2090
2159
|
);
|
|
2091
2160
|
const pagePlanOptions = {
|
|
2092
2161
|
...planOptions,
|
|
2093
|
-
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2162
|
+
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _65 => _65.experimental, 'optionalAccess', _66 => _66.serverComponents])) === "islands"
|
|
2094
2163
|
};
|
|
2095
2164
|
const layoutPlanOptions = {
|
|
2096
2165
|
...planOptions,
|
|
@@ -2122,7 +2191,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2122
2191
|
serverTreeLayout: metadata.serverTreeLayout
|
|
2123
2192
|
};
|
|
2124
2193
|
} catch (error) {
|
|
2125
|
-
|
|
2194
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
|
|
2126
2195
|
return {
|
|
2127
2196
|
...layout,
|
|
2128
2197
|
shouldHydrate: false,
|
|
@@ -2141,18 +2210,18 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2141
2210
|
};
|
|
2142
2211
|
}
|
|
2143
2212
|
});
|
|
2144
|
-
const layoutAppliesToRoute =
|
|
2213
|
+
const layoutAppliesToRoute = _chunk76GHW3WIcjs.routeBoundaryCoversDirectory;
|
|
2145
2214
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2146
2215
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2147
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
2216
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _67 => _67.docs, 'optionalAccess', _68 => _68.enabled]) && _optionalChain([config, 'access', _69 => _69.docs, 'access', _70 => _70.adapter, 'optionalAccess', _71 => _71.server]) && config.docs.adapter.react
|
|
2148
2217
|
);
|
|
2149
|
-
const adapterDocsEntry = _optionalChain([config, 'access',
|
|
2218
|
+
const adapterDocsEntry = _optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
|
|
2150
2219
|
const isAdapterDocsRoute = (routePattern) => Boolean(
|
|
2151
2220
|
adapterOwnsDocsRuntime && adapterDocsEntry && (adapterDocsEntry === "/" || routePattern === adapterDocsEntry || routePattern.startsWith(`${adapterDocsEntry}/`))
|
|
2152
2221
|
);
|
|
2153
|
-
const syntheticDocsEntry = _optionalChain([config, 'access',
|
|
2222
|
+
const syntheticDocsEntry = _optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2154
2223
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2155
|
-
const markdownPagePlan =
|
|
2224
|
+
const markdownPagePlan = _chunkF42U3R4Fcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2156
2225
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2157
2226
|
root,
|
|
2158
2227
|
isolatedMode,
|
|
@@ -2168,7 +2237,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2168
2237
|
pagePlanOptions
|
|
2169
2238
|
)
|
|
2170
2239
|
}));
|
|
2171
|
-
|
|
2240
|
+
_chunkF42U3R4Fcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2172
2241
|
clientLayouts.map((layout) => ({
|
|
2173
2242
|
pattern: layout.pattern,
|
|
2174
2243
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2177,7 +2246,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2177
2246
|
[
|
|
2178
2247
|
...routePlans.map(({ route, metadata }) => ({
|
|
2179
2248
|
pattern: routeDirectory(route),
|
|
2180
|
-
depth:
|
|
2249
|
+
depth: _chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2181
2250
|
metadata
|
|
2182
2251
|
})),
|
|
2183
2252
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -2200,7 +2269,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2200
2269
|
for (const layout of clientLayouts) {
|
|
2201
2270
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
|
|
2202
2271
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2203
|
-
|
|
2272
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F ${_chunkF42U3R4Fcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2204
2273
|
}
|
|
2205
2274
|
}
|
|
2206
2275
|
if (isolatedMode === "analyze") {
|
|
@@ -2211,7 +2280,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2211
2280
|
if (!("isolatedHydrationEligible" in metadata) || !metadata.isolatedHydrationEligible) {
|
|
2212
2281
|
continue;
|
|
2213
2282
|
}
|
|
2214
|
-
|
|
2283
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
2215
2284
|
`\u{1F4CA} Isolated hydration analysis: ${entry.modulePath} can exclude its server owner and hydrate ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"}.`
|
|
2216
2285
|
);
|
|
2217
2286
|
}
|
|
@@ -2223,8 +2292,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2223
2292
|
(layout) => (layout.shouldHydrate || layout.hasIsolatedClientBoundaries) && layoutAppliesToRoute(layout.pattern, routeDirectory(route))
|
|
2224
2293
|
);
|
|
2225
2294
|
if (metadata.suppressedAsyncHydration) {
|
|
2226
|
-
|
|
2227
|
-
`\u26A0\uFE0F ${
|
|
2295
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
2296
|
+
`\u26A0\uFE0F ${_chunkF42U3R4Fcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2228
2297
|
);
|
|
2229
2298
|
}
|
|
2230
2299
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
@@ -2249,12 +2318,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2249
2318
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
2250
2319
|
],
|
|
2251
2320
|
// The server renders a server tree only below a hydrating layout.
|
|
2252
|
-
...
|
|
2321
|
+
..._chunkF42U3R4Fcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2253
2322
|
});
|
|
2254
|
-
|
|
2323
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2255
2324
|
}
|
|
2256
2325
|
} catch (error) {
|
|
2257
|
-
|
|
2326
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
|
|
2258
2327
|
}
|
|
2259
2328
|
}
|
|
2260
2329
|
if (syntheticDocsEntry) {
|
|
@@ -2285,13 +2354,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2285
2354
|
}
|
|
2286
2355
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2287
2356
|
try {
|
|
2288
|
-
return
|
|
2357
|
+
return _chunkF42U3R4Fcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2289
2358
|
} catch (error) {
|
|
2290
|
-
|
|
2359
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2291
2360
|
return false;
|
|
2292
2361
|
}
|
|
2293
2362
|
});
|
|
2294
|
-
|
|
2363
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
2295
2364
|
`\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
|
|
2296
2365
|
);
|
|
2297
2366
|
const clientEntryRoot = _path2.default.join(root, ".farm", "tmp");
|
|
@@ -2304,10 +2373,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2304
2373
|
clientRouteSlots,
|
|
2305
2374
|
root,
|
|
2306
2375
|
srcDir,
|
|
2307
|
-
adapterOwnsDocsRuntime ? false :
|
|
2308
|
-
adapterOwnsDocsRuntime ? void 0 :
|
|
2309
|
-
_optionalChain([config, 'access',
|
|
2310
|
-
adapterOwnsDocsRuntime ? _optionalChain([config, 'access',
|
|
2376
|
+
adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
2377
|
+
adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
2378
|
+
_optionalChain([config, 'access', _76 => _76.docs, 'optionalAccess', _77 => _77.enabled]) ? config.docs.entry : void 0,
|
|
2379
|
+
adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _78 => _78.docs, 'access', _79 => _79.adapter, 'optionalAccess', _80 => _80.react]) : void 0,
|
|
2311
2380
|
config.i18n,
|
|
2312
2381
|
config.plugins,
|
|
2313
2382
|
config.renderer,
|
|
@@ -2315,9 +2384,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2315
2384
|
config.trailingSlash,
|
|
2316
2385
|
_chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2317
2386
|
config.basePath,
|
|
2318
|
-
|
|
2387
|
+
_chunkF42U3R4Fcjs.generateClientCachePersistenceCode.call(void 0, _chunkF42U3R4Fcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2319
2388
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2320
|
-
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2389
|
+
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _81 => _81.experimental, 'optionalAccess', _82 => _82.serverComponents])) === "islands"
|
|
2321
2390
|
);
|
|
2322
2391
|
await fs4.writeFile(clientEntryPath, clientHydrationCode);
|
|
2323
2392
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
@@ -2328,12 +2397,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2328
2397
|
buildLifetime: rendererBuildLifetime
|
|
2329
2398
|
});
|
|
2330
2399
|
if (hasScopedPostcssConfig) {
|
|
2331
|
-
|
|
2400
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
|
|
2332
2401
|
} else {
|
|
2333
2402
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2334
2403
|
await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2335
2404
|
postcssSearchPath = clientEntryDir;
|
|
2336
|
-
tailwindVitePlugin = await
|
|
2405
|
+
tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
|
|
2337
2406
|
builder: productionVite.builder,
|
|
2338
2407
|
announce: true
|
|
2339
2408
|
});
|
|
@@ -2354,7 +2423,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2354
2423
|
outDir: outputDir,
|
|
2355
2424
|
emptyOutDir: true,
|
|
2356
2425
|
// Never public: see resolveFarmClientSourcemap.
|
|
2357
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
2426
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _83 => _83.vite, 'optionalAccess', _84 => _84.build, 'optionalAccess', _85 => _85.sourcemap])),
|
|
2358
2427
|
assetsInlineLimit: 0,
|
|
2359
2428
|
cssCodeSplit: false,
|
|
2360
2429
|
// Bundle all CSS into one file
|
|
@@ -2368,7 +2437,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2368
2437
|
hashCharacters: "hex",
|
|
2369
2438
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
2370
2439
|
assetFileNames: (assetInfo) => {
|
|
2371
|
-
if (_optionalChain([assetInfo, 'access',
|
|
2440
|
+
if (_optionalChain([assetInfo, 'access', _86 => _86.name, 'optionalAccess', _87 => _87.endsWith, 'call', _88 => _88(".css")])) {
|
|
2372
2441
|
return "farm-client.css";
|
|
2373
2442
|
}
|
|
2374
2443
|
return "assets/[name]-h[hash][extname]";
|
|
@@ -2404,7 +2473,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2404
2473
|
}
|
|
2405
2474
|
},
|
|
2406
2475
|
plugins: [
|
|
2407
|
-
|
|
2476
|
+
_chunkF42U3R4Fcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2408
2477
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2409
2478
|
outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
|
|
2410
2479
|
}),
|
|
@@ -2429,7 +2498,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2429
2498
|
...rendererVitePlugins,
|
|
2430
2499
|
...config.vite.plugins || [],
|
|
2431
2500
|
farmServerOnlyEntriesPlugin(),
|
|
2432
|
-
|
|
2501
|
+
_chunkF42U3R4Fcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
2433
2502
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2434
2503
|
),
|
|
2435
2504
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -2491,7 +2560,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2491
2560
|
} : void 0,
|
|
2492
2561
|
// Ensure React is bundled for client
|
|
2493
2562
|
resolve: {
|
|
2494
|
-
alias:
|
|
2563
|
+
alias: _chunkF42U3R4Fcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2495
2564
|
dedupe: [...config.renderer.dedupe || []]
|
|
2496
2565
|
},
|
|
2497
2566
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2504,13 +2573,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2504
2573
|
]
|
|
2505
2574
|
}
|
|
2506
2575
|
};
|
|
2507
|
-
await viteBuild(
|
|
2576
|
+
await viteBuild(_chunkF42U3R4Fcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2508
2577
|
await mergeBuiltFontCss(outputDir);
|
|
2509
2578
|
await validateClientBuildOutput(root, srcDir, outputDir);
|
|
2510
2579
|
} finally {
|
|
2511
2580
|
try {
|
|
2512
2581
|
await fs4.rm(clientEntryDir, { recursive: true, force: true });
|
|
2513
|
-
} catch (
|
|
2582
|
+
} catch (e27) {
|
|
2514
2583
|
}
|
|
2515
2584
|
}
|
|
2516
2585
|
}
|
|
@@ -3358,6 +3427,14 @@ function countFarmKeptLayouts(request, layouts, params) {
|
|
|
3358
3427
|
// browser's chain starts at the next layout.
|
|
3359
3428
|
return keys.length > 1 ? 1 + getSharedLayoutPrefixLength(chain, keys.slice(1)) : 0;
|
|
3360
3429
|
}
|
|
3430
|
+
`;
|
|
3431
|
+
var FARM_DOCUMENT_PARSED_RUNTIME = `function farmDocumentParsed() {
|
|
3432
|
+
if (document.readyState !== "loading") return Promise.resolve();
|
|
3433
|
+
return new Promise(function(resolve) {
|
|
3434
|
+
document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3361
3438
|
`;
|
|
3362
3439
|
function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlots, root, srcDir, docsSearchEnabled, docsSearchModuleId, docsEntryPath, docsAdapterReact, i18nConfig = {
|
|
3363
3440
|
enabled: false,
|
|
@@ -3379,7 +3456,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3379
3456
|
direction: {}
|
|
3380
3457
|
}, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
3381
3458
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
3382
|
-
const clientPluginEntry =
|
|
3459
|
+
const clientPluginEntry = _chunkF42U3R4Fcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3383
3460
|
plugins,
|
|
3384
3461
|
root,
|
|
3385
3462
|
srcDir,
|
|
@@ -3388,9 +3465,9 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3388
3465
|
const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
3389
3466
|
const rendererClientImports = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
|
|
3390
3467
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3391
|
-
import __farmAppSetup from ${JSON.stringify(
|
|
3468
|
+
import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3392
3469
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3393
|
-
const providerClientCode =
|
|
3470
|
+
const providerClientCode = _chunkF42U3R4Fcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3394
3471
|
integrationProviders,
|
|
3395
3472
|
root,
|
|
3396
3473
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -3400,18 +3477,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
3400
3477
|
const layoutImportStatements = [];
|
|
3401
3478
|
const layoutRegistrations = [];
|
|
3402
3479
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
3403
|
-
const treeLayoutPatterns = islandValues ?
|
|
3480
|
+
const treeLayoutPatterns = islandValues ? _chunk76GHW3WIcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
3404
3481
|
layoutRoutes.forEach((layout, index) => {
|
|
3405
3482
|
const relativePath = toImportPath(layout.modulePath);
|
|
3406
3483
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
3407
3484
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
3408
|
-
(pattern) =>
|
|
3485
|
+
(pattern) => _chunk76GHW3WIcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
3409
3486
|
);
|
|
3410
3487
|
if (rendersOnClient && !treeLayout) {
|
|
3411
3488
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
3412
3489
|
}
|
|
3413
|
-
const groupScope =
|
|
3414
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
3490
|
+
const groupScope = _chunk76GHW3WIcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3491
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk76GHW3WIcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
3415
3492
|
layoutRegistrations.push(
|
|
3416
3493
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
|
|
3417
3494
|
);
|
|
@@ -3478,7 +3555,7 @@ ${clientCachePersistence.imports}
|
|
|
3478
3555
|
${i18nClientRuntime}
|
|
3479
3556
|
${docsNavigationRuntime}
|
|
3480
3557
|
${docsAdapterRuntime}
|
|
3481
|
-
${
|
|
3558
|
+
${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
|
|
3482
3559
|
|
|
3483
3560
|
setFarmBasePath(${JSON.stringify(basePath)});
|
|
3484
3561
|
setFarmTrailingSlashPreference(${JSON.stringify(trailingSlash)});
|
|
@@ -3718,7 +3795,7 @@ void farmClientRuntime.start();
|
|
|
3718
3795
|
spaRouter.initializeHistory();
|
|
3719
3796
|
window.__FARM_SPA_ROUTER__ = spaRouter;
|
|
3720
3797
|
|
|
3721
|
-
${islandValues ?
|
|
3798
|
+
${islandValues ? `${FARM_DOCUMENT_PARSED_RUNTIME}void farmDocumentParsed().then(hydrateFarmDocsAdapterRuntime);` : "void hydrateFarmDocsAdapterRuntime();"}
|
|
3722
3799
|
|
|
3723
3800
|
window.addEventListener("beforeunload", function(event) {
|
|
3724
3801
|
if (spaRouter.shouldBlockUnload()) {
|
|
@@ -3762,7 +3839,7 @@ document.addEventListener("click", function(e) {
|
|
|
3762
3839
|
clientPages.forEach((page) => {
|
|
3763
3840
|
for (const boundary of page.isolatedBoundaries) {
|
|
3764
3841
|
isolatedBoundaryModules.set(
|
|
3765
|
-
|
|
3842
|
+
_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, boundary.modulePath, root),
|
|
3766
3843
|
toImportPath(boundary.modulePath)
|
|
3767
3844
|
);
|
|
3768
3845
|
}
|
|
@@ -3845,7 +3922,7 @@ ${layoutImports}
|
|
|
3845
3922
|
${rendererClientImports}
|
|
3846
3923
|
${isolatedHydrationImport}
|
|
3847
3924
|
${providerClientCode.imports}
|
|
3848
|
-
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3925
|
+
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3849
3926
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
3850
3927
|
import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
|
|
3851
3928
|
${clientPluginEntry.imports}
|
|
@@ -3855,7 +3932,7 @@ ${docsNavigationRuntime}
|
|
|
3855
3932
|
${docsAdapterRuntime}
|
|
3856
3933
|
|
|
3857
3934
|
${imports.join("\n")}
|
|
3858
|
-
${
|
|
3935
|
+
${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
|
|
3859
3936
|
|
|
3860
3937
|
${providerClientCode.runtime}
|
|
3861
3938
|
|
|
@@ -3924,7 +4001,7 @@ function hasHydratableLayout(pathname) {
|
|
|
3924
4001
|
});
|
|
3925
4002
|
}
|
|
3926
4003
|
|
|
3927
|
-
${
|
|
4004
|
+
${_chunkF42U3R4Fcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
3928
4005
|
// Wrap a page element with applicable layouts
|
|
3929
4006
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
3930
4007
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -3959,7 +4036,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
3959
4036
|
return React.createElement("div", props, pageElement);
|
|
3960
4037
|
}
|
|
3961
4038
|
let farmLastRouteState = null;
|
|
3962
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
4039
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkF42U3R4Fcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
3963
4040
|
function farmTreeLayoutsOf(pathname) {
|
|
3964
4041
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
3965
4042
|
return layout.serverTree === true;
|
|
@@ -4032,7 +4109,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
|
|
|
4032
4109
|
if (!serverProps || serverProps.__farmRoutePropsResolved !== true) return null;
|
|
4033
4110
|
const props = {
|
|
4034
4111
|
...reviveServerPageProps(serverProps),
|
|
4035
|
-
searchParams:
|
|
4112
|
+
searchParams: createFarmSearchParams(serverProps.search ?? searchParams),
|
|
4036
4113
|
};
|
|
4037
4114
|
pageElement = React.createElement(Component, props);
|
|
4038
4115
|
} else if (typeof Component === "function" && Component.constructor && Component.constructor.name === "AsyncFunction") {
|
|
@@ -4047,7 +4124,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
|
|
|
4047
4124
|
const props = {
|
|
4048
4125
|
...reviveServerPageProps(serverProps),
|
|
4049
4126
|
params: params,
|
|
4050
|
-
searchParams:
|
|
4127
|
+
searchParams: createFarmSearchParams(searchParams),
|
|
4051
4128
|
};
|
|
4052
4129
|
pageElement = React.createElement(Component, props);
|
|
4053
4130
|
}
|
|
@@ -4293,16 +4370,7 @@ function resetReactRoot() {
|
|
|
4293
4370
|
isHydrated = false;
|
|
4294
4371
|
}
|
|
4295
4372
|
|
|
4296
|
-
${islandValues ?
|
|
4297
|
-
// hydrates them as they arrive; anything else waits for the whole document.
|
|
4298
|
-
function farmDocumentParsed() {
|
|
4299
|
-
if (document.readyState !== "loading") return Promise.resolve();
|
|
4300
|
-
return new Promise(function(resolve) {
|
|
4301
|
-
document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
|
|
4302
|
-
});
|
|
4303
|
-
}
|
|
4304
|
-
|
|
4305
|
-
` : ""}// Hydrate client components
|
|
4373
|
+
${islandValues ? FARM_DOCUMENT_PARSED_RUNTIME : ""}// Hydrate client components
|
|
4306
4374
|
async function hydrate() {
|
|
4307
4375
|
await window.__FARM_PPR_REFRESH_PROMISE__;
|
|
4308
4376
|
// A PPR refresh that is still retrying must not replace DOM once hydration starts.
|
|
@@ -4706,7 +4774,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
4706
4774
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4707
4775
|
const params = matched.params;
|
|
4708
4776
|
const searchParams = searchParamsToObject(url.searchParams);
|
|
4709
|
-
const props = { params: params, searchParams:
|
|
4777
|
+
const props = { params: params, searchParams: createFarmSearchParams(searchParams) };
|
|
4710
4778
|
let pageElement = React.createElement(Component, props);
|
|
4711
4779
|
if (hasHydratableLayout(pathname)) {
|
|
4712
4780
|
pageElement = createLayoutPageBoundary(matched.route, pageElement);
|
|
@@ -5098,7 +5166,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5098
5166
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
5099
5167
|
"module.exports = { plugins: [] };\n"
|
|
5100
5168
|
);
|
|
5101
|
-
tailwindVitePlugin = await
|
|
5169
|
+
tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
|
|
5102
5170
|
builder: productionVite.builder,
|
|
5103
5171
|
label: "for SSR"
|
|
5104
5172
|
});
|
|
@@ -5194,14 +5262,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5194
5262
|
}
|
|
5195
5263
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
5196
5264
|
const instrumentationPath = _chunkBRWIVOV4cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
5197
|
-
const notFoundPath =
|
|
5198
|
-
if (notFoundPath)
|
|
5265
|
+
const notFoundPath = _chunkF42U3R4Fcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
5266
|
+
if (notFoundPath) _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
5199
5267
|
layoutRoutes.sort((a, b) => {
|
|
5200
5268
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
5201
5269
|
const depthB = b.pattern.split("/").filter(Boolean).length;
|
|
5202
5270
|
return depthA - depthB;
|
|
5203
5271
|
});
|
|
5204
|
-
|
|
5272
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
5205
5273
|
`\u{1F4CB} Found ${pageRoutes.length} page routes, ${layoutRoutes.length} layouts, ${apiRoutes.length} API routes, ${applicationMetadataRoutes.length} metadata routes, and ${middlewareRoutes.length} middleware files`
|
|
5206
5274
|
);
|
|
5207
5275
|
const configuredIntegrationValues = Object.values(config.integrations || {});
|
|
@@ -5215,9 +5283,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5215
5283
|
(provider) => provider.component || provider.type === "clerk"
|
|
5216
5284
|
);
|
|
5217
5285
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
5218
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
5219
|
-
const hasMiddlewareConfig =
|
|
5220
|
-
const hasRouteContextConfig =
|
|
5286
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _89 => _89.mdx, 'optionalAccess', _90 => _90.components]));
|
|
5287
|
+
const hasMiddlewareConfig = _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5288
|
+
const hasRouteContextConfig = _chunkO3MMJPC2cjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
5221
5289
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
5222
5290
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
5223
5291
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -5227,23 +5295,23 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5227
5295
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
5228
5296
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
5229
5297
|
);
|
|
5230
|
-
if (
|
|
5298
|
+
if (_chunkVIFPE5RGcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
5231
5299
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
5232
|
-
|
|
5300
|
+
_chunkVIFPE5RGcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
5233
5301
|
config.docs,
|
|
5234
5302
|
{ root, srcDir: config.srcDir },
|
|
5235
5303
|
(pathname) => adapterGuardedPaths.has(pathname)
|
|
5236
5304
|
);
|
|
5237
5305
|
}
|
|
5238
5306
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
5239
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
5307
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _91 => _91.docs, 'optionalAccess', _92 => _92.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
|
|
5240
5308
|
farmDocsCspNonceMarker,
|
|
5241
|
-
async () => _optionalChain([config, 'access',
|
|
5309
|
+
async () => _optionalChain([config, 'access', _93 => _93.docs, 'access', _94 => _94.adapter, 'optionalAccess', _95 => _95.server]) ? await _chunkVIFPE5RGcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
5242
5310
|
root,
|
|
5243
5311
|
srcDir: config.srcDir,
|
|
5244
5312
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
5245
5313
|
fontStylesheetHref: "/farm-fonts.css",
|
|
5246
|
-
globalStylesheetHref:
|
|
5314
|
+
globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER
|
|
5247
5315
|
}) : await (async () => {
|
|
5248
5316
|
const guardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
5249
5317
|
return compileFarmDocsManifest(config.docs, {
|
|
@@ -5252,7 +5320,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5252
5320
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
5253
5321
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, root)),
|
|
5254
5322
|
fontStylesheetHref: "/farm-fonts.css",
|
|
5255
|
-
globalStylesheetHref:
|
|
5323
|
+
globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER,
|
|
5256
5324
|
isPathGuarded: (pathname) => guardedPaths.has(pathname)
|
|
5257
5325
|
});
|
|
5258
5326
|
})()
|
|
@@ -5347,7 +5415,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5347
5415
|
// Adapters can render provider scripts by serializing function source.
|
|
5348
5416
|
// keepNames injects helper calls into those functions; after Nitro
|
|
5349
5417
|
// minifies the server chunk the helper is no longer in script scope.
|
|
5350
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
5418
|
+
keepNames: !(_optionalChain([config, 'access', _96 => _96.docs, 'optionalAccess', _97 => _97.enabled]) && _optionalChain([config, 'access', _98 => _98.docs, 'access', _99 => _99.adapter, 'optionalAccess', _100 => _100.server])),
|
|
5351
5419
|
jsxDev: false
|
|
5352
5420
|
},
|
|
5353
5421
|
// SSR configuration to externalize problematic modules
|
|
@@ -5397,10 +5465,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5397
5465
|
define: {
|
|
5398
5466
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
5399
5467
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
5400
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
5468
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _101 => _101.env, 'optionalAccess', _102 => _102.public]) || {})
|
|
5401
5469
|
},
|
|
5402
5470
|
plugins: [
|
|
5403
|
-
|
|
5471
|
+
_chunkF42U3R4Fcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
5404
5472
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
5405
5473
|
...rendererVitePlugins,
|
|
5406
5474
|
...config.vite.plugins || [],
|
|
@@ -5461,7 +5529,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5461
5529
|
resolve: {
|
|
5462
5530
|
alias: [
|
|
5463
5531
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
5464
|
-
...Object.entries(
|
|
5532
|
+
...Object.entries(_chunkF42U3R4Fcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
5465
5533
|
([find, replacement]) => ({ find, replacement })
|
|
5466
5534
|
)
|
|
5467
5535
|
],
|
|
@@ -5469,12 +5537,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5469
5537
|
dedupe: [...config.renderer.dedupe || []]
|
|
5470
5538
|
}
|
|
5471
5539
|
};
|
|
5472
|
-
await viteBuild(
|
|
5540
|
+
await viteBuild(_chunkF42U3R4Fcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
5473
5541
|
} finally {
|
|
5474
5542
|
if (postcssConfigDir) {
|
|
5475
5543
|
try {
|
|
5476
5544
|
await fs4.rm(postcssConfigDir, { recursive: true, force: true });
|
|
5477
|
-
} catch (
|
|
5545
|
+
} catch (e28) {
|
|
5478
5546
|
}
|
|
5479
5547
|
}
|
|
5480
5548
|
}
|
|
@@ -5487,7 +5555,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5487
5555
|
function readFarmAppPackageIdentity(root) {
|
|
5488
5556
|
try {
|
|
5489
5557
|
return JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(root, "package.json"), "utf8"));
|
|
5490
|
-
} catch (
|
|
5558
|
+
} catch (e29) {
|
|
5491
5559
|
return {};
|
|
5492
5560
|
}
|
|
5493
5561
|
}
|
|
@@ -5499,14 +5567,14 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
5499
5567
|
lastModified[route.pattern] = _fs.statSync.call(void 0,
|
|
5500
5568
|
_nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath))
|
|
5501
5569
|
).mtime.toISOString();
|
|
5502
|
-
} catch (
|
|
5570
|
+
} catch (e30) {
|
|
5503
5571
|
}
|
|
5504
5572
|
}
|
|
5505
5573
|
return lastModified;
|
|
5506
5574
|
}
|
|
5507
5575
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
5508
|
-
if (!_optionalChain([config, 'access',
|
|
5509
|
-
const contentDir =
|
|
5576
|
+
if (!_optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled])) return [];
|
|
5577
|
+
const contentDir = _chunkIOUOGRDXcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
|
|
5510
5578
|
root: config.root,
|
|
5511
5579
|
srcDir: config.srcDir
|
|
5512
5580
|
});
|
|
@@ -5514,18 +5582,18 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
5514
5582
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
5515
5583
|
middlewareRoutes
|
|
5516
5584
|
};
|
|
5517
|
-
return
|
|
5585
|
+
return _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkIOUOGRDXcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
5518
5586
|
}
|
|
5519
5587
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
5520
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
5588
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _105 => _105.llmsTxt]);
|
|
5521
5589
|
const ownedByFile = (kind) => applicationMetadataRoutes.some(
|
|
5522
5590
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
5523
5591
|
);
|
|
5524
5592
|
return [
|
|
5525
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5526
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5527
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5528
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5593
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _106 => _106.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
5594
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _107 => _107.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
5595
|
+
..._optionalChain([agent, 'optionalAccess', _108 => _108.sitemap, 'optionalAccess', _109 => _109.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
5596
|
+
..._optionalChain([agent, 'optionalAccess', _110 => _110.crawlers, 'optionalAccess', _111 => _111.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
5529
5597
|
];
|
|
5530
5598
|
}
|
|
5531
5599
|
function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
@@ -5564,7 +5632,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
|
|
|
5564
5632
|
return JSON.stringify(modulePath.replace(/\\/g, "/"));
|
|
5565
5633
|
}
|
|
5566
5634
|
function generateNativeAuthIntegrationSource(auth) {
|
|
5567
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
5635
|
+
if (_optionalChain([auth, 'optionalAccess', _112 => _112.enabled]) !== true) {
|
|
5568
5636
|
return { importSource: "", registerSource: "" };
|
|
5569
5637
|
}
|
|
5570
5638
|
return {
|
|
@@ -5850,28 +5918,28 @@ function generateFarmRendererAppSetupServerCode(config) {
|
|
|
5850
5918
|
const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
|
|
5851
5919
|
if (!appSetupPath) return "";
|
|
5852
5920
|
return `
|
|
5853
|
-
import __farmAppSetup from ${JSON.stringify(
|
|
5921
|
+
import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
5854
5922
|
if (typeof ReactDOMServer.configureApp !== "function") {
|
|
5855
5923
|
throw new Error(${JSON.stringify(`Renderer \`${config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`)});
|
|
5856
5924
|
}
|
|
5857
5925
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
5858
5926
|
}
|
|
5859
5927
|
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) {
|
|
5860
|
-
const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
5928
|
+
const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _113 => _113.experimental, 'optionalAccess', _114 => _114.serverComponents])) === "islands";
|
|
5861
5929
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5862
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
5930
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _115 => _115.agent, 'optionalAccess', _116 => _116.crawlers, 'optionalAccess', _117 => _117.enabled])) && !applicationMetadataRoutes.some(
|
|
5863
5931
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
5864
5932
|
);
|
|
5865
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
5933
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _118 => _118.agent, 'optionalAccess', _119 => _119.sitemap, 'optionalAccess', _120 => _120.enabled])) && !applicationMetadataRoutes.some(
|
|
5866
5934
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
5867
5935
|
);
|
|
5868
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
5869
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
5936
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _121 => _121.agent, 'optionalAccess', _122 => _122.mcp]) === true && !_chunkSBABQKPTcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
5937
|
+
const servesAiCatalog = _optionalChain([config, 'access', _123 => _123.agent, 'optionalAccess', _124 => _124.aiCatalog]) !== false;
|
|
5870
5938
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
5871
5939
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5872
5940
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
5873
5941
|
const adapterOwnsDocsRuntime = Boolean(
|
|
5874
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
5942
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _125 => _125.docs, 'optionalAccess', _126 => _126.enabled]) && _optionalChain([config, 'access', _127 => _127.docs, 'access', _128 => _128.adapter, 'optionalAccess', _129 => _129.server]) && config.docs.adapter.react
|
|
5875
5943
|
);
|
|
5876
5944
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
5877
5945
|
const hasIsolatedClientGraphRuntime = _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
@@ -5916,8 +5984,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5916
5984
|
const hasGeneratedMetadataImages = metadataImageRoutes.some(
|
|
5917
5985
|
(image) => image.sourceType === "module"
|
|
5918
5986
|
);
|
|
5919
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
5920
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
5987
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5988
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _130 => _130.docs, 'optionalAccess', _131 => _131.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
5921
5989
|
const integrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
5922
5990
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
5923
5991
|
(provider) => provider.component || provider.type === "clerk"
|
|
@@ -5927,16 +5995,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5927
5995
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
5928
5996
|
);
|
|
5929
5997
|
}
|
|
5930
|
-
const providerServerModules =
|
|
5998
|
+
const providerServerModules = _chunkF42U3R4Fcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
5931
5999
|
renderedIntegrationProviders,
|
|
5932
6000
|
config.root,
|
|
5933
6001
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
5934
6002
|
);
|
|
5935
6003
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
5936
6004
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
5937
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
6005
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _132 => _132.providers]);
|
|
5938
6006
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
5939
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
6007
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _133 => _133.component]) === "function")) {
|
|
5940
6008
|
throw new Error(
|
|
5941
6009
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
5942
6010
|
);
|
|
@@ -5947,20 +6015,20 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5947
6015
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
5948
6016
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
5949
6017
|
);
|
|
5950
|
-
const isolatedHydrationMode =
|
|
5951
|
-
_optionalChain([config, 'access',
|
|
6018
|
+
const isolatedHydrationMode = _chunkF42U3R4Fcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
6019
|
+
_optionalChain([config, 'access', _134 => _134.experimental, 'optionalAccess', _135 => _135.isolatedClientHydration]),
|
|
5952
6020
|
{
|
|
5953
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
6021
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _136 => _136.experimental, 'optionalAccess', _137 => _137.serverComponents])) === "rsc",
|
|
5954
6022
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
5955
6023
|
}
|
|
5956
6024
|
);
|
|
5957
|
-
const hydrationPlanOptions =
|
|
6025
|
+
const hydrationPlanOptions = _chunkF42U3R4Fcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
5958
6026
|
config.renderer,
|
|
5959
6027
|
Boolean(unsupportedIntegrationProvider)
|
|
5960
6028
|
);
|
|
5961
6029
|
const pageHydrationPlanOptions = {
|
|
5962
6030
|
...hydrationPlanOptions,
|
|
5963
|
-
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
6031
|
+
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _138 => _138.experimental, 'optionalAccess', _139 => _139.serverComponents])) === "islands"
|
|
5964
6032
|
};
|
|
5965
6033
|
const layoutHydrationPlans = layoutRoutes.map((layout) => ({
|
|
5966
6034
|
...layout,
|
|
@@ -5972,7 +6040,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5972
6040
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
5973
6041
|
)
|
|
5974
6042
|
}));
|
|
5975
|
-
const markdownPagePlan =
|
|
6043
|
+
const markdownPagePlan = _chunkF42U3R4Fcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
5976
6044
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
5977
6045
|
config.root,
|
|
5978
6046
|
isolatedHydrationMode,
|
|
@@ -5990,7 +6058,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5990
6058
|
)
|
|
5991
6059
|
])
|
|
5992
6060
|
);
|
|
5993
|
-
|
|
6061
|
+
_chunkF42U3R4Fcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
5994
6062
|
layoutHydrationPlans.map((layout) => ({
|
|
5995
6063
|
pattern: layout.pattern,
|
|
5996
6064
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -5999,10 +6067,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5999
6067
|
pageRoutes.map((route) => ({
|
|
6000
6068
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
6001
6069
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
6002
|
-
depth:
|
|
6070
|
+
depth: _chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
6003
6071
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
6004
6072
|
})),
|
|
6005
|
-
|
|
6073
|
+
_chunk76GHW3WIcjs.routeBoundaryCoversDirectory
|
|
6006
6074
|
);
|
|
6007
6075
|
const providerServerImports = [
|
|
6008
6076
|
providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
|
|
@@ -6019,7 +6087,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6019
6087
|
apiRegistrations.push(`
|
|
6020
6088
|
{
|
|
6021
6089
|
path: ${JSON.stringify(route.path)},
|
|
6022
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
6090
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _140 => _140.pluginMethods, 'optionalAccess', _141 => _141.includes, 'call', _142 => _142(method)])))},
|
|
6023
6091
|
endpoints: ${varName},
|
|
6024
6092
|
}`);
|
|
6025
6093
|
});
|
|
@@ -6056,15 +6124,15 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6056
6124
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
6057
6125
|
);
|
|
6058
6126
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
6059
|
-
const renderingDirective =
|
|
6127
|
+
const renderingDirective = _chunkY7TLL65Bcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
6060
6128
|
pageRegistrations.push(`
|
|
6061
6129
|
{
|
|
6062
6130
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
6063
6131
|
directory: ${JSON.stringify(route.directory)},` : ""}
|
|
6064
6132
|
module: ${varName},
|
|
6065
6133
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
6066
|
-
clientModule: ${JSON.stringify(
|
|
6067
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
6134
|
+
clientModule: ${JSON.stringify(_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
6135
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkF42U3R4Fcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
|
|
6068
6136
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
6069
6137
|
${route.source !== void 0 ? `markdownSource: {
|
|
6070
6138
|
source: ${JSON.stringify(route.source)},
|
|
@@ -6074,7 +6142,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6074
6142
|
});
|
|
6075
6143
|
const layoutImports = [];
|
|
6076
6144
|
const layoutRegistrations = [];
|
|
6077
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
6145
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunk76GHW3WIcjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
6078
6146
|
layoutHydrationPlans.map((layout) => ({
|
|
6079
6147
|
pattern: layout.pattern,
|
|
6080
6148
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -6128,12 +6196,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6128
6196
|
errorImports.push(
|
|
6129
6197
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
6130
6198
|
);
|
|
6131
|
-
const groupScope =
|
|
6199
|
+
const groupScope = _chunk76GHW3WIcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
6132
6200
|
errorRegistrations.push(`
|
|
6133
6201
|
{
|
|
6134
|
-
pattern: ${JSON.stringify(
|
|
6202
|
+
pattern: ${JSON.stringify(_chunk76GHW3WIcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
6135
6203
|
groupScope: ${JSON.stringify(groupScope)},
|
|
6136
|
-
directoryDepth: ${
|
|
6204
|
+
directoryDepth: ${_chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
6137
6205
|
module: ${varName},
|
|
6138
6206
|
}`);
|
|
6139
6207
|
});
|
|
@@ -6271,6 +6339,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6271
6339
|
resolveFarmPreviewDeployment,
|
|
6272
6340
|
resolveFarmWebRequestOrigin,
|
|
6273
6341
|
runWithFarmRequestSpan,
|
|
6342
|
+
createFarmSearchParams,
|
|
6274
6343
|
searchParamsToObject,
|
|
6275
6344
|
setFarmBasePath,
|
|
6276
6345
|
setFarmTrailingSlashPreference,
|
|
@@ -6283,7 +6352,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6283
6352
|
import { getSharedLayoutPrefixLength, handleFarmFormActionRequest, ignoreFarmHeldValues, installFarmIslandValues, parseFarmLayoutChainHeader } from "@farm.js/core/internal/production-runtime";
|
|
6284
6353
|
import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server";
|
|
6285
6354
|
installFarmIslandsServer();
|
|
6286
|
-
const farmFormActionsConfig = ${JSON.stringify(
|
|
6355
|
+
const farmFormActionsConfig = ${JSON.stringify(_chunkFK25QSVCcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
|
|
6287
6356
|
installFarmIslandValues();
|
|
6288
6357
|
${islandsActionKeyCode()}
|
|
6289
6358
|
${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
|
|
@@ -6293,25 +6362,25 @@ ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
|
|
|
6293
6362
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
6294
6363
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
6295
6364
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
6296
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
6365
|
+
const docsHandlerImport = _optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
6297
6366
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
6298
6367
|
const pathname = typeof requestOrPathname === "string"
|
|
6299
6368
|
? requestOrPathname
|
|
6300
6369
|
: new URL(requestOrPathname.url).pathname;
|
|
6301
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
6370
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _145 => _145.apiPath]) || "/api/docs")};
|
|
6302
6371
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
6303
6372
|
};` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
6304
6373
|
import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
|
|
6305
6374
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
6306
6375
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
6307
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
6308
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
6376
|
+
const docsFontImport = _optionalChain([config, 'access', _146 => _146.docs, 'optionalAccess', _147 => _147.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
6377
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _148 => _148.docs, 'optionalAccess', _149 => _149.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
6309
6378
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
6310
6379
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
6311
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
6380
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _150 => _150.md, 'optionalAccess', _151 => _151.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
6312
6381
|
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;";
|
|
6313
6382
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
6314
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
6383
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _152 => _152.mdx, 'optionalAccess', _153 => _153.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
6315
6384
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
6316
6385
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
6317
6386
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -6337,7 +6406,7 @@ ${integrationRuntimeImport}
|
|
|
6337
6406
|
${nativeAuth.importSource}
|
|
6338
6407
|
${nativeMCP.importSource}
|
|
6339
6408
|
`;
|
|
6340
|
-
const imageRuntime =
|
|
6409
|
+
const imageRuntime = _chunkF42U3R4Fcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
6341
6410
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
6342
6411
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
6343
6412
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6516,7 +6585,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
6516
6585
|
|
|
6517
6586
|
function FarmDefault404Page() {
|
|
6518
6587
|
return React.createElement(React.Fragment, null,
|
|
6519
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
6588
|
+
React.createElement("style", null, ${JSON.stringify(_chunkF42U3R4Fcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
6520
6589
|
React.createElement("main", {
|
|
6521
6590
|
className: "farm-default-not-found",
|
|
6522
6591
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -6649,14 +6718,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
6649
6718
|
onError(error) { console.error("[Farm Image]", error); },
|
|
6650
6719
|
})`};
|
|
6651
6720
|
const farmMarkdownConfig = ${JSON.stringify(config.md)};
|
|
6652
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
6653
|
-
${_optionalChain([config, 'access',
|
|
6721
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
6722
|
+
${_optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.llmsTxt, 'optionalAccess', _158 => _158.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
6654
6723
|
const farmMdxConfig = ${JSON.stringify({
|
|
6655
6724
|
...config.mdx,
|
|
6656
|
-
components: typeof _optionalChain([config, 'access',
|
|
6725
|
+
components: typeof _optionalChain([config, 'access', _159 => _159.mdx, 'optionalAccess', _160 => _160.components]) === "string" ? config.mdx.components : void 0
|
|
6657
6726
|
})};
|
|
6658
6727
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
6659
|
-
${_optionalChain([config, 'access',
|
|
6728
|
+
${_optionalChain([config, 'access', _161 => _161.agent, 'optionalAccess', _162 => _162.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
6660
6729
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
6661
6730
|
// to the build.
|
|
6662
6731
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
@@ -6707,7 +6776,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
6707
6776
|
});
|
|
6708
6777
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
6709
6778
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
6710
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
6779
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _163 => _163.docs, 'optionalAccess', _164 => _164.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
6711
6780
|
try {
|
|
6712
6781
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
6713
6782
|
const candidates = [
|
|
@@ -6757,7 +6826,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
6757
6826
|
),
|
|
6758
6827
|
}
|
|
6759
6828
|
: undefined;
|
|
6760
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
6829
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _165 => _165.docs, 'optionalAccess', _166 => _166.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
|
|
6761
6830
|
${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
|
|
6762
6831
|
entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
|
|
6763
6832
|
docsPath: farmDocsResolvedConfig.entry,
|
|
@@ -6791,10 +6860,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _151 => _151.docs, '
|
|
|
6791
6860
|
getApplicableLayouts(getFarmRoutePathname(pathname)).map((layout) => layout.module),
|
|
6792
6861
|
),
|
|
6793
6862
|
fontStylesheetHref: "/farm-fonts.css",
|
|
6794
|
-
|
|
6863
|
+
// The client stylesheet carries globals.css under a content-hashed name.
|
|
6864
|
+
globalStylesheetHref: ${JSON.stringify(FARM_CLIENT_CSS_HREF_PLACEHOLDER)},
|
|
6795
6865
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
6796
6866
|
})` : "null"};
|
|
6797
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
6867
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _167 => _167.docs, 'optionalAccess', _168 => _168.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
|
|
6798
6868
|
|
|
6799
6869
|
// API routes bundled at build time
|
|
6800
6870
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -6819,12 +6889,12 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
6819
6889
|
}
|
|
6820
6890
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
6821
6891
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
6822
|
-
${_optionalChain([config, 'access',
|
|
6823
|
-
` : ""}${_optionalChain([config, 'access',
|
|
6824
|
-
|
|
6892
|
+
${_optionalChain([config, 'access', _169 => _169.agent, 'optionalAccess', _170 => _170.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkJ22JD5YJcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
6893
|
+
` : ""}${_optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
6894
|
+
_chunkJ22JD5YJcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
6825
6895
|
build: config.deploymentId,
|
|
6826
|
-
packages:
|
|
6827
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
6896
|
+
packages: _chunkF42U3R4Fcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
6897
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkF42U3R4Fcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
6828
6898
|
})
|
|
6829
6899
|
)};
|
|
6830
6900
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -7412,7 +7482,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
7412
7482
|
let inner = markup.replace(/^\\s+/, "");
|
|
7413
7483
|
let hoisted = "";
|
|
7414
7484
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
7415
|
-
const hoistable = /${
|
|
7485
|
+
const hoistable = /${_chunk76GHW3WIcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
7416
7486
|
let match;
|
|
7417
7487
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
7418
7488
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -7856,7 +7926,7 @@ async function handleMetadataImageRequest(request, routePathname) {
|
|
|
7856
7926
|
const searchParams = searchParamsToObject(url.searchParams);
|
|
7857
7927
|
const props = {
|
|
7858
7928
|
params: match.params,
|
|
7859
|
-
searchParams:
|
|
7929
|
+
searchParams: createFarmSearchParams(searchParams),
|
|
7860
7930
|
path: match.pagePath,
|
|
7861
7931
|
};
|
|
7862
7932
|
const value = typeof imageModule.default === "function"
|
|
@@ -7943,7 +8013,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
7943
8013
|
// a route guard.
|
|
7944
8014
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
7945
8015
|
pageRoutes.map((route) => route.pattern).filter(
|
|
7946
|
-
(pattern) => !pattern.includes("[") &&
|
|
8016
|
+
(pattern) => !pattern.includes("[") && _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0,
|
|
7947
8017
|
{
|
|
7948
8018
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
7949
8019
|
middlewareRoutes
|
|
@@ -7990,7 +8060,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
7990
8060
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
7991
8061
|
// registered at runtime, such as the docs engine's.
|
|
7992
8062
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
7993
|
-
_chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
8063
|
+
_chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkX5BCMLGPcjs.FARM_VERSION)
|
|
7994
8064
|
)};
|
|
7995
8065
|
let farmDefaultMCPRouteFree;
|
|
7996
8066
|
function getFarmDefaultMCPServer() {
|
|
@@ -8290,7 +8360,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
8290
8360
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
8291
8361
|
return true;
|
|
8292
8362
|
}
|
|
8293
|
-
${_optionalChain([config, 'access',
|
|
8363
|
+
${_optionalChain([config, 'access', _173 => _173.docs, 'optionalAccess', _174 => _174.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
8294
8364
|
if (
|
|
8295
8365
|
isFarmDocsAPIRequest(pathname) ||
|
|
8296
8366
|
docsPath === "/" ||
|
|
@@ -8316,7 +8386,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
8316
8386
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
8317
8387
|
};
|
|
8318
8388
|
}
|
|
8319
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
8389
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _175 => _175.docs, 'optionalAccess', _176 => _176.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
8320
8390
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
8321
8391
|
pathname,
|
|
8322
8392
|
method: request.method,
|
|
@@ -8400,7 +8470,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
8400
8470
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
8401
8471
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
8402
8472
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
8403
|
-
|
|
8473
|
+
_chunkJ22JD5YJcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
8404
8474
|
agent: {
|
|
8405
8475
|
...config.agent,
|
|
8406
8476
|
aiCatalog: servesAiCatalog,
|
|
@@ -8411,9 +8481,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
8411
8481
|
openapi: openAPIReference
|
|
8412
8482
|
})
|
|
8413
8483
|
)});
|
|
8414
|
-
${_optionalChain([config, 'access',
|
|
8484
|
+
${_optionalChain([config, 'access', _177 => _177.docs, 'optionalAccess', _178 => _178.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
8415
8485
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
8416
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
8486
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _179 => _179.apiPath]) || "/api/docs")},
|
|
8417
8487
|
};
|
|
8418
8488
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
8419
8489
|
const farmRouteLabelSlot = Symbol("farm.route.label.slot");
|
|
@@ -8428,11 +8498,11 @@ function labelFarmRequestOptions(options) {
|
|
|
8428
8498
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
8429
8499
|
return options;
|
|
8430
8500
|
}
|
|
8431
|
-
${_optionalChain([config, 'access',
|
|
8501
|
+
${_optionalChain([config, 'access', _180 => _180.docs, 'optionalAccess', _181 => _181.enabled]) ? `if (options.kind === "docs") {
|
|
8432
8502
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
8433
8503
|
return options;
|
|
8434
8504
|
}` : ""}
|
|
8435
|
-
${_optionalChain([config, 'access',
|
|
8505
|
+
${_optionalChain([config, 'access', _182 => _182.md, 'optionalAccess', _183 => _183.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
8436
8506
|
routePathname,
|
|
8437
8507
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
8438
8508
|
);
|
|
@@ -8467,7 +8537,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
8467
8537
|
return applicable;
|
|
8468
8538
|
}
|
|
8469
8539
|
|
|
8470
|
-
${_optionalChain([config, 'access',
|
|
8540
|
+
${_optionalChain([config, 'access', _184 => _184.docs, 'optionalAccess', _185 => _185.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
8471
8541
|
if (request.method === "HEAD") return response;
|
|
8472
8542
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
8473
8543
|
|
|
@@ -8575,7 +8645,7 @@ ${_optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 =>
|
|
|
8575
8645
|
|
|
8576
8646
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
8577
8647
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
8578
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
8648
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _186 => _186.experimental, 'optionalAccess', _187 => _187.ppr]) === true)};
|
|
8579
8649
|
|
|
8580
8650
|
function resolveRouteRenderingView(route) {
|
|
8581
8651
|
// The same merge development uses: baked directive config under the
|
|
@@ -8707,7 +8777,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
8707
8777
|
},
|
|
8708
8778
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
8709
8779
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
8710
|
-
${_optionalChain([config, 'access',
|
|
8780
|
+
${_optionalChain([config, 'access', _188 => _188.md, 'optionalAccess', _189 => _189.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
8711
8781
|
if (matchPageRoute(pathname)) {
|
|
8712
8782
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
8713
8783
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -8917,7 +8987,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8917
8987
|
}
|
|
8918
8988
|
` : ""}
|
|
8919
8989
|
|
|
8920
|
-
${_optionalChain([config, 'access',
|
|
8990
|
+
${_optionalChain([config, 'access', _190 => _190.docs, 'optionalAccess', _191 => _191.enabled]) ? `
|
|
8921
8991
|
// Docs responses are served after app middleware so route guards and
|
|
8922
8992
|
// middleware headers apply to the docs engine like any other page content.
|
|
8923
8993
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -8985,7 +9055,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8985
9055
|
}
|
|
8986
9056
|
` : ""}
|
|
8987
9057
|
|
|
8988
|
-
${_optionalChain([config, 'access',
|
|
9058
|
+
${_optionalChain([config, 'access', _192 => _192.md, 'optionalAccess', _193 => _193.enabled]) ? `
|
|
8989
9059
|
if (farmMarkdownConfig?.enabled) {
|
|
8990
9060
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
8991
9061
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -9084,11 +9154,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9084
9154
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
9085
9155
|
}
|
|
9086
9156
|
` : ""}
|
|
9087
|
-
${_optionalChain([config, 'access',
|
|
9157
|
+
${_optionalChain([config, 'access', _194 => _194.agent, 'optionalAccess', _195 => _195.manifest]) !== false ? `
|
|
9088
9158
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
9089
9159
|
// public manifest, the same document for every request.
|
|
9090
9160
|
if (
|
|
9091
|
-
[${JSON.stringify(
|
|
9161
|
+
[${JSON.stringify(_chunkJ22JD5YJcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkJ22JD5YJcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
9092
9162
|
normalizeRuntimePath(routePathname),
|
|
9093
9163
|
)
|
|
9094
9164
|
) {
|
|
@@ -9098,9 +9168,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9098
9168
|
);
|
|
9099
9169
|
}
|
|
9100
9170
|
` : ""}
|
|
9101
|
-
${_optionalChain([config, 'access',
|
|
9171
|
+
${_optionalChain([config, 'access', _196 => _196.agent, 'optionalAccess', _197 => _197.apiCatalog]) ? `
|
|
9102
9172
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
9103
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
9173
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkJ22JD5YJcjs.FARM_API_CATALOG_PATH)}) {
|
|
9104
9174
|
return applyProductionMiddlewareHeaders(
|
|
9105
9175
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
9106
9176
|
middlewareHeaders,
|
|
@@ -9125,11 +9195,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9125
9195
|
);
|
|
9126
9196
|
}
|
|
9127
9197
|
` : ""}
|
|
9128
|
-
${_optionalChain([config, 'access',
|
|
9198
|
+
${_optionalChain([config, 'access', _198 => _198.agent, 'optionalAccess', _199 => _199.llmsTxt, 'optionalAccess', _200 => _200.enabled]) ? `
|
|
9129
9199
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
9130
9200
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
9131
9201
|
? "llms"
|
|
9132
|
-
: ${_optionalChain([config, 'access',
|
|
9202
|
+
: ${_optionalChain([config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt, 'optionalAccess', _203 => _203.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
9133
9203
|
if (farmGeneratedLlmsKind) {
|
|
9134
9204
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
9135
9205
|
const llmsOrigin = new URL(request.url).origin;
|
|
@@ -9164,7 +9234,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9164
9234
|
}
|
|
9165
9235
|
` : ""}
|
|
9166
9236
|
|
|
9167
|
-
${_optionalChain([config, 'access',
|
|
9237
|
+
${_optionalChain([config, 'access', _204 => _204.docs, 'optionalAccess', _205 => _205.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
9168
9238
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
9169
9239
|
if (docsAPIResponse) {
|
|
9170
9240
|
return applyProductionMiddlewareHeaders(
|
|
@@ -9320,7 +9390,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9320
9390
|
const rawPageProps = withFarmRouteContext(
|
|
9321
9391
|
{
|
|
9322
9392
|
params,
|
|
9323
|
-
searchParams:
|
|
9393
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
9324
9394
|
path: pathname,
|
|
9325
9395
|
...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
|
|
9326
9396
|
},
|
|
@@ -9361,7 +9431,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9361
9431
|
...rawPageProps,
|
|
9362
9432
|
params: parsedParams,
|
|
9363
9433
|
search: parsedSearch,
|
|
9364
|
-
searchParams:
|
|
9434
|
+
searchParams: createFarmSearchParams(parsedSearch),
|
|
9365
9435
|
};
|
|
9366
9436
|
})();
|
|
9367
9437
|
if (
|
|
@@ -9380,7 +9450,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9380
9450
|
const routeStateProps = {
|
|
9381
9451
|
...rawPageProps,
|
|
9382
9452
|
search: searchParamsObj,
|
|
9383
|
-
searchParams:
|
|
9453
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
9384
9454
|
error: routeStateError,
|
|
9385
9455
|
};
|
|
9386
9456
|
if (isFarmNotFoundError(routeStateError) && routeComponents?.notFound) {
|
|
@@ -9409,7 +9479,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9409
9479
|
const rawSlotProps = withFarmRouteContext(
|
|
9410
9480
|
{
|
|
9411
9481
|
params: slot.params,
|
|
9412
|
-
searchParams:
|
|
9482
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
9413
9483
|
path: pathname,
|
|
9414
9484
|
...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
|
|
9415
9485
|
},
|
|
@@ -9436,7 +9506,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9436
9506
|
search: slotSchemas.search?.parse
|
|
9437
9507
|
? slotSchemas.search.parse(searchParamsObj)
|
|
9438
9508
|
: searchParamsObj,
|
|
9439
|
-
searchParams:
|
|
9509
|
+
searchParams: createFarmSearchParams(
|
|
9440
9510
|
slotSchemas.search?.parse
|
|
9441
9511
|
? slotSchemas.search.parse(searchParamsObj)
|
|
9442
9512
|
: searchParamsObj,
|
|
@@ -9700,7 +9770,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9700
9770
|
);
|
|
9701
9771
|
}
|
|
9702
9772
|
}
|
|
9703
|
-
${_optionalChain([config, 'access',
|
|
9773
|
+
${_optionalChain([config, 'access', _206 => _206.md, 'optionalAccess', _207 => _207.enabled]) ? `
|
|
9704
9774
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
9705
9775
|
// using the public path the .md request will be resolved against.
|
|
9706
9776
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -9719,7 +9789,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9719
9789
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
|
|
9720
9790
|
}
|
|
9721
9791
|
|
|
9722
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9792
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _208 => _208.agent, 'optionalAccess', _209 => _209.jsonLd]), () => ( false)))} });
|
|
9723
9793
|
const title = renderedMetadata.title;
|
|
9724
9794
|
const metaTags = renderedMetadata.tags;
|
|
9725
9795
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -10100,7 +10170,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10100
10170
|
reset: function() {},
|
|
10101
10171
|
params,
|
|
10102
10172
|
search: searchParamsObj,
|
|
10103
|
-
searchParams:
|
|
10173
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
10104
10174
|
path: pathname,
|
|
10105
10175
|
...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
|
|
10106
10176
|
});
|
|
@@ -10409,11 +10479,11 @@ ${generatePreloadResponseRuntimeSource()}
|
|
|
10409
10479
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
10410
10480
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
10411
10481
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
10412
|
-
${_optionalChain([config, 'access',
|
|
10482
|
+
${_optionalChain([config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
10413
10483
|
basePath: farmLocalAPIBasePath,
|
|
10414
10484
|
dispatch: async (localRequest) =>
|
|
10415
10485
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
10416
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
10486
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.noindexPreviews]) ? `
|
|
10417
10487
|
// Keep every response of a preview deployment out of search indexes.
|
|
10418
10488
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
10419
10489
|
}
|
|
@@ -10604,13 +10674,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
10604
10674
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
10605
10675
|
return "rewrite";
|
|
10606
10676
|
}
|
|
10607
|
-
if (
|
|
10608
|
-
if (
|
|
10609
|
-
if (
|
|
10677
|
+
if (_chunk76GHW3WIcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
10678
|
+
if (_chunk76GHW3WIcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
10679
|
+
if (_chunkO3MMJPC2cjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
10610
10680
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
10611
10681
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
10612
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
10613
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
10682
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _214 => _214.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
10683
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _215 => _215.regions, 'optionalAccess', _216 => _216.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
10614
10684
|
return "route runtime controls";
|
|
10615
10685
|
}
|
|
10616
10686
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -10624,9 +10694,9 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
10624
10694
|
}
|
|
10625
10695
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
10626
10696
|
return Object.values(routeRules || {}).some((rule) => {
|
|
10627
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
10628
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
10629
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
10697
|
+
const swr = _optionalChain([rule, 'optionalAccess', _217 => _217.swr]);
|
|
10698
|
+
const cache = _optionalChain([rule, 'optionalAccess', _218 => _218.cache]);
|
|
10699
|
+
const headers = _optionalChain([rule, 'optionalAccess', _219 => _219.headers]);
|
|
10630
10700
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
10631
10701
|
});
|
|
10632
10702
|
}
|
|
@@ -10639,10 +10709,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10639
10709
|
const nitroBuilder = nitroBuilderResult.value;
|
|
10640
10710
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
10641
10711
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
10642
|
-
const outputDir =
|
|
10712
|
+
const outputDir = _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
10643
10713
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
10644
10714
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
10645
|
-
const imageRuntime =
|
|
10715
|
+
const imageRuntime = _chunkF42U3R4Fcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
10646
10716
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
10647
10717
|
(image) => image.sourceType === "module"
|
|
10648
10718
|
);
|
|
@@ -10657,14 +10727,14 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10657
10727
|
...useExternalMetadataImageRuntime ? ["@vercel/og"] : []
|
|
10658
10728
|
]);
|
|
10659
10729
|
const isPrebuiltSSRCandidate = preset === "node-server" && [...ssrExternalPackages].every((packageName) => copiedRuntimePackages.has(packageName));
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10730
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
|
|
10731
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
|
|
10732
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
|
|
10663
10733
|
const ssgCollectionPromise = routeManager.collectSSGPages();
|
|
10664
10734
|
const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config));
|
|
10665
10735
|
const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
|
|
10666
|
-
const farmWorkflows = await
|
|
10667
|
-
const farmCron = await
|
|
10736
|
+
const farmWorkflows = await _chunkXB24LZWIcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
|
|
10737
|
+
const farmCron = await _chunkXYL4HSVCcjs.prepareFarmCronForNitro.call(void 0, config);
|
|
10668
10738
|
const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
|
|
10669
10739
|
ssgCollectionPromise,
|
|
10670
10740
|
middlewareRoutesPromise,
|
|
@@ -10677,12 +10747,18 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10677
10747
|
const rewriteSources = configuredRewrites.map((route) => route.source);
|
|
10678
10748
|
const prerenderRoutes = [];
|
|
10679
10749
|
const skippedPrerenderRoutes = [];
|
|
10750
|
+
const middlewareRoutesWithConfig = ssgPages.length > 0 ? await Promise.all(
|
|
10751
|
+
middlewareRoutes.map(async (route) => ({
|
|
10752
|
+
...route,
|
|
10753
|
+
config: await readMiddlewareFileConfig(route.filePath)
|
|
10754
|
+
}))
|
|
10755
|
+
) : middlewareRoutes;
|
|
10680
10756
|
for (const page of ssgPages) {
|
|
10681
10757
|
if (page.revalidate !== void 0) continue;
|
|
10682
10758
|
if (prerenderRoutes.includes(page.urlPath)) continue;
|
|
10683
10759
|
const reason = getPhysicalPrerenderBypassReason({
|
|
10684
10760
|
config,
|
|
10685
|
-
middlewareRoutes,
|
|
10761
|
+
middlewareRoutes: middlewareRoutesWithConfig,
|
|
10686
10762
|
routeRuntimeManifest,
|
|
10687
10763
|
redirectSources,
|
|
10688
10764
|
rewriteSources,
|
|
@@ -10695,21 +10771,21 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10695
10771
|
prerenderRoutes.push(page.urlPath);
|
|
10696
10772
|
}
|
|
10697
10773
|
for (const skipped of skippedPrerenderRoutes) {
|
|
10698
|
-
|
|
10774
|
+
_chunkVQJYGZNXcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
|
|
10699
10775
|
}
|
|
10700
10776
|
if (farmWorkflows.workflows.length > 0) {
|
|
10701
|
-
|
|
10777
|
+
_chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
|
|
10702
10778
|
}
|
|
10703
10779
|
if (farmCron.jobs.length > 0) {
|
|
10704
|
-
|
|
10780
|
+
_chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
|
|
10705
10781
|
}
|
|
10706
10782
|
if (preset === "cloudflare-pages" && farmCron.jobs.length > 0) {
|
|
10707
|
-
|
|
10783
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
10708
10784
|
"Cloudflare Pages does not install Cron Triggers. Use the cloudflare-module preset or an external scheduler with .farm/cron-manifest.json."
|
|
10709
10785
|
);
|
|
10710
10786
|
}
|
|
10711
|
-
const scheduledTasks =
|
|
10712
|
-
const cloudflareCronConfig =
|
|
10787
|
+
const scheduledTasks = _chunkXYL4HSVCcjs.mergeScheduledTasks.call(void 0, farmWorkflows.scheduledTasks, farmCron.scheduledTasks);
|
|
10788
|
+
const cloudflareCronConfig = _chunkXYL4HSVCcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs);
|
|
10713
10789
|
const [clientCssHref, clientJsSrc, docsModulePreloads, clientModulePreloads] = await Promise.all([
|
|
10714
10790
|
resolveHashedClientCssHref(clientOutputDir),
|
|
10715
10791
|
resolveHashedClientJsSrc(clientOutputDir),
|
|
@@ -11074,7 +11150,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
11074
11150
|
] : [],
|
|
11075
11151
|
{
|
|
11076
11152
|
route: "/**",
|
|
11077
|
-
handler:
|
|
11153
|
+
handler: _chunkVQJYGZNXcjs.toPosixPath.call(void 0, nitroEntryPath)
|
|
11078
11154
|
}
|
|
11079
11155
|
],
|
|
11080
11156
|
routeRules: {
|
|
@@ -11119,20 +11195,20 @@ function toFarmNodeResponse(request, response) {
|
|
|
11119
11195
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
11120
11196
|
);
|
|
11121
11197
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
11122
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
11123
|
-
_optionalChain([nitroConfig, 'access',
|
|
11124
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
11198
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _220 => _220.rollupConfig, 'optionalAccess', _221 => _221.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _222 => _222.rollupConfig, 'optionalAccess', _223 => _223.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _224 => _224.output, 'optionalAccess', _225 => _225.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
|
|
11199
|
+
_optionalChain([nitroConfig, 'access', _226 => _226.handlers, 'optionalAccess', _227 => _227.some, 'call', _228 => _228(
|
|
11200
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _229 => _229.handler]) || "") === nitroEntryPath
|
|
11125
11201
|
)])
|
|
11126
11202
|
);
|
|
11127
11203
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
11128
11204
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
11129
11205
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
11130
11206
|
const shouldMinify = nitroConfig.minify !== false;
|
|
11131
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
11207
|
+
const keepServerNames = !(_optionalChain([config, 'access', _230 => _230.docs, 'optionalAccess', _231 => _231.enabled]) && _optionalChain([config, 'access', _232 => _232.docs, 'access', _233 => _233.adapter, 'optionalAccess', _234 => _234.server]));
|
|
11132
11208
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
11133
11209
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
11134
11210
|
if (canReusePrebuiltSSR) {
|
|
11135
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
11211
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _235 => _235.rollupConfig, 'optionalAccess', _236 => _236.plugins]);
|
|
11136
11212
|
nitroConfig.rollupConfig = {
|
|
11137
11213
|
...nitroConfig.rollupConfig,
|
|
11138
11214
|
plugins: [
|
|
@@ -11143,9 +11219,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
11143
11219
|
}
|
|
11144
11220
|
nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
|
|
11145
11221
|
const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
|
|
11146
|
-
if (_optionalChain([config, 'access',
|
|
11222
|
+
if (_optionalChain([config, 'access', _237 => _237.md, 'optionalAccess', _238 => _238.enabled])) {
|
|
11147
11223
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
11148
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
11224
|
+
if (!route.contents || !_optionalChain([route, 'access', _239 => _239.contentType, 'optionalAccess', _240 => _240.toLowerCase, 'call', _241 => _241(), 'access', _242 => _242.includes, 'call', _243 => _243("html")])) return;
|
|
11149
11225
|
const alternatePath = _chunkWJFFPXCVcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
|
|
11150
11226
|
if (!alternatePath) return;
|
|
11151
11227
|
const routeRule = nitroInstance.options.routeRules[route.route] || {};
|
|
@@ -11166,7 +11242,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
11166
11242
|
}
|
|
11167
11243
|
if (config.security.csp && config.security.csp.nonce) {
|
|
11168
11244
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
11169
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
11245
|
+
if (!route.contents || !_optionalChain([route, 'access', _244 => _244.contentType, 'optionalAccess', _245 => _245.toLowerCase, 'call', _246 => _246(), 'access', _247 => _247.includes, 'call', _248 => _248("html")])) return;
|
|
11170
11246
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
11171
11247
|
if (!staticCsp) return;
|
|
11172
11248
|
route.contents = staticCsp.html;
|
|
@@ -11240,14 +11316,14 @@ function toFarmNodeResponse(request, response) {
|
|
|
11240
11316
|
});
|
|
11241
11317
|
}
|
|
11242
11318
|
if (prerenderRoutes.length > 0) {
|
|
11243
|
-
|
|
11244
|
-
const previousPrerender = process.env[
|
|
11245
|
-
process.env[
|
|
11319
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
11320
|
+
const previousPrerender = process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV];
|
|
11321
|
+
process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV] = "1";
|
|
11246
11322
|
try {
|
|
11247
11323
|
await nitroBuilder.prerender(nitroInstance);
|
|
11248
11324
|
} finally {
|
|
11249
|
-
if (previousPrerender === void 0) delete process.env[
|
|
11250
|
-
else process.env[
|
|
11325
|
+
if (previousPrerender === void 0) delete process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV];
|
|
11326
|
+
else process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
11251
11327
|
}
|
|
11252
11328
|
}
|
|
11253
11329
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
|
|
@@ -11299,10 +11375,10 @@ function toFarmNodeResponse(request, response) {
|
|
|
11299
11375
|
if (failedCopy) throw failedCopy.reason;
|
|
11300
11376
|
if (canReusePrebuiltSSR) {
|
|
11301
11377
|
await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs4);
|
|
11302
|
-
|
|
11378
|
+
_chunkVQJYGZNXcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
|
|
11303
11379
|
}
|
|
11304
11380
|
if (useRolldownBuilder) {
|
|
11305
|
-
|
|
11381
|
+
_chunkVQJYGZNXcjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
|
|
11306
11382
|
}
|
|
11307
11383
|
if (pluginManager) {
|
|
11308
11384
|
await pluginManager.runHookParallel("afterNitroBuild", {
|
|
@@ -11315,7 +11391,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
11315
11391
|
if (isVercel) {
|
|
11316
11392
|
await postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest);
|
|
11317
11393
|
}
|
|
11318
|
-
|
|
11394
|
+
_chunkVQJYGZNXcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
|
|
11319
11395
|
}
|
|
11320
11396
|
function resolveFarmNitroOutputConfig(preset, outputDir) {
|
|
11321
11397
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
@@ -11372,7 +11448,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
11372
11448
|
await fs4.rename(src, dest);
|
|
11373
11449
|
return;
|
|
11374
11450
|
} catch (error) {
|
|
11375
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
11451
|
+
const code = _optionalChain([error, 'optionalAccess', _249 => _249.code]);
|
|
11376
11452
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
11377
11453
|
throw error;
|
|
11378
11454
|
}
|
|
@@ -11398,7 +11474,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
11398
11474
|
try {
|
|
11399
11475
|
await moveVercelOutputPath(publicDir, staticDir, fs4);
|
|
11400
11476
|
} catch (error) {
|
|
11401
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
11477
|
+
if (_optionalChain([error, 'optionalAccess', _250 => _250.code]) !== "ENOENT") throw error;
|
|
11402
11478
|
}
|
|
11403
11479
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
|
|
11404
11480
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
|
|
@@ -11415,22 +11491,22 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
11415
11491
|
presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
|
|
11416
11492
|
runtimeRoutes
|
|
11417
11493
|
});
|
|
11418
|
-
const vercelConfigWithWorkflowCrons =
|
|
11494
|
+
const vercelConfigWithWorkflowCrons = _chunkXB24LZWIcjs.applyFarmWorkflowVercelCrons.call(void 0,
|
|
11419
11495
|
vercelConfig,
|
|
11420
11496
|
farmWorkflows.workflows
|
|
11421
11497
|
);
|
|
11422
|
-
const vercelConfigWithCrons =
|
|
11498
|
+
const vercelConfigWithCrons = _chunkXYL4HSVCcjs.applyFarmCronVercelCrons.call(void 0,
|
|
11423
11499
|
vercelConfigWithWorkflowCrons,
|
|
11424
11500
|
config.cron.jobs
|
|
11425
11501
|
);
|
|
11426
11502
|
await fs4.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
|
|
11427
|
-
|
|
11503
|
+
_chunkVQJYGZNXcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
11428
11504
|
}
|
|
11429
11505
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
11430
11506
|
const docsContentDir = resolveBuildDocsContentDir(config, root);
|
|
11431
11507
|
if (!docsContentDir) return;
|
|
11432
11508
|
const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
|
|
11433
|
-
const lastModifiedManifest =
|
|
11509
|
+
const lastModifiedManifest = _chunkIOUOGRDXcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
11434
11510
|
fallback: "now"
|
|
11435
11511
|
});
|
|
11436
11512
|
await fs4.rm(bundledContentDir, { recursive: true, force: true });
|
|
@@ -11440,11 +11516,11 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
|
11440
11516
|
force: true
|
|
11441
11517
|
});
|
|
11442
11518
|
await fs4.writeFile(
|
|
11443
|
-
_path2.default.join(bundledContentDir,
|
|
11519
|
+
_path2.default.join(bundledContentDir, _chunkIOUOGRDXcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
11444
11520
|
`${JSON.stringify(lastModifiedManifest, null, 2)}
|
|
11445
11521
|
`
|
|
11446
11522
|
);
|
|
11447
|
-
|
|
11523
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
|
|
11448
11524
|
}
|
|
11449
11525
|
function resolveServerFunctionPlatform(preset) {
|
|
11450
11526
|
return preset === "vercel" || preset === "netlify" ? { os: "linux", cpu: "x64", libc: "glibc" } : null;
|
|
@@ -11466,7 +11542,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
11466
11542
|
if (!resolvePackageJson(projectRequire, "sharp")) {
|
|
11467
11543
|
try {
|
|
11468
11544
|
sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
11469
|
-
} catch (
|
|
11545
|
+
} catch (e31) {
|
|
11470
11546
|
}
|
|
11471
11547
|
}
|
|
11472
11548
|
const copiedPackages = /* @__PURE__ */ new Map();
|
|
@@ -11511,7 +11587,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
11511
11587
|
try {
|
|
11512
11588
|
await copyPackage("sharp", sharpRequire);
|
|
11513
11589
|
if (!copiedPackages.has("sharp")) {
|
|
11514
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
11590
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkF42U3R4Fcjs.SHARP_INSTALL_HINT}`);
|
|
11515
11591
|
}
|
|
11516
11592
|
} catch (error) {
|
|
11517
11593
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -11538,7 +11614,7 @@ async function installStagedSharpRuntime(staged, nitroFuncDir, fs4) {
|
|
|
11538
11614
|
} finally {
|
|
11539
11615
|
await fs4.rm(staged.stageDir, { recursive: true, force: true });
|
|
11540
11616
|
}
|
|
11541
|
-
|
|
11617
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
11542
11618
|
`\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
|
|
11543
11619
|
);
|
|
11544
11620
|
}
|
|
@@ -11582,7 +11658,7 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs4) {
|
|
|
11582
11658
|
function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
|
|
11583
11659
|
const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
|
|
11584
11660
|
if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
|
|
11585
|
-
const file = generated.modulePath ?
|
|
11661
|
+
const file = generated.modulePath ? _chunkVQJYGZNXcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
|
|
11586
11662
|
throw new Error(
|
|
11587
11663
|
`${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
|
|
11588
11664
|
);
|
|
@@ -11593,7 +11669,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
|
|
|
11593
11669
|
if (packageJsonPath) return packageJsonPath;
|
|
11594
11670
|
try {
|
|
11595
11671
|
return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
|
|
11596
|
-
} catch (
|
|
11672
|
+
} catch (e32) {
|
|
11597
11673
|
return null;
|
|
11598
11674
|
}
|
|
11599
11675
|
}
|
|
@@ -11616,7 +11692,7 @@ async function copyMetadataImageRuntime(root, nitroFuncDir, fs4) {
|
|
|
11616
11692
|
"@vercel/og": String(packageJson.version || "0.11.1")
|
|
11617
11693
|
};
|
|
11618
11694
|
await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
|
|
11619
|
-
|
|
11695
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
|
|
11620
11696
|
}
|
|
11621
11697
|
async function readNitroOutputPackage(outputDir, fs4) {
|
|
11622
11698
|
const packagePath = _path2.default.join(outputDir, "package.json");
|
|
@@ -11640,7 +11716,7 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
11640
11716
|
const resolved = parentRequire.resolve(request);
|
|
11641
11717
|
if (resolved.endsWith(".json")) return resolved;
|
|
11642
11718
|
_nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
|
|
11643
|
-
} catch (
|
|
11719
|
+
} catch (e33) {
|
|
11644
11720
|
}
|
|
11645
11721
|
}
|
|
11646
11722
|
try {
|
|
@@ -11651,13 +11727,13 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
11651
11727
|
try {
|
|
11652
11728
|
const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
|
|
11653
11729
|
if (manifest.name === packageName) return candidate;
|
|
11654
|
-
} catch (
|
|
11730
|
+
} catch (e34) {
|
|
11655
11731
|
}
|
|
11656
11732
|
}
|
|
11657
11733
|
if (_path2.default.basename(directory) === "node_modules") break;
|
|
11658
11734
|
directory = _path2.default.dirname(directory);
|
|
11659
11735
|
}
|
|
11660
|
-
} catch (
|
|
11736
|
+
} catch (e35) {
|
|
11661
11737
|
}
|
|
11662
11738
|
return null;
|
|
11663
11739
|
}
|
|
@@ -11666,13 +11742,13 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
|
|
|
11666
11742
|
let prismaClientDir;
|
|
11667
11743
|
try {
|
|
11668
11744
|
prismaClientDir = _path2.default.dirname(projectRequire.resolve("@prisma/client/default.js"));
|
|
11669
|
-
} catch (
|
|
11745
|
+
} catch (e36) {
|
|
11670
11746
|
return;
|
|
11671
11747
|
}
|
|
11672
11748
|
const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
|
|
11673
11749
|
try {
|
|
11674
11750
|
await fs4.access(generatedClientDir);
|
|
11675
|
-
} catch (
|
|
11751
|
+
} catch (e37) {
|
|
11676
11752
|
return;
|
|
11677
11753
|
}
|
|
11678
11754
|
const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
|
|
@@ -11741,7 +11817,7 @@ function createBuildTargetBaseline(config) {
|
|
|
11741
11817
|
preset,
|
|
11742
11818
|
distDir,
|
|
11743
11819
|
outputDir,
|
|
11744
|
-
outputWasDerived: outputDir ===
|
|
11820
|
+
outputWasDerived: outputDir === _chunkO3MMJPC2cjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
11745
11821
|
};
|
|
11746
11822
|
}
|
|
11747
11823
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -11750,8 +11826,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11750
11826
|
const distDir = config.distDir || ".farm";
|
|
11751
11827
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
11752
11828
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
11753
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
11754
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
11829
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkO3MMJPC2cjs.getDeployTargetForPreset.call(void 0, preset);
|
|
11830
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkO3MMJPC2cjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
11755
11831
|
return {
|
|
11756
11832
|
root,
|
|
11757
11833
|
preset,
|
|
@@ -11759,7 +11835,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11759
11835
|
distDir,
|
|
11760
11836
|
deployTarget,
|
|
11761
11837
|
outputDir,
|
|
11762
|
-
deployOutputDir:
|
|
11838
|
+
deployOutputDir: _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
11763
11839
|
};
|
|
11764
11840
|
}
|
|
11765
11841
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -11796,15 +11872,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11796
11872
|
};
|
|
11797
11873
|
config = {
|
|
11798
11874
|
...config,
|
|
11799
|
-
images:
|
|
11875
|
+
images: _chunkF42U3R4Fcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
11800
11876
|
root: targets.root,
|
|
11801
11877
|
preset: targets.preset
|
|
11802
11878
|
})
|
|
11803
11879
|
};
|
|
11804
|
-
if (_optionalChain([config, 'access',
|
|
11880
|
+
if (_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
|
|
11805
11881
|
pluginManager.updateContext({ config });
|
|
11806
11882
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
11807
|
-
|
|
11883
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
11808
11884
|
await pluginManager.setupPlugins();
|
|
11809
11885
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
11810
11886
|
root,
|
|
@@ -11813,10 +11889,10 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11813
11889
|
distDir,
|
|
11814
11890
|
outputDir: deployOutputDir
|
|
11815
11891
|
});
|
|
11816
|
-
|
|
11892
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
11817
11893
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
11818
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
11819
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
11894
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _253 => _253.status]) === "rejected") throw productionViteResult.reason;
|
|
11895
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _254 => _254.value]);
|
|
11820
11896
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
11821
11897
|
projectModuleServer = await createProjectModuleServer(
|
|
11822
11898
|
createViteServer,
|
|
@@ -11824,27 +11900,27 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11824
11900
|
root,
|
|
11825
11901
|
rendererBuild.signal
|
|
11826
11902
|
);
|
|
11827
|
-
const farmApp =
|
|
11903
|
+
const farmApp = _chunkF42U3R4Fcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
11828
11904
|
await farmApp.initialize();
|
|
11829
11905
|
const routeManager = farmApp.getRouteManager();
|
|
11830
11906
|
const serverRenderer = farmApp.getServerRenderer();
|
|
11831
|
-
const typeArtifacts =
|
|
11907
|
+
const typeArtifacts = _chunkY7TLL65Bcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
11832
11908
|
root,
|
|
11833
11909
|
srcDir,
|
|
11834
11910
|
layers: config.layers,
|
|
11835
11911
|
plugins: config.plugins,
|
|
11836
11912
|
extraRoutes: [
|
|
11837
|
-
..._optionalChain([config, 'access',
|
|
11838
|
-
...
|
|
11913
|
+
..._optionalChain([config, 'access', _255 => _255.openapi, 'optionalAccess', _256 => _256.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
11914
|
+
..._chunkIOUOGRDXcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
11839
11915
|
],
|
|
11840
11916
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
11841
11917
|
componentExtensions: config.renderer.componentExtensions,
|
|
11842
11918
|
i18nConfig: config.i18n
|
|
11843
11919
|
}).catch((error) => {
|
|
11844
11920
|
const message = error instanceof Error ? error.message : String(error);
|
|
11845
|
-
|
|
11921
|
+
_chunkVQJYGZNXcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
11846
11922
|
});
|
|
11847
|
-
const apiRouteManager = new (0,
|
|
11923
|
+
const apiRouteManager = new (0, _chunkKHXAJ2KAcjs.APIRouteManager)(
|
|
11848
11924
|
_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config),
|
|
11849
11925
|
projectModuleServer,
|
|
11850
11926
|
{
|
|
@@ -11870,11 +11946,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11870
11946
|
});
|
|
11871
11947
|
} else {
|
|
11872
11948
|
const { build: legacyViteBuild } = await import("vite");
|
|
11873
|
-
|
|
11949
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client bundle...");
|
|
11874
11950
|
await buildClient2(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "client"));
|
|
11875
|
-
|
|
11951
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building SSR bundle...");
|
|
11876
11952
|
await buildSSR(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "server"));
|
|
11877
|
-
|
|
11953
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
|
|
11878
11954
|
await buildNitro(
|
|
11879
11955
|
config,
|
|
11880
11956
|
routeManager,
|
|
@@ -11895,8 +11971,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11895
11971
|
outputDir: deployOutputDir,
|
|
11896
11972
|
success: true
|
|
11897
11973
|
});
|
|
11898
|
-
|
|
11899
|
-
|
|
11974
|
+
_chunkVQJYGZNXcjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
|
|
11975
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
|
|
11900
11976
|
} catch (error) {
|
|
11901
11977
|
const { root, preset, distDir, deployOutputDir } = _nullishCoalesce(targets, () => ( resolveBuildTargets(config, options, targetBaseline)));
|
|
11902
11978
|
await pluginManager.runHookParallel("onError", {
|
|
@@ -11915,11 +11991,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11915
11991
|
outputDir: deployOutputDir,
|
|
11916
11992
|
success: false
|
|
11917
11993
|
});
|
|
11918
|
-
|
|
11994
|
+
_chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
11919
11995
|
throw error;
|
|
11920
11996
|
} finally {
|
|
11921
11997
|
try {
|
|
11922
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
11998
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _257 => _257.close, 'call', _258 => _258()]);
|
|
11923
11999
|
} finally {
|
|
11924
12000
|
rendererBuild.abort();
|
|
11925
12001
|
}
|
|
@@ -11930,7 +12006,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11930
12006
|
ssr: true,
|
|
11931
12007
|
buildLifetime
|
|
11932
12008
|
});
|
|
11933
|
-
const viteConfig =
|
|
12009
|
+
const viteConfig = _chunkF42U3R4Fcjs.mergeFarmViteConfig.call(void 0,
|
|
11934
12010
|
{
|
|
11935
12011
|
root,
|
|
11936
12012
|
appType: "custom",
|
|
@@ -11942,7 +12018,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11942
12018
|
},
|
|
11943
12019
|
plugins: [
|
|
11944
12020
|
...rendererVitePlugins,
|
|
11945
|
-
|
|
12021
|
+
_chunkF42U3R4Fcjs.farmFontImportsPlugin.call(void 0, {
|
|
11946
12022
|
root,
|
|
11947
12023
|
basePath: config.basePath,
|
|
11948
12024
|
publicDir: config.publicDir
|
|
@@ -11954,7 +12030,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11954
12030
|
hmr: false
|
|
11955
12031
|
},
|
|
11956
12032
|
resolve: {
|
|
11957
|
-
alias:
|
|
12033
|
+
alias: _chunkF42U3R4Fcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
11958
12034
|
dedupe: [...config.renderer.dedupe || []]
|
|
11959
12035
|
},
|
|
11960
12036
|
optimizeDeps: {
|
|
@@ -11987,10 +12063,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11987
12063
|
noDiscovery: true
|
|
11988
12064
|
},
|
|
11989
12065
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
11990
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
12066
|
+
environments: _optionalChain([viteConfig, 'access', _259 => _259.environments, 'optionalAccess', _260 => _260.ssr, 'optionalAccess', _261 => _261.dev, 'optionalAccess', _262 => _262.createEnvironment]) ? viteConfig.environments : {
|
|
11991
12067
|
...viteConfig.environments,
|
|
11992
12068
|
ssr: {
|
|
11993
|
-
..._optionalChain([viteConfig, 'access',
|
|
12069
|
+
..._optionalChain([viteConfig, 'access', _263 => _263.environments, 'optionalAccess', _264 => _264.ssr]),
|
|
11994
12070
|
...await createFarmProjectModuleSsrEnvironment()
|
|
11995
12071
|
}
|
|
11996
12072
|
}
|
|
@@ -12046,7 +12122,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
12046
12122
|
define: {
|
|
12047
12123
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
12048
12124
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
12049
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
12125
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _265 => _265.env, 'optionalAccess', _266 => _266.public]) || {})
|
|
12050
12126
|
},
|
|
12051
12127
|
plugins: [
|
|
12052
12128
|
farmI18nClientBridgePlugin(),
|
|
@@ -12066,7 +12142,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
|
|
|
12066
12142
|
}
|
|
12067
12143
|
async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
|
|
12068
12144
|
const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
|
|
12069
|
-
import("./nitro-
|
|
12145
|
+
import("./nitro-CK7M4RMY.cjs"),
|
|
12070
12146
|
import("nitro/builder")
|
|
12071
12147
|
]);
|
|
12072
12148
|
let nitroConfig = await createNitroConfig(
|
|
@@ -12079,7 +12155,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12079
12155
|
if (pluginManager) {
|
|
12080
12156
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
12081
12157
|
}
|
|
12082
|
-
const outputDir =
|
|
12158
|
+
const outputDir = _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12083
12159
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
12084
12160
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
12085
12161
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -12089,7 +12165,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12089
12165
|
try {
|
|
12090
12166
|
await mkdir(publicOutputDir, { recursive: true });
|
|
12091
12167
|
await cp(clientDir, publicOutputDir, { recursive: true });
|
|
12092
|
-
|
|
12168
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied client assets to public directory");
|
|
12093
12169
|
const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
|
|
12094
12170
|
const assetsDir = _path2.default.join(publicOutputDir, "assets");
|
|
12095
12171
|
const manifestExists = await import("fs/promises").then(
|
|
@@ -12099,12 +12175,12 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12099
12175
|
(fs4) => fs4.access(assetsDir).then(() => true).catch(() => false)
|
|
12100
12176
|
);
|
|
12101
12177
|
if (manifestExists && assetsExist) {
|
|
12102
|
-
|
|
12178
|
+
_chunkVQJYGZNXcjs.logger.info("\u2705 Verified client assets are present");
|
|
12103
12179
|
} else {
|
|
12104
|
-
|
|
12180
|
+
_chunkVQJYGZNXcjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
|
|
12105
12181
|
}
|
|
12106
12182
|
} catch (error) {
|
|
12107
|
-
|
|
12183
|
+
_chunkVQJYGZNXcjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
|
|
12108
12184
|
throw error;
|
|
12109
12185
|
}
|
|
12110
12186
|
const serverDir = _path2.default.join(root, distDir, "server");
|
|
@@ -12112,9 +12188,9 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12112
12188
|
try {
|
|
12113
12189
|
await mkdir(nitroServerDir, { recursive: true });
|
|
12114
12190
|
await cp(serverDir, nitroServerDir, { recursive: true });
|
|
12115
|
-
|
|
12191
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
|
|
12116
12192
|
} catch (error) {
|
|
12117
|
-
|
|
12193
|
+
_chunkVQJYGZNXcjs.logger.warn(`Could not copy SSR bundles: ${error}`);
|
|
12118
12194
|
}
|
|
12119
12195
|
const nitro = await createNitro(nitroConfig);
|
|
12120
12196
|
const registryPath = _path2.default.join(root, distDir, ".nitro", "server", "farm-registry.ts");
|
|
@@ -12138,11 +12214,11 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12138
12214
|
const { readFile } = await import("fs/promises");
|
|
12139
12215
|
const manifestContent = await readFile(clientManifestPath, "utf-8");
|
|
12140
12216
|
farmRegistry.clientManifest = JSON.parse(manifestContent);
|
|
12141
|
-
} catch (
|
|
12217
|
+
} catch (e38) {
|
|
12142
12218
|
farmRegistry.clientManifest = {};
|
|
12143
12219
|
}
|
|
12144
12220
|
} catch (error) {
|
|
12145
|
-
|
|
12221
|
+
_chunkVQJYGZNXcjs.logger.warn(`Could not populate registry: ${error}`);
|
|
12146
12222
|
}
|
|
12147
12223
|
await nitroBuild(nitro);
|
|
12148
12224
|
if (pluginManager) {
|
|
@@ -12150,7 +12226,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12150
12226
|
root,
|
|
12151
12227
|
preset,
|
|
12152
12228
|
distDir,
|
|
12153
|
-
outputDir:
|
|
12229
|
+
outputDir: _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
12154
12230
|
});
|
|
12155
12231
|
}
|
|
12156
12232
|
}
|