@farm.js/core 0.1.42 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-ssVy_tea.d.mts → agent-mcp-3KDz4hr9.d.mts} +1 -1
- package/dist/{agent-mcp-SSD6L3VZ.d.ts → agent-mcp-6yRebHk7.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +2 -2
- package/dist/api.d.mts +8 -3
- package/dist/api.d.ts +8 -3
- package/dist/api.mjs +1 -1
- package/dist/{app-KjFzdCqy.d.ts → app-8Db1zR-2.d.ts} +8 -4
- package/dist/{app-1h3lVT4a.d.mts → app-DlTWv4cn.d.mts} +8 -4
- package/dist/{app-manifest-D3RkVNuS.d.mts → app-manifest-TRzS7ZZ9.d.mts} +1 -1
- package/dist/{app-manifest-DaW8-tvX.d.ts → app-manifest-cO2jkG1F.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{chunk-ECKF2BAM.cjs → chunk-2GVF3C2F.cjs} +255 -42
- package/dist/chunk-2NXO5SBY.mjs +57 -0
- package/dist/chunk-3BROEWFY.cjs +39 -0
- package/dist/{chunk-NU25TRIO.mjs → chunk-4MRQ5OKQ.mjs} +11 -7
- package/dist/{chunk-375K2ZVU.mjs → chunk-4OCEMK72.mjs} +259 -48
- package/dist/{chunk-6PKXK4TY.mjs → chunk-53ZV6K65.mjs} +1 -1
- package/dist/{chunk-LYIZHJTK.cjs → chunk-5LPHJZSI.cjs} +14 -14
- package/dist/chunk-5NIWBWDD.mjs +97 -0
- package/dist/{chunk-NRDBW4MP.mjs → chunk-7IQQIPRZ.mjs} +10 -0
- package/dist/{chunk-QTEJGB5A.mjs → chunk-7SCCY6SI.mjs} +79 -176
- package/dist/chunk-APDGOKKE.cjs +148 -0
- package/dist/chunk-AZBSVLRM.cjs +132 -0
- package/dist/{chunk-ZS6HDNOM.cjs → chunk-BKPXWRTT.cjs} +6 -6
- package/dist/chunk-CEDPEDNW.cjs +98 -0
- package/dist/chunk-D5RFPV2H.mjs +148 -0
- package/dist/{chunk-724JLMS4.mjs → chunk-F646BZ4Y.mjs} +4 -2
- package/dist/{chunk-C5KVWHIH.cjs → chunk-G2Z5DGMS.cjs} +5 -3
- package/dist/{chunk-7YHSD3Z6.cjs → chunk-GVNCWSQV.cjs} +83 -29
- package/dist/{chunk-24SP5TGU.mjs → chunk-H4LXPWI2.mjs} +2 -2
- package/dist/chunk-H7BLEEAE.cjs +57 -0
- package/dist/{chunk-QKZMB7LY.cjs → chunk-HUMEHX24.cjs} +2 -2
- package/dist/{chunk-BD3D7EZV.cjs → chunk-IXFOBGLQ.cjs} +9 -3
- package/dist/{chunk-JG3MEQUH.cjs → chunk-JDJAPCR2.cjs} +420 -209
- package/dist/{chunk-MHN4UR5U.cjs → chunk-KFZZFZ7J.cjs} +7 -7
- package/dist/chunk-LRJRXXQZ.cjs +109 -0
- package/dist/{chunk-BXJ5HJTJ.cjs → chunk-LVABUXLA.cjs} +15 -11
- package/dist/{chunk-HCSVR4YZ.mjs → chunk-M3BXTWJM.mjs} +18 -0
- package/dist/{chunk-2JZHQDUY.mjs → chunk-NXO75WY4.mjs} +1 -1
- package/dist/{chunk-TUL355PH.mjs → chunk-OYSGGV6O.mjs} +135 -160
- package/dist/{chunk-JR4QCLJY.cjs → chunk-PDU4P2IC.cjs} +19 -1
- package/dist/chunk-PJEHUSHA.mjs +229 -0
- package/dist/chunk-QGH2RQVF.mjs +132 -0
- package/dist/{chunk-YWMZUGIS.mjs → chunk-R3ZFQJEF.mjs} +247 -34
- package/dist/{chunk-ZATTDMBW.cjs → chunk-RACQTC7K.cjs} +270 -367
- package/dist/{chunk-WSOBCAYO.cjs → chunk-RQYTOFQM.cjs} +23 -23
- package/dist/chunk-S34OBRMZ.mjs +109 -0
- package/dist/{chunk-TS4JHGUJ.mjs → chunk-S3ZEMCE6.mjs} +9 -3
- package/dist/{chunk-WWFTAUFG.cjs → chunk-SBH2JLLF.cjs} +12 -2
- package/dist/{chunk-YSLWRWWP.cjs → chunk-SKK6UF5P.cjs} +200 -46
- package/dist/chunk-T7J7E63D.cjs +144 -0
- package/dist/{chunk-PIZXONIS.mjs → chunk-TESO7EFU.mjs} +55 -1
- package/dist/{chunk-TCJ4A4A2.cjs → chunk-VIVQERJ5.cjs} +318 -344
- package/dist/{chunk-JIYYX7WU.mjs → chunk-VLXNGUKO.mjs} +1 -1
- package/dist/{chunk-OFZUJMCU.mjs → chunk-WPJQN64R.mjs} +195 -41
- package/dist/chunk-XARSG2TG.mjs +144 -0
- package/dist/chunk-XUGFRFD2.mjs +39 -0
- package/dist/{chunk-AHFRQMRX.cjs → chunk-YBDSTNMH.cjs} +1 -1
- package/dist/{chunk-U2UC7UGP.mjs → chunk-YGZH4T2X.mjs} +1 -1
- package/dist/chunk-YKUEJ3MG.cjs +229 -0
- package/dist/{chunk-IVQY6UTY.mjs → chunk-ZYWJIPKQ.mjs} +1 -1
- package/dist/{client-plugins-C9Py_50W.d.mts → client-plugins-Cv0OJtnM.d.mts} +21 -2
- package/dist/{client-plugins-DIem0I0W.d.ts → client-plugins-kwQuZcWq.d.ts} +21 -2
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +4 -3
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +3 -2
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-Q3LBNUJ7.mjs → devtools-M22FEFPK.mjs} +3 -3
- package/dist/{devtools-2RY3EKHL.cjs → devtools-MLB3JJMC.cjs} +4 -4
- package/dist/docs.cjs +5 -5
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +4 -4
- package/dist/index-CQOp8EmB.d.mts +48 -0
- package/dist/index-DAl0QTZS.d.ts +48 -0
- package/dist/index.cjs +40 -23
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.mjs +45 -28
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +28 -14
- package/dist/internal/build-runtime.d.mts +12 -16
- package/dist/internal/build-runtime.d.ts +12 -16
- package/dist/internal/build-runtime.mjs +27 -13
- package/dist/internal/cli-runtime.cjs +22 -10
- package/dist/internal/cli-runtime.mjs +22 -10
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +5 -1
- package/dist/internal/client-runtime.d.mts +1 -0
- package/dist/internal/client-runtime.d.ts +1 -0
- package/dist/internal/client-runtime.mjs +4 -0
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/form-actions-client.cjs +18 -0
- package/dist/internal/form-actions-client.d.mts +5 -0
- package/dist/internal/form-actions-client.d.ts +5 -0
- package/dist/internal/form-actions-client.mjs +18 -0
- package/dist/internal/form-actions.cjs +18 -0
- package/dist/internal/form-actions.d.mts +14 -0
- package/dist/internal/form-actions.d.ts +14 -0
- package/dist/internal/form-actions.mjs +18 -0
- package/dist/internal/island-codec.cjs +22 -0
- package/dist/internal/island-codec.d.mts +29 -0
- package/dist/internal/island-codec.d.ts +29 -0
- package/dist/internal/island-codec.mjs +22 -0
- package/dist/internal/island-value-store.cjs +13 -0
- package/dist/internal/island-value-store.d.mts +6 -0
- package/dist/internal/island-value-store.d.ts +6 -0
- package/dist/internal/island-value-store.mjs +13 -0
- package/dist/internal/islands-runtime.cjs +77 -0
- package/dist/internal/islands-runtime.d.mts +57 -0
- package/dist/internal/islands-runtime.d.ts +57 -0
- package/dist/internal/islands-runtime.mjs +77 -0
- package/dist/internal/islands-server.cjs +19 -0
- package/dist/internal/islands-server.d.mts +3 -0
- package/dist/internal/islands-server.d.ts +3 -0
- package/dist/internal/islands-server.mjs +19 -0
- package/dist/internal/islx-client.cjs +5 -0
- package/dist/internal/islx-client.d.mts +2 -0
- package/dist/internal/islx-client.d.ts +2 -0
- package/dist/internal/islx-client.mjs +3 -0
- package/dist/internal/islx-react.cjs +4 -0
- package/dist/internal/islx-react.d.mts +1 -0
- package/dist/internal/islx-react.d.ts +1 -0
- package/dist/internal/islx-react.mjs +2 -0
- package/dist/internal/islx-server.cjs +5 -0
- package/dist/internal/islx-server.d.mts +2 -0
- package/dist/internal/islx-server.d.ts +2 -0
- package/dist/internal/islx-server.mjs +3 -0
- package/dist/internal/isolated-boundary.cjs +4 -3
- package/dist/internal/isolated-boundary.d.mts +13 -1
- package/dist/internal/isolated-boundary.d.ts +13 -1
- package/dist/internal/isolated-boundary.mjs +3 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +23 -6
- package/dist/internal/production-runtime.d.mts +20 -10
- package/dist/internal/production-runtime.d.ts +20 -10
- package/dist/internal/production-runtime.mjs +23 -6
- package/dist/internal/server-tree.cjs +6 -3
- package/dist/internal/server-tree.d.mts +25 -2
- package/dist/internal/server-tree.d.ts +25 -2
- package/dist/internal/server-tree.mjs +7 -4
- package/dist/island-value-protocol-BRayRghM.d.mts +12 -0
- package/dist/island-value-protocol-BRayRghM.d.ts +12 -0
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/navigation.cjs +5 -4
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +4 -3
- package/dist/og.d.mts +5 -0
- package/dist/og.d.ts +5 -0
- package/dist/plugin.cjs +17 -11
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +16 -10
- package/dist/{production-runtime-bjjWq-DA.d.ts → production-runtime-5nArjFpn.d.ts} +1 -1
- package/dist/{production-runtime-CHFKIgpW.d.mts → production-runtime-BzsF2z5F.d.mts} +1 -1
- package/dist/query/client.cjs +6 -5
- package/dist/query/client.mjs +2 -1
- package/dist/{render-plan-DOHg6wdO.d.mts → render-plan-B9yQorV4.d.mts} +4 -2
- package/dist/{render-plan-B2UndB4x.d.ts → render-plan-fg6E_HvL.d.ts} +4 -2
- package/dist/renderer/react/server.cjs +7 -6
- package/dist/renderer/react/server.d.mts +3 -1
- package/dist/renderer/react/server.d.ts +3 -1
- package/dist/renderer/react/server.mjs +5 -4
- package/dist/renderer-client.cjs +5 -4
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +2 -1
- package/dist/renderer.d.mts +3 -1
- package/dist/renderer.d.ts +3 -1
- package/dist/{request-DQcGfdgQ.d.mts → request-C4j_g-BH.d.mts} +1 -1
- package/dist/{request-DVNXRQrI.d.ts → request-gz8vFK0n.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering-B_6fj-GG.d.ts → route-rendering-DamyKVi3.d.ts} +1 -1
- package/dist/{route-rendering-CEX4mFn-.d.mts → route-rendering-iTTOwz1f.d.mts} +1 -1
- package/dist/{router-CKHPBKXX.d.mts → router-EoSzHlos.d.mts} +1 -1
- package/dist/{router-CHEMHm1P.d.ts → router-OVjDqVo8.d.ts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/rsc-pipeline-LK4K5JFK.mjs +77 -0
- package/dist/rsc-pipeline-YCDRJME4.cjs +77 -0
- package/dist/{runtime-Br2ZDTAv.d.ts → runtime-CwiuozLd.d.ts} +1 -1
- package/dist/{runtime-jj8TKNsy.d.mts → runtime-DDH4tiuF.d.mts} +1 -1
- package/dist/{schema-dev-notice-5JPE67AI.cjs → schema-dev-notice-77ZL23PL.cjs} +4 -4
- package/dist/{schema-dev-notice-WLPZ6WKU.mjs → schema-dev-notice-BLXOS6U2.mjs} +2 -2
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +55 -37
- package/dist/server.d.mts +15 -10
- package/dist/server.d.ts +15 -10
- package/dist/server.mjs +35 -17
- package/dist/{spa-router-BEvS9Erj.d.mts → spa-router-Br4qFCWf.d.mts} +8 -3
- package/dist/{spa-router-DmCuH5B7.d.ts → spa-router-BsWUKH73.d.ts} +8 -3
- package/dist/{ssg-gT093ETk.d.ts → ssg-Csy2vwpi.d.ts} +2 -2
- package/dist/{ssg-57v6cZcW.d.mts → ssg-Donyfcxy.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils-CCTKvR-P.d.ts → utils-Luk72LXC.d.ts} +1 -1
- package/dist/{utils-raHHQVyL.d.mts → utils-d_k1ZZw0.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +17 -11
- package/dist/vite.d.mts +6 -4
- package/dist/vite.d.ts +6 -4
- package/dist/vite.mjs +16 -10
- package/package.json +53 -1
- package/dist/{chunk-35WS7P2V.mjs → chunk-26CXZR6L.mjs} +3 -3
- package/dist/{chunk-QEILRWVV.cjs → chunk-3XEMGDBF.cjs} +2 -2
- package/dist/{chunk-BPOTSHDO.cjs → chunk-IOAUK4OI.cjs} +2 -2
- package/dist/{chunk-BYR3RQPB.mjs → chunk-T76H22WI.mjs} +4 -4
|
@@ -1,5 +1,9 @@
|
|
|
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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return 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
|
+
|
|
4
|
+
var _chunkCEDPEDNWcjs = require('./chunk-CEDPEDNW.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
3
7
|
var _chunkKEXK442Icjs = require('./chunk-KEXK442I.cjs');
|
|
4
8
|
|
|
5
9
|
|
|
@@ -26,19 +30,21 @@ var _chunkKEXK442Icjs = require('./chunk-KEXK442I.cjs');
|
|
|
26
30
|
|
|
27
31
|
|
|
28
32
|
|
|
33
|
+
var _chunkRACQTC7Kcjs = require('./chunk-RACQTC7K.cjs');
|
|
29
34
|
|
|
30
35
|
|
|
36
|
+
var _chunk45QJHGZMcjs = require('./chunk-45QJHGZM.cjs');
|
|
31
37
|
|
|
32
38
|
|
|
39
|
+
var _chunkLRJRXXQZcjs = require('./chunk-LRJRXXQZ.cjs');
|
|
33
40
|
|
|
34
|
-
var _chunkZATTDMBWcjs = require('./chunk-ZATTDMBW.cjs');
|
|
35
41
|
|
|
36
42
|
|
|
37
|
-
var
|
|
43
|
+
var _chunk3XEMGDBFcjs = require('./chunk-3XEMGDBF.cjs');
|
|
44
|
+
|
|
38
45
|
|
|
39
46
|
|
|
40
47
|
|
|
41
|
-
var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
|
|
42
48
|
|
|
43
49
|
|
|
44
50
|
|
|
@@ -52,7 +58,7 @@ var _chunkQEILRWVVcjs = require('./chunk-QEILRWVV.cjs');
|
|
|
52
58
|
|
|
53
59
|
|
|
54
60
|
|
|
55
|
-
var
|
|
61
|
+
var _chunkGVNCWSQVcjs = require('./chunk-GVNCWSQV.cjs');
|
|
56
62
|
|
|
57
63
|
|
|
58
64
|
var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
|
|
@@ -74,7 +80,8 @@ var _chunkCY2ZQ5C6cjs = require('./chunk-CY2ZQ5C6.cjs');
|
|
|
74
80
|
var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
|
|
75
81
|
|
|
76
82
|
|
|
77
|
-
|
|
83
|
+
|
|
84
|
+
var _chunkPDU4P2ICcjs = require('./chunk-PDU4P2IC.cjs');
|
|
78
85
|
|
|
79
86
|
|
|
80
87
|
|
|
@@ -211,7 +218,7 @@ var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
|
|
|
211
218
|
var _chunk5NAVKJCZcjs = require('./chunk-5NAVKJCZ.cjs');
|
|
212
219
|
|
|
213
220
|
|
|
214
|
-
var
|
|
221
|
+
var _chunkYBDSTNMHcjs = require('./chunk-YBDSTNMH.cjs');
|
|
215
222
|
|
|
216
223
|
|
|
217
224
|
var _chunkS3A45T7Fcjs = require('./chunk-S3A45T7F.cjs');
|
|
@@ -244,12 +251,34 @@ var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
|
244
251
|
|
|
245
252
|
|
|
246
253
|
|
|
247
|
-
|
|
248
254
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
249
255
|
|
|
256
|
+
// src/form-actions-transform.ts
|
|
257
|
+
var _crypto = require('crypto');
|
|
258
|
+
var _compiler = require('@farm.js/islx/compiler');
|
|
259
|
+
var _path = require('path'); var path2 = _interopRequireWildcard(_path); var path5 = _interopRequireWildcard(_path); var path3 = _interopRequireWildcard(_path);
|
|
260
|
+
function transformFarmFormActionModule(options) {
|
|
261
|
+
const result = _compiler.transformActions.call(void 0, {
|
|
262
|
+
code: options.code,
|
|
263
|
+
id: options.id,
|
|
264
|
+
root: options.root,
|
|
265
|
+
environment: options.ssr ? "server" : "client",
|
|
266
|
+
parse: options.parse,
|
|
267
|
+
runtime: {
|
|
268
|
+
server: "@farm.js/core/internal/islx-server",
|
|
269
|
+
client: "@farm.js/core/internal/islx-client"
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
return result ? result.code : null;
|
|
273
|
+
}
|
|
274
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, transformFarmFormActionModule, "transformFarmFormActionModule");
|
|
275
|
+
|
|
276
|
+
// src/vite.ts
|
|
277
|
+
var _vite = require('vite');
|
|
278
|
+
|
|
250
279
|
// src/dev-preview-guard.ts
|
|
251
280
|
var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs = _interopRequireWildcard(_fs);
|
|
252
|
-
|
|
281
|
+
|
|
253
282
|
var FARM_PREVIEW_REQUEST_HEADER = "x-farm-preview";
|
|
254
283
|
function isFarmPreviewTunnelRequest(headers) {
|
|
255
284
|
return headers[FARM_PREVIEW_REQUEST_HEADER] !== void 0;
|
|
@@ -265,10 +294,10 @@ var VITE_DEFAULT_FS_DENY = [
|
|
|
265
294
|
];
|
|
266
295
|
function getFarmDevFsDeny(userDeny, options) {
|
|
267
296
|
const deny = ["**/.farm/**"];
|
|
268
|
-
const root =
|
|
269
|
-
const distDir = options.distDir ?
|
|
270
|
-
const relativeDistDir = distDir ?
|
|
271
|
-
if (distDir && relativeDistDir && relativeDistDir !== ".farm" && relativeDistDir !== ".." && !relativeDistDir.startsWith(`..${
|
|
297
|
+
const root = path2.resolve(options.root || process.cwd());
|
|
298
|
+
const distDir = options.distDir ? path2.resolve(root, options.distDir) : void 0;
|
|
299
|
+
const relativeDistDir = distDir ? path2.relative(root, distDir) : "";
|
|
300
|
+
if (distDir && relativeDistDir && relativeDistDir !== ".farm" && relativeDistDir !== ".." && !relativeDistDir.startsWith(`..${path2.sep}`) && !/[*?[\]{}()!+@]/.test(distDir)) {
|
|
272
301
|
deny.push(`${distDir.replace(/\\/g, "/")}/**`);
|
|
273
302
|
}
|
|
274
303
|
return userDeny ? deny : [...VITE_DEFAULT_FS_DENY, ...deny];
|
|
@@ -314,7 +343,7 @@ async function isAllowedPreviewRequest(server, options, req) {
|
|
|
314
343
|
const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _3 => _3.moduleGraph, 'access', _4 => _4.getModuleByUrl, 'call', _5 => _5(url)])), "inClientGraph");
|
|
315
344
|
if (SOURCE_QUERY_FLAGS.some((flag) => query.has(flag))) return inClientGraph();
|
|
316
345
|
if (await inClientGraph()) return true;
|
|
317
|
-
if (file.split(
|
|
346
|
+
if (file.split(path2.sep).includes("node_modules")) return true;
|
|
318
347
|
if (server.config.publicDir && isInside(await realpathOr(server.config.publicDir), file)) {
|
|
319
348
|
return true;
|
|
320
349
|
}
|
|
@@ -322,8 +351,8 @@ async function isAllowedPreviewRequest(server, options, req) {
|
|
|
322
351
|
if (!isModuleOrAsset) return false;
|
|
323
352
|
for (const source of options.getSourceRoots()) {
|
|
324
353
|
const sourceRoot = await realpathOr(source.root);
|
|
325
|
-
const sourceDir = await realpathOr(
|
|
326
|
-
if (sourceRoot === sourceDir &&
|
|
354
|
+
const sourceDir = await realpathOr(path2.resolve(source.root, source.srcDir));
|
|
355
|
+
if (sourceRoot === sourceDir && path2.dirname(file) === sourceDir) continue;
|
|
327
356
|
if (isInside(sourceDir, file)) return true;
|
|
328
357
|
}
|
|
329
358
|
return false;
|
|
@@ -342,9 +371,9 @@ async function resolveRequestedFile(server, pathname) {
|
|
|
342
371
|
}
|
|
343
372
|
const resolved = await _optionalChain([server, 'access', _6 => _6.environments, 'optionalAccess', _7 => _7.client, 'optionalAccess', _8 => _8.pluginContainer, 'access', _9 => _9.resolveId, 'call', _10 => _10(id, void 0)]);
|
|
344
373
|
const resolvedId = _optionalChain([resolved, 'optionalAccess', _11 => _11.id, 'access', _12 => _12.replace, 'call', _13 => _13(/[?#].*$/, "")]);
|
|
345
|
-
if (resolvedId &&
|
|
374
|
+
if (resolvedId && path2.isAbsolute(resolvedId)) candidate = resolvedId;
|
|
346
375
|
else if (_optionalChain([resolvedId, 'optionalAccess', _14 => _14.startsWith, 'call', _15 => _15("\0")])) return void 0;
|
|
347
|
-
else if (id.startsWith("/")) candidate =
|
|
376
|
+
else if (id.startsWith("/")) candidate = path2.join(server.config.root, id);
|
|
348
377
|
}
|
|
349
378
|
if (!candidate) return void 0;
|
|
350
379
|
try {
|
|
@@ -359,13 +388,13 @@ async function realpathOr(directory) {
|
|
|
359
388
|
try {
|
|
360
389
|
return await _fs.promises.realpath(directory);
|
|
361
390
|
} catch (e4) {
|
|
362
|
-
return
|
|
391
|
+
return path2.resolve(directory);
|
|
363
392
|
}
|
|
364
393
|
}
|
|
365
394
|
_chunkS3JO3N4Hcjs.__name.call(void 0, realpathOr, "realpathOr");
|
|
366
395
|
function isInside(directory, file) {
|
|
367
|
-
const relative2 =
|
|
368
|
-
return relative2 !== "" && relative2 !== ".." && !relative2.startsWith(`..${
|
|
396
|
+
const relative2 = path2.relative(directory, file);
|
|
397
|
+
return relative2 !== "" && relative2 !== ".." && !relative2.startsWith(`..${path2.sep}`) && !path2.isAbsolute(relative2);
|
|
369
398
|
}
|
|
370
399
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isInside, "isInside");
|
|
371
400
|
|
|
@@ -423,9 +452,9 @@ function devServableFileExists(pathname, baseDirs) {
|
|
|
423
452
|
if (!relativePathname) return false;
|
|
424
453
|
for (const baseDir of baseDirs) {
|
|
425
454
|
if (typeof baseDir !== "string" || baseDir.length === 0) continue;
|
|
426
|
-
const resolvedBase =
|
|
427
|
-
const candidate =
|
|
428
|
-
if (!candidate.startsWith(resolvedBase +
|
|
455
|
+
const resolvedBase = path3.resolve(baseDir);
|
|
456
|
+
const candidate = path3.resolve(resolvedBase, relativePathname);
|
|
457
|
+
if (!candidate.startsWith(resolvedBase + path3.sep)) continue;
|
|
429
458
|
try {
|
|
430
459
|
if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {
|
|
431
460
|
return true;
|
|
@@ -639,90 +668,6 @@ async function createBlurDataURL(bytes) {
|
|
|
639
668
|
}
|
|
640
669
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createBlurDataURL, "createBlurDataURL");
|
|
641
670
|
|
|
642
|
-
// src/react-refresh.ts
|
|
643
|
-
var _module = require('module');
|
|
644
|
-
|
|
645
|
-
var REACT_REFRESH_PLUGIN = "vite:react-refresh";
|
|
646
|
-
var FARM_REACT_REFRESH_PREAMBLE_ID = "/@farm/react-refresh-preamble";
|
|
647
|
-
var FARM_OWNED = /* @__PURE__ */ Symbol.for("farm.react-refresh.owned");
|
|
648
|
-
function isFarmReactRefreshActive(config) {
|
|
649
|
-
return config.command === "serve" && !config.isProduction && config.server.hmr !== false && config.plugins.some((plugin) => plugin.name === REACT_REFRESH_PLUGIN);
|
|
650
|
-
}
|
|
651
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmReactRefreshActive, "isFarmReactRefreshActive");
|
|
652
|
-
function isFarmClientEntryId(id) {
|
|
653
|
-
const pathname = id.split("?", 1)[0];
|
|
654
|
-
return pathname === "/@farm/client" || pathname === "/@farm/client.js";
|
|
655
|
-
}
|
|
656
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmClientEntryId, "isFarmClientEntryId");
|
|
657
|
-
function hasAppReactPlugin(plugins) {
|
|
658
|
-
const pending = [..._nullishCoalesce(plugins, () => ( []))];
|
|
659
|
-
while (pending.length > 0) {
|
|
660
|
-
const entry = pending.pop();
|
|
661
|
-
if (Array.isArray(entry)) {
|
|
662
|
-
pending.push(...entry);
|
|
663
|
-
continue;
|
|
664
|
-
}
|
|
665
|
-
if (!entry || typeof entry !== "object" || "then" in entry) continue;
|
|
666
|
-
if (entry.name === REACT_REFRESH_PLUGIN && !(FARM_OWNED in entry)) return true;
|
|
667
|
-
}
|
|
668
|
-
return false;
|
|
669
|
-
}
|
|
670
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, hasAppReactPlugin, "hasAppReactPlugin");
|
|
671
|
-
function createFarmReactRefreshPreamblePlugin() {
|
|
672
|
-
let active = false;
|
|
673
|
-
return {
|
|
674
|
-
name: "farm:react-refresh-preamble",
|
|
675
|
-
apply: "serve",
|
|
676
|
-
configResolved(config) {
|
|
677
|
-
active = isFarmReactRefreshActive(config);
|
|
678
|
-
},
|
|
679
|
-
resolveId(id) {
|
|
680
|
-
if (id === FARM_REACT_REFRESH_PREAMBLE_ID) return id;
|
|
681
|
-
},
|
|
682
|
-
load(id) {
|
|
683
|
-
if (id !== FARM_REACT_REFRESH_PREAMBLE_ID) return;
|
|
684
|
-
if (!active) return "";
|
|
685
|
-
return `import RefreshRuntime from "/@react-refresh";
|
|
686
|
-
RefreshRuntime.injectIntoGlobalHook(window);
|
|
687
|
-
window.$RefreshReg$ = () => {};
|
|
688
|
-
window.$RefreshSig$ = () => (type) => type;
|
|
689
|
-
window.__vite_plugin_react_preamble_installed__ = true;
|
|
690
|
-
`;
|
|
691
|
-
},
|
|
692
|
-
transform(code, id) {
|
|
693
|
-
if (!active || _optionalChain([this, 'access', _39 => _39.environment, 'optionalAccess', _40 => _40.config, 'access', _41 => _41.consumer]) !== "client" || !isFarmClientEntryId(id)) {
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
return {
|
|
697
|
-
code: `import ${JSON.stringify(FARM_REACT_REFRESH_PREAMBLE_ID)};
|
|
698
|
-
${code}`,
|
|
699
|
-
map: null
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmReactRefreshPreamblePlugin, "createFarmReactRefreshPreamblePlugin");
|
|
705
|
-
async function createFarmReactRefreshPlugins() {
|
|
706
|
-
const entry = _module.createRequire.call(void 0,
|
|
707
|
-
typeof __filename === "string" ? __filename : _chunkS3JO3N4Hcjs.define_import_meta_default.url
|
|
708
|
-
).resolve("@vitejs/plugin-react");
|
|
709
|
-
const { default: react } = await import(
|
|
710
|
-
/* @vite-ignore */
|
|
711
|
-
_url.pathToFileURL.call(void 0, entry).href
|
|
712
|
-
);
|
|
713
|
-
const plugins = react().map(
|
|
714
|
-
(plugin) => Object.assign(
|
|
715
|
-
{
|
|
716
|
-
...plugin,
|
|
717
|
-
apply: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, env) => env.command === "serve" && !hasAppReactPlugin(config.plugins), "apply")
|
|
718
|
-
},
|
|
719
|
-
{ [FARM_OWNED]: true }
|
|
720
|
-
)
|
|
721
|
-
);
|
|
722
|
-
return [...plugins, createFarmReactRefreshPreamblePlugin()];
|
|
723
|
-
}
|
|
724
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmReactRefreshPlugins, "createFarmReactRefreshPlugins");
|
|
725
|
-
|
|
726
671
|
// src/navigation/page-data-error.ts
|
|
727
672
|
function resolveFarmPageDataFailure(error) {
|
|
728
673
|
if (_chunkOX6O6WVAcjs.isFarmNotFoundError.call(void 0, error)) {
|
|
@@ -767,14 +712,14 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
|
|
|
767
712
|
// src/vite.ts
|
|
768
713
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
769
714
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
770
|
-
const llms = _chunkD5IHNDHIcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access',
|
|
715
|
+
const llms = _chunkD5IHNDHIcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _39 => _39.agent, 'optionalAccess', _40 => _40.llmsTxt]));
|
|
771
716
|
if (!llms.enabled) return [];
|
|
772
717
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
773
718
|
}
|
|
774
719
|
_chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
|
|
775
720
|
function farmAgentGeneratedPaths(config) {
|
|
776
|
-
const crawlers = _chunkJAXDRRRCcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access',
|
|
777
|
-
const sitemap = _chunkJAXDRRRCcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access',
|
|
721
|
+
const crawlers = _chunkJAXDRRRCcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _41 => _41.agent, 'optionalAccess', _42 => _42.crawlers]));
|
|
722
|
+
const sitemap = _chunkJAXDRRRCcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _43 => _43.agent, 'optionalAccess', _44 => _44.sitemap]));
|
|
778
723
|
return [
|
|
779
724
|
...farmLlmsTxtGeneratedPaths(config),
|
|
780
725
|
...sitemap.enabled ? ["/sitemap.xml"] : [],
|
|
@@ -824,7 +769,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
824
769
|
}
|
|
825
770
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
826
771
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
827
|
-
return import("./devtools-
|
|
772
|
+
return import("./devtools-MLB3JJMC.cjs");
|
|
828
773
|
}
|
|
829
774
|
_chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
830
775
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -840,7 +785,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
840
785
|
name: "farm:i18n-client-bridge",
|
|
841
786
|
enforce: "pre",
|
|
842
787
|
resolveId(id, _importer, options) {
|
|
843
|
-
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess',
|
|
788
|
+
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _45 => _45.ssr])) {
|
|
844
789
|
return FARM_I18N_CLIENT_BRIDGE_ID;
|
|
845
790
|
}
|
|
846
791
|
return null;
|
|
@@ -865,7 +810,7 @@ function farmServerOnlyEntriesPlugin() {
|
|
|
865
810
|
resolveId(id, importer, options) {
|
|
866
811
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
867
812
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
868
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
813
|
+
if (!_optionalChain([options, 'optionalAccess', _46 => _46.ssr])) {
|
|
869
814
|
this.error(
|
|
870
815
|
`${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
|
|
871
816
|
);
|
|
@@ -911,11 +856,11 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
911
856
|
if (!snapshot) return "";
|
|
912
857
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
913
858
|
if (snapshot.routing === "none") return runtime;
|
|
914
|
-
return `${
|
|
859
|
+
return `${_chunkGVNCWSQVcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
915
860
|
}
|
|
916
861
|
_chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
|
|
917
862
|
function getPublicEnvDefine(config) {
|
|
918
|
-
const publicEnv = _optionalChain([config, 'access',
|
|
863
|
+
const publicEnv = _optionalChain([config, 'access', _47 => _47.env, 'optionalAccess', _48 => _48.public]);
|
|
919
864
|
if (!isResolvedEnvScope(publicEnv)) {
|
|
920
865
|
return {};
|
|
921
866
|
}
|
|
@@ -956,7 +901,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
|
|
|
956
901
|
return;
|
|
957
902
|
}
|
|
958
903
|
if (res.headersSent) {
|
|
959
|
-
_optionalChain([res, 'access',
|
|
904
|
+
_optionalChain([res, 'access', _49 => _49.destroy, 'optionalCall', _50 => _50(error instanceof Error ? error : new Error(String(error)))]);
|
|
960
905
|
return;
|
|
961
906
|
}
|
|
962
907
|
res.statusCode = 500;
|
|
@@ -1055,7 +1000,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1055
1000
|
const originalWrite = res.write.bind(res);
|
|
1056
1001
|
const originalEnd = res.end.bind(res);
|
|
1057
1002
|
const originalWriteHead = res.writeHead.bind(res);
|
|
1058
|
-
const originalFlushHeaders = _optionalChain([res, 'access',
|
|
1003
|
+
const originalFlushHeaders = _optionalChain([res, 'access', _51 => _51.flushHeaders, 'optionalAccess', _52 => _52.bind, 'call', _53 => _53(res)]);
|
|
1059
1004
|
let afterResponseCalled = false;
|
|
1060
1005
|
let interceptedEnd = false;
|
|
1061
1006
|
const htmlChunks = [];
|
|
@@ -1095,7 +1040,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1095
1040
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1096
1041
|
if (shouldBufferResponse) {
|
|
1097
1042
|
const callback = args.find((arg) => typeof arg === "function");
|
|
1098
|
-
_optionalChain([callback, 'optionalCall',
|
|
1043
|
+
_optionalChain([callback, 'optionalCall', _54 => _54()]);
|
|
1099
1044
|
return true;
|
|
1100
1045
|
}
|
|
1101
1046
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -1210,14 +1155,14 @@ function getEnvDefines(config, configEnv) {
|
|
|
1210
1155
|
_chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
|
|
1211
1156
|
)
|
|
1212
1157
|
};
|
|
1213
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
1158
|
+
if (_optionalChain([configEnv, 'optionalAccess', _55 => _55.isSsrBuild])) {
|
|
1214
1159
|
defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
1215
1160
|
}
|
|
1216
1161
|
return defines;
|
|
1217
1162
|
}
|
|
1218
1163
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
|
|
1219
1164
|
function getFarmAPIBaseURLDefine(config) {
|
|
1220
|
-
const baseURL = _optionalChain([config, 'access',
|
|
1165
|
+
const baseURL = _optionalChain([config, 'access', _56 => _56.api, 'optionalAccess', _57 => _57.baseURL]);
|
|
1221
1166
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
|
|
1222
1167
|
}
|
|
1223
1168
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
|
|
@@ -1247,7 +1192,7 @@ function fileContainsProgrammaticPageRoute(file) {
|
|
|
1247
1192
|
_chunkS3JO3N4Hcjs.__name.call(void 0, fileContainsProgrammaticPageRoute, "fileContainsProgrammaticPageRoute");
|
|
1248
1193
|
function rewriteEarlySsrRelativeImports(options) {
|
|
1249
1194
|
const cleanId = options.id.split("?", 1)[0];
|
|
1250
|
-
if (!
|
|
1195
|
+
if (!path5.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
|
|
1251
1196
|
return null;
|
|
1252
1197
|
}
|
|
1253
1198
|
const replacements = [];
|
|
@@ -1267,7 +1212,7 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
1267
1212
|
const suffixIndex = source.value.search(/[?#]/);
|
|
1268
1213
|
const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
|
|
1269
1214
|
const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
|
|
1270
|
-
const resolvedPath =
|
|
1215
|
+
const resolvedPath = path5.resolve(path5.dirname(cleanId), sourcePath);
|
|
1271
1216
|
replacements.push({
|
|
1272
1217
|
start: source.start,
|
|
1273
1218
|
end: source.end,
|
|
@@ -1298,7 +1243,8 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1298
1243
|
const safeName = exportName.replace(/[^A-Za-z0-9_$]/g, "_");
|
|
1299
1244
|
const wrapperName = `__farm_isolated_boundary_${safeName || "default"}__`;
|
|
1300
1245
|
wrapperStatements.push(
|
|
1301
|
-
|
|
1246
|
+
// Islands mode renders through islx; the older isolated hydration keeps Farm's boundary.
|
|
1247
|
+
options.slots ? `const ${wrapperName} = __farm_islx_island__(${localName}, ${JSON.stringify(options.moduleReference)}, ${JSON.stringify(exportName)}, ${JSON.stringify(options.islandStrategy)});` : `const ${wrapperName} = __farm_create_isolated_boundary__(__farm_isolated_react__, ${localName}, ${JSON.stringify(options.moduleReference)}, ${JSON.stringify(exportName)}, ${JSON.stringify(options.islandStrategy)});`
|
|
1302
1248
|
);
|
|
1303
1249
|
wrapperStatements.push(
|
|
1304
1250
|
isDefault ? `export default ${wrapperName};` : `export { ${wrapperName} as ${exportName} };`
|
|
@@ -1307,9 +1253,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1307
1253
|
transformedExports++;
|
|
1308
1254
|
}, "addWrapper");
|
|
1309
1255
|
for (const node of body) {
|
|
1310
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1256
|
+
if (_optionalChain([node, 'optionalAccess', _58 => _58.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
1311
1257
|
const declaration2 = node.declaration;
|
|
1312
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
1258
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _59 => _59.id, 'optionalAccess', _60 => _60.name])) {
|
|
1313
1259
|
replacements.push({
|
|
1314
1260
|
start: node.start,
|
|
1315
1261
|
end: node.end,
|
|
@@ -1327,14 +1273,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1327
1273
|
}
|
|
1328
1274
|
continue;
|
|
1329
1275
|
}
|
|
1330
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1276
|
+
if (_optionalChain([node, 'optionalAccess', _61 => _61.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
1331
1277
|
const declaration = node.declaration;
|
|
1332
1278
|
const declaredNames = [];
|
|
1333
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
1279
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _62 => _62.id, 'optionalAccess', _63 => _63.name])) {
|
|
1334
1280
|
declaredNames.push(declaration.id.name);
|
|
1335
1281
|
} else if (declaration.type === "VariableDeclaration") {
|
|
1336
1282
|
for (const declarator of declaration.declarations || []) {
|
|
1337
|
-
if (_optionalChain([declarator, 'access',
|
|
1283
|
+
if (_optionalChain([declarator, 'access', _64 => _64.id, 'optionalAccess', _65 => _65.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
1338
1284
|
}
|
|
1339
1285
|
}
|
|
1340
1286
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -1354,8 +1300,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1354
1300
|
for (const replacement of replacements.sort((left, right) => right.start - left.start)) {
|
|
1355
1301
|
output = output.slice(0, replacement.start) + replacement.code + output.slice(replacement.end);
|
|
1356
1302
|
}
|
|
1357
|
-
|
|
1358
|
-
import { createFarmIsolatedClientBoundary as __farm_create_isolated_boundary__ } from "@farm.js/core/internal/isolated-boundary"
|
|
1303
|
+
const runtimeImport = options.slots ? `import { createIsland as __farm_islx_island__ } from "@farm.js/core/internal/islx-react";` : `import * as __farm_isolated_react__ from "react";
|
|
1304
|
+
import { createFarmIsolatedClientBoundary as __farm_create_isolated_boundary__ } from "@farm.js/core/internal/isolated-boundary";`;
|
|
1305
|
+
return `${runtimeImport}
|
|
1359
1306
|
${output}
|
|
1360
1307
|
${wrapperStatements.join("\n")}
|
|
1361
1308
|
export const __farm_client_boundary_originals__ = Object.freeze({ ${originalEntries.join(", ")} });
|
|
@@ -1398,7 +1345,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
1398
1345
|
} catch (e11) {
|
|
1399
1346
|
return;
|
|
1400
1347
|
}
|
|
1401
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
1348
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _66 => _66.env, 'optionalAccess', _67 => _67.public]), () => ( {}))));
|
|
1402
1349
|
const findings = analyzeClientBoundary(program, publicKeys);
|
|
1403
1350
|
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
1404
1351
|
return;
|
|
@@ -1421,7 +1368,7 @@ function hasViteAlias(alias, find) {
|
|
|
1421
1368
|
_chunkS3JO3N4Hcjs.__name.call(void 0, hasViteAlias, "hasViteAlias");
|
|
1422
1369
|
function farmPlugin(options = {}, initialPluginManager) {
|
|
1423
1370
|
const imageImports = farmImageImportsPlugin();
|
|
1424
|
-
const fontImports =
|
|
1371
|
+
const fontImports = _chunkRACQTC7Kcjs.farmFontImportsPlugin.call(void 0, {
|
|
1425
1372
|
root: options.root,
|
|
1426
1373
|
basePath: options.basePath,
|
|
1427
1374
|
publicDir: options.publicDir
|
|
@@ -1451,14 +1398,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1451
1398
|
].join(" ");
|
|
1452
1399
|
console.log(log);
|
|
1453
1400
|
}, "logUpdate");
|
|
1454
|
-
const getProgrammaticClientRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
1401
|
+
const getProgrammaticClientRoutes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _68 => _68.getRouteManager, 'call', _69 => _69(), 'access', _70 => _70.getProgrammaticClientRoutes, 'call', _71 => _71()]))), "getProgrammaticClientRoutes");
|
|
1455
1402
|
return {
|
|
1456
1403
|
name: "farm",
|
|
1457
1404
|
api: { getProgrammaticClientRoutes },
|
|
1458
1405
|
config(userConfig, configEnv) {
|
|
1459
1406
|
isBuild = configEnv.command === "build";
|
|
1460
1407
|
const layerAliases = _chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
1461
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access',
|
|
1408
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _72 => _72.resolve, 'optionalAccess', _73 => _73.alias]), "@") ? {} : _chunkRACQTC7Kcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
|
|
1462
1409
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
1463
1410
|
return {
|
|
1464
1411
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
@@ -1473,8 +1420,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1473
1420
|
},
|
|
1474
1421
|
server: {
|
|
1475
1422
|
fs: {
|
|
1476
|
-
...layerRoots.length ? { allow: [
|
|
1477
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
1423
|
+
...layerRoots.length ? { allow: [path5.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
1424
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _74 => _74.server, 'optionalAccess', _75 => _75.fs, 'optionalAccess', _76 => _76.deny]), options)
|
|
1478
1425
|
}
|
|
1479
1426
|
}
|
|
1480
1427
|
};
|
|
@@ -1486,8 +1433,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1486
1433
|
serverFnTransformActive = config.plugins.some(
|
|
1487
1434
|
(plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
1488
1435
|
);
|
|
1489
|
-
reactRefreshActive = isFarmReactRefreshActive(config);
|
|
1490
|
-
if (_optionalChain([options, 'access',
|
|
1436
|
+
reactRefreshActive = _chunkCEDPEDNWcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
1437
|
+
if (_optionalChain([options, 'access', _77 => _77.experimental, 'optionalAccess', _78 => _78.serverActions]) === true && !serverFnTransformActive) {
|
|
1491
1438
|
_chunk5QIKR7RRcjs.logger.warn(
|
|
1492
1439
|
"experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
|
|
1493
1440
|
);
|
|
@@ -1496,7 +1443,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1496
1443
|
async configureServer(viteServer) {
|
|
1497
1444
|
viteServer.middlewares.use(
|
|
1498
1445
|
createFarmDevPreviewGuard(viteServer, {
|
|
1499
|
-
getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1446
|
+
getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _79 => _79.getConfig, 'call', _80 => _80()]), () => ( options))), "getSourceRoots")
|
|
1500
1447
|
})
|
|
1501
1448
|
);
|
|
1502
1449
|
if (typeof fontImports.configureServer === "function") {
|
|
@@ -1511,7 +1458,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1511
1458
|
} catch (e12) {
|
|
1512
1459
|
}
|
|
1513
1460
|
}, "emitPluginError");
|
|
1514
|
-
farmApp = new (0,
|
|
1461
|
+
farmApp = new (0, _chunkRACQTC7Kcjs.FarmApp)(
|
|
1515
1462
|
{
|
|
1516
1463
|
...options,
|
|
1517
1464
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -1521,7 +1468,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1521
1468
|
await farmApp.initialize();
|
|
1522
1469
|
const farmConfig = farmApp.getConfig();
|
|
1523
1470
|
let farmAppPackages;
|
|
1524
|
-
if (_optionalChain([farmConfig, 'access',
|
|
1471
|
+
if (_optionalChain([farmConfig, 'access', _81 => _81.agent, 'optionalAccess', _82 => _82.noindexPreviews])) {
|
|
1525
1472
|
server.middlewares.use((_req, res, next) => {
|
|
1526
1473
|
if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
1527
1474
|
res.setHeader("X-Robots-Tag", _chunkJAXDRRRCcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
@@ -1541,7 +1488,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1541
1488
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
1542
1489
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
1543
1490
|
// a caller-controlled Host header.
|
|
1544
|
-
trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access',
|
|
1491
|
+
trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _83 => _83.resolvedUrls, 'optionalAccess', _84 => _84.local, 'access', _85 => _85[0]]), "trustedLocalOrigin"),
|
|
1545
1492
|
onError(error) {
|
|
1546
1493
|
_chunk5QIKR7RRcjs.logger.error(
|
|
1547
1494
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -1550,7 +1497,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1550
1497
|
});
|
|
1551
1498
|
}
|
|
1552
1499
|
const sourceRoots = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, farmConfig);
|
|
1553
|
-
server.watcher.add(sourceRoots.map((source) =>
|
|
1500
|
+
server.watcher.add(sourceRoots.map((source) => path5.join(source.root, source.srcDir)));
|
|
1554
1501
|
if (farmConfig.i18n.enabled) {
|
|
1555
1502
|
server.watcher.add(
|
|
1556
1503
|
farmConfig.i18n.locales.map(
|
|
@@ -1561,15 +1508,15 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1561
1508
|
const workflowConfig = farmConfig.workflows;
|
|
1562
1509
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
1563
1510
|
const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
|
|
1564
|
-
..._optionalChain([options, 'access',
|
|
1565
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
1511
|
+
..._optionalChain([options, 'access', _86 => _86.openapi, 'optionalAccess', _87 => _87.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
1512
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _88 => _88.getFarmDocsRouteTypeEntries, 'call', _89 => _89(farmConfig.docs)]), () => ( []))
|
|
1566
1513
|
], "getExtraRouteTypes");
|
|
1567
1514
|
const appDirSlugs = sourceRoots.map(
|
|
1568
|
-
(source) =>
|
|
1515
|
+
(source) => path5.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
1569
1516
|
);
|
|
1570
1517
|
const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
1571
1518
|
try {
|
|
1572
|
-
const result = await
|
|
1519
|
+
const result = await _chunk3XEMGDBFcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
1573
1520
|
root: farmConfig.root,
|
|
1574
1521
|
srcDir: farmConfig.srcDir,
|
|
1575
1522
|
layers: farmConfig.layers,
|
|
@@ -1606,10 +1553,10 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1606
1553
|
}, "generateTypeArtifacts");
|
|
1607
1554
|
await generateTypeArtifacts("startup");
|
|
1608
1555
|
const srcDirSlugs = sourceRoots.map(
|
|
1609
|
-
(source) =>
|
|
1556
|
+
(source) => path5.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
1610
1557
|
);
|
|
1611
1558
|
const layerConfigFiles = new Set(
|
|
1612
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
1559
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _90 => _90.configFile, 'optionalAccess', _91 => _91.replace, 'call', _92 => _92(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
1613
1560
|
);
|
|
1614
1561
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
1615
1562
|
..._chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -1688,7 +1635,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1688
1635
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
1689
1636
|
}
|
|
1690
1637
|
if (isI18nCatalogFile(file)) {
|
|
1691
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
1638
|
+
_optionalChain([farmApp, 'optionalAccess', _93 => _93.getI18nRuntime, 'call', _94 => _94(), 'access', _95 => _95.reload, 'call', _96 => _96(), 'access', _97 => _97.then, 'call', _98 => _98(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _99 => _99.catch, 'call', _100 => _100((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
1692
1639
|
}
|
|
1693
1640
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
1694
1641
|
if (isRouteRefreshEvent) {
|
|
@@ -1701,8 +1648,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1701
1648
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
1702
1649
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
1703
1650
|
Promise.all([
|
|
1704
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
1705
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
1651
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _101 => _101(`${ev} ${file}`)]),
|
|
1652
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _102 => _102.reload, 'call', _103 => _103()]) : void 0
|
|
1706
1653
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
1707
1654
|
}, 50);
|
|
1708
1655
|
}
|
|
@@ -1754,7 +1701,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1754
1701
|
farmApp.getServerRenderer().setAPIRouteLookup((routePath) => apiRouteManager.getRoutes().has(routePath));
|
|
1755
1702
|
let discoveredWorkflows = [];
|
|
1756
1703
|
const hasWorkflowDirectory = workflowConfig.enabled && workflowConfig.dirs.some(
|
|
1757
|
-
(dir) => fs2.existsSync(
|
|
1704
|
+
(dir) => fs2.existsSync(path5.isAbsolute(dir) ? dir : path5.join(farmConfig.root, dir))
|
|
1758
1705
|
);
|
|
1759
1706
|
if (hasWorkflowDirectory) {
|
|
1760
1707
|
const { createFarmWorkflowRequestHandler, discoverFarmWorkflows } = await loadFarmWorkflowsDevRuntime();
|
|
@@ -1804,11 +1751,11 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1804
1751
|
});
|
|
1805
1752
|
}
|
|
1806
1753
|
}
|
|
1807
|
-
if (_optionalChain([options, 'access',
|
|
1754
|
+
if (_optionalChain([options, 'access', _104 => _104.openapi, 'optionalAccess', _105 => _105.enabled])) {
|
|
1808
1755
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
1809
1756
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
1810
1757
|
mode: "development",
|
|
1811
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
1758
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _106 => _106.api, 'optionalAccess', _107 => _107.baseURL]) === "string" ? options.api.baseURL : void 0
|
|
1812
1759
|
});
|
|
1813
1760
|
const spec = await openAPIManager.generateSpec();
|
|
1814
1761
|
reportOpenAPIDevGenerationResult(spec);
|
|
@@ -1837,7 +1784,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1837
1784
|
return _chunkAMDMVWMIcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
1838
1785
|
}, "resolveDocsLayoutFonts");
|
|
1839
1786
|
releaseDocsMCPServers();
|
|
1840
|
-
const isFarmDocsPathGuarded = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href) =>
|
|
1787
|
+
const isFarmDocsPathGuarded = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href) => _chunkGVNCWSQVcjs.farmPathGuardCoversPage.call(void 0,
|
|
1841
1788
|
{
|
|
1842
1789
|
config: farmConfig,
|
|
1843
1790
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -1850,19 +1797,19 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1850
1797
|
clientEntry: "/@farm/client.js",
|
|
1851
1798
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
1852
1799
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
1853
|
-
globalStylesheetHref:
|
|
1800
|
+
globalStylesheetHref: _chunkRACQTC7Kcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
1854
1801
|
farmConfig.root,
|
|
1855
1802
|
farmConfig.srcDir
|
|
1856
1803
|
),
|
|
1857
1804
|
loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
|
|
1858
1805
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
1859
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
1806
|
+
if (specifier === _optionalChain([farmConfig, 'access', _108 => _108.docs, 'access', _109 => _109.adapter, 'optionalAccess', _110 => _110.server]) && _optionalChain([resolved, 'optionalAccess', _111 => _111.id])) {
|
|
1860
1807
|
return import(
|
|
1861
1808
|
/* @vite-ignore */
|
|
1862
1809
|
_url.pathToFileURL.call(void 0, resolved.id).href
|
|
1863
1810
|
);
|
|
1864
1811
|
}
|
|
1865
|
-
return _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
1812
|
+
return _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _112 => _112.id]), () => ( specifier)));
|
|
1866
1813
|
}, "loadModule"),
|
|
1867
1814
|
registerMCPServer: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (mcpServer) => {
|
|
1868
1815
|
const dispose = _chunk75RZHGLScjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -1880,21 +1827,21 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1880
1827
|
fontAssets: _chunkHREOKQWTcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
1881
1828
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
1882
1829
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
1883
|
-
globalStylesheetHref:
|
|
1830
|
+
globalStylesheetHref: _chunkRACQTC7Kcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
1884
1831
|
farmConfig.root,
|
|
1885
1832
|
farmConfig.srcDir
|
|
1886
1833
|
),
|
|
1887
1834
|
isPathGuarded: isFarmDocsPathGuarded
|
|
1888
1835
|
}) : null;
|
|
1889
1836
|
const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request, response) => {
|
|
1890
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
1837
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _113 => _113.headers, 'access', _114 => _114.get, 'call', _115 => _115("content-type"), 'optionalAccess', _116 => _116.toLowerCase, 'call', _117 => _117(), 'access', _118 => _118.includes, 'call', _119 => _119("text/html")])) {
|
|
1891
1838
|
return response;
|
|
1892
1839
|
}
|
|
1893
1840
|
const pathname = new URL(request.url).pathname;
|
|
1894
1841
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
1895
1842
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
1896
1843
|
...layout,
|
|
1897
|
-
metadata:
|
|
1844
|
+
metadata: _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
1898
1845
|
}));
|
|
1899
1846
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
1900
1847
|
return response;
|
|
@@ -1908,7 +1855,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1908
1855
|
headers: response.headers
|
|
1909
1856
|
});
|
|
1910
1857
|
}
|
|
1911
|
-
const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1858
|
+
const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _120 => _120.getConfig, 'call', _121 => _121()]), () => ( options))).renderer);
|
|
1912
1859
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
1913
1860
|
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkPJ42JESYcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
1914
1861
|
Promise.all(
|
|
@@ -1937,7 +1884,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1937
1884
|
])
|
|
1938
1885
|
);
|
|
1939
1886
|
const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
|
|
1940
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
1887
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _122 => _122.route, 'optionalAccess', _123 => _123.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
1941
1888
|
const bootstrapScript = `<script>
|
|
1942
1889
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
1943
1890
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -2033,7 +1980,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2033
1980
|
}, "dispatch")
|
|
2034
1981
|
},
|
|
2035
1982
|
(request) => {
|
|
2036
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1983
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _124 => _124.getConfig, 'call', _125 => _125()]), () => ( options));
|
|
2037
1984
|
const currentServerConfig = _chunk5NAVKJCZcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2038
1985
|
return _chunkZTP3BJG6cjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2039
1986
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2044,7 +1991,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2044
1991
|
withAPIRequestTracing(async (req, res, next) => {
|
|
2045
1992
|
const requestUrl = req.url || "/";
|
|
2046
1993
|
const requestMethod = req.method || "GET";
|
|
2047
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1994
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _126 => _126.getConfig, 'call', _127 => _127()]), () => ( options));
|
|
2048
1995
|
const currentServerConfig = _chunk5NAVKJCZcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2049
1996
|
const parsedRequestUrl = _chunkZTP3BJG6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2050
1997
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2112,7 +2059,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2112
2059
|
openapi: options.openapi
|
|
2113
2060
|
},
|
|
2114
2061
|
workflows: discoveredWorkflows,
|
|
2115
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
2062
|
+
plugins: _optionalChain([pm, 'optionalAccess', _128 => _128.getSortedPlugins, 'call', _129 => _129()])
|
|
2116
2063
|
});
|
|
2117
2064
|
res.statusCode = 200;
|
|
2118
2065
|
res.setHeader(
|
|
@@ -2135,7 +2082,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2135
2082
|
return;
|
|
2136
2083
|
}
|
|
2137
2084
|
const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
2138
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
2085
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _130 => _130.hasMiddleware, 'call', _131 => _131()])) return false;
|
|
2139
2086
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
2140
2087
|
return runFarmMiddlewareWithNavigation(
|
|
2141
2088
|
farmApp.getServerRenderer(),
|
|
@@ -2150,11 +2097,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2150
2097
|
computed
|
|
2151
2098
|
} = {}) => {
|
|
2152
2099
|
const discard = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
2153
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
2100
|
+
await _optionalChain([computed, 'optionalAccess', _132 => _132.body, 'optionalAccess', _133 => _133.cancel, 'call', _134 => _134(), 'access', _135 => _135.catch, 'call', _136 => _136(() => {
|
|
2154
2101
|
})]);
|
|
2155
2102
|
}, "discard");
|
|
2156
2103
|
let runtimeSession2;
|
|
2157
|
-
if (_optionalChain([pm, 'optionalAccess',
|
|
2104
|
+
if (_optionalChain([pm, 'optionalAccess', _137 => _137.hasRuntimeRequestHooks, 'call', _138 => _138()])) {
|
|
2158
2105
|
try {
|
|
2159
2106
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
2160
2107
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -2186,7 +2133,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2186
2133
|
let response;
|
|
2187
2134
|
try {
|
|
2188
2135
|
response = await respond(
|
|
2189
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
2136
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _139 => _139.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
2190
2137
|
);
|
|
2191
2138
|
} catch (error) {
|
|
2192
2139
|
if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
|
|
@@ -2199,7 +2146,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2199
2146
|
);
|
|
2200
2147
|
}, "serveBuiltInRoute");
|
|
2201
2148
|
const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
2202
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
2149
|
+
if (openAPIManager && _optionalChain([options, 'access', _140 => _140.openapi, 'optionalAccess', _141 => _141.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
2203
2150
|
const specManager = openAPIManager;
|
|
2204
2151
|
await serveBuiltInRoute(async () => {
|
|
2205
2152
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -2219,7 +2166,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2219
2166
|
});
|
|
2220
2167
|
return;
|
|
2221
2168
|
}
|
|
2222
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
2169
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _142 => _142.openapi, 'optionalAccess', _143 => _143.route])) {
|
|
2223
2170
|
const docsManager = openAPIManager;
|
|
2224
2171
|
await serveBuiltInRoute(
|
|
2225
2172
|
async () => {
|
|
@@ -2230,29 +2177,29 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2230
2177
|
);
|
|
2231
2178
|
return;
|
|
2232
2179
|
}
|
|
2233
|
-
if (_optionalChain([options, 'access',
|
|
2180
|
+
if (_optionalChain([options, 'access', _144 => _144.agent, 'optionalAccess', _145 => _145.manifest]) !== false && _chunkGVNCWSQVcjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
2234
2181
|
await serveBuiltInRoute(async () => {
|
|
2235
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
2236
|
-
const manifest = await
|
|
2182
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkRACQTC7Kcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
2183
|
+
const manifest = await _chunkGVNCWSQVcjs.createFarmAppManifestResponse.call(void 0,
|
|
2237
2184
|
new Request(parsedRequestUrl, {
|
|
2238
2185
|
method: requestMethod,
|
|
2239
2186
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
2240
2187
|
}),
|
|
2241
2188
|
{
|
|
2242
|
-
...
|
|
2189
|
+
..._chunkGVNCWSQVcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
2243
2190
|
build: "development",
|
|
2244
2191
|
packages: farmAppPackages,
|
|
2245
2192
|
// Read again on each request; unchanged files come from a cache.
|
|
2246
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
2193
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _146 => _146.plugins, 'optionalAccess', _147 => _147.some, 'call', _148 => _148(({ name }) => name === "farm:webmcp")]) ? _chunkRACQTC7Kcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
2247
2194
|
}),
|
|
2248
2195
|
defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP"),
|
|
2249
2196
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
2250
|
-
guardCoversPath: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (
|
|
2197
|
+
guardCoversPath: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (path6) => _chunkGVNCWSQVcjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
2251
2198
|
{
|
|
2252
2199
|
config: farmConfig,
|
|
2253
2200
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
2254
2201
|
},
|
|
2255
|
-
|
|
2202
|
+
path6,
|
|
2256
2203
|
apiServerBasePath
|
|
2257
2204
|
), "guardCoversPath")
|
|
2258
2205
|
}
|
|
@@ -2261,11 +2208,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2261
2208
|
});
|
|
2262
2209
|
return;
|
|
2263
2210
|
}
|
|
2264
|
-
if (_optionalChain([options, 'access',
|
|
2211
|
+
if (_optionalChain([options, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkGVNCWSQVcjs.FARM_API_CATALOG_PATH) {
|
|
2265
2212
|
await serveBuiltInRoute(
|
|
2266
|
-
() =>
|
|
2213
|
+
() => _chunkGVNCWSQVcjs.createFarmApiCatalogResponse.call(void 0,
|
|
2267
2214
|
requestMethod,
|
|
2268
|
-
|
|
2215
|
+
_chunkGVNCWSQVcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
2269
2216
|
new Request(parsedRequestUrl, {
|
|
2270
2217
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
2271
2218
|
})
|
|
@@ -2273,8 +2220,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2273
2220
|
);
|
|
2274
2221
|
return;
|
|
2275
2222
|
}
|
|
2276
|
-
if (_optionalChain([options, 'access',
|
|
2277
|
-
const aiCatalog =
|
|
2223
|
+
if (_optionalChain([options, 'access', _151 => _151.agent, 'optionalAccess', _152 => _152.aiCatalog]) !== false) {
|
|
2224
|
+
const aiCatalog = _chunkGVNCWSQVcjs.createFarmAiCatalogResponse.call(void 0,
|
|
2278
2225
|
new Request(parsedRequestUrl, {
|
|
2279
2226
|
method: requestMethod,
|
|
2280
2227
|
headers: {
|
|
@@ -2328,7 +2275,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2328
2275
|
config: farmApp.getConfig().mdx,
|
|
2329
2276
|
resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
|
|
2330
2277
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
2331
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
2278
|
+
const sourcePath = _optionalChain([match, 'access', _153 => _153.route, 'optionalAccess', _154 => _154.markdownSourcePath]) || (match.route && _chunkSZLNU3GJcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
2332
2279
|
if (!sourcePath) {
|
|
2333
2280
|
return null;
|
|
2334
2281
|
}
|
|
@@ -2464,7 +2411,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2464
2411
|
"beforeRequest",
|
|
2465
2412
|
(plugin) => {
|
|
2466
2413
|
const owner = _chunkRHGK2JENcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
2467
|
-
return plugin.name !== _chunkNFG4PUPIcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
2414
|
+
return plugin.name !== _chunkNFG4PUPIcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _155 => _155.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
2468
2415
|
},
|
|
2469
2416
|
req,
|
|
2470
2417
|
res
|
|
@@ -2500,7 +2447,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2500
2447
|
isProd: false
|
|
2501
2448
|
},
|
|
2502
2449
|
request,
|
|
2503
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
2450
|
+
{ clientAddress: _optionalChain([req, 'access', _156 => _156.socket, 'optionalAccess', _157 => _157.remoteAddress]) }
|
|
2504
2451
|
);
|
|
2505
2452
|
if (!result) {
|
|
2506
2453
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -2595,7 +2542,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2595
2542
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
2596
2543
|
const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
|
|
2597
2544
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
2598
|
-
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess',
|
|
2545
|
+
const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _158 => _158.route, 'access', _159 => _159.path]) || _optionalChain([apiRouteManager, 'access', _160 => _160.matchRoute, 'call', _161 => _161(pathname2), 'optionalAccess', _162 => _162.route, 'access', _163 => _163.path]) || urlPath2;
|
|
2599
2546
|
_chunkGS3WR5HXcjs.emitFarmEvent.call(void 0, {
|
|
2600
2547
|
type: "route.matched",
|
|
2601
2548
|
pathname: pathname2,
|
|
@@ -2685,7 +2632,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2685
2632
|
return;
|
|
2686
2633
|
}
|
|
2687
2634
|
}
|
|
2688
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2635
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _164 => _164.isFarmDocsAPIRequest, 'call', _165 => _165(pathname2)])) {
|
|
2689
2636
|
try {
|
|
2690
2637
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
2691
2638
|
const headers = new Headers();
|
|
@@ -2758,18 +2705,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2758
2705
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
2759
2706
|
return;
|
|
2760
2707
|
}
|
|
2761
|
-
if (_optionalChain([req, 'access',
|
|
2708
|
+
if (_optionalChain([req, 'access', _166 => _166.url, 'optionalAccess', _167 => _167.startsWith, 'call', _168 => _168("/@")]) || _optionalChain([req, 'access', _169 => _169.url, 'optionalAccess', _170 => _170.startsWith, 'call', _171 => _171("/node_modules")])) {
|
|
2762
2709
|
return next();
|
|
2763
2710
|
}
|
|
2764
2711
|
if (shouldBypassFarmRouterForDottedPath(
|
|
2765
2712
|
requestPathname,
|
|
2766
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2713
|
+
_optionalChain([farmApp, 'optionalAccess', _172 => _172.getRouteManager, 'call', _173 => _173()]),
|
|
2767
2714
|
[server.config.publicDir, server.config.root],
|
|
2768
2715
|
farmAgentGeneratedPaths(farmConfig)
|
|
2769
2716
|
)) {
|
|
2770
2717
|
return next();
|
|
2771
2718
|
}
|
|
2772
|
-
if (_optionalChain([req, 'access',
|
|
2719
|
+
if (_optionalChain([req, 'access', _174 => _174.url, 'optionalAccess', _175 => _175.startsWith, 'call', _176 => _176("/__farm/page-data")])) {
|
|
2773
2720
|
const urlObj = parsedRequestUrl;
|
|
2774
2721
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
2775
2722
|
try {
|
|
@@ -2797,7 +2744,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2797
2744
|
});
|
|
2798
2745
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
2799
2746
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
2800
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
2747
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _177 => _177.hasMiddleware, 'call', _178 => _178()])) {
|
|
2801
2748
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
2802
2749
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
2803
2750
|
farmApp.getServerRenderer(),
|
|
@@ -2825,10 +2772,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2825
2772
|
if (pm) {
|
|
2826
2773
|
await pm.runHookParallel("afterRouteMatch", {
|
|
2827
2774
|
pathname: targetPath,
|
|
2828
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
2829
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
2830
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
2831
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
2775
|
+
matched: !!_optionalChain([match, 'optionalAccess', _179 => _179.route]),
|
|
2776
|
+
routePattern: _optionalChain([match, 'optionalAccess', _180 => _180.route, 'optionalAccess', _181 => _181.pattern]) || null,
|
|
2777
|
+
params: _optionalChain([match, 'optionalAccess', _182 => _182.params]) || {},
|
|
2778
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _183 => _183.layouts]) || []).map((l) => l.pattern)
|
|
2832
2779
|
});
|
|
2833
2780
|
}
|
|
2834
2781
|
if (!match) {
|
|
@@ -2851,7 +2798,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2851
2798
|
);
|
|
2852
2799
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
2853
2800
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
2854
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
2801
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
2855
2802
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
2856
2803
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
2857
2804
|
let mergedMetadata = {};
|
|
@@ -2859,7 +2806,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2859
2806
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
2860
2807
|
);
|
|
2861
2808
|
const layoutHydrationMetadata = layouts.map(
|
|
2862
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
2809
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
2863
2810
|
);
|
|
2864
2811
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
2865
2812
|
(metadata) => metadata.shouldHydrate
|
|
@@ -2923,7 +2870,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2923
2870
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
2924
2871
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
2925
2872
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
2926
|
-
), () => (
|
|
2873
|
+
), () => ( _chunkRACQTC7Kcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
2927
2874
|
const slotContext = await _chunk6QQDAAAZcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
2928
2875
|
request: targetRequest,
|
|
2929
2876
|
params: slot.params,
|
|
@@ -2969,15 +2916,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2969
2916
|
);
|
|
2970
2917
|
const projectRoot = server.config.root;
|
|
2971
2918
|
const toUrlPath = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (absolutePath) => _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, absolutePath, projectRoot), "toUrlPath");
|
|
2972
|
-
const renderPlan =
|
|
2919
|
+
const renderPlan = _chunkGVNCWSQVcjs.createFarmRouteRenderPlan.call(void 0, {
|
|
2973
2920
|
pageShouldHydrate: shouldHydrate,
|
|
2974
2921
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
2975
2922
|
islandStrategy: hydrationIslandStrategy,
|
|
2976
|
-
rendering:
|
|
2923
|
+
rendering: _chunk3XEMGDBFcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
2977
2924
|
});
|
|
2978
2925
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
2979
|
-
const layoutStartIndex =
|
|
2980
|
-
|
|
2926
|
+
const layoutStartIndex = _chunkGVNCWSQVcjs.getSharedLayoutPrefixLength.call(void 0,
|
|
2927
|
+
_chunkGVNCWSQVcjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
2981
2928
|
destinationLayoutPatterns
|
|
2982
2929
|
);
|
|
2983
2930
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -2987,7 +2934,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2987
2934
|
middlewareContext,
|
|
2988
2935
|
() => renderer.renderNavigationFragment({
|
|
2989
2936
|
PageComponent: routeModule.default,
|
|
2990
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
2937
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _184 => _184.default]),
|
|
2991
2938
|
pageProps: routeProps,
|
|
2992
2939
|
params,
|
|
2993
2940
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -3058,7 +3005,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3058
3005
|
{
|
|
3059
3006
|
status: 200,
|
|
3060
3007
|
headers: {
|
|
3061
|
-
"Cache-Control":
|
|
3008
|
+
"Cache-Control": _chunkGVNCWSQVcjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
3062
3009
|
"X-Farm-Navigation": "html-fragment",
|
|
3063
3010
|
Vary: "X-Farm-Layout-Chain",
|
|
3064
3011
|
[_chunkC5GUTBZKcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -3095,14 +3042,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3095
3042
|
trustProxy: currentServerConfig.trustProxy
|
|
3096
3043
|
}).pathname;
|
|
3097
3044
|
const routeManager2 = farmApp.getRouteManager();
|
|
3098
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3099
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3100
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3101
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3102
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3103
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3104
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3105
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3045
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _185 => _185.hasHook, 'call', _186 => _186("beforeRouteMatch")]), () => ( false));
|
|
3046
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _187 => _187.hasHook, 'call', _188 => _188("afterRouteMatch")]), () => ( false));
|
|
3047
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _189 => _189.hasHook, 'call', _190 => _190("beforeRequest")]), () => ( false));
|
|
3048
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _191 => _191.hasHook, 'call', _192 => _192("beforeRender")]), () => ( false));
|
|
3049
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _193 => _193.hasHook, 'call', _194 => _194("afterResponse")]), () => ( false));
|
|
3050
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _195 => _195.hasHook, 'call', _196 => _196("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _197 => _197.hasHook, 'call', _198 => _198("afterRender")]), () => ( false)));
|
|
3051
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _199 => _199.hasRuntimeRequestHooks, 'call', _200 => _200()]), () => ( false));
|
|
3052
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _201 => _201.hasRuntimeHook, 'call', _202 => _202("after")]), () => ( false));
|
|
3106
3053
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
3107
3054
|
let runtimeSession;
|
|
3108
3055
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -3113,8 +3060,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3113
3060
|
kind: "page",
|
|
3114
3061
|
route: {
|
|
3115
3062
|
pathname: requestedPathname,
|
|
3116
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3117
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3063
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _203 => _203.route, 'optionalAccess', _204 => _204.pattern]) || null,
|
|
3064
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _205 => _205.params]) || {}
|
|
3118
3065
|
}
|
|
3119
3066
|
}
|
|
3120
3067
|
);
|
|
@@ -3147,17 +3094,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3147
3094
|
if (pm && hasAfterRouteMatchHook) {
|
|
3148
3095
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3149
3096
|
pathname,
|
|
3150
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
3151
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3152
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3153
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
3097
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _206 => _206.route]),
|
|
3098
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _207 => _207.route, 'optionalAccess', _208 => _208.pattern]) || null,
|
|
3099
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _209 => _209.params]) || {},
|
|
3100
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _210 => _210.layouts]) || []).map((l) => l.pattern)
|
|
3154
3101
|
});
|
|
3155
3102
|
}
|
|
3156
3103
|
const renderPayload = {
|
|
3157
3104
|
pathname,
|
|
3158
3105
|
method,
|
|
3159
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3160
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3106
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _211 => _211.route, 'optionalAccess', _212 => _212.pattern]) || null,
|
|
3107
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _213 => _213.params]) || {}
|
|
3161
3108
|
};
|
|
3162
3109
|
const shouldInterceptResponse = Boolean(
|
|
3163
3110
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -3179,7 +3126,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3179
3126
|
emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
|
|
3180
3127
|
}) : void 0;
|
|
3181
3128
|
try {
|
|
3182
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3129
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _214 => _214.hasMiddleware, 'call', _215 => _215()])) {
|
|
3183
3130
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3184
3131
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3185
3132
|
farmApp.getServerRenderer(),
|
|
@@ -3189,7 +3136,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3189
3136
|
() => middlewareManager.execute(req, res)
|
|
3190
3137
|
);
|
|
3191
3138
|
if (handled) {
|
|
3192
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3139
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _216 => _216.isEnded, 'call', _217 => _217()])) {
|
|
3193
3140
|
const duration = Date.now() - startTime;
|
|
3194
3141
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3195
3142
|
}
|
|
@@ -3202,14 +3149,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3202
3149
|
req.url || "/",
|
|
3203
3150
|
`http://${req.headers.host || "localhost:3000"}`
|
|
3204
3151
|
).pathname;
|
|
3205
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
3152
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _218 => _218.matchRoute, 'call', _219 => _219(currentPathname), 'optionalAccess', _220 => _220.route]));
|
|
3206
3153
|
await pm.runHookParallelFiltered(
|
|
3207
3154
|
"beforeRequest",
|
|
3208
3155
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkNFG4PUPIcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3209
3156
|
req,
|
|
3210
3157
|
res
|
|
3211
3158
|
);
|
|
3212
|
-
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access',
|
|
3159
|
+
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _221 => _221.url, 'optionalAccess', _222 => _222.startsWith, 'call', _223 => _223("/")]) && !res.writableEnded) {
|
|
3213
3160
|
const destinationUrl = new URL(req.url, fullUrl);
|
|
3214
3161
|
const destinationMatch = routeManager2.matchRoute(destinationUrl.pathname);
|
|
3215
3162
|
const guarded = await pm.runRuntimeBeforeForRewrite(
|
|
@@ -3219,8 +3166,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3219
3166
|
kind: "page",
|
|
3220
3167
|
route: {
|
|
3221
3168
|
pathname: destinationUrl.pathname,
|
|
3222
|
-
pattern: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3223
|
-
params: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3169
|
+
pattern: _optionalChain([destinationMatch, 'optionalAccess', _224 => _224.route, 'optionalAccess', _225 => _225.pattern]) || null,
|
|
3170
|
+
params: _optionalChain([destinationMatch, 'optionalAccess', _226 => _226.params]) || {}
|
|
3224
3171
|
}
|
|
3225
3172
|
}
|
|
3226
3173
|
);
|
|
@@ -3232,8 +3179,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3232
3179
|
}
|
|
3233
3180
|
}
|
|
3234
3181
|
}
|
|
3235
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
3236
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3182
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _227 => _227.isEnded, 'call', _228 => _228()])) {
|
|
3183
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _229 => _229.isEnded, 'call', _230 => _230()])) {
|
|
3237
3184
|
const duration = Date.now() - startTime;
|
|
3238
3185
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3239
3186
|
}
|
|
@@ -3291,8 +3238,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3291
3238
|
if (imageModule) return imageModule;
|
|
3292
3239
|
}
|
|
3293
3240
|
if (_chunkCGVPXIRNcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
3294
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
3295
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
3241
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _231 => _231.getConfig, 'call', _232 => _232(), 'access', _233 => _233.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3242
|
+
const root = _optionalChain([server, 'optionalAccess', _234 => _234.config, 'access', _235 => _235.root]) || options.root;
|
|
3296
3243
|
if (isClientEnvironment(this, loadOptions)) {
|
|
3297
3244
|
return generateProgrammaticClientRouteModuleForId(
|
|
3298
3245
|
id,
|
|
@@ -3305,32 +3252,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3305
3252
|
return generateProgrammaticRouteModule(id, root, renderer);
|
|
3306
3253
|
}
|
|
3307
3254
|
if (isFarmClientVirtualId(id)) {
|
|
3308
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
3309
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3310
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3311
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3312
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3255
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _236 => _236.getConfig, 'call', _237 => _237()]);
|
|
3256
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _238 => _238.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3257
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _239 => _239.integrations]) || options.integrations;
|
|
3258
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _240 => _240.root]) || _optionalChain([server, 'optionalAccess', _241 => _241.config, 'access', _242 => _242.root]) || process.cwd();
|
|
3259
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _243 => _243.docs]);
|
|
3313
3260
|
const adapterOwnsDocsRuntime = Boolean(
|
|
3314
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
3261
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _244 => _244.adapter, 'optionalAccess', _245 => _245.server]) && docs.adapter.react
|
|
3315
3262
|
);
|
|
3316
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3263
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _246 => _246.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
3317
3264
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
3318
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3319
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3265
|
+
_optionalChain([docs, 'optionalAccess', _247 => _247.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
3266
|
+
_optionalChain([docs, 'optionalAccess', _248 => _248.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
3320
3267
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
3321
3268
|
]);
|
|
3322
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
3269
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _249 => _249.isFarmDocsSearchEnabled, 'call', _250 => _250(docs)]), () => ( false));
|
|
3323
3270
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
3324
3271
|
docsSearchEnabled,
|
|
3325
3272
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
3326
3273
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
3327
3274
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
3328
|
-
const generatedDevIndicatorsClientRuntime = farmApp ?
|
|
3275
|
+
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkPDU4P2ICcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
3329
3276
|
const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkRHGK2JENcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
3330
|
-
const isolatedHydrationMode =
|
|
3331
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3277
|
+
const isolatedHydrationMode = _chunkRACQTC7Kcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3278
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _251 => _251.experimental, 'optionalAccess', _252 => _252.isolatedClientHydration]),
|
|
3332
3279
|
{
|
|
3333
|
-
serverComponents: _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3280
|
+
serverComponents: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _253 => _253.experimental, 'optionalAccess', _254 => _254.serverComponents])) === "rsc",
|
|
3334
3281
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
3335
3282
|
}
|
|
3336
3283
|
);
|
|
@@ -3338,31 +3285,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3338
3285
|
integrationProviders,
|
|
3339
3286
|
[
|
|
3340
3287
|
..._chunkRHGK2JENcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
3341
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
3288
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _255 => _255.getFarmDocsDocumentNavigationMatchers, 'call', _256 => _256(docs)]), () => ( []))
|
|
3342
3289
|
],
|
|
3343
3290
|
generatedDocsSearchRuntime,
|
|
3344
3291
|
`${generatedDevtoolsClientRuntime}
|
|
3345
3292
|
${generatedDevIndicatorsClientRuntime}`,
|
|
3346
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3293
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _257 => _257.plugins]) || [],
|
|
3347
3294
|
root,
|
|
3348
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3349
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3350
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
3295
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _258 => _258.srcDir]) || options.srcDir || "src",
|
|
3296
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _259 => _259.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
3297
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _260 => _260.adapter, 'optionalAccess', _261 => _261.react]) : void 0,
|
|
3351
3298
|
renderer,
|
|
3352
|
-
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3353
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3354
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3355
|
-
|
|
3356
|
-
|
|
3299
|
+
isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _262 => _262.getRouteManager, 'call', _263 => _263(), 'access', _264 => _264.getIsolatedClientBoundaryModules, 'call', _265 => _265(root)])))), 'optionalAccess', _266 => _266.size]) > 0,
|
|
3300
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _267 => _267.trailingSlash]), () => ( false)),
|
|
3301
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _268 => _268.basePath]), () => ( "/")),
|
|
3302
|
+
_chunkRACQTC7Kcjs.generateClientCachePersistenceCode.call(void 0,
|
|
3303
|
+
_chunkRACQTC7Kcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _269 => _269.cache]))
|
|
3357
3304
|
),
|
|
3358
|
-
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
|
|
3305
|
+
_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
3306
|
+
_chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _270 => _270.experimental, 'optionalAccess', _271 => _271.serverComponents])) === "islands"
|
|
3359
3307
|
);
|
|
3360
3308
|
}
|
|
3361
3309
|
if (id === "/@farm/server") {
|
|
3362
3310
|
return generateServerCode();
|
|
3363
3311
|
}
|
|
3364
3312
|
if (id === "/@farm/manifest") {
|
|
3365
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3313
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _272 => _272.getRouteManager, 'call', _273 => _273()]);
|
|
3366
3314
|
if (!routeManager) {
|
|
3367
3315
|
return `
|
|
3368
3316
|
export const getManifest = () => ({
|
|
@@ -3375,9 +3323,9 @@ export const getManifest = () => ({
|
|
|
3375
3323
|
`;
|
|
3376
3324
|
}
|
|
3377
3325
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
3378
|
-
const globalStylesheetHref =
|
|
3326
|
+
const globalStylesheetHref = _chunkRACQTC7Kcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
3379
3327
|
server.config.root,
|
|
3380
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3328
|
+
_optionalChain([farmApp, 'optionalAccess', _274 => _274.getConfig, 'call', _275 => _275(), 'access', _276 => _276.srcDir])
|
|
3381
3329
|
);
|
|
3382
3330
|
const fullManifest = {
|
|
3383
3331
|
clientEntry: "/@farm/client.js",
|
|
@@ -3403,11 +3351,11 @@ export const getManifest = () => ({
|
|
|
3403
3351
|
};
|
|
3404
3352
|
}
|
|
3405
3353
|
for (const layout of manifest.layouts) {
|
|
3406
|
-
const groupScope =
|
|
3354
|
+
const groupScope = _chunkGVNCWSQVcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3407
3355
|
fullManifest.layouts[layout.pattern] = {
|
|
3408
3356
|
modulePath: layout.modulePath,
|
|
3409
3357
|
pattern: layout.pattern,
|
|
3410
|
-
...groupScope ? { urlPattern:
|
|
3358
|
+
...groupScope ? { urlPattern: _chunkGVNCWSQVcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
3411
3359
|
shouldHydrate: layout.shouldHydrate,
|
|
3412
3360
|
islandStrategy: layout.islandStrategy,
|
|
3413
3361
|
preloads: [layout.modulePath],
|
|
@@ -3431,24 +3379,37 @@ export const manifest = getManifest();
|
|
|
3431
3379
|
}
|
|
3432
3380
|
},
|
|
3433
3381
|
async transform(code, id, transformOptions) {
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3382
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _277 => _277.getConfig, 'call', _278 => _278()]), () => ( options));
|
|
3383
|
+
if (_chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _279 => _279.experimental, 'optionalAccess', _280 => _280.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3384
|
+
const file = id.split("?", 1)[0];
|
|
3385
|
+
const actionModule = transformFarmFormActionModule({
|
|
3386
|
+
code,
|
|
3387
|
+
id,
|
|
3388
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _281 => _281.config, 'access', _282 => _282.root]) || process.cwd(),
|
|
3389
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _283 => _283.ssr]) === true,
|
|
3390
|
+
// Parsed by file type: page components are TSX.
|
|
3391
|
+
parse: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (source) => _vite.parseSync.call(void 0, file, source).program, "parse")
|
|
3392
|
+
});
|
|
3393
|
+
if (actionModule) return { code: actionModule, map: null };
|
|
3394
|
+
}
|
|
3395
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _284 => _284.ssr])) {
|
|
3396
|
+
const docsConfigModule = _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _285 => _285.getConfig, 'call', _286 => _286(), 'optionalAccess', _287 => _287.docs]));
|
|
3397
|
+
if (_chunkRACQTC7Kcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
3398
|
+
const redacted = _chunkRACQTC7Kcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
3438
3399
|
if (redacted !== null) return { code: redacted, map: null };
|
|
3439
3400
|
}
|
|
3440
3401
|
}
|
|
3441
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3442
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3443
|
-
if (_optionalChain([currentConfig, 'access',
|
|
3402
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _288 => _288.ssr])) {
|
|
3403
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _289 => _289.getConfig, 'call', _290 => _290()]), () => ( options));
|
|
3404
|
+
if (_optionalChain([currentConfig, 'access', _291 => _291.experimental, 'optionalAccess', _292 => _292.serverActions]) !== true || !serverFnTransformActive) {
|
|
3444
3405
|
const violation = findClientServerFnViolation(code, id);
|
|
3445
3406
|
if (violation) {
|
|
3446
3407
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
3447
3408
|
}
|
|
3448
3409
|
}
|
|
3449
3410
|
}
|
|
3450
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3451
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3411
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _293 => _293.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
3412
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _294 => _294.getConfig, 'call', _295 => _295()]), () => ( options)));
|
|
3452
3413
|
}
|
|
3453
3414
|
if (typeof imageImports.transform === "function") {
|
|
3454
3415
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -3463,13 +3424,13 @@ export const manifest = getManifest();
|
|
|
3463
3424
|
id,
|
|
3464
3425
|
transformOptions
|
|
3465
3426
|
);
|
|
3466
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
3427
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _296 => _296.code, 'optionalAccess', _297 => _297.toString, 'call', _298 => _298()]);
|
|
3467
3428
|
if (fontCode) {
|
|
3468
3429
|
transformedCode = fontCode;
|
|
3469
3430
|
transformed = true;
|
|
3470
3431
|
}
|
|
3471
3432
|
}
|
|
3472
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3433
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _299 => _299.ssr]) && server) {
|
|
3473
3434
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
3474
3435
|
code: transformedCode,
|
|
3475
3436
|
id,
|
|
@@ -3481,27 +3442,28 @@ export const manifest = getManifest();
|
|
|
3481
3442
|
transformed = true;
|
|
3482
3443
|
}
|
|
3483
3444
|
}
|
|
3484
|
-
if (
|
|
3445
|
+
if (_chunkRACQTC7Kcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
3485
3446
|
const clientBoundarySource = transformedCode;
|
|
3486
3447
|
const moduleInfo = this.getModuleInfo(id);
|
|
3487
3448
|
if (moduleInfo) {
|
|
3488
3449
|
moduleInfo.isClientComponent = true;
|
|
3489
3450
|
}
|
|
3490
|
-
transformedCode =
|
|
3451
|
+
transformedCode = _chunkRACQTC7Kcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
3491
3452
|
transformed = true;
|
|
3492
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3453
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _300 => _300.getConfig, 'call', _301 => _301()]), () => ( options));
|
|
3493
3454
|
let isolatedModuleReference = null;
|
|
3494
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3455
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _302 => _302.config, 'access', _303 => _303.root]) || process.cwd();
|
|
3495
3456
|
const cleanId = id.split("?", 1)[0];
|
|
3496
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3497
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
3498
|
-
if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration &&
|
|
3457
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _304 => _304.getRouteManager, 'call', _305 => _305(), 'access', _306 => _306.getIsolatedClientBoundaryModules, 'call', _307 => _307(root)])));
|
|
3458
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _308 => _308.has, 'call', _309 => _309(path5.resolve(cleanId))]) === true;
|
|
3459
|
+
if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && _chunkRACQTC7Kcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource)) {
|
|
3499
3460
|
isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
3500
3461
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
3501
3462
|
code: transformedCode,
|
|
3502
3463
|
moduleReference: isolatedModuleReference,
|
|
3503
|
-
islandStrategy: _nullishCoalesce(
|
|
3504
|
-
parse: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (source) => this.parse(source), "parse")
|
|
3464
|
+
islandStrategy: _nullishCoalesce(_chunkRACQTC7Kcjs.getIslandStrategyExport.call(void 0, clientBoundarySource), () => ( "load")),
|
|
3465
|
+
parse: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (source) => this.parse(source), "parse"),
|
|
3466
|
+
slots: _chunkPDU4P2ICcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _310 => _310.experimental, 'optionalAccess', _311 => _311.serverComponents])) === "islands"
|
|
3505
3467
|
});
|
|
3506
3468
|
if (!transformedBoundary) {
|
|
3507
3469
|
this.error(
|
|
@@ -3531,7 +3493,7 @@ export const manifest = getManifest();
|
|
|
3531
3493
|
);
|
|
3532
3494
|
return;
|
|
3533
3495
|
}` : "";
|
|
3534
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
3496
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _312 => _312.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
3535
3497
|
if (import.meta.hot) {
|
|
3536
3498
|
import.meta.hot.accept((newModule) => {
|
|
3537
3499
|
${isolatedHmrUpdate}
|
|
@@ -3586,14 +3548,14 @@ if (import.meta.hot) {
|
|
|
3586
3548
|
}
|
|
3587
3549
|
_chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
3588
3550
|
_chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
|
|
3589
|
-
const outDir =
|
|
3590
|
-
const clientDir =
|
|
3551
|
+
const outDir = path5.join(_optionalChain([server, 'optionalAccess', _313 => _313.config, 'access', _314 => _314.root]) || process.cwd(), options.outDir || "dist");
|
|
3552
|
+
const clientDir = path5.join(outDir, "client");
|
|
3591
3553
|
for (const page of ssgPages) {
|
|
3592
3554
|
try {
|
|
3593
3555
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
3594
3556
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
3595
3557
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
3596
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
3558
|
+
if (!_optionalChain([mod, 'optionalAccess', _315 => _315.default])) return;
|
|
3597
3559
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
3598
3560
|
const layoutModules = await Promise.all(
|
|
3599
3561
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -3625,7 +3587,7 @@ if (import.meta.hot) {
|
|
|
3625
3587
|
const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
3626
3588
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
3627
3589
|
const fullHtml = `<!DOCTYPE html>
|
|
3628
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
3590
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _316 => _316.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
3629
3591
|
<head>
|
|
3630
3592
|
<meta charset="utf-8">
|
|
3631
3593
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -3639,8 +3601,8 @@ if (import.meta.hot) {
|
|
|
3639
3601
|
<script type="module" src="/assets/client.js"></script>
|
|
3640
3602
|
</body>
|
|
3641
3603
|
</html>`;
|
|
3642
|
-
const outputPath = page.urlPath === "/" ?
|
|
3643
|
-
fs2.mkdirSync(
|
|
3604
|
+
const outputPath = page.urlPath === "/" ? path5.join(clientDir, "index.html") : path5.join(clientDir, page.urlPath + ".html");
|
|
3605
|
+
fs2.mkdirSync(path5.dirname(outputPath), { recursive: true });
|
|
3644
3606
|
fs2.writeFileSync(outputPath, fullHtml);
|
|
3645
3607
|
const revalidateInfo = page.revalidate ? ` (revalidate: ${page.revalidate}s)` : "";
|
|
3646
3608
|
_chunk5QIKR7RRcjs.logger.success(` \u2713 ${page.urlPath}${revalidateInfo}`);
|
|
@@ -3649,7 +3611,7 @@ if (import.meta.hot) {
|
|
|
3649
3611
|
_chunk5QIKR7RRcjs.logger.error(` \u2717 ${page.urlPath}: ${error}`);
|
|
3650
3612
|
}
|
|
3651
3613
|
}
|
|
3652
|
-
const manifestPath =
|
|
3614
|
+
const manifestPath = path5.join(outDir, "__ssg_manifest.json");
|
|
3653
3615
|
fs2.writeFileSync(
|
|
3654
3616
|
manifestPath,
|
|
3655
3617
|
JSON.stringify(
|
|
@@ -3683,23 +3645,23 @@ if (import.meta.hot) {
|
|
|
3683
3645
|
});
|
|
3684
3646
|
}
|
|
3685
3647
|
}
|
|
3686
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
3648
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _317 => _317.getConfig, 'call', _318 => _318()]);
|
|
3687
3649
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
3688
3650
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
3689
3651
|
(appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
3690
3652
|
)) {
|
|
3691
3653
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
3692
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3654
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _319 => _319(`updated ${file}`)]);
|
|
3693
3655
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
3694
3656
|
return [];
|
|
3695
3657
|
}
|
|
3696
|
-
const currentSrcRoot = currentFarmConfig ? _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) =>
|
|
3658
|
+
const currentSrcRoot = currentFarmConfig ? _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path5.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
|
|
3697
3659
|
if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunkCGVPXIRNcjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
|
|
3698
|
-
logUpdate("PAGE", `updated ${
|
|
3660
|
+
logUpdate("PAGE", `updated ${path5.basename(file)}`);
|
|
3699
3661
|
for (const mod of modules) {
|
|
3700
3662
|
server2.moduleGraph.invalidateModule(mod);
|
|
3701
3663
|
}
|
|
3702
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3664
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _320 => _320(`updated ${file}`)]);
|
|
3703
3665
|
server2.ws.send({
|
|
3704
3666
|
type: "full-reload",
|
|
3705
3667
|
path: "*"
|
|
@@ -3712,7 +3674,7 @@ if (import.meta.hot) {
|
|
|
3712
3674
|
for (const mod of modules) {
|
|
3713
3675
|
server2.moduleGraph.invalidateModule(mod);
|
|
3714
3676
|
}
|
|
3715
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3677
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _321 => _321(`updated ${file}`)]);
|
|
3716
3678
|
server2.ws.send({
|
|
3717
3679
|
type: "full-reload",
|
|
3718
3680
|
path: "*"
|
|
@@ -3720,12 +3682,12 @@ if (import.meta.hot) {
|
|
|
3720
3682
|
return [];
|
|
3721
3683
|
}
|
|
3722
3684
|
if (apiRouteManager && _chunkPJ42JESYcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
3723
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3685
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _322 => _322(`updated ${file}`)]);
|
|
3724
3686
|
}
|
|
3725
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
3726
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3687
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _323 => _323.experimental, 'optionalAccess', _324 => _324.isolatedClientHydration]);
|
|
3688
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _325 => _325.getRouteManager, 'call', _326 => _326()]);
|
|
3727
3689
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
3728
|
-
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
3690
|
+
const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _327 => _327.renderer])) && planRouteManager !== void 0;
|
|
3729
3691
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
3730
3692
|
const routeManager = planRouteManager;
|
|
3731
3693
|
if (routeManager) {
|
|
@@ -3785,7 +3747,7 @@ if (import.meta.hot) {
|
|
|
3785
3747
|
}
|
|
3786
3748
|
return [];
|
|
3787
3749
|
}
|
|
3788
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3750
|
+
_optionalChain([farmApp, 'optionalAccess', _328 => _328.getRouteManager, 'call', _329 => _329(), 'access', _330 => _330.invalidateClientManifest, 'call', _331 => _331()]);
|
|
3789
3751
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
3790
3752
|
if (manifestModule) {
|
|
3791
3753
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -3829,10 +3791,10 @@ function createPageDataMiddlewareRequest(req, target) {
|
|
|
3829
3791
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createPageDataMiddlewareRequest, "createPageDataMiddlewareRequest");
|
|
3830
3792
|
function resolveDevelopmentRoot(farmRoot, viteRoot) {
|
|
3831
3793
|
if (!farmRoot) return viteRoot;
|
|
3832
|
-
if (
|
|
3794
|
+
if (path5.resolve(farmRoot) === path5.resolve(viteRoot)) return farmRoot;
|
|
3833
3795
|
try {
|
|
3834
3796
|
if (fs2.realpathSync(farmRoot) === fs2.realpathSync(viteRoot)) {
|
|
3835
|
-
return
|
|
3797
|
+
return path5.resolve(viteRoot);
|
|
3836
3798
|
}
|
|
3837
3799
|
} catch (e14) {
|
|
3838
3800
|
}
|
|
@@ -3846,13 +3808,13 @@ function isFarmClientVirtualId(id) {
|
|
|
3846
3808
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isFarmClientVirtualId, "isFarmClientVirtualId");
|
|
3847
3809
|
function isClientEnvironment(context, loadOptions) {
|
|
3848
3810
|
const environment = context.environment;
|
|
3849
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
3850
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
3851
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
3811
|
+
if (_optionalChain([environment, 'optionalAccess', _332 => _332.config, 'optionalAccess', _333 => _333.consumer])) return environment.config.consumer === "client";
|
|
3812
|
+
if (_optionalChain([environment, 'optionalAccess', _334 => _334.name])) return environment.name === "client";
|
|
3813
|
+
return _optionalChain([loadOptions, 'optionalAccess', _335 => _335.ssr]) !== true;
|
|
3852
3814
|
}
|
|
3853
3815
|
_chunkS3JO3N4Hcjs.__name.call(void 0, isClientEnvironment, "isClientEnvironment");
|
|
3854
3816
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
3855
|
-
const graph = _optionalChain([server, 'access',
|
|
3817
|
+
const graph = _optionalChain([server, 'access', _336 => _336.environments, 'optionalAccess', _337 => _337.client, 'optionalAccess', _338 => _338.moduleGraph]);
|
|
3856
3818
|
if (!graph) return;
|
|
3857
3819
|
for (const [id, module] of graph.idToModuleMap) {
|
|
3858
3820
|
if (_chunkCGVPXIRNcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -3867,7 +3829,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
3867
3829
|
kind: parsed.kind,
|
|
3868
3830
|
routePath: parsed.routePath,
|
|
3869
3831
|
routesFile,
|
|
3870
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
3832
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _339 => _339.routes, 'access', _340 => _340.get, 'call', _341 => _341(
|
|
3871
3833
|
_chunkVDRM36QBcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
3872
3834
|
)]),
|
|
3873
3835
|
rendererServer: renderer.server,
|
|
@@ -3876,7 +3838,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
3876
3838
|
}
|
|
3877
3839
|
_chunkS3JO3N4Hcjs.__name.call(void 0, generateProgrammaticClientRouteModuleForId, "generateProgrammaticClientRouteModuleForId");
|
|
3878
3840
|
function resolveRealModuleFile(filePath, root) {
|
|
3879
|
-
const resolved = _nullishCoalesce(
|
|
3841
|
+
const resolved = _nullishCoalesce(_chunkRACQTC7Kcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
3880
3842
|
try {
|
|
3881
3843
|
return _chunk5QIKR7RRcjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
3882
3844
|
} catch (e15) {
|
|
@@ -4194,12 +4156,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4194
4156
|
}
|
|
4195
4157
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4196
4158
|
const params = parseRouteModuleSchema(
|
|
4197
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4159
|
+
_optionalChain([schemas, 'optionalAccess', _342 => _342.params]),
|
|
4198
4160
|
input.props.params,
|
|
4199
4161
|
"params",
|
|
4200
4162
|
input.routePath
|
|
4201
4163
|
);
|
|
4202
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4164
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _343 => _343.search]), input.search, "search", input.routePath);
|
|
4203
4165
|
return {
|
|
4204
4166
|
...input.props,
|
|
4205
4167
|
params,
|
|
@@ -4220,13 +4182,13 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
4220
4182
|
}
|
|
4221
4183
|
}
|
|
4222
4184
|
_chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteModuleSchema, "parseRouteModuleSchema");
|
|
4223
|
-
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
|
|
4224
|
-
const providerClientCode =
|
|
4185
|
+
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkPSV6XKPOcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
4186
|
+
const providerClientCode = _chunkRACQTC7Kcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4225
4187
|
integrationProviders,
|
|
4226
4188
|
root,
|
|
4227
4189
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
4228
4190
|
);
|
|
4229
|
-
const clientPluginEntry =
|
|
4191
|
+
const clientPluginEntry = _chunkRACQTC7Kcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4230
4192
|
plugins,
|
|
4231
4193
|
root,
|
|
4232
4194
|
srcDir,
|
|
@@ -4237,8 +4199,7 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
|
|
|
4237
4199
|
import { hydrateRoot, createRoot } from 'react-dom/client'` : appSetupPath ? `import React, { hydrateRoot, createRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)}
|
|
4238
4200
|
import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, appSetupPath, root))}
|
|
4239
4201
|
__farmConfigureApp(__farmAppSetup)` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
|
|
4240
|
-
const isolatedHydrationImport = isolatedHydrationEnabled ?
|
|
4241
|
-
import { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'` : "";
|
|
4202
|
+
const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement } from '@farm.js/core/internal/islands-runtime'" : "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'\nimport { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'"}` : "";
|
|
4242
4203
|
const docsAdapterImportBlock = _chunkCY2ZQ5C6cjs.generateFarmDocsAdapterClientRuntime.call(void 0,
|
|
4243
4204
|
docsAdapterReact,
|
|
4244
4205
|
docsConfigModule
|
|
@@ -4246,7 +4207,7 @@ import { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'
|
|
|
4246
4207
|
const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
|
|
4247
4208
|
ReactRuntime: React,
|
|
4248
4209
|
hydrateRoot,
|
|
4249
|
-
load: (reference) => import(/* @vite-ignore */ reference),
|
|
4210
|
+
load: (reference) => import(/* @vite-ignore */ farmModuleUrl(reference)),
|
|
4250
4211
|
schedule: scheduleFarmIslandHydration,
|
|
4251
4212
|
wrap: wrapWithIntegrationProviders,
|
|
4252
4213
|
});
|
|
@@ -4266,7 +4227,7 @@ async function hydrateFarmIsolatedClientBoundaries(scope = document, signal) {
|
|
|
4266
4227
|
async function createFarmServerTreePageElement(source, pathname) {
|
|
4267
4228
|
try {
|
|
4268
4229
|
return await createFarmServerTreeElement(React, source, {
|
|
4269
|
-
load: (reference) => import(/* @vite-ignore */ reference),
|
|
4230
|
+
load: (reference) => import(/* @vite-ignore */ farmModuleUrl(reference)),
|
|
4270
4231
|
ServerHtml: FarmServerPage,
|
|
4271
4232
|
key: pathname,
|
|
4272
4233
|
});
|
|
@@ -4290,6 +4251,18 @@ import {
|
|
|
4290
4251
|
} from '@farm.js/core/deployment'
|
|
4291
4252
|
${providerClientCode.imports}
|
|
4292
4253
|
${clientPluginEntry.imports}
|
|
4254
|
+
|
|
4255
|
+
// Vite appends ?import to a dynamic import of a variable, and the browser keys that URL as a second
|
|
4256
|
+
// copy of a module other modules import statically: two React contexts, two stores. Vite leaves an
|
|
4257
|
+
// absolute URL alone. Other files (Markdown pages) need ?import to be served as JavaScript.
|
|
4258
|
+
function farmModuleUrl(reference) {
|
|
4259
|
+
return typeof reference === "string" &&
|
|
4260
|
+
reference[0] === "/" &&
|
|
4261
|
+
reference[1] !== "/" &&
|
|
4262
|
+
/\\.(?:[cm]?[jt]sx?|vue|svelte)(?:$|\\?)/.test(reference)
|
|
4263
|
+
? new URL(reference, location.origin).href
|
|
4264
|
+
: reference;
|
|
4265
|
+
}
|
|
4293
4266
|
${clientCachePersistence.imports}
|
|
4294
4267
|
${docsSearchClientRuntime}
|
|
4295
4268
|
${devtoolsClientRuntime}
|
|
@@ -4573,7 +4546,7 @@ class LegacyManifestSPARouter {
|
|
|
4573
4546
|
this.prefetchingUrls.add(pathname);
|
|
4574
4547
|
try {
|
|
4575
4548
|
// Prefetch by importing the module (Vite caches it)
|
|
4576
|
-
const module = await import(/* @vite-ignore */ modulePath);
|
|
4549
|
+
const module = await import(/* @vite-ignore */ farmModuleUrl(modulePath));
|
|
4577
4550
|
this.moduleCache.set(modulePath, module);
|
|
4578
4551
|
pageModuleCache.set(modulePath, module);
|
|
4579
4552
|
} catch (error) {
|
|
@@ -4821,7 +4794,7 @@ async function renderRouteSlot(slot, mode = 'render') {
|
|
|
4821
4794
|
|
|
4822
4795
|
let slotModule = pageModuleCache.get(slot.modulePath);
|
|
4823
4796
|
if (!slotModule) {
|
|
4824
|
-
slotModule = await import(/* @vite-ignore */ slot.modulePath);
|
|
4797
|
+
slotModule = await import(/* @vite-ignore */ farmModuleUrl(slot.modulePath));
|
|
4825
4798
|
pageModuleCache.set(slot.modulePath, slotModule);
|
|
4826
4799
|
}
|
|
4827
4800
|
const SlotComponent = slotModule?.default;
|
|
@@ -4986,7 +4959,7 @@ async function buildClientHydrationElement(
|
|
|
4986
4959
|
|
|
4987
4960
|
if (loadingModulePath) {
|
|
4988
4961
|
try {
|
|
4989
|
-
const loadingModule = await import(/* @vite-ignore */ loadingModulePath);
|
|
4962
|
+
const loadingModule = await import(/* @vite-ignore */ farmModuleUrl(loadingModulePath));
|
|
4990
4963
|
const LoadingComponent = loadingModule?.default;
|
|
4991
4964
|
if (LoadingComponent) {
|
|
4992
4965
|
const loadingFallback = React.createElement(LoadingComponent, {
|
|
@@ -5014,7 +4987,7 @@ async function loadLayoutComponents(layouts = []) {
|
|
|
5014
4987
|
try {
|
|
5015
4988
|
let LayoutComponent = layoutComponentCache.get(layout.modulePath);
|
|
5016
4989
|
if (!LayoutComponent) {
|
|
5017
|
-
const layoutModule = await import(/* @vite-ignore */ layout.modulePath);
|
|
4990
|
+
const layoutModule = await import(/* @vite-ignore */ farmModuleUrl(layout.modulePath));
|
|
5018
4991
|
LayoutComponent = layoutModule.default;
|
|
5019
4992
|
if (LayoutComponent) {
|
|
5020
4993
|
layoutComponentCache.set(layout.modulePath, LayoutComponent);
|
|
@@ -5037,7 +5010,7 @@ async function loadLayoutComponents(layouts = []) {
|
|
|
5037
5010
|
return loadedLayouts;
|
|
5038
5011
|
}
|
|
5039
5012
|
|
|
5040
|
-
${
|
|
5013
|
+
${_chunkRACQTC7Kcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5041
5014
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
5042
5015
|
let wrapped = element;
|
|
5043
5016
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -5176,7 +5149,7 @@ async function tryHydrateImportedPage(
|
|
|
5176
5149
|
if (pageShouldHydrate) {
|
|
5177
5150
|
let pageModule = pageModuleCache.get(modulePath);
|
|
5178
5151
|
if (!pageModule) {
|
|
5179
|
-
pageModule = await import(/* @vite-ignore */ modulePath);
|
|
5152
|
+
pageModule = await import(/* @vite-ignore */ farmModuleUrl(modulePath));
|
|
5180
5153
|
pageModuleCache.set(modulePath, pageModule);
|
|
5181
5154
|
}
|
|
5182
5155
|
if (signal?.aborted || !container?.isConnected) return false;
|
|
@@ -5335,7 +5308,7 @@ function parseNavigationFragment(html) {
|
|
|
5335
5308
|
return template.content;
|
|
5336
5309
|
}
|
|
5337
5310
|
|
|
5338
|
-
function replaceNavigationBoundary(container, fragment, currentPatterns, nextPatterns) {
|
|
5311
|
+
function replaceNavigationBoundary(container, fragment, currentPatterns, nextPatterns, refresh = false) {
|
|
5339
5312
|
let sharedCount = 0;
|
|
5340
5313
|
while (
|
|
5341
5314
|
sharedCount < currentPatterns.length &&
|
|
@@ -5362,7 +5335,9 @@ function replaceNavigationBoundary(container, fragment, currentPatterns, nextPat
|
|
|
5362
5335
|
return container;
|
|
5363
5336
|
}
|
|
5364
5337
|
|
|
5365
|
-
${isolatedHydrationEnabled ?
|
|
5338
|
+
${isolatedHydrationEnabled ? `${islandValues ? `// A refresh keeps the islands still on the page, with their state and new props.
|
|
5339
|
+
if (refresh) farmIsolatedHydrationRuntime.carryOver(currentTarget, nextTarget);
|
|
5340
|
+
` : ""}disposeFarmIsolatedClientBoundaries(currentTarget);` : ""}
|
|
5366
5341
|
currentTarget.replaceWith(nextTarget);
|
|
5367
5342
|
activateFragmentScripts(nextTarget);
|
|
5368
5343
|
if (fragmentTreeRoot && fragmentTreeRoot !== nextTarget) fragmentTreeRoot.remove();
|
|
@@ -5386,7 +5361,7 @@ let activeLayoutShouldHydrate = window.__FARM_LAYOUT_SHOULD_HYDRATE__ === true;
|
|
|
5386
5361
|
|
|
5387
5362
|
// ====== MANIFEST-DRIVEN HTML-FRAGMENT NAVIGATION ======
|
|
5388
5363
|
// One page-data response carries both server HTML and the hydration plan.
|
|
5389
|
-
async function renderPage(pageData) {
|
|
5364
|
+
async function renderPage(pageData, info) {
|
|
5390
5365
|
const container = document.getElementById('root');
|
|
5391
5366
|
if (!container) return;
|
|
5392
5367
|
cancelPendingPageHydration();
|
|
@@ -5479,7 +5454,7 @@ async function renderPage(pageData) {
|
|
|
5479
5454
|
const pageShouldHydrate = route.pageShouldHydrate || route.isClientComponent;
|
|
5480
5455
|
const layoutShouldHydrate = route.layoutShouldHydrate;
|
|
5481
5456
|
${isolatedHydrationEnabled ? `const hasIsolatedClientBoundaries = Boolean(
|
|
5482
|
-
fragment.querySelector('
|
|
5457
|
+
fragment.querySelector('f-island[src]'),
|
|
5483
5458
|
);
|
|
5484
5459
|
const shouldHydrate =
|
|
5485
5460
|
pageShouldHydrate || layoutShouldHydrate || (route.shouldHydrate && !hasIsolatedClientBoundaries);` : "const shouldHydrate = route.shouldHydrate || pageShouldHydrate || layoutShouldHydrate;"}
|
|
@@ -5515,7 +5490,7 @@ async function renderPage(pageData) {
|
|
|
5515
5490
|
if (appRoot) { try { appRoot.unmount(); } catch (error) {} appRoot = null; }
|
|
5516
5491
|
if (reactRoot) { try { reactRoot.unmount(); } catch (error) {} reactRoot = null; }
|
|
5517
5492
|
delete window.__FARM_REACT_ROOT__;
|
|
5518
|
-
${isolatedHydrationEnabled ? "isolatedHydrationScope = replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns) || container;" : "replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns);"}
|
|
5493
|
+
${isolatedHydrationEnabled ? "isolatedHydrationScope = replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns, info?.refresh === true) || container;" : "replaceNavigationBoundary(container, fragment, activeLayoutPatterns, layoutPatterns);"}
|
|
5519
5494
|
}
|
|
5520
5495
|
|
|
5521
5496
|
const hydrationController = new AbortController();
|
|
@@ -5612,7 +5587,7 @@ async function hydrate() {
|
|
|
5612
5587
|
const modulePath = window.__FARM_PAGE_MODULE__;
|
|
5613
5588
|
${isolatedHydrationEnabled ? `const hasIsolatedClientBoundaries =
|
|
5614
5589
|
window.__FARM_HAS_ISOLATED_CLIENT_BOUNDARIES__ === true ||
|
|
5615
|
-
Boolean(rootContainer.querySelector('
|
|
5590
|
+
Boolean(rootContainer.querySelector('f-island[src]'));` : ""}
|
|
5616
5591
|
|
|
5617
5592
|
let pageProps = normalizeServerProps(window.__FARM_PROPS__);
|
|
5618
5593
|
applyCanonicalPathFromProps(pageProps);
|
|
@@ -5858,9 +5833,9 @@ function generateClientManifest(bundle) {
|
|
|
5858
5833
|
}
|
|
5859
5834
|
_chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientManifest");
|
|
5860
5835
|
async function defineConfig(config = {}) {
|
|
5861
|
-
const tailwindVitePlugin = await
|
|
5862
|
-
const appRoot =
|
|
5863
|
-
if (_optionalChain([config, 'access',
|
|
5836
|
+
const tailwindVitePlugin = await _chunkLRJRXXQZcjs.loadTailwindVitePlugin.call(void 0, );
|
|
5837
|
+
const appRoot = path5.resolve(config.root || process.cwd());
|
|
5838
|
+
if (_optionalChain([config, 'access', _344 => _344.extends, 'optionalAccess', _345 => _345.length])) {
|
|
5864
5839
|
const { config: layeredConfig } = await import("./layers-VUWIOFEO.cjs").then(
|
|
5865
5840
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
5866
5841
|
root: appRoot,
|
|
@@ -5870,11 +5845,11 @@ async function defineConfig(config = {}) {
|
|
|
5870
5845
|
config = layeredConfig;
|
|
5871
5846
|
}
|
|
5872
5847
|
config.renderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
5873
|
-
config.images =
|
|
5848
|
+
config.images = _chunkRACQTC7Kcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
5874
5849
|
const rendererVitePlugins = await _chunkPSV6XKPOcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
5875
5850
|
ssr: true
|
|
5876
5851
|
});
|
|
5877
|
-
const reactRefreshPlugins = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? await createFarmReactRefreshPlugins() : [];
|
|
5852
|
+
const reactRefreshPlugins = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, config.renderer) ? await _chunkCEDPEDNWcjs.createFarmReactRefreshPlugins.call(void 0, ) : [];
|
|
5878
5853
|
const nodeBuiltinStubs = {
|
|
5879
5854
|
"node:string_decoder": "data:text/javascript,export class StringDecoder { write(buf) { return ''; } end() { return ''; } }; export default StringDecoder;",
|
|
5880
5855
|
"node:buffer": "data:text/javascript,export const Buffer = { from: () => ({}), alloc: () => ({}), isBuffer: () => false }; export default { Buffer };",
|
|
@@ -5962,13 +5937,13 @@ async function defineConfig(config = {}) {
|
|
|
5962
5937
|
if (!serverStarted) {
|
|
5963
5938
|
serverStarted = true;
|
|
5964
5939
|
const elapsed = Date.now() - startTime;
|
|
5965
|
-
const address = _optionalChain([server, 'access',
|
|
5940
|
+
const address = _optionalChain([server, 'access', _346 => _346.httpServer, 'optionalAccess', _347 => _347.address, 'call', _348 => _348()]);
|
|
5966
5941
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
5967
5942
|
const hostConfig = server.config.server.host;
|
|
5968
5943
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
5969
5944
|
console.log("");
|
|
5970
5945
|
console.log(
|
|
5971
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
5946
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkYBDSTNMHcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
5972
5947
|
);
|
|
5973
5948
|
console.log("");
|
|
5974
5949
|
console.log(
|
|
@@ -6000,7 +5975,7 @@ async function defineConfig(config = {}) {
|
|
|
6000
5975
|
};
|
|
6001
5976
|
return {
|
|
6002
5977
|
plugins: [
|
|
6003
|
-
|
|
5978
|
+
_chunkRACQTC7Kcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6004
5979
|
tailwindVitePlugin,
|
|
6005
5980
|
...rendererVitePlugins,
|
|
6006
5981
|
...reactRefreshPlugins,
|
|
@@ -6014,8 +5989,8 @@ async function defineConfig(config = {}) {
|
|
|
6014
5989
|
customLogger: farmLogger,
|
|
6015
5990
|
clearScreen: false,
|
|
6016
5991
|
optimizeDeps: {
|
|
6017
|
-
...
|
|
6018
|
-
|
|
5992
|
+
..._chunkRACQTC7Kcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
5993
|
+
_chunkRACQTC7Kcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
6019
5994
|
appRoot,
|
|
6020
5995
|
_chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
6021
5996
|
),
|
|
@@ -6058,7 +6033,7 @@ async function defineConfig(config = {}) {
|
|
|
6058
6033
|
// Stub out problematic server-only modules during dev mode
|
|
6059
6034
|
alias: {
|
|
6060
6035
|
..._chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
6061
|
-
...
|
|
6036
|
+
..._chunkRACQTC7Kcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
6062
6037
|
// Nitro internals that should not be resolved in browser
|
|
6063
6038
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
6064
6039
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|
|
@@ -6088,5 +6063,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, defineConfig, "defineConfig");
|
|
|
6088
6063
|
|
|
6089
6064
|
|
|
6090
6065
|
|
|
6091
|
-
|
|
6092
|
-
exports.farmImageImportsPlugin = farmImageImportsPlugin; exports.createFarmReactRefreshPlugins = createFarmReactRefreshPlugins; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig;
|
|
6066
|
+
exports.farmImageImportsPlugin = farmImageImportsPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig;
|