@farm.js/core 0.1.64 → 0.1.66
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/{analyzer-Q3QXC6PD.mjs → analyzer-4UFP4HVP.mjs} +3 -3
- package/dist/analyzer-H7SIX6BJ.cjs +16 -0
- package/dist/{chunk-XVWSDSUM.mjs → chunk-27FPUFWR.mjs} +60 -5
- package/dist/{chunk-JCEFKP5M.mjs → chunk-423SSBYQ.mjs} +6 -0
- package/dist/{chunk-SLYDIHLW.mjs → chunk-435QJNC2.mjs} +2 -2
- package/dist/{chunk-XZLZ6YPP.cjs → chunk-4OSOLDPL.cjs} +118 -50
- package/dist/{chunk-MG356ROI.cjs → chunk-4TVPYN32.cjs} +3 -3
- package/dist/chunk-672ISQIG.mjs +3704 -0
- package/dist/{chunk-NXFA7G3Y.cjs → chunk-752IHQTD.cjs} +4 -4
- package/dist/chunk-7ONGIFYX.cjs +3704 -0
- package/dist/{chunk-RAH5MT53.mjs → chunk-AZUUKA66.mjs} +153 -42
- package/dist/{chunk-O2XFIPNL.cjs → chunk-BIF5MLTH.cjs} +1 -1
- package/dist/{chunk-FH45OB37.mjs → chunk-BYRZ5VTH.mjs} +1 -1
- package/dist/{chunk-V727H3RI.cjs → chunk-CCAUIBIS.cjs} +6 -0
- package/dist/{chunk-DUSHDZQL.cjs → chunk-CHYTADNK.cjs} +15 -13
- package/dist/chunk-CJNAUEVC.mjs +34 -0
- package/dist/{chunk-S25BQIFW.cjs → chunk-DVKH2RVN.cjs} +2 -2
- package/dist/{chunk-FAP7CX7C.cjs → chunk-E4UDLFWR.cjs} +527 -3019
- package/dist/{chunk-EFZGB7JC.cjs → chunk-E5UN4OWX.cjs} +1 -0
- package/dist/{chunk-WNYRYI4D.mjs → chunk-EMNKZGF4.mjs} +380 -2872
- package/dist/{chunk-VVTJTMGQ.cjs → chunk-GL7N5UHF.cjs} +4 -4
- package/dist/{chunk-UR25Z5Z6.mjs → chunk-HCGWDRZO.mjs} +1 -1
- package/dist/{chunk-EL4364S2.cjs → chunk-HZPKJRYA.cjs} +74 -19
- package/dist/{chunk-3EBHJET2.cjs → chunk-IT6WRNGB.cjs} +380 -269
- package/dist/{chunk-LQDLEWPO.mjs → chunk-MPIGW42F.mjs} +1 -1
- package/dist/{chunk-S7ZW72JH.cjs → chunk-MPJEIHW2.cjs} +2 -2
- package/dist/{chunk-53ZCZ46B.cjs → chunk-NHQM2Q4I.cjs} +2 -1
- package/dist/{chunk-UYRI6U3P.mjs → chunk-O75GQVUK.mjs} +2 -1
- package/dist/{chunk-OYF23QLG.mjs → chunk-OB7VKCUZ.mjs} +38 -33
- package/dist/{chunk-JCPSA4X5.cjs → chunk-OP7LHY4Y.cjs} +128 -123
- package/dist/{chunk-O7IEMY55.cjs → chunk-RY4ABNPE.cjs} +3 -3
- package/dist/{chunk-6NHSGVVA.mjs → chunk-SK7QSNWE.mjs} +1 -1
- package/dist/{chunk-NNLFW3P4.mjs → chunk-TKK5QHKZ.mjs} +1 -1
- package/dist/{chunk-ZNXTU4YH.mjs → chunk-TM2E623I.mjs} +1 -0
- package/dist/{chunk-PAKCHVUS.mjs → chunk-TPA2PV5J.mjs} +3 -35
- package/dist/{chunk-6NNYPY5W.mjs → chunk-UBMHQVWN.mjs} +78 -10
- package/dist/{chunk-BPNOYILC.cjs → chunk-UVV3I5QA.cjs} +3 -35
- package/dist/{chunk-N3Z3PLHC.cjs → chunk-VBCQ5WOI.cjs} +6 -6
- package/dist/{chunk-WFNAOWH4.mjs → chunk-WFWFECDW.mjs} +2 -2
- package/dist/{chunk-SNFTMSHX.mjs → chunk-WVYRLP5E.mjs} +1 -1
- package/dist/{chunk-O4FWNLQK.mjs → chunk-XBSLKXBL.mjs} +10 -8
- package/dist/chunk-ZIHWAN55.cjs +34 -0
- package/dist/{devtools-WET5NAKO.cjs → devtools-N2JQCMXB.cjs} +5 -4
- package/dist/{devtools-MX3FE733.mjs → devtools-NZUVNUP3.mjs} +4 -3
- package/dist/docs.cjs +6 -5
- package/dist/docs.mjs +5 -4
- package/dist/environment/vite.cjs +9 -2
- package/dist/environment/vite.d.mts +3 -0
- package/dist/environment/vite.d.ts +3 -0
- package/dist/environment/vite.mjs +8 -1
- package/dist/index.cjs +22 -21
- package/dist/index.mjs +21 -20
- package/dist/internal/build-runtime.cjs +20 -19
- package/dist/internal/build-runtime.mjs +19 -18
- package/dist/internal/cli-runtime.cjs +6 -5
- package/dist/internal/cli-runtime.mjs +5 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/config-runtime.cjs +6 -5
- package/dist/internal/config-runtime.mjs +5 -4
- 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 +5 -5
- package/dist/internal/native-server-fns.mjs +4 -4
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +7 -7
- package/dist/internal/production-runtime.d.mts +14 -0
- package/dist/internal/production-runtime.d.ts +14 -0
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/{native-tree-WOX3JMBG.cjs → native-tree-7LPH57Z4.cjs} +3 -3
- package/dist/{native-tree-BPEE2LAL.mjs → native-tree-VV6WN3GX.mjs} +2 -2
- package/dist/plugin.cjs +11 -10
- package/dist/plugin.mjs +10 -9
- package/dist/{port-UFUZL6RI.mjs → port-CLL4BC4O.mjs} +1 -1
- package/dist/{port-VTLHPZOI.cjs → port-HASZTQGY.cjs} +9 -9
- package/dist/{rsc-pipeline-3LNVP2OO.mjs → rsc-pipeline-7PNVJSTR.mjs} +6 -5
- package/dist/{rsc-pipeline-G5WELVW3.cjs → rsc-pipeline-Z7QBZOIJ.cjs} +7 -6
- package/dist/{runtime-DMEULPE7.cjs → runtime-FKFCUHSK.cjs} +21 -20
- package/dist/{runtime-HQJ2LLQL.mjs → runtime-QQHX4BP3.mjs} +12 -11
- package/dist/server.cjs +36 -35
- package/dist/server.mjs +19 -18
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +14 -12
- package/dist/vite.mjs +13 -11
- package/package.json +1 -1
- package/dist/analyzer-ODLF2Z6O.cjs +0 -16
- package/dist/chunk-NK2VWS7P.cjs +0 -954
- package/dist/chunk-ZQ5BDNKW.mjs +0 -954
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkE5UN4OWXcjs = require('./chunk-E5UN4OWX.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
|
|
@@ -31,14 +31,14 @@ var _chunk4BS3HSY7cjs = require('./chunk-4BS3HSY7.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkRY4ABNPEcjs = require('./chunk-RY4ABNPE.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunkDVKH2RVNcjs = require('./chunk-DVKH2RVN.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -58,7 +58,7 @@ var _chunkWMTBBQHYcjs = require('./chunk-WMTBBQHY.cjs');
|
|
|
58
58
|
var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
var
|
|
61
|
+
var _chunk4TVPYN32cjs = require('./chunk-4TVPYN32.cjs');
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
@@ -67,7 +67,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _chunkCHYTADNKcjs = require('./chunk-CHYTADNK.cjs');
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
|
|
@@ -100,34 +100,37 @@ var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
|
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
|
|
103
|
+
var _chunkE4UDLFWRcjs = require('./chunk-E4UDLFWR.cjs');
|
|
103
104
|
|
|
104
105
|
|
|
106
|
+
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
105
107
|
|
|
106
108
|
|
|
109
|
+
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
107
110
|
|
|
108
111
|
|
|
109
112
|
|
|
110
113
|
|
|
114
|
+
var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
111
115
|
|
|
112
116
|
|
|
113
117
|
|
|
114
|
-
var _chunkFAP7CX7Ccjs = require('./chunk-FAP7CX7C.cjs');
|
|
115
118
|
|
|
116
119
|
|
|
117
|
-
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
118
120
|
|
|
119
121
|
|
|
120
|
-
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
|
|
124
125
|
|
|
125
|
-
var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
126
126
|
|
|
127
|
+
var _chunkUJ3R2AH2cjs = require('./chunk-UJ3R2AH2.cjs');
|
|
127
128
|
|
|
128
129
|
|
|
130
|
+
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
129
131
|
|
|
130
132
|
|
|
133
|
+
var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
131
134
|
|
|
132
135
|
|
|
133
136
|
|
|
@@ -135,35 +138,32 @@ var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
|
135
138
|
|
|
136
139
|
|
|
137
140
|
|
|
138
|
-
var
|
|
141
|
+
var _chunk752IHQTDcjs = require('./chunk-752IHQTD.cjs');
|
|
139
142
|
|
|
140
143
|
|
|
141
|
-
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
142
144
|
|
|
143
145
|
|
|
144
|
-
var
|
|
146
|
+
var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
145
147
|
|
|
146
148
|
|
|
149
|
+
var _chunkMPJEIHW2cjs = require('./chunk-MPJEIHW2.cjs');
|
|
147
150
|
|
|
148
151
|
|
|
152
|
+
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
149
153
|
|
|
150
154
|
|
|
151
155
|
|
|
152
|
-
var _chunkNXFA7G3Ycjs = require('./chunk-NXFA7G3Y.cjs');
|
|
153
156
|
|
|
154
157
|
|
|
155
158
|
|
|
156
159
|
|
|
157
|
-
var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
158
160
|
|
|
159
161
|
|
|
160
|
-
var _chunkS7ZW72JHcjs = require('./chunk-S7ZW72JH.cjs');
|
|
161
162
|
|
|
162
163
|
|
|
163
|
-
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
164
164
|
|
|
165
165
|
|
|
166
|
-
var
|
|
166
|
+
var _chunk7ONGIFYXcjs = require('./chunk-7ONGIFYX.cjs');
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
|
|
@@ -174,26 +174,26 @@ var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
|
|
|
174
174
|
var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
175
175
|
|
|
176
176
|
|
|
177
|
-
var
|
|
177
|
+
var _chunkV56632LAcjs = require('./chunk-V56632LA.cjs');
|
|
178
178
|
|
|
179
179
|
|
|
180
|
-
var _chunkV56632LAcjs = require('./chunk-V56632LA.cjs');
|
|
181
180
|
|
|
181
|
+
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
182
182
|
|
|
183
183
|
|
|
184
|
+
var _chunkZIHWAN55cjs = require('./chunk-ZIHWAN55.cjs');
|
|
184
185
|
|
|
185
186
|
|
|
187
|
+
var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
|
|
186
188
|
|
|
187
189
|
|
|
188
190
|
|
|
189
|
-
var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
|
|
190
191
|
|
|
191
192
|
|
|
192
193
|
|
|
193
|
-
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
194
194
|
|
|
195
195
|
|
|
196
|
-
var
|
|
196
|
+
var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
@@ -264,7 +264,7 @@ var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
|
264
264
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
265
265
|
|
|
266
266
|
|
|
267
|
-
var
|
|
267
|
+
var _chunkBIF5MLTHcjs = require('./chunk-BIF5MLTH.cjs');
|
|
268
268
|
|
|
269
269
|
|
|
270
270
|
var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
|
|
@@ -416,7 +416,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
416
416
|
globalStylesheetHref: options.globalStylesheetHref,
|
|
417
417
|
isPathGuarded: options.isPathGuarded
|
|
418
418
|
});
|
|
419
|
-
const apiHandler =
|
|
419
|
+
const apiHandler = _chunkDVKH2RVNcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
420
420
|
rootDir: options.root,
|
|
421
421
|
srcDir: options.srcDir,
|
|
422
422
|
docs,
|
|
@@ -1875,7 +1875,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1875
1875
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
1876
1876
|
const srcDir = config.srcDir || "src";
|
|
1877
1877
|
const distDir = config.distDir || ".farm";
|
|
1878
|
-
const deployOutputDir =
|
|
1878
|
+
const deployOutputDir = _chunkCHYTADNKcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
1879
1879
|
const lifecyclePluginManager = options.pluginManager;
|
|
1880
1880
|
const productionViteResultPromise = Promise.allSettled([
|
|
1881
1881
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -2148,7 +2148,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
2150
2150
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
2151
|
-
await fs4.writeFile(clientCssPath,
|
|
2151
|
+
await fs4.writeFile(clientCssPath, _chunkE4UDLFWRcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
2152
2152
|
}
|
|
2153
2153
|
var IncompleteClientBuildOutputError = class extends Error {
|
|
2154
2154
|
constructor(detail) {
|
|
@@ -2194,13 +2194,13 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2194
2194
|
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)}`;
|
|
2195
2195
|
let plan = cache.get(key);
|
|
2196
2196
|
if (!plan) {
|
|
2197
|
-
plan =
|
|
2197
|
+
plan = _chunk7ONGIFYXcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2198
2198
|
cache.set(key, plan);
|
|
2199
2199
|
}
|
|
2200
2200
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
2201
2201
|
}
|
|
2202
2202
|
async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes, mobile = false) {
|
|
2203
|
-
if (!mobile) await
|
|
2203
|
+
if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
|
|
2204
2204
|
const viteBuild = productionVite.build;
|
|
2205
2205
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
2206
2206
|
const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
|
|
@@ -2218,25 +2218,25 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2218
2218
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
2219
2219
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
2220
2220
|
);
|
|
2221
|
-
if (_optionalChain([config, 'access', _57 => _57.experimental, 'optionalAccess', _58 => _58.isolatedClientHydration]) === "enabled" &&
|
|
2221
|
+
if (_optionalChain([config, 'access', _57 => _57.experimental, 'optionalAccess', _58 => _58.isolatedClientHydration]) === "enabled" && _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
2222
2222
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
2223
2223
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2224
2224
|
);
|
|
2225
2225
|
}
|
|
2226
|
-
const isolatedMode =
|
|
2226
|
+
const isolatedMode = _chunk7ONGIFYXcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2227
2227
|
_optionalChain([config, 'access', _61 => _61.experimental, 'optionalAccess', _62 => _62.isolatedClientHydration]),
|
|
2228
2228
|
{
|
|
2229
|
-
serverComponents:
|
|
2229
|
+
serverComponents: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.serverComponents])) === "rsc",
|
|
2230
2230
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2231
2231
|
}
|
|
2232
2232
|
);
|
|
2233
|
-
const planOptions =
|
|
2233
|
+
const planOptions = _chunk7ONGIFYXcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2234
2234
|
config.renderer,
|
|
2235
2235
|
Boolean(unsupportedIntegrationProvider)
|
|
2236
2236
|
);
|
|
2237
2237
|
const pagePlanOptions = {
|
|
2238
2238
|
...planOptions,
|
|
2239
|
-
serverOwners:
|
|
2239
|
+
serverOwners: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _65 => _65.experimental, 'optionalAccess', _66 => _66.serverComponents])) === "islands"
|
|
2240
2240
|
};
|
|
2241
2241
|
const layoutPlanOptions = {
|
|
2242
2242
|
...planOptions,
|
|
@@ -2289,7 +2289,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2289
2289
|
});
|
|
2290
2290
|
const layoutAppliesToRoute = _chunkUJ3R2AH2cjs.routeBoundaryCoversDirectory;
|
|
2291
2291
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2292
|
-
const islandsMode =
|
|
2292
|
+
const islandsMode = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _67 => _67.experimental, 'optionalAccess', _68 => _68.serverComponents])) === "islands";
|
|
2293
2293
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2294
2294
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _69 => _69.docs, 'optionalAccess', _70 => _70.enabled]) && _optionalChain([config, 'access', _71 => _71.docs, 'access', _72 => _72.adapter, 'optionalAccess', _73 => _73.server]) && config.docs.adapter.react
|
|
2295
2295
|
);
|
|
@@ -2302,7 +2302,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2302
2302
|
);
|
|
2303
2303
|
const syntheticDocsEntry = _optionalChain([config, 'access', _76 => _76.docs, 'optionalAccess', _77 => _77.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2304
2304
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2305
|
-
const markdownPagePlan =
|
|
2305
|
+
const markdownPagePlan = _chunk7ONGIFYXcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2306
2306
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2307
2307
|
root,
|
|
2308
2308
|
isolatedMode,
|
|
@@ -2318,7 +2318,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2318
2318
|
pagePlanOptions
|
|
2319
2319
|
)
|
|
2320
2320
|
}));
|
|
2321
|
-
|
|
2321
|
+
_chunk7ONGIFYXcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2322
2322
|
clientLayouts.map((layout) => ({
|
|
2323
2323
|
pattern: layout.pattern,
|
|
2324
2324
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2351,7 +2351,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2351
2351
|
for (const layout of clientLayouts) {
|
|
2352
2352
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
2353
2353
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2354
|
-
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${
|
|
2354
|
+
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F ${_chunk7ONGIFYXcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2355
2355
|
}
|
|
2356
2356
|
}
|
|
2357
2357
|
if (isolatedMode === "analyze") {
|
|
@@ -2375,12 +2375,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2375
2375
|
);
|
|
2376
2376
|
if (metadata.suppressedAsyncHydration) {
|
|
2377
2377
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
2378
|
-
`\u26A0\uFE0F ${
|
|
2378
|
+
`\u26A0\uFE0F ${_chunk7ONGIFYXcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2379
2379
|
);
|
|
2380
2380
|
}
|
|
2381
2381
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
2382
2382
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
2383
|
-
const islandStrategy =
|
|
2383
|
+
const islandStrategy = _chunkE4UDLFWRcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
2384
2384
|
route,
|
|
2385
2385
|
metadata,
|
|
2386
2386
|
clientLayouts,
|
|
@@ -2398,7 +2398,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2398
2398
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
2399
2399
|
],
|
|
2400
2400
|
// The server renders a server tree only below a hydrating layout.
|
|
2401
|
-
...
|
|
2401
|
+
..._chunk7ONGIFYXcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2402
2402
|
});
|
|
2403
2403
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2404
2404
|
}
|
|
@@ -2434,7 +2434,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2434
2434
|
}
|
|
2435
2435
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2436
2436
|
try {
|
|
2437
|
-
return
|
|
2437
|
+
return _chunk7ONGIFYXcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2438
2438
|
} catch (error) {
|
|
2439
2439
|
_chunkQMNWKQL4cjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2440
2440
|
return false;
|
|
@@ -2465,11 +2465,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2465
2465
|
config.trailingSlash,
|
|
2466
2466
|
_chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2467
2467
|
config.basePath,
|
|
2468
|
-
|
|
2468
|
+
_chunkE4UDLFWRcjs.generateClientCachePersistenceCode.call(void 0, _chunkE4UDLFWRcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2469
2469
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2470
|
-
|
|
2470
|
+
_chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _83 => _83.experimental, 'optionalAccess', _84 => _84.serverComponents])) === "islands",
|
|
2471
2471
|
platform,
|
|
2472
|
-
islandsMode ?
|
|
2472
|
+
islandsMode ? _chunk7ONGIFYXcjs.collectFarmServerStylesheets.call(void 0,
|
|
2473
2473
|
[
|
|
2474
2474
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
2475
2475
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -2477,10 +2477,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2477
2477
|
root
|
|
2478
2478
|
) : []
|
|
2479
2479
|
);
|
|
2480
|
-
const entryName = platform === "mobile" ?
|
|
2480
|
+
const entryName = platform === "mobile" ? _chunkE5UN4OWXcjs.FARM_MOBILE_CLIENT_ENTRY_NAME : "farm-client";
|
|
2481
2481
|
await fs4.writeFile(clientEntryPath, clientHydrationCode);
|
|
2482
2482
|
const clientInput = { [entryName]: clientEntryPath };
|
|
2483
|
-
if (platform === "web" &&
|
|
2483
|
+
if (platform === "web" && _chunkE4UDLFWRcjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
2484
2484
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
2485
2485
|
await fs4.writeFile(
|
|
2486
2486
|
clientBootPath,
|
|
@@ -2552,7 +2552,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2552
2552
|
}
|
|
2553
2553
|
},
|
|
2554
2554
|
plugins: [
|
|
2555
|
-
|
|
2555
|
+
_chunkE4UDLFWRcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2556
2556
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2557
2557
|
outDir: _path2.default.join(
|
|
2558
2558
|
_path2.default.dirname(outputDir),
|
|
@@ -2560,7 +2560,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2560
2560
|
)
|
|
2561
2561
|
}),
|
|
2562
2562
|
// The web client's preload manifests; the mobile client records its files instead.
|
|
2563
|
-
platform === "mobile" ?
|
|
2563
|
+
platform === "mobile" ? _chunkE5UN4OWXcjs.createFarmMobileClientManifestPlugin.call(void 0, {
|
|
2564
2564
|
buildDir: _path2.default.dirname(outputDir),
|
|
2565
2565
|
entryName
|
|
2566
2566
|
}) : createFarmClientModulePreloadPlugin({
|
|
@@ -2584,7 +2584,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2584
2584
|
...rendererVitePlugins,
|
|
2585
2585
|
...config.vite.plugins || [],
|
|
2586
2586
|
farmServerOnlyEntriesPlugin({ platform }),
|
|
2587
|
-
|
|
2587
|
+
_chunkE4UDLFWRcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
2588
2588
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2589
2589
|
),
|
|
2590
2590
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -2638,7 +2638,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2638
2638
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
|
|
2639
2639
|
pluginManager
|
|
2640
2640
|
),
|
|
2641
|
-
|
|
2641
|
+
_chunk7ONGIFYXcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
2642
2642
|
],
|
|
2643
2643
|
mode: "production",
|
|
2644
2644
|
css: postcssSearchPath ? {
|
|
@@ -2646,7 +2646,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2646
2646
|
} : void 0,
|
|
2647
2647
|
// Ensure React is bundled for client
|
|
2648
2648
|
resolve: {
|
|
2649
|
-
alias:
|
|
2649
|
+
alias: _chunkE4UDLFWRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2650
2650
|
dedupe: [...config.renderer.dedupe || []]
|
|
2651
2651
|
},
|
|
2652
2652
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2659,12 +2659,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2659
2659
|
]
|
|
2660
2660
|
}
|
|
2661
2661
|
};
|
|
2662
|
-
await viteBuild(
|
|
2662
|
+
await viteBuild(_chunkE4UDLFWRcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2663
2663
|
if (platform === "mobile") {
|
|
2664
2664
|
await fs4.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
2665
|
-
if (!await
|
|
2665
|
+
if (!await _chunkE5UN4OWXcjs.hasFarmMobileClientEntry.call(void 0, _path2.default.dirname(outputDir), outputDir)) {
|
|
2666
2666
|
throw new IncompleteClientBuildOutputError(
|
|
2667
|
-
`${
|
|
2667
|
+
`${_chunkE5UN4OWXcjs.FARM_MOBILE_CLIENT_ENTRY_NAME}.js is missing or empty`
|
|
2668
2668
|
);
|
|
2669
2669
|
}
|
|
2670
2670
|
} else {
|
|
@@ -2758,7 +2758,7 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
2758
2758
|
return response;
|
|
2759
2759
|
}
|
|
2760
2760
|
|
|
2761
|
-
${streamNavigations ?
|
|
2761
|
+
${streamNavigations ? _chunkE4UDLFWRcjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
|
|
2762
2762
|
|
|
2763
2763
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
2764
2764
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -3516,7 +3516,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3516
3516
|
direction: {}
|
|
3517
3517
|
}, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
|
|
3518
3518
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
3519
|
-
const clientPluginEntry =
|
|
3519
|
+
const clientPluginEntry = _chunkE4UDLFWRcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3520
3520
|
plugins,
|
|
3521
3521
|
root,
|
|
3522
3522
|
srcDir,
|
|
@@ -3528,7 +3528,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3528
3528
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3529
3529
|
import __farmAppSetup from ${JSON.stringify(_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3530
3530
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3531
|
-
const providerClientCode =
|
|
3531
|
+
const providerClientCode = _chunkE4UDLFWRcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3532
3532
|
integrationProviders,
|
|
3533
3533
|
root,
|
|
3534
3534
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -4085,7 +4085,7 @@ function hasHydratableLayout(pathname) {
|
|
|
4085
4085
|
});
|
|
4086
4086
|
}
|
|
4087
4087
|
|
|
4088
|
-
${
|
|
4088
|
+
${_chunkE4UDLFWRcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
4089
4089
|
// Wrap a page element with applicable layouts
|
|
4090
4090
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
4091
4091
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4120,7 +4120,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
4120
4120
|
return React.createElement("div", props, pageElement);
|
|
4121
4121
|
}
|
|
4122
4122
|
let farmLastRouteState = null;
|
|
4123
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
4123
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkE4UDLFWRcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4124
4124
|
function farmTreeLayoutsOf(pathname) {
|
|
4125
4125
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
4126
4126
|
return layout.serverTree === true;
|
|
@@ -5350,7 +5350,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5350
5350
|
}
|
|
5351
5351
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
5352
5352
|
const instrumentationPath = _chunkBRWIVOV4cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
5353
|
-
const notFoundPath =
|
|
5353
|
+
const notFoundPath = _chunkE4UDLFWRcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
5354
5354
|
if (notFoundPath) _chunkQMNWKQL4cjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
5355
5355
|
layoutRoutes.sort((a, b) => {
|
|
5356
5356
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -5373,7 +5373,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5373
5373
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
5374
5374
|
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _91 => _91.mdx, 'optionalAccess', _92 => _92.components]));
|
|
5375
5375
|
const hasMiddlewareConfig = _chunkUJ3R2AH2cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5376
|
-
const hasRouteContextConfig =
|
|
5376
|
+
const hasRouteContextConfig = _chunkCHYTADNKcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
5377
5377
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
5378
5378
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
5379
5379
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -5383,9 +5383,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5383
5383
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
5384
5384
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
5385
5385
|
);
|
|
5386
|
-
if (
|
|
5386
|
+
if (_chunkDVKH2RVNcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
5387
5387
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
5388
|
-
|
|
5388
|
+
_chunkDVKH2RVNcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
5389
5389
|
config.docs,
|
|
5390
5390
|
{ root, srcDir: config.srcDir },
|
|
5391
5391
|
(pathname) => adapterGuardedPaths.has(pathname)
|
|
@@ -5394,7 +5394,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5394
5394
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
5395
5395
|
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _93 => _93.docs, 'optionalAccess', _94 => _94.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
|
|
5396
5396
|
farmDocsCspNonceMarker,
|
|
5397
|
-
async () => _optionalChain([config, 'access', _95 => _95.docs, 'access', _96 => _96.adapter, 'optionalAccess', _97 => _97.server]) ? await
|
|
5397
|
+
async () => _optionalChain([config, 'access', _95 => _95.docs, 'access', _96 => _96.adapter, 'optionalAccess', _97 => _97.server]) ? await _chunkDVKH2RVNcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
5398
5398
|
root,
|
|
5399
5399
|
srcDir: config.srcDir,
|
|
5400
5400
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -5557,7 +5557,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5557
5557
|
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _103 => _103.env, 'optionalAccess', _104 => _104.public]) || {})
|
|
5558
5558
|
},
|
|
5559
5559
|
plugins: [
|
|
5560
|
-
|
|
5560
|
+
_chunkE4UDLFWRcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
5561
5561
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
5562
5562
|
...rendererVitePlugins,
|
|
5563
5563
|
...config.vite.plugins || [],
|
|
@@ -5571,7 +5571,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5571
5571
|
{ ...createReactProductionModePlugin(), enforce: "pre" },
|
|
5572
5572
|
farmServerOnlyEntriesPlugin(),
|
|
5573
5573
|
farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
|
|
5574
|
-
|
|
5574
|
+
_chunk7ONGIFYXcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
5575
5575
|
...hasRuntimeConfigModule ? [
|
|
5576
5576
|
farmStripPlatformConfigPlugin(
|
|
5577
5577
|
[
|
|
@@ -5618,7 +5618,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5618
5618
|
resolve: {
|
|
5619
5619
|
alias: [
|
|
5620
5620
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
5621
|
-
...Object.entries(
|
|
5621
|
+
...Object.entries(_chunkE4UDLFWRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
5622
5622
|
([find, replacement]) => ({ find, replacement })
|
|
5623
5623
|
)
|
|
5624
5624
|
],
|
|
@@ -5626,7 +5626,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5626
5626
|
dedupe: [...config.renderer.dedupe || []]
|
|
5627
5627
|
}
|
|
5628
5628
|
};
|
|
5629
|
-
await viteBuild(
|
|
5629
|
+
await viteBuild(_chunkE4UDLFWRcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
5630
5630
|
} finally {
|
|
5631
5631
|
if (postcssConfigDir) {
|
|
5632
5632
|
try {
|
|
@@ -6049,8 +6049,8 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
6049
6049
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
6050
6050
|
}
|
|
6051
6051
|
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 = []) {
|
|
6052
|
-
const farmIslandsMode =
|
|
6053
|
-
const farmClientBoot =
|
|
6052
|
+
const farmIslandsMode = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _121 => _121.experimental, 'optionalAccess', _122 => _122.serverComponents])) === "islands";
|
|
6053
|
+
const farmClientBoot = _chunkE4UDLFWRcjs.canBootFarmIslandsClient.call(void 0, config);
|
|
6054
6054
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
6055
6055
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
6056
6056
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
@@ -6128,7 +6128,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6128
6128
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
6129
6129
|
);
|
|
6130
6130
|
}
|
|
6131
|
-
const providerServerModules =
|
|
6131
|
+
const providerServerModules = _chunkE4UDLFWRcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
6132
6132
|
renderedIntegrationProviders,
|
|
6133
6133
|
config.root,
|
|
6134
6134
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
@@ -6148,20 +6148,20 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6148
6148
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
6149
6149
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
6150
6150
|
);
|
|
6151
|
-
const isolatedHydrationMode =
|
|
6151
|
+
const isolatedHydrationMode = _chunk7ONGIFYXcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
6152
6152
|
_optionalChain([config, 'access', _147 => _147.experimental, 'optionalAccess', _148 => _148.isolatedClientHydration]),
|
|
6153
6153
|
{
|
|
6154
|
-
serverComponents:
|
|
6154
|
+
serverComponents: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _149 => _149.experimental, 'optionalAccess', _150 => _150.serverComponents])) === "rsc",
|
|
6155
6155
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
6156
6156
|
}
|
|
6157
6157
|
);
|
|
6158
|
-
const hydrationPlanOptions =
|
|
6158
|
+
const hydrationPlanOptions = _chunk7ONGIFYXcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
6159
6159
|
config.renderer,
|
|
6160
6160
|
Boolean(unsupportedIntegrationProvider)
|
|
6161
6161
|
);
|
|
6162
6162
|
const pageHydrationPlanOptions = {
|
|
6163
6163
|
...hydrationPlanOptions,
|
|
6164
|
-
serverOwners:
|
|
6164
|
+
serverOwners: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _151 => _151.experimental, 'optionalAccess', _152 => _152.serverComponents])) === "islands"
|
|
6165
6165
|
};
|
|
6166
6166
|
const layoutHydrationPlans = layoutRoutes.map((layout) => ({
|
|
6167
6167
|
...layout,
|
|
@@ -6173,7 +6173,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6173
6173
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
6174
6174
|
)
|
|
6175
6175
|
}));
|
|
6176
|
-
const markdownPagePlan =
|
|
6176
|
+
const markdownPagePlan = _chunk7ONGIFYXcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
6177
6177
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
6178
6178
|
config.root,
|
|
6179
6179
|
isolatedHydrationMode,
|
|
@@ -6191,7 +6191,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6191
6191
|
)
|
|
6192
6192
|
])
|
|
6193
6193
|
);
|
|
6194
|
-
|
|
6194
|
+
_chunk7ONGIFYXcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
6195
6195
|
layoutHydrationPlans.map((layout) => ({
|
|
6196
6196
|
pattern: layout.pattern,
|
|
6197
6197
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -6266,8 +6266,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6266
6266
|
module: ${varName},
|
|
6267
6267
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
6268
6268
|
clientModule: ${JSON.stringify(_chunkQMNWKQL4cjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
6269
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
6270
|
-
const rootStrategy =
|
|
6269
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunk7ONGIFYXcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
6270
|
+
const rootStrategy = _chunkE4UDLFWRcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
6271
6271
|
route,
|
|
6272
6272
|
clientMetadata,
|
|
6273
6273
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -6516,7 +6516,7 @@ import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-r
|
|
|
6516
6516
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
6517
6517
|
// once the client build has finished (see buildNitroUniversal). A shell's document stays out of
|
|
6518
6518
|
// shared caches, which the adapter learns as it does for a guarded response.
|
|
6519
|
-
const farmMobileShellClient = JSON.parse("${
|
|
6519
|
+
const farmMobileShellClient = JSON.parse("${_chunkE5UN4OWXcjs.FARM_MOBILE_SHELL_CLIENT_PLACEHOLDER}");
|
|
6520
6520
|
function applyFarmMobileShellResponse(request, response, context) {
|
|
6521
6521
|
return _applyFarmMobileShellClient(request, response, farmMobileShellClient, () =>
|
|
6522
6522
|
context?.onGuardedResponse?.()
|
|
@@ -6619,10 +6619,10 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
6619
6619
|
);
|
|
6620
6620
|
const nativeServerFns = (config.plugins || []).some(
|
|
6621
6621
|
(plugin) => _optionalChain([plugin, 'optionalAccess', _171 => _171.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
6622
|
-
) ?
|
|
6622
|
+
) ? _chunkRY4ABNPEcjs.collectFarmNativeServerFns.call(void 0, {
|
|
6623
6623
|
root: config.root,
|
|
6624
6624
|
srcDir: config.srcDir,
|
|
6625
|
-
entries:
|
|
6625
|
+
entries: _chunkRY4ABNPEcjs.findFarmNativeScreenFiles.call(void 0, _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config))
|
|
6626
6626
|
}) : void 0;
|
|
6627
6627
|
const integrationImports = `
|
|
6628
6628
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -6637,7 +6637,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
6637
6637
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
6638
6638
|
});` : ""}
|
|
6639
6639
|
`;
|
|
6640
|
-
const imageRuntime =
|
|
6640
|
+
const imageRuntime = _chunkE4UDLFWRcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
6641
6641
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
6642
6642
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
6643
6643
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6817,7 +6817,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
6817
6817
|
|
|
6818
6818
|
function FarmDefault404Page() {
|
|
6819
6819
|
return React.createElement(React.Fragment, null,
|
|
6820
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
6820
|
+
React.createElement("style", null, ${JSON.stringify(_chunkE4UDLFWRcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
6821
6821
|
React.createElement("main", {
|
|
6822
6822
|
className: "farm-default-not-found",
|
|
6823
6823
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -6967,7 +6967,7 @@ ${_optionalChain([config, 'access', _179 => _179.agent, 'optionalAccess', _180 =
|
|
|
6967
6967
|
// to the build.
|
|
6968
6968
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
6969
6969
|
globalThis.process?.env,
|
|
6970
|
-
${JSON.stringify(
|
|
6970
|
+
${JSON.stringify(_chunkMPJEIHW2cjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
6971
6971
|
);` : ""}
|
|
6972
6972
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
6973
6973
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -7134,12 +7134,12 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
7134
7134
|
}
|
|
7135
7135
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
7136
7136
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
7137
|
-
${_optionalChain([config, 'access', _192 => _192.agent, 'optionalAccess', _193 => _193.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(
|
|
7137
|
+
${_optionalChain([config, 'access', _192 => _192.agent, 'optionalAccess', _193 => _193.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunk752IHQTDcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
7138
7138
|
` : ""}${_optionalChain([config, 'access', _194 => _194.agent, 'optionalAccess', _195 => _195.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
7139
|
-
|
|
7139
|
+
_chunk752IHQTDcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
7140
7140
|
build: config.deploymentId,
|
|
7141
|
-
packages:
|
|
7142
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
7141
|
+
packages: _chunkE4UDLFWRcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
7142
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkE4UDLFWRcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
7143
7143
|
})
|
|
7144
7144
|
)};
|
|
7145
7145
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -8344,7 +8344,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
8344
8344
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
8345
8345
|
// registered at runtime, such as the docs engine's.
|
|
8346
8346
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
8347
|
-
_chunkY5TOT5F6cjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
8347
|
+
_chunkY5TOT5F6cjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkBIF5MLTHcjs.FARM_VERSION)
|
|
8348
8348
|
)};
|
|
8349
8349
|
let farmDefaultMCPRouteFree;
|
|
8350
8350
|
function getFarmDefaultMCPServer() {
|
|
@@ -8754,7 +8754,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
8754
8754
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
8755
8755
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
8756
8756
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
8757
|
-
|
|
8757
|
+
_chunk752IHQTDcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
8758
8758
|
agent: {
|
|
8759
8759
|
...config.agent,
|
|
8760
8760
|
aiCatalog: servesAiCatalog,
|
|
@@ -9353,6 +9353,10 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9353
9353
|
renderPage: (targetRequest) => fetchFarmInnerRequest(targetRequest, adapterContext),
|
|
9354
9354
|
// The client CSS this build emitted, embedded once it settled (FARM_NATIVE_STYLESHEETS).
|
|
9355
9355
|
loadStylesheet: (href) => farmNativeStylesheets[href],
|
|
9356
|
+
// Behind a TLS-terminating proxy, links and form actions use the forwarded origin.
|
|
9357
|
+
origin: resolveFarmWebRequestOrigin(request, {
|
|
9358
|
+
trustProxy: farmServerConfig.trustProxy === true,
|
|
9359
|
+
}),
|
|
9356
9360
|
});
|
|
9357
9361
|
return applyProductionMiddlewareHeaders(treeResponse, middlewareHeaders);
|
|
9358
9362
|
}
|
|
@@ -9461,7 +9465,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9461
9465
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
9462
9466
|
// public manifest, the same document for every request.
|
|
9463
9467
|
if (
|
|
9464
|
-
[${JSON.stringify(
|
|
9468
|
+
[${JSON.stringify(_chunk752IHQTDcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunk752IHQTDcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
9465
9469
|
normalizeRuntimePath(routePathname),
|
|
9466
9470
|
)
|
|
9467
9471
|
) {
|
|
@@ -9473,7 +9477,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9473
9477
|
` : ""}
|
|
9474
9478
|
${_optionalChain([config, 'access', _222 => _222.agent, 'optionalAccess', _223 => _223.apiCatalog]) ? `
|
|
9475
9479
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
9476
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
9480
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk752IHQTDcjs.FARM_API_CATALOG_PATH)}) {
|
|
9477
9481
|
return applyProductionMiddlewareHeaders(
|
|
9478
9482
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
9479
9483
|
middlewareHeaders,
|
|
@@ -11023,7 +11027,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
11023
11027
|
}
|
|
11024
11028
|
if (_chunkUJ3R2AH2cjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
11025
11029
|
if (_chunkUJ3R2AH2cjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
11026
|
-
if (
|
|
11030
|
+
if (_chunkCHYTADNKcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
11027
11031
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
11028
11032
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
11029
11033
|
if (_optionalChain([manifestEntry, 'optionalAccess', _240 => _240.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
@@ -11041,7 +11045,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
11041
11045
|
}
|
|
11042
11046
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
11043
11047
|
if (!_optionalChain([config, 'access', _243 => _243.docs, 'optionalAccess', _244 => _244.enabled]) || !config.docs.prerender) return [];
|
|
11044
|
-
if (!_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) || !
|
|
11048
|
+
if (!_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) || !_chunkDVKH2RVNcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
11045
11049
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
11046
11050
|
"docs.prerender needs a docs adapter such as @farming-labs/farmjs; Farm's built-in docs renderer keeps rendering docs pages on request."
|
|
11047
11051
|
);
|
|
@@ -11053,7 +11057,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
11053
11057
|
);
|
|
11054
11058
|
return [];
|
|
11055
11059
|
}
|
|
11056
|
-
const pages = await
|
|
11060
|
+
const pages = await _chunkDVKH2RVNcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
11057
11061
|
if (!pages) {
|
|
11058
11062
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
11059
11063
|
`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.`
|
|
@@ -11079,10 +11083,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
11079
11083
|
const nitroBuilder = nitroBuilderResult.value;
|
|
11080
11084
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
11081
11085
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
11082
|
-
const outputDir =
|
|
11086
|
+
const outputDir = _chunkCHYTADNKcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
11083
11087
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
11084
11088
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
11085
|
-
const imageRuntime =
|
|
11089
|
+
const imageRuntime = _chunkE4UDLFWRcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
11086
11090
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
11087
11091
|
(image) => image.sourceType === "module"
|
|
11088
11092
|
);
|
|
@@ -11197,19 +11201,20 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
11197
11201
|
let nativeStylesheets;
|
|
11198
11202
|
const encodedDocsModulePreloads = encodeFarmDocsModulePreloads(docsModulePreloads);
|
|
11199
11203
|
const encodedClientModulePreloads = encodeFarmClientModulePreloads(clientModulePreloads);
|
|
11200
|
-
const encodedMobileShellClient = shouldBuildFarmMobileClient(config) ?
|
|
11201
|
-
await
|
|
11204
|
+
const encodedMobileShellClient = shouldBuildFarmMobileClient(config) ? _chunkE5UN4OWXcjs.encodeFarmMobileShellClient.call(void 0,
|
|
11205
|
+
await _chunkE5UN4OWXcjs.finalizeFarmMobileClient.call(void 0, {
|
|
11202
11206
|
buildDir: _path2.default.join(root, distDir),
|
|
11203
11207
|
clientOutputDir,
|
|
11204
11208
|
webEntry: clientJsSrc,
|
|
11209
|
+
webBoot: clientBootSrc,
|
|
11205
11210
|
stylesheet: clientCssHref,
|
|
11206
11211
|
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _248 => _248.files]), () => ( []))
|
|
11207
11212
|
})
|
|
11208
11213
|
) : null;
|
|
11209
11214
|
for (const output of Object.values(ssrBundle)) {
|
|
11210
11215
|
if (output.type !== "chunk") continue;
|
|
11211
|
-
if (encodedMobileShellClient && output.code.includes(
|
|
11212
|
-
output.code = output.code.split(
|
|
11216
|
+
if (encodedMobileShellClient && output.code.includes(_chunkE5UN4OWXcjs.FARM_MOBILE_SHELL_CLIENT_PLACEHOLDER)) {
|
|
11217
|
+
output.code = output.code.split(_chunkE5UN4OWXcjs.FARM_MOBILE_SHELL_CLIENT_PLACEHOLDER).join(encodedMobileShellClient);
|
|
11213
11218
|
}
|
|
11214
11219
|
if (output.code.includes(FARM_DOCS_MODULE_PRELOADS_PLACEHOLDER)) {
|
|
11215
11220
|
output.code = output.code.split(FARM_DOCS_MODULE_PRELOADS_PLACEHOLDER).join(encodedDocsModulePreloads);
|
|
@@ -11768,13 +11773,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
11768
11773
|
}
|
|
11769
11774
|
if (prerenderRoutes.length > 0) {
|
|
11770
11775
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
11771
|
-
const previousPrerender = process.env[
|
|
11772
|
-
process.env[
|
|
11776
|
+
const previousPrerender = process.env[_chunk4TVPYN32cjs.FARM_PRERENDER_ENV];
|
|
11777
|
+
process.env[_chunk4TVPYN32cjs.FARM_PRERENDER_ENV] = "1";
|
|
11773
11778
|
try {
|
|
11774
11779
|
await nitroBuilder.prerender(nitroInstance);
|
|
11775
11780
|
} finally {
|
|
11776
|
-
if (previousPrerender === void 0) delete process.env[
|
|
11777
|
-
else process.env[
|
|
11781
|
+
if (previousPrerender === void 0) delete process.env[_chunk4TVPYN32cjs.FARM_PRERENDER_ENV];
|
|
11782
|
+
else process.env[_chunk4TVPYN32cjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
11778
11783
|
}
|
|
11779
11784
|
}
|
|
11780
11785
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
|
|
@@ -12079,7 +12084,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
12079
12084
|
try {
|
|
12080
12085
|
await copyPackage("sharp", sharpRequire);
|
|
12081
12086
|
if (!copiedPackages.has("sharp")) {
|
|
12082
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
12087
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkE4UDLFWRcjs.SHARP_INSTALL_HINT}`);
|
|
12083
12088
|
}
|
|
12084
12089
|
} catch (error) {
|
|
12085
12090
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -12300,7 +12305,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
12300
12305
|
// src/build/index.ts
|
|
12301
12306
|
async function build(config, options = {}) {
|
|
12302
12307
|
return _chunk4IHMHFQBcjs.withProductionNodeEnv.call(void 0,
|
|
12303
|
-
() =>
|
|
12308
|
+
() => _chunk7ONGIFYXcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
12304
12309
|
);
|
|
12305
12310
|
}
|
|
12306
12311
|
function createBuildTargetBaseline(config) {
|
|
@@ -12311,7 +12316,7 @@ function createBuildTargetBaseline(config) {
|
|
|
12311
12316
|
preset,
|
|
12312
12317
|
distDir,
|
|
12313
12318
|
outputDir,
|
|
12314
|
-
outputWasDerived: outputDir ===
|
|
12319
|
+
outputWasDerived: outputDir === _chunkCHYTADNKcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
12315
12320
|
};
|
|
12316
12321
|
}
|
|
12317
12322
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -12320,8 +12325,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
12320
12325
|
const distDir = config.distDir || ".farm";
|
|
12321
12326
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
12322
12327
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
12323
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
12324
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
12328
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkCHYTADNKcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
12329
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkCHYTADNKcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
12325
12330
|
return {
|
|
12326
12331
|
root,
|
|
12327
12332
|
preset,
|
|
@@ -12329,7 +12334,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
12329
12334
|
distDir,
|
|
12330
12335
|
deployTarget,
|
|
12331
12336
|
outputDir,
|
|
12332
|
-
deployOutputDir:
|
|
12337
|
+
deployOutputDir: _chunkCHYTADNKcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
12333
12338
|
};
|
|
12334
12339
|
}
|
|
12335
12340
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -12366,7 +12371,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
12366
12371
|
};
|
|
12367
12372
|
config = {
|
|
12368
12373
|
...config,
|
|
12369
|
-
images:
|
|
12374
|
+
images: _chunkE4UDLFWRcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
12370
12375
|
root: targets.root,
|
|
12371
12376
|
preset: targets.preset
|
|
12372
12377
|
})
|
|
@@ -12374,7 +12379,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
12374
12379
|
if (_optionalChain([config, 'access', _282 => _282.docs, 'optionalAccess', _283 => _283.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
|
|
12375
12380
|
pluginManager.updateContext({ config });
|
|
12376
12381
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
12377
|
-
|
|
12382
|
+
_chunk7ONGIFYXcjs.usePackageClientBoundaryCacheFile.call(void 0,
|
|
12378
12383
|
_path2.default.resolve(root, distDir, "cache", "client-boundaries.json")
|
|
12379
12384
|
);
|
|
12380
12385
|
_chunkQMNWKQL4cjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
@@ -12397,7 +12402,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
12397
12402
|
root,
|
|
12398
12403
|
rendererBuild.signal
|
|
12399
12404
|
);
|
|
12400
|
-
const farmApp =
|
|
12405
|
+
const farmApp = _chunkE4UDLFWRcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
12401
12406
|
await farmApp.initialize();
|
|
12402
12407
|
const routeManager = farmApp.getRouteManager();
|
|
12403
12408
|
const serverRenderer = farmApp.getServerRenderer();
|
|
@@ -12504,7 +12509,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
12504
12509
|
ssr: true,
|
|
12505
12510
|
buildLifetime
|
|
12506
12511
|
});
|
|
12507
|
-
const viteConfig =
|
|
12512
|
+
const viteConfig = _chunkE4UDLFWRcjs.mergeFarmViteConfig.call(void 0,
|
|
12508
12513
|
{
|
|
12509
12514
|
root,
|
|
12510
12515
|
appType: "custom",
|
|
@@ -12516,12 +12521,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
12516
12521
|
},
|
|
12517
12522
|
plugins: [
|
|
12518
12523
|
...rendererVitePlugins,
|
|
12519
|
-
|
|
12524
|
+
_chunkE4UDLFWRcjs.farmFontImportsPlugin.call(void 0, {
|
|
12520
12525
|
root,
|
|
12521
12526
|
basePath: config.basePath,
|
|
12522
12527
|
publicDir: config.publicDir
|
|
12523
12528
|
}),
|
|
12524
|
-
|
|
12529
|
+
_chunk7ONGIFYXcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
|
|
12525
12530
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
12526
12531
|
// resolves as it does in the server build.
|
|
12527
12532
|
farmServerOnlyEntriesPlugin()
|
|
@@ -12531,7 +12536,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
12531
12536
|
hmr: false
|
|
12532
12537
|
},
|
|
12533
12538
|
resolve: {
|
|
12534
|
-
alias:
|
|
12539
|
+
alias: _chunkE4UDLFWRcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
12535
12540
|
dedupe: [...config.renderer.dedupe || []]
|
|
12536
12541
|
},
|
|
12537
12542
|
optimizeDeps: {
|
|
@@ -12595,7 +12600,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
12595
12600
|
farmI18nClientBridgePlugin(),
|
|
12596
12601
|
farmServerOnlyEntriesPlugin(),
|
|
12597
12602
|
farmPlugin(config, pluginManager),
|
|
12598
|
-
|
|
12603
|
+
_chunk7ONGIFYXcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
12599
12604
|
],
|
|
12600
12605
|
mode: "production"
|
|
12601
12606
|
});
|
|
@@ -12628,7 +12633,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
12628
12633
|
plugins: [
|
|
12629
12634
|
farmI18nClientBridgePlugin(),
|
|
12630
12635
|
farmPlugin(config, pluginManager),
|
|
12631
|
-
|
|
12636
|
+
_chunk7ONGIFYXcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
12632
12637
|
],
|
|
12633
12638
|
mode: "production"
|
|
12634
12639
|
});
|
|
@@ -12656,7 +12661,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12656
12661
|
if (pluginManager) {
|
|
12657
12662
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
12658
12663
|
}
|
|
12659
|
-
const outputDir =
|
|
12664
|
+
const outputDir = _chunkCHYTADNKcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12660
12665
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
12661
12666
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
12662
12667
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -12727,7 +12732,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12727
12732
|
root,
|
|
12728
12733
|
preset,
|
|
12729
12734
|
distDir,
|
|
12730
|
-
outputDir:
|
|
12735
|
+
outputDir: _chunkCHYTADNKcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
12731
12736
|
});
|
|
12732
12737
|
}
|
|
12733
12738
|
}
|