@farm.js/core 0.1.68 → 0.1.69
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.d-wkVPK1GA.d.mts → agent-mcp.d-DOfBMEzP.d.mts} +1 -1
- package/dist/{agent-mcp.d-Uh5xr7aX.d.ts → agent-mcp.d-DnIgriX1.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/{analyzer-CQDU7E3Y.mjs → analyzer-NAL5TJUP.mjs} +2 -2
- package/dist/analyzer-SAJSV6SP.cjs +16 -0
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- 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 +4 -21
- package/dist/api.d.ts +4 -21
- package/dist/api.mjs +1 -1
- package/dist/{app-manifest.d-BT5i2F-o.d.ts → app-manifest.d-CaAcaukR.d.ts} +1 -1
- package/dist/{app-manifest.d-Dd4q5CFx.d.mts → app-manifest.d-_BVbI0xp.d.mts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-BVOpL_f2.d.ts → app.d-BWeDqOaF.d.ts} +4 -4
- package/dist/{app.d-BhiDXex_.d.mts → app.d-CaPwtytN.d.mts} +4 -4
- package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-CTDVF0Fc.d.mts} +2 -1
- package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-CTDVF0Fc.d.ts} +2 -1
- package/dist/{chunk-SQ6IWJ3H.cjs → chunk-22LGTSBA.cjs} +1 -1
- package/dist/{chunk-T5XFZQCL.mjs → chunk-2P7UYHZP.mjs} +1 -1
- package/dist/{chunk-LDEXTX4I.cjs → chunk-4JRAMCUP.cjs} +11 -4
- package/dist/{chunk-TNK2TVRS.cjs → chunk-4W4ZWSV2.cjs} +196 -155
- package/dist/{chunk-MNJDNTGO.mjs → chunk-5TOWKGV3.mjs} +1 -1
- package/dist/{chunk-7LK5CTUM.cjs → chunk-6GQJVY4E.cjs} +18 -13
- package/dist/{chunk-5JKDFRTK.cjs → chunk-ABIBASLJ.cjs} +2 -2
- package/dist/{chunk-F6CMGWAL.mjs → chunk-ANMIR6US.mjs} +1 -1
- package/dist/{chunk-Z6SOXHAD.mjs → chunk-CKCKCUYO.mjs} +72 -31
- package/dist/{chunk-2ZOYOYEE.mjs → chunk-D5F7RPZP.mjs} +71 -1
- package/dist/{chunk-F36LS2C7.cjs → chunk-DHR2WDSL.cjs} +27 -27
- package/dist/{chunk-URN7VFO7.cjs → chunk-F6YLXK5L.cjs} +10 -11
- package/dist/{chunk-YTNBCXCW.cjs → chunk-GQ6QOH7T.cjs} +9 -5
- package/dist/{chunk-BZWTBELF.cjs → chunk-GTQOEEE7.cjs} +77 -7
- package/dist/{chunk-IGDYL2IA.cjs → chunk-GUMKIQJL.cjs} +2 -2
- package/dist/{chunk-4UAQB5LB.mjs → chunk-IYLZZTP6.mjs} +4 -4
- package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
- package/dist/{chunk-225APHKC.cjs → chunk-L5OZN6YW.cjs} +3 -3
- package/dist/{chunk-KWCZKJYU.cjs → chunk-L6NWQ3DR.cjs} +351 -277
- package/dist/{chunk-6OFOIMNS.mjs → chunk-MAGFDK4Q.mjs} +1 -1
- package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
- package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
- package/dist/{chunk-A3T445WK.mjs → chunk-PDQ6EGPK.mjs} +8 -1
- package/dist/{chunk-VRGY3X2I.mjs → chunk-PEYDQMSA.mjs} +5 -6
- package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
- package/dist/{chunk-JSOCDYER.cjs → chunk-Q4HH5Q6A.cjs} +15 -1
- package/dist/{chunk-NT4W4H52.mjs → chunk-SZORL7EW.mjs} +18 -13
- package/dist/{chunk-Z3PW3DIR.cjs → chunk-TKYOJ5G2.cjs} +3 -3
- package/dist/{chunk-DIXFKAPM.mjs → chunk-UHU4QALN.mjs} +153 -79
- package/dist/{chunk-WPB67LE5.mjs → chunk-ULMXZYOA.mjs} +1 -1
- package/dist/{chunk-MZ4CRSY7.cjs → chunk-VO65MYJD.cjs} +4 -4
- package/dist/{chunk-DXZ57EPE.mjs → chunk-YOHHL2UE.mjs} +14 -0
- package/dist/{chunk-VFNAK6A5.mjs → chunk-ZR2QB45W.mjs} +7 -3
- package/dist/{chunk-KDO6T6OB.mjs → chunk-ZYCEEE3V.mjs} +1 -1
- package/dist/{client-component.d-DNVSLEPi.d.ts → client-component.d-CfJxuXZl.d.ts} +2 -2
- package/dist/{client-component.d-BvQOxSqh.d.mts → client-component.d-CnEeVvGG.d.mts} +2 -2
- package/dist/{client-plugins.d-CNDqcAuf.d.ts → client-plugins.d-D7dHV1Nf.d.ts} +15 -3
- package/dist/{client-plugins.d-CE1lVK2R.d.mts → client-plugins.d-Do5ULA0x.d.mts} +15 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-R27T3BRY.cjs → devtools-7HNDS4SY.cjs} +2 -2
- package/dist/{devtools-2A2GPC7B.mjs → devtools-BP4EBTKQ.mjs} +1 -1
- package/dist/docs.cjs +5 -3
- package/dist/docs.d.mts +15 -3
- package/dist/docs.d.ts +15 -3
- package/dist/docs.mjs +5 -3
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +17 -16
- package/dist/{index.d-Bt3kl19W.d.mts → index.d-B1MpEJAo.d.mts} +1 -1
- package/dist/{index.d-Cx_-DaKV.d.ts → index.d-CVFk37uX.d.ts} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.mjs +17 -16
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- 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 +15 -16
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +14 -15
- package/dist/internal/cli-runtime.cjs +2 -2
- package/dist/internal/cli-runtime.mjs +1 -1
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +8 -4
- package/dist/internal/production-runtime.d.mts +19 -12
- package/dist/internal/production-runtime.d.ts +19 -12
- package/dist/internal/production-runtime.mjs +8 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-Bki4pOaJ.d.mts → mount.d-CBqr-LfI.d.mts} +1 -1
- package/dist/{mount.d-DjR5aerM.d.ts → mount.d-CGzN61Kq.d.ts} +1 -1
- package/dist/{navigation-delegate.d-VDkziXTK.d.mts → navigation-delegate.d-BwCOhpj7.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CtghaSP3.d.ts → navigation-delegate.d-CLH2dXjy.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
- package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
- package/dist/plugin.cjs +10 -10
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +9 -9
- package/dist/{render-plan.d-BSwV8PE4.d.mts → render-plan.d-CzGDjcT0.d.mts} +1 -1
- package/dist/{render-plan.d-i9sI4tc9.d.ts → render-plan.d-W6LmjD6y.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-Dgln8tuI.d.ts → request.d-CTVRZiQv.d.ts} +1 -1
- package/dist/{request.d-C24FNQ_7.d.mts → request.d-CgNVderU.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-Ds0BfwQi.d.mts → route-rendering.d-D0bmZVJA.d.mts} +1 -1
- package/dist/{route-rendering.d-CUylZKJA.d.ts → route-rendering.d-FDSNtCMg.d.ts} +1 -1
- package/dist/{router.d-B56rMOFm.d.ts → router.d-DZ3ldniI.d.ts} +1 -1
- package/dist/{router.d-CFPcbqzc.d.mts → router.d-GRKm_uAV.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-3T7V6OUT.cjs → rsc-pipeline-J4KKBSCH.cjs} +4 -5
- package/dist/{rsc-pipeline-GA4AQWZI.mjs → rsc-pipeline-PJZOVYSY.mjs} +3 -4
- package/dist/{runtime-REUTNTI5.cjs → runtime-OLEO5NXF.cjs} +4 -4
- package/dist/{runtime-ZYCKKY7L.mjs → runtime-QDBSE4H6.mjs} +2 -2
- package/dist/{runtime.d-DLRO-ExG.d.mts → runtime.d-DqXihlxm.d.mts} +1 -1
- package/dist/{runtime.d-H7k9hOQE.d.ts → runtime.d-pqFQBU2N.d.ts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +31 -31
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +12 -12
- package/dist/{spa-router.d-Dr7oanhl.d.ts → spa-router.d-DhOhaQ-7.d.ts} +2 -2
- package/dist/{spa-router.d-g4CzhEH1.d.mts → spa-router.d-Dhvy60p4.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-BxxyDEb8.d.ts → utils.d-BVCMRRau.d.ts} +1 -1
- package/dist/{utils.d-HIla3pD_.d.mts → utils.d-Q8EHCpkF.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +10 -10
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +9 -9
- package/package.json +2 -2
- package/dist/analyzer-PPAHM4AW.cjs +0 -16
- package/dist/chunk-HHLEYA4B.cjs +0 -17
- package/dist/chunk-QYNZ3CTI.mjs +0 -17
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var _chunkHHLEYA4Bcjs = require('./chunk-HHLEYA4B.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
|
|
7
4
|
|
|
8
5
|
|
|
@@ -29,7 +26,7 @@ var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
|
|
|
29
26
|
|
|
30
27
|
|
|
31
28
|
|
|
32
|
-
var
|
|
29
|
+
var _chunkL5OZN6YWcjs = require('./chunk-L5OZN6YW.cjs');
|
|
33
30
|
|
|
34
31
|
|
|
35
32
|
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
@@ -43,7 +40,8 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
|
|
|
43
40
|
|
|
44
41
|
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
|
|
44
|
+
var _chunk4JRAMCUPcjs = require('./chunk-4JRAMCUP.cjs');
|
|
47
45
|
|
|
48
46
|
|
|
49
47
|
|
|
@@ -67,7 +65,7 @@ var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
|
67
65
|
var _chunkUKZ6AWKZcjs = require('./chunk-UKZ6AWKZ.cjs');
|
|
68
66
|
|
|
69
67
|
|
|
70
|
-
var
|
|
68
|
+
var _chunkTKYOJ5G2cjs = require('./chunk-TKYOJ5G2.cjs');
|
|
71
69
|
|
|
72
70
|
|
|
73
71
|
var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
@@ -76,7 +74,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
|
76
74
|
|
|
77
75
|
|
|
78
76
|
|
|
79
|
-
var
|
|
77
|
+
var _chunk6GQJVY4Ecjs = require('./chunk-6GQJVY4E.cjs');
|
|
80
78
|
|
|
81
79
|
|
|
82
80
|
var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
|
|
@@ -112,14 +110,15 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
|
|
|
112
110
|
|
|
113
111
|
|
|
114
112
|
|
|
115
|
-
var
|
|
113
|
+
var _chunkDHR2WDSLcjs = require('./chunk-DHR2WDSL.cjs');
|
|
114
|
+
|
|
116
115
|
|
|
117
116
|
|
|
118
117
|
|
|
119
|
-
var
|
|
118
|
+
var _chunkQ4HH5Q6Acjs = require('./chunk-Q4HH5Q6A.cjs');
|
|
120
119
|
|
|
121
120
|
|
|
122
|
-
var
|
|
121
|
+
var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
|
|
123
122
|
|
|
124
123
|
|
|
125
124
|
|
|
@@ -151,7 +150,7 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
151
150
|
|
|
152
151
|
|
|
153
152
|
|
|
154
|
-
var
|
|
153
|
+
var _chunkGQ6QOH7Tcjs = require('./chunk-GQ6QOH7T.cjs');
|
|
155
154
|
|
|
156
155
|
|
|
157
156
|
|
|
@@ -159,7 +158,7 @@ var _chunkYTNBCXCWcjs = require('./chunk-YTNBCXCW.cjs');
|
|
|
159
158
|
var _chunkX3MHKLCOcjs = require('./chunk-X3MHKLCO.cjs');
|
|
160
159
|
|
|
161
160
|
|
|
162
|
-
var
|
|
161
|
+
var _chunkGUMKIQJLcjs = require('./chunk-GUMKIQJL.cjs');
|
|
163
162
|
|
|
164
163
|
|
|
165
164
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -177,7 +176,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
177
176
|
|
|
178
177
|
|
|
179
178
|
|
|
180
|
-
var
|
|
179
|
+
var _chunkVO65MYJDcjs = require('./chunk-VO65MYJD.cjs');
|
|
181
180
|
|
|
182
181
|
|
|
183
182
|
|
|
@@ -283,7 +282,7 @@ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
|
283
282
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
284
283
|
|
|
285
284
|
|
|
286
|
-
var
|
|
285
|
+
var _chunk22LGTSBAcjs = require('./chunk-22LGTSBA.cjs');
|
|
287
286
|
|
|
288
287
|
|
|
289
288
|
var _chunk23VJEGKCcjs = require('./chunk-23VJEGKC.cjs');
|
|
@@ -456,7 +455,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
456
455
|
isPathGuarded: options.isPathGuarded,
|
|
457
456
|
basePath
|
|
458
457
|
});
|
|
459
|
-
const apiHandler =
|
|
458
|
+
const apiHandler = _chunk4JRAMCUPcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
460
459
|
rootDir: options.root,
|
|
461
460
|
srcDir: options.srcDir,
|
|
462
461
|
docs,
|
|
@@ -968,13 +967,14 @@ function createFarmVercelImmutableAssetRoute() {
|
|
|
968
967
|
};
|
|
969
968
|
}
|
|
970
969
|
function buildFarmVercelRoutes(options) {
|
|
971
|
-
const { presetRoutes, runtimeRoutes, middlewareRoutes = [] } = options;
|
|
970
|
+
const { presetRoutes, runtimeRoutes, middlewareRoutes = [], canonicalSlashRoutes = [] } = options;
|
|
972
971
|
const filesystemIndex = presetRoutes.findIndex((route) => route.handle === "filesystem");
|
|
973
972
|
const sourceRoutes = filesystemIndex >= 0 ? presetRoutes.slice(0, filesystemIndex) : [];
|
|
974
973
|
const preservedSourceRoutes = sourceRoutes.filter((route) => route.continue !== true);
|
|
975
974
|
return [
|
|
976
975
|
...preservedSourceRoutes,
|
|
977
976
|
...middlewareRoutes,
|
|
977
|
+
...canonicalSlashRoutes,
|
|
978
978
|
createFarmVercelImmutableAssetRoute(),
|
|
979
979
|
{ handle: "filesystem" },
|
|
980
980
|
...runtimeRoutes,
|
|
@@ -984,6 +984,18 @@ function buildFarmVercelRoutes(options) {
|
|
|
984
984
|
}
|
|
985
985
|
];
|
|
986
986
|
}
|
|
987
|
+
function escapeRegExp2(value) {
|
|
988
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
989
|
+
}
|
|
990
|
+
function createFarmVercelCanonicalSlashRoutes(publicPaths) {
|
|
991
|
+
const otherSpellings = [
|
|
992
|
+
...new Set(
|
|
993
|
+
publicPaths.filter((pathname) => pathname !== "/").map((pathname) => pathname.endsWith("/") ? pathname.replace(/\/+$/, "") : `${pathname}/`).filter((pathname) => pathname !== "")
|
|
994
|
+
)
|
|
995
|
+
];
|
|
996
|
+
if (otherSpellings.length === 0) return [];
|
|
997
|
+
return [{ src: `^(?:${otherSpellings.map(escapeRegExp2).join("|")})$`, dest: "/__nitro" }];
|
|
998
|
+
}
|
|
987
999
|
|
|
988
1000
|
// src/nitro/ssr-public-assets.ts
|
|
989
1001
|
|
|
@@ -1243,7 +1255,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1243
1255
|
// removed block used (`readFileSync` for a version, say).
|
|
1244
1256
|
enforce: "pre",
|
|
1245
1257
|
transform: {
|
|
1246
|
-
filter: { id:
|
|
1258
|
+
filter: { id: _chunkDHR2WDSLcjs.fileNamePattern.call(void 0, configFiles) },
|
|
1247
1259
|
async handler(code, id) {
|
|
1248
1260
|
const file = id.split("?", 1)[0];
|
|
1249
1261
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1376,7 +1388,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
|
|
|
1376
1388
|
function isFarmEdgeMiddlewareRoute(route) {
|
|
1377
1389
|
return typeof route.config === "object" && _optionalChain([route, 'access', _42 => _42.config, 'optionalAccess', _43 => _43.runtime]) === "edge";
|
|
1378
1390
|
}
|
|
1379
|
-
function
|
|
1391
|
+
function escapeRegExp3(value) {
|
|
1380
1392
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1381
1393
|
}
|
|
1382
1394
|
function toFarmVercelEdgeGuardedUrls(pathnames, basePath) {
|
|
@@ -1388,7 +1400,7 @@ function createFarmVercelEdgeMiddlewareRoute(pathnames, basePath = "/") {
|
|
|
1388
1400
|
const publicPaths = toFarmVercelEdgeGuardedUrls(pathnames, basePath);
|
|
1389
1401
|
const alternatives = publicPaths.map((pathname) => {
|
|
1390
1402
|
const trimmed = pathname.replace(/\/+$/, "");
|
|
1391
|
-
return trimmed ? `${
|
|
1403
|
+
return trimmed ? `${escapeRegExp3(trimmed)}(?:/|/index\\.html|\\.html)?` : "/(?:index\\.html)?";
|
|
1392
1404
|
});
|
|
1393
1405
|
return {
|
|
1394
1406
|
src: `^(?:${alternatives.join("|")})$`,
|
|
@@ -1471,7 +1483,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
1471
1483
|
logLevel: "silent",
|
|
1472
1484
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
1473
1485
|
resolve: {
|
|
1474
|
-
alias:
|
|
1486
|
+
alias: _chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
1475
1487
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
1476
1488
|
},
|
|
1477
1489
|
transform: {
|
|
@@ -1860,7 +1872,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
1860
1872
|
return {
|
|
1861
1873
|
name: "farm-omitted-metadata-image-runtime",
|
|
1862
1874
|
resolveId: {
|
|
1863
|
-
filter: { id:
|
|
1875
|
+
filter: { id: _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
1864
1876
|
handler(source, importer) {
|
|
1865
1877
|
if (source !== "@vercel/og") return null;
|
|
1866
1878
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -1869,7 +1881,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
1869
1881
|
}
|
|
1870
1882
|
},
|
|
1871
1883
|
load: {
|
|
1872
|
-
filter: { id:
|
|
1884
|
+
filter: { id: _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
1873
1885
|
handler(id) {
|
|
1874
1886
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
1875
1887
|
return `
|
|
@@ -2254,7 +2266,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
2254
2266
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
2255
2267
|
const srcDir = config.srcDir || "src";
|
|
2256
2268
|
const distDir = config.distDir || ".farm";
|
|
2257
|
-
const deployOutputDir =
|
|
2269
|
+
const deployOutputDir = _chunk6GQJVY4Ecjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
2258
2270
|
const lifecyclePluginManager = options.pluginManager;
|
|
2259
2271
|
const productionViteResultPromise = Promise.allSettled([
|
|
2260
2272
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -2539,7 +2551,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
2539
2551
|
}
|
|
2540
2552
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
2541
2553
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
2542
|
-
await fs4.writeFile(clientCssPath,
|
|
2554
|
+
await fs4.writeFile(clientCssPath, _chunkDHR2WDSLcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
2543
2555
|
}
|
|
2544
2556
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
2545
2557
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -2592,7 +2604,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2592
2604
|
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2593
2605
|
let plan = cache.get(key);
|
|
2594
2606
|
if (!plan) {
|
|
2595
|
-
plan =
|
|
2607
|
+
plan = _chunkVO65MYJDcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2596
2608
|
cache.set(key, plan);
|
|
2597
2609
|
}
|
|
2598
2610
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2601,7 +2613,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2601
2613
|
if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
|
|
2602
2614
|
const viteBuild = productionVite.build;
|
|
2603
2615
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
2604
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
2616
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
2605
2617
|
const fs4 = await import("fs/promises");
|
|
2606
2618
|
const pluginManager = new PluginManager2({
|
|
2607
2619
|
config,
|
|
@@ -2621,14 +2633,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2621
2633
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2622
2634
|
);
|
|
2623
2635
|
}
|
|
2624
|
-
const isolatedMode =
|
|
2636
|
+
const isolatedMode = _chunkVO65MYJDcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2625
2637
|
_optionalChain([config, 'access', _85 => _85.experimental, 'optionalAccess', _86 => _86.isolatedClientHydration]),
|
|
2626
2638
|
{
|
|
2627
2639
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _87 => _87.experimental, 'optionalAccess', _88 => _88.serverComponents])) === "rsc",
|
|
2628
2640
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2629
2641
|
}
|
|
2630
2642
|
);
|
|
2631
|
-
const planOptions =
|
|
2643
|
+
const planOptions = _chunkVO65MYJDcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2632
2644
|
config.renderer,
|
|
2633
2645
|
Boolean(unsupportedIntegrationProvider)
|
|
2634
2646
|
);
|
|
@@ -2700,7 +2712,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2700
2712
|
);
|
|
2701
2713
|
const syntheticDocsEntry = _optionalChain([config, 'access', _100 => _100.docs, 'optionalAccess', _101 => _101.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2702
2714
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2703
|
-
const markdownPagePlan =
|
|
2715
|
+
const markdownPagePlan = _chunkVO65MYJDcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2704
2716
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2705
2717
|
root,
|
|
2706
2718
|
isolatedMode,
|
|
@@ -2716,7 +2728,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2716
2728
|
pagePlanOptions
|
|
2717
2729
|
)
|
|
2718
2730
|
}));
|
|
2719
|
-
|
|
2731
|
+
_chunkVO65MYJDcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2720
2732
|
clientLayouts.map((layout) => ({
|
|
2721
2733
|
pattern: layout.pattern,
|
|
2722
2734
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2749,7 +2761,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2749
2761
|
for (const layout of clientLayouts) {
|
|
2750
2762
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
2751
2763
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2752
|
-
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${
|
|
2764
|
+
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunkVO65MYJDcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2753
2765
|
}
|
|
2754
2766
|
}
|
|
2755
2767
|
if (isolatedMode === "analyze") {
|
|
@@ -2783,7 +2795,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2783
2795
|
);
|
|
2784
2796
|
if (metadata.suppressedAsyncHydration) {
|
|
2785
2797
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
2786
|
-
`\u26A0\uFE0F ${
|
|
2798
|
+
`\u26A0\uFE0F ${_chunkVO65MYJDcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2787
2799
|
);
|
|
2788
2800
|
}
|
|
2789
2801
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -2791,7 +2803,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2791
2803
|
).flatMap(({ plan }) => plan.isolatedBoundaries);
|
|
2792
2804
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
2793
2805
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
2794
|
-
const islandStrategy =
|
|
2806
|
+
const islandStrategy = _chunkDHR2WDSLcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
2795
2807
|
route,
|
|
2796
2808
|
metadata,
|
|
2797
2809
|
clientLayouts,
|
|
@@ -2810,7 +2822,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2810
2822
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
2811
2823
|
],
|
|
2812
2824
|
// The server renders a server tree only below a hydrating layout.
|
|
2813
|
-
...
|
|
2825
|
+
..._chunkVO65MYJDcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2814
2826
|
});
|
|
2815
2827
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2816
2828
|
}
|
|
@@ -2847,7 +2859,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2847
2859
|
}
|
|
2848
2860
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2849
2861
|
try {
|
|
2850
|
-
const metadata =
|
|
2862
|
+
const metadata = _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
2851
2863
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
2852
2864
|
} catch (error) {
|
|
2853
2865
|
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -2879,11 +2891,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2879
2891
|
config.trailingSlash,
|
|
2880
2892
|
_chunkBDYM2TN3cjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2881
2893
|
config.basePath,
|
|
2882
|
-
|
|
2894
|
+
_chunkDHR2WDSLcjs.generateClientCachePersistenceCode.call(void 0, _chunkDHR2WDSLcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2883
2895
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2884
2896
|
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _107 => _107.experimental, 'optionalAccess', _108 => _108.serverComponents])) === "islands",
|
|
2885
2897
|
platform,
|
|
2886
|
-
islandsMode ?
|
|
2898
|
+
islandsMode ? _chunkVO65MYJDcjs.collectFarmServerStylesheets.call(void 0,
|
|
2887
2899
|
[
|
|
2888
2900
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
2889
2901
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -2898,7 +2910,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2898
2910
|
await fs4.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
|
|
2899
2911
|
}
|
|
2900
2912
|
const clientInput = { [entryName]: clientEntryPath };
|
|
2901
|
-
if (platform === "web" &&
|
|
2913
|
+
if (platform === "web" && _chunkDHR2WDSLcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
2902
2914
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
2903
2915
|
await fs4.writeFile(
|
|
2904
2916
|
clientBootPath,
|
|
@@ -2919,7 +2931,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2919
2931
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2920
2932
|
await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2921
2933
|
postcssSearchPath = clientEntryDir;
|
|
2922
|
-
tailwindVitePlugin = await
|
|
2934
|
+
tailwindVitePlugin = await _chunkQ4HH5Q6Acjs.loadTailwindVitePlugin.call(void 0, {
|
|
2923
2935
|
builder: productionVite.builder,
|
|
2924
2936
|
announce: true
|
|
2925
2937
|
});
|
|
@@ -2970,7 +2982,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2970
2982
|
}
|
|
2971
2983
|
},
|
|
2972
2984
|
plugins: [
|
|
2973
|
-
|
|
2985
|
+
_chunkDHR2WDSLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2974
2986
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2975
2987
|
outDir: _path2.default.join(
|
|
2976
2988
|
_path2.default.dirname(outputDir),
|
|
@@ -3002,7 +3014,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3002
3014
|
...rendererVitePlugins,
|
|
3003
3015
|
...config.vite.plugins || [],
|
|
3004
3016
|
farmServerOnlyEntriesPlugin({ platform }),
|
|
3005
|
-
|
|
3017
|
+
_chunkDHR2WDSLcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3006
3018
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3007
3019
|
),
|
|
3008
3020
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3035,7 +3047,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3035
3047
|
},
|
|
3036
3048
|
load: {
|
|
3037
3049
|
filter: {
|
|
3038
|
-
id:
|
|
3050
|
+
id: _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [
|
|
3039
3051
|
"\0empty-module",
|
|
3040
3052
|
"\0empty-api-route",
|
|
3041
3053
|
"\0farm-i18n-client-bridge",
|
|
@@ -3072,7 +3084,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3072
3084
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
|
|
3073
3085
|
pluginManager
|
|
3074
3086
|
),
|
|
3075
|
-
|
|
3087
|
+
_chunkVO65MYJDcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3076
3088
|
],
|
|
3077
3089
|
mode: "production",
|
|
3078
3090
|
css: postcssSearchPath ? {
|
|
@@ -3080,7 +3092,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3080
3092
|
} : void 0,
|
|
3081
3093
|
// Ensure React is bundled for client
|
|
3082
3094
|
resolve: {
|
|
3083
|
-
alias:
|
|
3095
|
+
alias: _chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3084
3096
|
dedupe: [...config.renderer.dedupe || []]
|
|
3085
3097
|
},
|
|
3086
3098
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3093,7 +3105,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3093
3105
|
]
|
|
3094
3106
|
}
|
|
3095
3107
|
};
|
|
3096
|
-
await viteBuild(
|
|
3108
|
+
await viteBuild(_chunkDHR2WDSLcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
3097
3109
|
if (platform === "mobile") {
|
|
3098
3110
|
await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
3099
3111
|
if (!await _chunkE5UN4OWXcjs.hasFarmMobileClientEntry.call(void 0, _path2.default.dirname(outputDir), outputDir)) {
|
|
@@ -3193,7 +3205,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3193
3205
|
return response;
|
|
3194
3206
|
}
|
|
3195
3207
|
|
|
3196
|
-
${streamNavigations ?
|
|
3208
|
+
${streamNavigations ? _chunkDHR2WDSLcjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
|
|
3197
3209
|
|
|
3198
3210
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3199
3211
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -4150,7 +4162,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4150
4162
|
direction: {}
|
|
4151
4163
|
}, plugins = [], renderer = _chunk67MZTLTFcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
4152
4164
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
4153
|
-
const clientPluginEntry =
|
|
4165
|
+
const clientPluginEntry = _chunkQ4HH5Q6Acjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4154
4166
|
plugins,
|
|
4155
4167
|
root,
|
|
4156
4168
|
srcDir,
|
|
@@ -4162,7 +4174,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
4162
4174
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
4163
4175
|
import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
|
|
4164
4176
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
4165
|
-
const providerClientCode =
|
|
4177
|
+
const providerClientCode = _chunkDHR2WDSLcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4166
4178
|
integrationProviders,
|
|
4167
4179
|
root,
|
|
4168
4180
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -4283,7 +4295,7 @@ mountFarmDocsSearch();
|
|
|
4283
4295
|
|
|
4284
4296
|
${generateUniversalRouterStateRuntime()}
|
|
4285
4297
|
|
|
4286
|
-
${
|
|
4298
|
+
${_chunkDHR2WDSLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
4287
4299
|
|
|
4288
4300
|
// SPA Router for server-rendered pages (HTML swap)
|
|
4289
4301
|
const spaRouter = {
|
|
@@ -4719,7 +4731,7 @@ function hasHydratableLayout(pathname) {
|
|
|
4719
4731
|
});
|
|
4720
4732
|
}
|
|
4721
4733
|
|
|
4722
|
-
${
|
|
4734
|
+
${_chunkDHR2WDSLcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
4723
4735
|
// Wrap a page element with applicable layouts
|
|
4724
4736
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
4725
4737
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4754,7 +4766,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
4754
4766
|
return React.createElement("div", props, pageElement);
|
|
4755
4767
|
}
|
|
4756
4768
|
let farmLastRouteState = null;
|
|
4757
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
4769
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkDHR2WDSLcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4758
4770
|
function farmTreeLayoutsOf(pathname) {
|
|
4759
4771
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
4760
4772
|
return layout.serverTree === true;
|
|
@@ -5318,7 +5330,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
5318
5330
|
return true;
|
|
5319
5331
|
}` : ""}
|
|
5320
5332
|
|
|
5321
|
-
${
|
|
5333
|
+
${_chunkDHR2WDSLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5322
5334
|
|
|
5323
5335
|
function activateNavigationScripts(root) {
|
|
5324
5336
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -5421,7 +5433,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
5421
5433
|
return shell.innerHTML;
|
|
5422
5434
|
}
|
|
5423
5435
|
|
|
5424
|
-
${islandValues ?
|
|
5436
|
+
${islandValues ? _chunkDHR2WDSLcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
5425
5437
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
5426
5438
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
5427
5439
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -6003,7 +6015,7 @@ void hydrate();
|
|
|
6003
6015
|
async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
|
|
6004
6016
|
const viteBuild = productionVite.build;
|
|
6005
6017
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
6006
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
6018
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
6007
6019
|
const fs4 = await import("fs/promises");
|
|
6008
6020
|
const pluginManager = new PluginManager2({
|
|
6009
6021
|
config,
|
|
@@ -6024,7 +6036,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6024
6036
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
6025
6037
|
"module.exports = { plugins: [] };\n"
|
|
6026
6038
|
);
|
|
6027
|
-
tailwindVitePlugin = await
|
|
6039
|
+
tailwindVitePlugin = await _chunkQ4HH5Q6Acjs.loadTailwindVitePlugin.call(void 0, {
|
|
6028
6040
|
builder: productionVite.builder,
|
|
6029
6041
|
label: "for SSR"
|
|
6030
6042
|
});
|
|
@@ -6131,7 +6143,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6131
6143
|
}))
|
|
6132
6144
|
) : discoveredMiddlewareRoutes;
|
|
6133
6145
|
const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
6134
|
-
const notFoundPath =
|
|
6146
|
+
const notFoundPath = _chunkDHR2WDSLcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
6135
6147
|
if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
6136
6148
|
layoutRoutes.sort((a, b) => {
|
|
6137
6149
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -6154,8 +6166,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6154
6166
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
6155
6167
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _118 => _118.mdx, 'optionalAccess', _119 => _119.components]));
|
|
6156
6168
|
const hasMiddlewareConfig = _chunkUPOYKX4Scjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
6157
|
-
const hasRouteContextConfig =
|
|
6158
|
-
const hasServerRuntimePlugins =
|
|
6169
|
+
const hasRouteContextConfig = _chunk6GQJVY4Ecjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
6170
|
+
const hasServerRuntimePlugins = _chunkQ4HH5Q6Acjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
6159
6171
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
6160
6172
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
6161
6173
|
const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
|
|
@@ -6164,9 +6176,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6164
6176
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
6165
6177
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
6166
6178
|
);
|
|
6167
|
-
if (
|
|
6179
|
+
if (_chunk4JRAMCUPcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
6168
6180
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
6169
|
-
|
|
6181
|
+
_chunk4JRAMCUPcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
6170
6182
|
config.docs,
|
|
6171
6183
|
{ root, srcDir: config.srcDir },
|
|
6172
6184
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -6176,7 +6188,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6176
6188
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
6177
6189
|
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _120 => _120.docs, 'optionalAccess', _121 => _121.enabled]) && _chunkI7J5RLGOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHDPT6OYEcjs._runWithFarmCspNonce.call(void 0,
|
|
6178
6190
|
farmDocsCspNonceMarker,
|
|
6179
|
-
async () => _optionalChain([config, 'access', _122 => _122.docs, 'access', _123 => _123.adapter, 'optionalAccess', _124 => _124.server]) ? await
|
|
6191
|
+
async () => _optionalChain([config, 'access', _122 => _122.docs, 'access', _123 => _123.adapter, 'optionalAccess', _124 => _124.server]) ? await _chunk4JRAMCUPcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
6180
6192
|
root,
|
|
6181
6193
|
srcDir: config.srcDir,
|
|
6182
6194
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -6199,6 +6211,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6199
6211
|
if (farmDocsPrecompiledManifest && farmDocsCspNonceMarker) {
|
|
6200
6212
|
farmDocsPrecompiledManifest.cspNonceMarker = farmDocsCspNonceMarker;
|
|
6201
6213
|
}
|
|
6214
|
+
const farmDocsAnalyticsPages = await listFarmDocsAnalyticsPages(config, root, preset);
|
|
6202
6215
|
const virtualEntryCode = generateVirtualEntryCode(
|
|
6203
6216
|
apiRoutes,
|
|
6204
6217
|
pageRoutes,
|
|
@@ -6225,7 +6238,8 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6225
6238
|
i18nCatalogs,
|
|
6226
6239
|
isolatedClientBoundaryModules,
|
|
6227
6240
|
hydrationPlanCache,
|
|
6228
|
-
mobileShellLoadingRoutes
|
|
6241
|
+
mobileShellLoadingRoutes,
|
|
6242
|
+
farmDocsAnalyticsPages
|
|
6229
6243
|
);
|
|
6230
6244
|
const virtualEntryId = "\0virtual:farm-ssr-entry";
|
|
6231
6245
|
const useExternalMetadataImageRuntime = shouldUseExternalMetadataImageRuntime(preset, true);
|
|
@@ -6341,7 +6355,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6341
6355
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _130 => _130.env, 'optionalAccess', _131 => _131.public]) || {})
|
|
6342
6356
|
},
|
|
6343
6357
|
plugins: [
|
|
6344
|
-
|
|
6358
|
+
_chunkDHR2WDSLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6345
6359
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
6346
6360
|
...rendererVitePlugins,
|
|
6347
6361
|
...config.vite.plugins || [],
|
|
@@ -6364,7 +6378,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6364
6378
|
{ ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
|
|
6365
6379
|
farmServerOnlyEntriesPlugin(),
|
|
6366
6380
|
farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
|
|
6367
|
-
|
|
6381
|
+
_chunkVO65MYJDcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
6368
6382
|
...hasRuntimeConfigModule ? [
|
|
6369
6383
|
farmStripPlatformConfigPlugin(
|
|
6370
6384
|
[
|
|
@@ -6376,7 +6390,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6376
6390
|
{
|
|
6377
6391
|
name: "farm-virtual-ssr-entry",
|
|
6378
6392
|
resolveId: {
|
|
6379
|
-
filter: { id:
|
|
6393
|
+
filter: { id: _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
6380
6394
|
handler(id) {
|
|
6381
6395
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
6382
6396
|
return virtualEntryId;
|
|
@@ -6385,7 +6399,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6385
6399
|
}
|
|
6386
6400
|
},
|
|
6387
6401
|
load: {
|
|
6388
|
-
filter: { id:
|
|
6402
|
+
filter: { id: _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
6389
6403
|
handler(id) {
|
|
6390
6404
|
if (id === virtualEntryId) {
|
|
6391
6405
|
return virtualEntryCode;
|
|
@@ -6417,7 +6431,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6417
6431
|
resolve: {
|
|
6418
6432
|
alias: [
|
|
6419
6433
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
6420
|
-
...Object.entries(
|
|
6434
|
+
...Object.entries(_chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
6421
6435
|
([find, replacement]) => ({ find, replacement })
|
|
6422
6436
|
)
|
|
6423
6437
|
],
|
|
@@ -6425,7 +6439,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
6425
6439
|
dedupe: [...config.renderer.dedupe || []]
|
|
6426
6440
|
}
|
|
6427
6441
|
};
|
|
6428
|
-
await viteBuild(
|
|
6442
|
+
await viteBuild(_chunkDHR2WDSLcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
6429
6443
|
} finally {
|
|
6430
6444
|
if (postcssConfigDir) {
|
|
6431
6445
|
try {
|
|
@@ -6863,10 +6877,10 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
6863
6877
|
}
|
|
6864
6878
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
6865
6879
|
}
|
|
6866
|
-
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = []) {
|
|
6880
|
+
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
|
|
6867
6881
|
const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
|
|
6868
6882
|
const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _148 => _148.experimental, 'optionalAccess', _149 => _149.serverComponents])) === "islands";
|
|
6869
|
-
const farmClientBoot =
|
|
6883
|
+
const farmClientBoot = _chunkDHR2WDSLcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
6870
6884
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
6871
6885
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
6872
6886
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
@@ -6945,7 +6959,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6945
6959
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
6946
6960
|
);
|
|
6947
6961
|
}
|
|
6948
|
-
const providerServerModules =
|
|
6962
|
+
const providerServerModules = _chunkDHR2WDSLcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
6949
6963
|
renderedIntegrationProviders,
|
|
6950
6964
|
config.root,
|
|
6951
6965
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -6965,14 +6979,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6965
6979
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
6966
6980
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
6967
6981
|
);
|
|
6968
|
-
const isolatedHydrationMode =
|
|
6982
|
+
const isolatedHydrationMode = _chunkVO65MYJDcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
6969
6983
|
_optionalChain([config, 'access', _174 => _174.experimental, 'optionalAccess', _175 => _175.isolatedClientHydration]),
|
|
6970
6984
|
{
|
|
6971
6985
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _176 => _176.experimental, 'optionalAccess', _177 => _177.serverComponents])) === "rsc",
|
|
6972
6986
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
6973
6987
|
}
|
|
6974
6988
|
);
|
|
6975
|
-
const hydrationPlanOptions =
|
|
6989
|
+
const hydrationPlanOptions = _chunkVO65MYJDcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
6976
6990
|
config.renderer,
|
|
6977
6991
|
Boolean(unsupportedIntegrationProvider)
|
|
6978
6992
|
);
|
|
@@ -6990,7 +7004,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6990
7004
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
6991
7005
|
)
|
|
6992
7006
|
}));
|
|
6993
|
-
const markdownPagePlan =
|
|
7007
|
+
const markdownPagePlan = _chunkVO65MYJDcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
6994
7008
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
6995
7009
|
config.root,
|
|
6996
7010
|
isolatedHydrationMode,
|
|
@@ -7008,7 +7022,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7008
7022
|
)
|
|
7009
7023
|
])
|
|
7010
7024
|
);
|
|
7011
|
-
|
|
7025
|
+
_chunkVO65MYJDcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
7012
7026
|
layoutHydrationPlans.map((layout) => ({
|
|
7013
7027
|
pattern: layout.pattern,
|
|
7014
7028
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -7083,8 +7097,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7083
7097
|
module: ${varName},
|
|
7084
7098
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
7085
7099
|
clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
7086
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
7087
|
-
const rootStrategy =
|
|
7100
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkVO65MYJDcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
7101
|
+
const rootStrategy = _chunkDHR2WDSLcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
7088
7102
|
route,
|
|
7089
7103
|
clientMetadata,
|
|
7090
7104
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -7147,7 +7161,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
7147
7161
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
7148
7162
|
interception: ${JSON.stringify(slot.interception)},
|
|
7149
7163
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
7150
|
-
hydrates: ${!farmIslandsMode ||
|
|
7164
|
+
hydrates: ${!farmIslandsMode || _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
7151
7165
|
module: ${varName},
|
|
7152
7166
|
}`);
|
|
7153
7167
|
});
|
|
@@ -7446,10 +7460,10 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
7446
7460
|
);
|
|
7447
7461
|
const nativeServerFns = (config.plugins || []).some(
|
|
7448
7462
|
(plugin) => _optionalChain([plugin, 'optionalAccess', _198 => _198.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
7449
|
-
) ?
|
|
7463
|
+
) ? _chunkL5OZN6YWcjs.collectFarmNativeServerFns.call(void 0, {
|
|
7450
7464
|
root: config.root,
|
|
7451
7465
|
srcDir: config.srcDir,
|
|
7452
|
-
entries:
|
|
7466
|
+
entries: _chunkL5OZN6YWcjs.findFarmNativeScreenFiles.call(void 0, _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, config))
|
|
7453
7467
|
}) : void 0;
|
|
7454
7468
|
const integrationImports = `
|
|
7455
7469
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -7464,7 +7478,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
7464
7478
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
7465
7479
|
});` : ""}
|
|
7466
7480
|
`;
|
|
7467
|
-
const imageRuntime =
|
|
7481
|
+
const imageRuntime = _chunkDHR2WDSLcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
7468
7482
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
7469
7483
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
7470
7484
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -7646,7 +7660,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
7646
7660
|
|
|
7647
7661
|
function FarmDefault404Page() {
|
|
7648
7662
|
return React.createElement(React.Fragment, null,
|
|
7649
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
7663
|
+
React.createElement("style", null, ${JSON.stringify(_chunkDHR2WDSLcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
7650
7664
|
React.createElement("main", {
|
|
7651
7665
|
className: "farm-default-not-found",
|
|
7652
7666
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -7796,7 +7810,7 @@ ${_optionalChain([config, 'access', _206 => _206.agent, 'optionalAccess', _207 =
|
|
|
7796
7810
|
// to the build.
|
|
7797
7811
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
7798
7812
|
globalThis.process?.env,
|
|
7799
|
-
${JSON.stringify(
|
|
7813
|
+
${JSON.stringify(_chunkGUMKIQJLcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
7800
7814
|
);` : ""}
|
|
7801
7815
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
7802
7816
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -7927,7 +7941,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _215 => _215.docs, '
|
|
|
7927
7941
|
registerMCPServer: registerFarmMCPServer,
|
|
7928
7942
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
7929
7943
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
7930
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
7944
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunk4JRAMCUPcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
7931
7945
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
7932
7946
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
7933
7947
|
isPathGuarded: (pathname) =>
|
|
@@ -7981,12 +7995,12 @@ const farmLocalAPIBasePath = ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPISe
|
|
|
7981
7995
|
// runtime request.
|
|
7982
7996
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
7983
7997
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
7984
|
-
${_optionalChain([config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(
|
|
7998
|
+
${_optionalChain([config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkGQ6QOH7Tcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
7985
7999
|
` : ""}${_optionalChain([config, 'access', _221 => _221.agent, 'optionalAccess', _222 => _222.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
7986
|
-
|
|
8000
|
+
_chunkGQ6QOH7Tcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
7987
8001
|
build: config.deploymentId,
|
|
7988
|
-
packages:
|
|
7989
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
8002
|
+
packages: _chunkDHR2WDSLcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
8003
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkDHR2WDSLcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
7990
8004
|
})
|
|
7991
8005
|
)};
|
|
7992
8006
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -9236,7 +9250,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
9236
9250
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
9237
9251
|
// registered at runtime, such as the docs engine's.
|
|
9238
9252
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
9239
|
-
_chunkX3MHKLCOcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
9253
|
+
_chunkX3MHKLCOcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunk22LGTSBAcjs.FARM_VERSION)
|
|
9240
9254
|
)};
|
|
9241
9255
|
let farmDefaultMCPRouteFree;
|
|
9242
9256
|
function getFarmDefaultMCPServer() {
|
|
@@ -9422,7 +9436,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
9422
9436
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
9423
9437
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
9424
9438
|
const farmPrerendering =
|
|
9425
|
-
typeof process !== "undefined" && process.env?.${
|
|
9439
|
+
typeof process !== "undefined" && process.env?.${_chunkTKYOJ5G2cjs.FARM_PRERENDER_ENV} === "1";
|
|
9426
9440
|
` : ""}
|
|
9427
9441
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
9428
9442
|
config: farmMiddlewareConfig,
|
|
@@ -9678,7 +9692,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
9678
9692
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
9679
9693
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
9680
9694
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
9681
|
-
|
|
9695
|
+
_chunkGQ6QOH7Tcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
9682
9696
|
agent: {
|
|
9683
9697
|
...config.agent,
|
|
9684
9698
|
aiCatalog: servesAiCatalog,
|
|
@@ -9691,7 +9705,8 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
9691
9705
|
)});
|
|
9692
9706
|
${_optionalChain([config, 'access', _227 => _227.docs, 'optionalAccess', _228 => _228.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
9693
9707
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
9694
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _229 => _229.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _230 => _230.docs, 'access', _231 => _231.roots, 'optionalAccess', _232 => _232.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}
|
|
9708
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _229 => _229.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _230 => _230.docs, 'access', _231 => _231.roots, 'optionalAccess', _232 => _232.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
9709
|
+
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
9695
9710
|
};
|
|
9696
9711
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
9697
9712
|
const farmRouteLabelSlot = Symbol("farm.route.label.slot");
|
|
@@ -10437,7 +10452,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10437
10452
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
10438
10453
|
// public manifest, the same document for every request.
|
|
10439
10454
|
if (
|
|
10440
|
-
[${JSON.stringify(
|
|
10455
|
+
[${JSON.stringify(_chunkGQ6QOH7Tcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkGQ6QOH7Tcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
10441
10456
|
normalizeRuntimePath(routePathname),
|
|
10442
10457
|
)
|
|
10443
10458
|
) {
|
|
@@ -10449,7 +10464,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10449
10464
|
` : ""}
|
|
10450
10465
|
${_optionalChain([config, 'access', _251 => _251.agent, 'optionalAccess', _252 => _252.apiCatalog]) ? `
|
|
10451
10466
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
10452
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
10467
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkGQ6QOH7Tcjs.FARM_API_CATALOG_PATH)}) {
|
|
10453
10468
|
return applyProductionMiddlewareHeaders(
|
|
10454
10469
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
10455
10470
|
middlewareHeaders,
|
|
@@ -12099,7 +12114,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
12099
12114
|
}
|
|
12100
12115
|
if (_chunkUPOYKX4Scjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
12101
12116
|
if (_chunkUPOYKX4Scjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
12102
|
-
if (
|
|
12117
|
+
if (_chunk6GQJVY4Ecjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
12103
12118
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
12104
12119
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
12105
12120
|
if (_optionalChain([manifestEntry, 'optionalAccess', _269 => _269.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
@@ -12123,7 +12138,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12123
12138
|
);
|
|
12124
12139
|
return [];
|
|
12125
12140
|
}
|
|
12126
|
-
if (!
|
|
12141
|
+
if (!_chunk4JRAMCUPcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
12127
12142
|
const { pages: pages2, originDependent } = _chunkFVYBEMODcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
|
|
12128
12143
|
root,
|
|
12129
12144
|
srcDir: config.srcDir
|
|
@@ -12141,7 +12156,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12141
12156
|
);
|
|
12142
12157
|
return [];
|
|
12143
12158
|
}
|
|
12144
|
-
const pages = await
|
|
12159
|
+
const pages = await _chunk4JRAMCUPcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
12145
12160
|
if (!pages) {
|
|
12146
12161
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
12147
12162
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
@@ -12150,11 +12165,28 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
12150
12165
|
}
|
|
12151
12166
|
return pages;
|
|
12152
12167
|
}
|
|
12168
|
+
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
12169
|
+
if (!_optionalChain([config, 'access', _274 => _274.docs, 'optionalAccess', _275 => _275.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
12170
|
+
return [];
|
|
12171
|
+
}
|
|
12172
|
+
try {
|
|
12173
|
+
return await _chunk4JRAMCUPcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
12174
|
+
root,
|
|
12175
|
+
srcDir: config.srcDir,
|
|
12176
|
+
adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunk4JRAMCUPcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
12177
|
+
});
|
|
12178
|
+
} catch (error) {
|
|
12179
|
+
_chunkQMNWKQL4cjs.logger.warn(
|
|
12180
|
+
`Farm Infra analytics reports docs pages by the docs route, not each page's path: listing them failed (${error instanceof Error ? error.message : String(error)}).`
|
|
12181
|
+
);
|
|
12182
|
+
return [];
|
|
12183
|
+
}
|
|
12184
|
+
}
|
|
12153
12185
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
12154
12186
|
return Object.values(routeRules || {}).some((rule) => {
|
|
12155
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
12156
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
12157
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
12187
|
+
const swr = _optionalChain([rule, 'optionalAccess', _276 => _276.swr]);
|
|
12188
|
+
const cache = _optionalChain([rule, 'optionalAccess', _277 => _277.cache]);
|
|
12189
|
+
const headers = _optionalChain([rule, 'optionalAccess', _278 => _278.headers]);
|
|
12158
12190
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
12159
12191
|
});
|
|
12160
12192
|
}
|
|
@@ -12167,10 +12199,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12167
12199
|
const nitroBuilder = nitroBuilderResult.value;
|
|
12168
12200
|
const isVercel = preset === "vercel";
|
|
12169
12201
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
12170
|
-
const outputDir =
|
|
12202
|
+
const outputDir = _chunk6GQJVY4Ecjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12171
12203
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
12172
12204
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
12173
|
-
const imageRuntime =
|
|
12205
|
+
const imageRuntime = _chunkDHR2WDSLcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
12174
12206
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
12175
12207
|
(image) => image.sourceType === "module"
|
|
12176
12208
|
);
|
|
@@ -12304,7 +12336,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
12304
12336
|
webEntry: clientJsSrc,
|
|
12305
12337
|
webBoot: clientBootSrc,
|
|
12306
12338
|
stylesheet: clientCssHref,
|
|
12307
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
12339
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _279 => _279.files]), () => ( []))
|
|
12308
12340
|
})
|
|
12309
12341
|
) : null;
|
|
12310
12342
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -12471,12 +12503,19 @@ function resolveTrustedLocalOrigin(event, request) {
|
|
|
12471
12503
|
: requestURL.hostname
|
|
12472
12504
|
const isLoopback = (value) =>
|
|
12473
12505
|
value === 'localhost' || value === '::1' || /^127(?:[.][0-9]{1,3}){3}$/.test(value)
|
|
12474
|
-
|
|
12506
|
+
if (
|
|
12507
|
+
requestURL.protocol === protocol &&
|
|
12475
12508
|
requestPort === port &&
|
|
12476
12509
|
isLoopback(address) &&
|
|
12477
12510
|
isLoopback(normalizedRequestHostname)
|
|
12478
|
-
|
|
12479
|
-
|
|
12511
|
+
) {
|
|
12512
|
+
return requestURL.origin
|
|
12513
|
+
}
|
|
12514
|
+
// Any other Host is the client's to choose, so it must not decide where a local image is
|
|
12515
|
+
// fetched from: the optimizer reads local sources from this server's own socket address, as the
|
|
12516
|
+
// development server does. A TLS socket's certificate names the public host, not this address,
|
|
12517
|
+
// so there the request origin still stands in.
|
|
12518
|
+
return socket.encrypted ? undefined : origin
|
|
12480
12519
|
}
|
|
12481
12520
|
|
|
12482
12521
|
// Export the event handler for Nitro
|
|
@@ -12757,23 +12796,23 @@ function toFarmNodeResponse(request, response) {
|
|
|
12757
12796
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
12758
12797
|
);
|
|
12759
12798
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
12760
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
12761
|
-
_optionalChain([nitroConfig, 'access',
|
|
12762
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
12799
|
+
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _280 => _280.rollupConfig, 'optionalAccess', _281 => _281.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _282 => _282.rollupConfig, 'optionalAccess', _283 => _283.plugins])) && customRollupKeys.length === 0 && Boolean(
|
|
12800
|
+
_optionalChain([nitroConfig, 'access', _284 => _284.handlers, 'optionalAccess', _285 => _285.some, 'call', _286 => _286(
|
|
12801
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _287 => _287.handler]) || "") === nitroEntryPath
|
|
12763
12802
|
)])
|
|
12764
12803
|
);
|
|
12765
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access',
|
|
12804
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _288 => _288.output, 'optionalAccess', _289 => _289.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
|
|
12766
12805
|
const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
12767
12806
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
12768
12807
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
12769
12808
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
12770
12809
|
const shouldMinify = nitroConfig.minify !== false;
|
|
12771
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
12810
|
+
const keepServerNames = !(_optionalChain([config, 'access', _290 => _290.docs, 'optionalAccess', _291 => _291.enabled]) && _optionalChain([config, 'access', _292 => _292.docs, 'access', _293 => _293.adapter, 'optionalAccess', _294 => _294.server]));
|
|
12772
12811
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
12773
12812
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
12774
12813
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
12775
12814
|
if (ssrRollupPlugin) {
|
|
12776
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
12815
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _295 => _295.rollupConfig, 'optionalAccess', _296 => _296.plugins]);
|
|
12777
12816
|
nitroConfig.rollupConfig = {
|
|
12778
12817
|
...nitroConfig.rollupConfig,
|
|
12779
12818
|
plugins: [
|
|
@@ -12800,9 +12839,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
12800
12839
|
const orderOf = (route) => _nullishCoalesce(prerenderOrder.get(route), () => ( Number.MAX_SAFE_INTEGER));
|
|
12801
12840
|
prerenderedRoutes.sort((a, b) => orderOf(a.route) - orderOf(b.route));
|
|
12802
12841
|
});
|
|
12803
|
-
if (_optionalChain([config, 'access',
|
|
12842
|
+
if (_optionalChain([config, 'access', _297 => _297.md, 'optionalAccess', _298 => _298.enabled])) {
|
|
12804
12843
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
12805
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
12844
|
+
if (!route.contents || !_optionalChain([route, 'access', _299 => _299.contentType, 'optionalAccess', _300 => _300.toLowerCase, 'call', _301 => _301(), 'access', _302 => _302.includes, 'call', _303 => _303("html")])) return;
|
|
12806
12845
|
const alternatePath = _chunkFT6KJHS3cjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
|
|
12807
12846
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
12808
12847
|
});
|
|
@@ -12825,7 +12864,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12825
12864
|
}
|
|
12826
12865
|
if (config.security.csp && config.security.csp.nonce) {
|
|
12827
12866
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
12828
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
12867
|
+
if (!route.contents || !_optionalChain([route, 'access', _304 => _304.contentType, 'optionalAccess', _305 => _305.toLowerCase, 'call', _306 => _306(), 'access', _307 => _307.includes, 'call', _308 => _308("html")])) return;
|
|
12829
12868
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
12830
12869
|
if (!staticCsp) return;
|
|
12831
12870
|
route.contents = staticCsp.html;
|
|
@@ -12860,7 +12899,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
12860
12899
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
12861
12900
|
if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
|
|
12862
12901
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
12863
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
12902
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _309 => _309.rollupConfig, 'optionalAccess', _310 => _310.plugins]);
|
|
12864
12903
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
12865
12904
|
prerendererConfig.rollupConfig = {
|
|
12866
12905
|
...prerendererConfig.rollupConfig,
|
|
@@ -12917,13 +12956,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
12917
12956
|
}
|
|
12918
12957
|
if (prerenderRoutes.length > 0) {
|
|
12919
12958
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
12920
|
-
const previousPrerender = process.env[
|
|
12921
|
-
process.env[
|
|
12959
|
+
const previousPrerender = process.env[_chunkTKYOJ5G2cjs.FARM_PRERENDER_ENV];
|
|
12960
|
+
process.env[_chunkTKYOJ5G2cjs.FARM_PRERENDER_ENV] = "1";
|
|
12922
12961
|
try {
|
|
12923
12962
|
await nitroBuilder.prerender(nitroInstance);
|
|
12924
12963
|
} finally {
|
|
12925
|
-
if (previousPrerender === void 0) delete process.env[
|
|
12926
|
-
else process.env[
|
|
12964
|
+
if (previousPrerender === void 0) delete process.env[_chunkTKYOJ5G2cjs.FARM_PRERENDER_ENV];
|
|
12965
|
+
else process.env[_chunkTKYOJ5G2cjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
12927
12966
|
}
|
|
12928
12967
|
}
|
|
12929
12968
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
|
|
@@ -13007,7 +13046,8 @@ function toFarmNodeResponse(request, response) {
|
|
|
13007
13046
|
buildDir: _path2.default.join(root, distDir),
|
|
13008
13047
|
middlewareRoutes: edgeMiddlewareRoutes,
|
|
13009
13048
|
guardedPages: edgeGuardedPrerenderRoutes
|
|
13010
|
-
}
|
|
13049
|
+
},
|
|
13050
|
+
prerenderRoutes.map(toPrerenderPublicPath)
|
|
13011
13051
|
);
|
|
13012
13052
|
}
|
|
13013
13053
|
_chunkQMNWKQL4cjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
|
|
@@ -13098,7 +13138,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
13098
13138
|
await fs4.rename(src, dest);
|
|
13099
13139
|
return;
|
|
13100
13140
|
} catch (error) {
|
|
13101
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
13141
|
+
const code = _optionalChain([error, 'optionalAccess', _311 => _311.code]);
|
|
13102
13142
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
13103
13143
|
throw error;
|
|
13104
13144
|
}
|
|
@@ -13106,7 +13146,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
13106
13146
|
await fs4.cp(src, dest, { recursive: true, force: true });
|
|
13107
13147
|
await fs4.rm(src, { recursive: true, force: true });
|
|
13108
13148
|
}
|
|
13109
|
-
async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware) {
|
|
13149
|
+
async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest, cronJobs, edgeMiddleware, prerenderedPages) {
|
|
13110
13150
|
const serverDir = _path2.default.join(outputDir, "server");
|
|
13111
13151
|
const functionsDir = _path2.default.join(outputDir, "functions");
|
|
13112
13152
|
const nitroFuncDir = _path2.default.join(functionsDir, "__nitro.func");
|
|
@@ -13124,7 +13164,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13124
13164
|
try {
|
|
13125
13165
|
await moveVercelOutputPath(publicDir, staticDir, fs4);
|
|
13126
13166
|
} catch (error) {
|
|
13127
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
13167
|
+
if (_optionalChain([error, 'optionalAccess', _312 => _312.code]) !== "ENOENT") throw error;
|
|
13128
13168
|
}
|
|
13129
13169
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
|
|
13130
13170
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
|
|
@@ -13154,7 +13194,8 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13154
13194
|
vercelConfig.routes = buildFarmVercelRoutes({
|
|
13155
13195
|
presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
|
|
13156
13196
|
runtimeRoutes,
|
|
13157
|
-
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : []
|
|
13197
|
+
middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? [createFarmVercelEdgeMiddlewareRoute(edgeMiddleware.guardedPages, config.basePath)] : [],
|
|
13198
|
+
canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
|
|
13158
13199
|
});
|
|
13159
13200
|
const vercelConfigWithWorkflowCrons = _chunkFSODPZRTcjs.applyFarmWorkflowVercelCrons.call(void 0,
|
|
13160
13201
|
vercelConfig,
|
|
@@ -13165,7 +13206,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
13165
13206
|
_chunkQMNWKQL4cjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
13166
13207
|
}
|
|
13167
13208
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
13168
|
-
if (!_optionalChain([config, 'access',
|
|
13209
|
+
if (!_optionalChain([config, 'access', _313 => _313.docs, 'optionalAccess', _314 => _314.enabled])) return;
|
|
13169
13210
|
const [mainRoot, ...extraRoots] = _chunkFVYBEMODcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
13170
13211
|
await copyFarmDocsRootContent(
|
|
13171
13212
|
mainRoot,
|
|
@@ -13190,7 +13231,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
13190
13231
|
const lastModifiedManifest = _chunkFVYBEMODcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
13191
13232
|
fallback: "now"
|
|
13192
13233
|
});
|
|
13193
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
13234
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _315 => _315.unknown, 'optionalAccess', _316 => _316.length]), () => ( 0));
|
|
13194
13235
|
if (undatedPages > 0) {
|
|
13195
13236
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
13196
13237
|
`${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
|
|
@@ -13274,7 +13315,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
13274
13315
|
try {
|
|
13275
13316
|
await copyPackage("sharp", sharpRequire);
|
|
13276
13317
|
if (!copiedPackages.has("sharp")) {
|
|
13277
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
13318
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkDHR2WDSLcjs.SHARP_INSTALL_HINT}`);
|
|
13278
13319
|
}
|
|
13279
13320
|
} catch (error) {
|
|
13280
13321
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -13504,7 +13545,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
13504
13545
|
// src/build/index.ts
|
|
13505
13546
|
async function build(config, options = {}) {
|
|
13506
13547
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
13507
|
-
() =>
|
|
13548
|
+
() => _chunkVO65MYJDcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
13508
13549
|
);
|
|
13509
13550
|
}
|
|
13510
13551
|
function createBuildTargetBaseline(config) {
|
|
@@ -13515,7 +13556,7 @@ function createBuildTargetBaseline(config) {
|
|
|
13515
13556
|
preset,
|
|
13516
13557
|
distDir,
|
|
13517
13558
|
outputDir,
|
|
13518
|
-
outputWasDerived: outputDir ===
|
|
13559
|
+
outputWasDerived: outputDir === _chunk6GQJVY4Ecjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
13519
13560
|
};
|
|
13520
13561
|
}
|
|
13521
13562
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -13524,8 +13565,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
13524
13565
|
const distDir = config.distDir || ".farm";
|
|
13525
13566
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
13526
13567
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
13527
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
13528
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
13568
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunk6GQJVY4Ecjs.getDeployTargetForPreset.call(void 0, preset);
|
|
13569
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunk6GQJVY4Ecjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
13529
13570
|
return {
|
|
13530
13571
|
root,
|
|
13531
13572
|
preset,
|
|
@@ -13533,7 +13574,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
13533
13574
|
distDir,
|
|
13534
13575
|
deployTarget,
|
|
13535
13576
|
outputDir,
|
|
13536
|
-
deployOutputDir:
|
|
13577
|
+
deployOutputDir: _chunk6GQJVY4Ecjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
13537
13578
|
};
|
|
13538
13579
|
}
|
|
13539
13580
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -13541,7 +13582,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13541
13582
|
const targetBaseline = createBuildTargetBaseline(config);
|
|
13542
13583
|
let targets;
|
|
13543
13584
|
const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))]);
|
|
13544
|
-
const pluginManager = new (0,
|
|
13585
|
+
const pluginManager = new (0, _chunkJFPKARWMcjs.PluginManager)({
|
|
13545
13586
|
config,
|
|
13546
13587
|
isDev: false,
|
|
13547
13588
|
isProd: true
|
|
@@ -13570,15 +13611,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13570
13611
|
};
|
|
13571
13612
|
config = {
|
|
13572
13613
|
...config,
|
|
13573
|
-
images:
|
|
13614
|
+
images: _chunkDHR2WDSLcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
13574
13615
|
root: targets.root,
|
|
13575
13616
|
preset: targets.preset
|
|
13576
13617
|
})
|
|
13577
13618
|
};
|
|
13578
|
-
if (_optionalChain([config, 'access',
|
|
13619
|
+
if (_optionalChain([config, 'access', _317 => _317.docs, 'optionalAccess', _318 => _318.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
|
|
13579
13620
|
pluginManager.updateContext({ config });
|
|
13580
13621
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
13581
|
-
|
|
13622
|
+
_chunkVO65MYJDcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkVO65MYJDcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
13582
13623
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
13583
13624
|
await pluginManager.setupPlugins();
|
|
13584
13625
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -13590,8 +13631,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13590
13631
|
});
|
|
13591
13632
|
_chunkQMNWKQL4cjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
13592
13633
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
13593
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
13594
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
13634
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _319 => _319.status]) === "rejected") throw productionViteResult.reason;
|
|
13635
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _320 => _320.value]);
|
|
13595
13636
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
13596
13637
|
projectModuleServer = await createProjectModuleServer(
|
|
13597
13638
|
createViteServer,
|
|
@@ -13599,7 +13640,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13599
13640
|
root,
|
|
13600
13641
|
rendererBuild.signal
|
|
13601
13642
|
);
|
|
13602
|
-
const farmApp =
|
|
13643
|
+
const farmApp = _chunkDHR2WDSLcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
13603
13644
|
await farmApp.initialize();
|
|
13604
13645
|
const routeManager = farmApp.getRouteManager();
|
|
13605
13646
|
const serverRenderer = farmApp.getServerRenderer();
|
|
@@ -13609,7 +13650,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13609
13650
|
layers: config.layers,
|
|
13610
13651
|
plugins: config.plugins,
|
|
13611
13652
|
extraRoutes: [
|
|
13612
|
-
..._optionalChain([config, 'access',
|
|
13653
|
+
..._optionalChain([config, 'access', _321 => _321.openapi, 'optionalAccess', _322 => _322.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
13613
13654
|
..._chunkFVYBEMODcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
13614
13655
|
],
|
|
13615
13656
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
@@ -13694,7 +13735,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
13694
13735
|
throw error;
|
|
13695
13736
|
} finally {
|
|
13696
13737
|
try {
|
|
13697
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
13738
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _323 => _323.close, 'call', _324 => _324()]);
|
|
13698
13739
|
} finally {
|
|
13699
13740
|
rendererBuild.abort();
|
|
13700
13741
|
}
|
|
@@ -13706,7 +13747,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13706
13747
|
ssr: true,
|
|
13707
13748
|
buildLifetime
|
|
13708
13749
|
});
|
|
13709
|
-
const viteConfig =
|
|
13750
|
+
const viteConfig = _chunkDHR2WDSLcjs.mergeFarmViteConfig.call(void 0,
|
|
13710
13751
|
{
|
|
13711
13752
|
root,
|
|
13712
13753
|
appType: "custom",
|
|
@@ -13718,12 +13759,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13718
13759
|
},
|
|
13719
13760
|
plugins: [
|
|
13720
13761
|
...rendererVitePlugins,
|
|
13721
|
-
|
|
13762
|
+
_chunkDHR2WDSLcjs.farmFontImportsPlugin.call(void 0, {
|
|
13722
13763
|
root,
|
|
13723
13764
|
basePath: config.basePath,
|
|
13724
13765
|
publicDir: config.publicDir
|
|
13725
13766
|
}),
|
|
13726
|
-
|
|
13767
|
+
_chunkVO65MYJDcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
|
|
13727
13768
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
13728
13769
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
13729
13770
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -13735,7 +13776,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13735
13776
|
hmr: false
|
|
13736
13777
|
},
|
|
13737
13778
|
resolve: {
|
|
13738
|
-
alias:
|
|
13779
|
+
alias: _chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
13739
13780
|
dedupe: [...config.renderer.dedupe || []]
|
|
13740
13781
|
},
|
|
13741
13782
|
optimizeDeps: {
|
|
@@ -13774,10 +13815,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13774
13815
|
noDiscovery: true
|
|
13775
13816
|
},
|
|
13776
13817
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
13777
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
13818
|
+
environments: _optionalChain([viteConfig, 'access', _325 => _325.environments, 'optionalAccess', _326 => _326.ssr, 'optionalAccess', _327 => _327.dev, 'optionalAccess', _328 => _328.createEnvironment]) ? viteConfig.environments : {
|
|
13778
13819
|
...viteConfig.environments,
|
|
13779
13820
|
ssr: {
|
|
13780
|
-
..._optionalChain([viteConfig, 'access',
|
|
13821
|
+
..._optionalChain([viteConfig, 'access', _329 => _329.environments, 'optionalAccess', _330 => _330.ssr]),
|
|
13781
13822
|
...await createFarmProjectModuleSsrEnvironment()
|
|
13782
13823
|
}
|
|
13783
13824
|
}
|
|
@@ -13785,7 +13826,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
13785
13826
|
}
|
|
13786
13827
|
async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
13787
13828
|
const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
13788
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
13829
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
13789
13830
|
const pluginManager = new PluginManager2({
|
|
13790
13831
|
config,
|
|
13791
13832
|
isDev: false,
|
|
@@ -13805,14 +13846,14 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
13805
13846
|
farmI18nClientBridgePlugin(),
|
|
13806
13847
|
farmServerOnlyEntriesPlugin(),
|
|
13807
13848
|
farmPlugin(config, pluginManager),
|
|
13808
|
-
|
|
13849
|
+
_chunkVO65MYJDcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
13809
13850
|
],
|
|
13810
13851
|
mode: "production"
|
|
13811
13852
|
});
|
|
13812
13853
|
}
|
|
13813
13854
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
13814
13855
|
const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
|
|
13815
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
13856
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-F2O4BFTK.cjs");
|
|
13816
13857
|
const pluginManager = new PluginManager2({
|
|
13817
13858
|
config,
|
|
13818
13859
|
isDev: false,
|
|
@@ -13833,12 +13874,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
13833
13874
|
define: {
|
|
13834
13875
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
13835
13876
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
13836
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
13877
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _331 => _331.env, 'optionalAccess', _332 => _332.public]) || {})
|
|
13837
13878
|
},
|
|
13838
13879
|
plugins: [
|
|
13839
13880
|
farmI18nClientBridgePlugin(),
|
|
13840
13881
|
farmPlugin(config, pluginManager),
|
|
13841
|
-
|
|
13882
|
+
_chunkVO65MYJDcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
13842
13883
|
],
|
|
13843
13884
|
mode: "production"
|
|
13844
13885
|
});
|
|
@@ -13866,7 +13907,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13866
13907
|
if (pluginManager) {
|
|
13867
13908
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
13868
13909
|
}
|
|
13869
|
-
const outputDir =
|
|
13910
|
+
const outputDir = _chunk6GQJVY4Ecjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
13870
13911
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
13871
13912
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
13872
13913
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -13937,7 +13978,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
13937
13978
|
root,
|
|
13938
13979
|
preset,
|
|
13939
13980
|
distDir,
|
|
13940
|
-
outputDir:
|
|
13981
|
+
outputDir: _chunk6GQJVY4Ecjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
13941
13982
|
});
|
|
13942
13983
|
}
|
|
13943
13984
|
}
|