@farm.js/core 0.1.63 → 0.1.65
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-handler-OV4WRFBL.cjs → agent-mcp-handler-OXT73ZBY.cjs} +5 -5
- package/dist/{agent-mcp-handler-7QMX2LUY.mjs → agent-mcp-handler-QLFDDTYN.mjs} +4 -4
- package/dist/{agent-mcp.d-CCQ-wKwg.d.mts → agent-mcp.d-CO_ABmNK.d.mts} +1 -1
- package/dist/{agent-mcp.d-DOJCBSh9.d.ts → agent-mcp.d-QD2WZ9BS.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-GHWK46LX.cjs +16 -0
- package/dist/{analyzer-WNPQPWFR.mjs → analyzer-PE33SK5W.mjs} +3 -2
- 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.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/{app-manifest.d-BaA0omsv.d.mts → app-manifest.d-BpKxiU_E.d.mts} +1 -1
- package/dist/{app-manifest.d-poayV4lq.d.ts → app-manifest.d-DDmNkYQQ.d.ts} +1 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-DdWxeIGU.d.mts → app.d-kuoVWhWM.d.mts} +4 -4
- package/dist/{app.d-D4Dn03E3.d.ts → app.d-x68Cwr0_.d.ts} +4 -4
- package/dist/{chunk-LT4VAF5Z.cjs → chunk-2C5L5RPM.cjs} +7 -6
- package/dist/{chunk-BA2IA32Q.mjs → chunk-2L54YV25.mjs} +13 -11
- package/dist/{chunk-5IKQ7BIR.cjs → chunk-32RPJAAS.cjs} +16 -16
- package/dist/{chunk-QN5WRQSQ.cjs → chunk-3KJPIO5D.cjs} +610 -3102
- package/dist/{chunk-EENTT56C.mjs → chunk-6X5NKNBE.mjs} +43 -38
- package/dist/{chunk-RFYL5OLP.mjs → chunk-72JSHQQQ.mjs} +1 -1
- package/dist/{chunk-LA45FN37.mjs → chunk-7GYCZRTH.mjs} +386 -2878
- package/dist/chunk-7QVRWGBL.cjs +3704 -0
- package/dist/{chunk-PRFNLQSP.cjs → chunk-7XGWBPQQ.cjs} +4 -4
- package/dist/{chunk-FNHN3RBD.cjs → chunk-A3G5IY2W.cjs} +1 -1
- package/dist/{chunk-EYLC6GD6.cjs → chunk-C7DCMGC4.cjs} +12 -12
- package/dist/chunk-CJNAUEVC.mjs +34 -0
- package/dist/{chunk-LFFSDZ4Y.cjs → chunk-CZF4XIRZ.cjs} +3 -3
- package/dist/{chunk-7FFW7DC4.mjs → chunk-E2TSYUHV.mjs} +4 -4
- package/dist/{chunk-55U5QIXQ.mjs → chunk-FIR62CR3.mjs} +1 -1
- package/dist/{chunk-MEQN6DDA.cjs → chunk-FJWN7RV4.cjs} +5 -5
- package/dist/{chunk-VVTJTMGQ.cjs → chunk-GL7N5UHF.cjs} +4 -4
- package/dist/{chunk-4DIKLG56.mjs → chunk-GRBJ7VKH.mjs} +1 -1
- package/dist/{chunk-UR25Z5Z6.mjs → chunk-HCGWDRZO.mjs} +1 -1
- package/dist/{chunk-GPKBUME5.mjs → chunk-HKNYNSOK.mjs} +2 -2
- package/dist/{chunk-U6WCUVSV.cjs → chunk-IMK32ERL.cjs} +23 -21
- package/dist/chunk-IOEXXZK3.mjs +88 -0
- package/dist/{chunk-IOF4KXMP.mjs → chunk-IP2KHSGF.mjs} +205 -26
- package/dist/{chunk-YSXTNSXS.mjs → chunk-K7OZAVOI.mjs} +7 -6
- package/dist/{chunk-KVW2M6PI.mjs → chunk-KL7SHLQB.mjs} +1 -1
- package/dist/{chunk-UZZ6IEQP.mjs → chunk-MESQF2JC.mjs} +2 -2
- package/dist/{chunk-DZPR2W6U.cjs → chunk-O6L3YYPM.cjs} +5 -5
- package/dist/{chunk-6BJJYOFL.cjs → chunk-OLIGNTWU.cjs} +7 -7
- package/dist/{chunk-5L7I6AMY.cjs → chunk-OSFIUSYK.cjs} +5 -5
- package/dist/{chunk-LA6O5EL2.mjs → chunk-Q75QPLBA.mjs} +1 -1
- package/dist/{chunk-O5FCWI6O.mjs → chunk-QHRCR44V.mjs} +2 -2
- package/dist/{chunk-E72UD6ME.mjs → chunk-RVGSVQWT.mjs} +1 -1
- package/dist/{chunk-Z74NNER4.cjs → chunk-T4M52BA5.cjs} +164 -159
- package/dist/{chunk-PCXIJKPM.mjs → chunk-TNBJ4LZG.mjs} +2 -2
- package/dist/{chunk-PAKCHVUS.mjs → chunk-TPA2PV5J.mjs} +3 -35
- package/dist/{chunk-Y2YBNQ3D.cjs → chunk-TRIDJQ6A.cjs} +6 -6
- package/dist/{chunk-PVJX4UPA.cjs → chunk-TZOGZKI7.cjs} +411 -295
- package/dist/{chunk-O27PLNQZ.cjs → chunk-UJ3R2AH2.cjs} +4 -4
- package/dist/{chunk-BPNOYILC.cjs → chunk-UVV3I5QA.cjs} +3 -35
- package/dist/{chunk-CBDRR3J3.mjs → chunk-VHHLKIDZ.mjs} +166 -50
- package/dist/{chunk-T4TBK5NY.mjs → chunk-VQ4NWOWO.mjs} +2 -2
- package/dist/{chunk-ZZ2QKCKW.mjs → chunk-WAY6LOQH.mjs} +1 -1
- package/dist/chunk-WBTHHTBO.cjs +88 -0
- package/dist/{chunk-IWRLV46X.cjs → chunk-WMTBBQHY.cjs} +4 -4
- package/dist/{chunk-LWWDTBGL.cjs → chunk-WNXVWXG3.cjs} +2 -2
- package/dist/{chunk-CI4UNQHO.cjs → chunk-XBSKPLHF.cjs} +2 -2
- package/dist/{chunk-QAS7KE7J.cjs → chunk-Y5TOT5F6.cjs} +5 -5
- package/dist/{chunk-ANXU3D32.cjs → chunk-YD4J37RN.cjs} +403 -32
- package/dist/{chunk-XICXQXYE.mjs → chunk-YUW7F6SK.mjs} +2 -2
- package/dist/chunk-ZAUOOGER.mjs +3704 -0
- package/dist/{chunk-DPE53XWL.mjs → chunk-ZEXE4TGY.mjs} +1 -1
- package/dist/chunk-ZIHWAN55.cjs +34 -0
- package/dist/{chunk-GVOMPU3Y.cjs → chunk-ZQQK4U66.cjs} +213 -34
- package/dist/{chunk-S2NUYHRY.mjs → chunk-ZX2JHEWW.mjs} +384 -13
- package/dist/{client-component.d-CSEFlHfG.d.mts → client-component.d-D74pqdea.d.mts} +2 -2
- package/dist/{client-component.d-CQLvqLAJ.d.ts → client-component.d-D8VcypQA.d.ts} +2 -2
- package/dist/{client-plugins.d-BgPUYPc9.d.ts → client-plugins.d-CXElzotB.d.ts} +8 -1
- package/dist/{client-plugins.d-BTF0gZm4.d.mts → client-plugins.d-D4-6hNx7.d.mts} +8 -1
- 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-HDKTYIZF.mjs → devtools-PUVZB3F2.mjs} +7 -6
- package/dist/{devtools-ZHN5JLVI.cjs → devtools-SGYOG36E.cjs} +8 -7
- package/dist/docs.cjs +10 -9
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +9 -8
- 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 +29 -27
- package/dist/{index.d-Coow7bD4.d.ts → index.d-A_x10zGS.d.ts} +1 -1
- package/dist/{index.d-Dbjx0ku7.d.mts → index.d-SSgYDv4D.d.mts} +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +28 -26
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +27 -25
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +26 -24
- package/dist/internal/cli-runtime.cjs +10 -9
- package/dist/internal/cli-runtime.mjs +9 -8
- 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 +4 -4
- package/dist/internal/client-runtime.d.ts +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -8
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +8 -7
- package/dist/internal/infra-analytics-runtime.cjs +9 -9
- package/dist/internal/infra-analytics-runtime.mjs +7 -7
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -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 +11 -11
- package/dist/internal/production-runtime.d.mts +20 -12
- package/dist/internal/production-runtime.d.ts +20 -12
- package/dist/internal/production-runtime.mjs +10 -10
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/mobile.d.mts +2 -2
- package/dist/mobile.d.ts +2 -2
- package/dist/{native-tree-Z2WYUJEV.cjs → native-tree-HE2FLS72.cjs} +3 -3
- package/dist/{native-tree-AS5L3ID3.mjs → native-tree-YF2DSPKM.mjs} +2 -2
- package/dist/{navigation-delegate.d-Ca_BV0Wu.d.mts → navigation-delegate.d-DQVYKoaZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-aHiPI6GL.d.ts → navigation-delegate.d-GghbHJuK.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +18 -17
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +17 -16
- package/dist/{production-runtime.d-C0rF7a10.d.ts → production-runtime.d-Bzns3NW9.d.ts} +1 -1
- package/dist/{production-runtime.d-CnAsSWgF.d.mts → production-runtime.d-DiFa5vHW.d.mts} +1 -1
- package/dist/{render-plan.d-BxeITFT1.d.ts → render-plan.d-CL_Ikfg_.d.ts} +1 -1
- package/dist/{render-plan.d-Z-93m5GZ.d.mts → render-plan.d-CcF0MeCf.d.mts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-X7Q1vmGF.d.ts → request.d-B1RnTLri.d.ts} +1 -1
- package/dist/{request.d-8_fMFNEb.d.mts → request.d-DarDOCk9.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-BUr3Jp8S.d.ts → route-rendering.d-BTUYCIj4.d.ts} +1 -1
- package/dist/{route-rendering.d-BInmBmul.d.mts → route-rendering.d-D_2Ual0-.d.mts} +1 -1
- package/dist/{router.d-crorSRiW.d.ts → router.d-CMANF6da.d.ts} +1 -1
- package/dist/{router.d-CZQmbpHx.d.mts → router.d-Cuv1jntg.d.mts} +1 -1
- package/dist/{routes.d-BknKQcTu.d.ts → routes.d-B6yFe6jm.d.ts} +1 -1
- package/dist/{routes.d-D1IrO9KK.d.mts → routes.d-c2HKfrfL.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-3MPRULGA.mjs → rsc-pipeline-T3PWURLJ.mjs} +9 -8
- package/dist/{rsc-pipeline-RHEZNBFQ.cjs → rsc-pipeline-V4ANLRAA.cjs} +10 -9
- package/dist/{runtime-OZKFZQCU.cjs → runtime-5AROV2C3.cjs} +29 -17
- package/dist/{runtime-X5UR7VHP.mjs → runtime-LRIQ3XH7.mjs} +26 -14
- package/dist/{runtime.d-CCsjTZJW.d.ts → runtime.d-C3RQUj6_.d.ts} +1 -1
- package/dist/{runtime.d-CETtpLb-.d.mts → runtime.d-wvh4ngU0.d.mts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +42 -41
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +26 -25
- package/dist/{spa-router.d-CtSHzXlC.d.mts → spa-router.d-WU_qS5gJ.d.mts} +2 -2
- package/dist/{spa-router.d-CCADbSqJ.d.ts → spa-router.d-m8H_Kl_B.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-CjyE-npA.d.ts → utils.d-C9dQD5Zg.d.ts} +1 -1
- package/dist/{utils.d-zFPHKFFJ.d.mts → utils.d-W9IiEqmW.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -19
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +20 -18
- package/package.json +1 -1
- package/dist/analyzer-KEA5JVDR.cjs +0 -15
- package/dist/chunk-NK2VWS7P.cjs +0 -954
- package/dist/chunk-ZQ5BDNKW.mjs +0 -954
|
@@ -28,34 +28,36 @@ var _chunk5IQ2ERQAcjs = require('./chunk-5IQ2ERQA.cjs');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
var _chunk3KJPIO5Dcjs = require('./chunk-3KJPIO5D.cjs');
|
|
31
32
|
|
|
32
33
|
|
|
34
|
+
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
33
35
|
|
|
34
36
|
|
|
37
|
+
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
35
38
|
|
|
36
39
|
|
|
40
|
+
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
|
|
44
|
+
var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
40
45
|
|
|
41
46
|
|
|
42
47
|
|
|
43
48
|
|
|
44
49
|
|
|
45
|
-
var _chunkQN5WRQSQcjs = require('./chunk-QN5WRQSQ.cjs');
|
|
46
50
|
|
|
47
51
|
|
|
48
|
-
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
49
52
|
|
|
50
53
|
|
|
51
|
-
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
52
54
|
|
|
55
|
+
var _chunkUJ3R2AH2cjs = require('./chunk-UJ3R2AH2.cjs');
|
|
53
56
|
|
|
54
|
-
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
55
57
|
|
|
58
|
+
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
56
59
|
|
|
57
60
|
|
|
58
|
-
var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
59
61
|
|
|
60
62
|
|
|
61
63
|
|
|
@@ -66,39 +68,40 @@ var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
|
|
69
|
-
var _chunkO27PLNQZcjs = require('./chunk-O27PLNQZ.cjs');
|
|
70
71
|
|
|
71
72
|
|
|
72
|
-
var
|
|
73
|
+
var _chunkC7DCMGC4cjs = require('./chunk-C7DCMGC4.cjs');
|
|
73
74
|
|
|
74
75
|
|
|
76
|
+
var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
75
77
|
|
|
76
78
|
|
|
79
|
+
var _chunkWNXVWXG3cjs = require('./chunk-WNXVWXG3.cjs');
|
|
77
80
|
|
|
78
81
|
|
|
79
82
|
|
|
80
83
|
|
|
84
|
+
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
88
|
+
|
|
81
89
|
|
|
82
90
|
|
|
83
91
|
|
|
84
92
|
|
|
85
93
|
|
|
86
94
|
|
|
87
|
-
var _chunkEYLC6GD6cjs = require('./chunk-EYLC6GD6.cjs');
|
|
88
95
|
|
|
89
96
|
|
|
90
|
-
var _chunkQAS7KE7Jcjs = require('./chunk-QAS7KE7J.cjs');
|
|
91
97
|
|
|
92
98
|
|
|
93
|
-
var _chunkLWWDTBGLcjs = require('./chunk-LWWDTBGL.cjs');
|
|
94
99
|
|
|
95
100
|
|
|
96
101
|
|
|
97
102
|
|
|
98
|
-
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
99
103
|
|
|
100
104
|
|
|
101
|
-
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
102
105
|
|
|
103
106
|
|
|
104
107
|
|
|
@@ -106,7 +109,8 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
106
109
|
|
|
107
110
|
|
|
108
111
|
|
|
109
|
-
|
|
112
|
+
|
|
113
|
+
var _chunk7QVRWGBLcjs = require('./chunk-7QVRWGBL.cjs');
|
|
110
114
|
|
|
111
115
|
|
|
112
116
|
|
|
@@ -117,8 +121,7 @@ var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
|
|
|
117
121
|
var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
118
122
|
|
|
119
123
|
|
|
120
|
-
|
|
121
|
-
var _chunkBPNOYILCcjs = require('./chunk-BPNOYILC.cjs');
|
|
124
|
+
var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
|
|
122
125
|
|
|
123
126
|
|
|
124
127
|
|
|
@@ -128,24 +131,27 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
128
131
|
|
|
129
132
|
|
|
130
133
|
|
|
134
|
+
var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
|
|
131
135
|
|
|
132
136
|
|
|
137
|
+
var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
|
|
133
138
|
|
|
134
139
|
|
|
135
|
-
var
|
|
140
|
+
var _chunkZIHWAN55cjs = require('./chunk-ZIHWAN55.cjs');
|
|
141
|
+
|
|
136
142
|
|
|
137
143
|
|
|
138
144
|
|
|
145
|
+
var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
|
|
139
146
|
|
|
140
|
-
var _chunkDZPR2W6Ucjs = require('./chunk-DZPR2W6U.cjs');
|
|
141
147
|
|
|
142
148
|
|
|
143
|
-
var _chunkMEQN6DDAcjs = require('./chunk-MEQN6DDA.cjs');
|
|
144
149
|
|
|
145
150
|
|
|
146
151
|
|
|
147
152
|
|
|
148
|
-
|
|
153
|
+
|
|
154
|
+
var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
|
|
149
155
|
|
|
150
156
|
|
|
151
157
|
|
|
@@ -157,7 +163,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
157
163
|
|
|
158
164
|
|
|
159
165
|
|
|
160
|
-
var
|
|
166
|
+
var _chunk7XGWBPQQcjs = require('./chunk-7XGWBPQQ.cjs');
|
|
161
167
|
|
|
162
168
|
|
|
163
169
|
|
|
@@ -166,7 +172,7 @@ var _chunkPRFNLQSPcjs = require('./chunk-PRFNLQSP.cjs');
|
|
|
166
172
|
|
|
167
173
|
|
|
168
174
|
|
|
169
|
-
var
|
|
175
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
170
176
|
|
|
171
177
|
|
|
172
178
|
|
|
@@ -257,7 +263,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
257
263
|
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
258
264
|
|
|
259
265
|
|
|
260
|
-
var
|
|
266
|
+
var _chunkA3G5IY2Wcjs = require('./chunk-A3G5IY2W.cjs');
|
|
261
267
|
|
|
262
268
|
|
|
263
269
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -829,13 +835,13 @@ function reportOpenAPIDevGenerationResult(spec, output = _chunkQMNWKQL4cjs.logge
|
|
|
829
835
|
// src/vite.ts
|
|
830
836
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
831
837
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
832
|
-
const llms =
|
|
838
|
+
const llms = _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _53 => _53.agent, 'optionalAccess', _54 => _54.llmsTxt]));
|
|
833
839
|
if (!llms.enabled) return [];
|
|
834
840
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
835
841
|
}
|
|
836
842
|
function farmAgentGeneratedPaths(config) {
|
|
837
|
-
const crawlers =
|
|
838
|
-
const sitemap =
|
|
843
|
+
const crawlers = _chunkO6L3YYPMcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _55 => _55.agent, 'optionalAccess', _56 => _56.crawlers]));
|
|
844
|
+
const sitemap = _chunkO6L3YYPMcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _57 => _57.agent, 'optionalAccess', _58 => _58.sitemap]));
|
|
839
845
|
return [
|
|
840
846
|
...farmLlmsTxtGeneratedPaths(config),
|
|
841
847
|
...sitemap.enabled ? ["/sitemap.xml"] : [],
|
|
@@ -880,7 +886,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
880
886
|
return import("./workflows.cjs");
|
|
881
887
|
}
|
|
882
888
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
883
|
-
return import("./devtools-
|
|
889
|
+
return import("./devtools-SGYOG36E.cjs");
|
|
884
890
|
}
|
|
885
891
|
function loadFarmDevtoolsUIRuntime() {
|
|
886
892
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -923,11 +929,17 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
923
929
|
return {
|
|
924
930
|
name: "farm:server-only-entries",
|
|
925
931
|
enforce: "pre",
|
|
926
|
-
config() {
|
|
932
|
+
config(config) {
|
|
927
933
|
return {
|
|
928
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
929
|
-
|
|
930
|
-
|
|
934
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunk7QVRWGBLcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
935
|
+
ssr: {
|
|
936
|
+
noExternal: [
|
|
937
|
+
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
938
|
+
SERVER_ONLY_PACKAGE,
|
|
939
|
+
// Packages Node cannot load as a bundler does (stylesheet imports, `module`-only ESM).
|
|
940
|
+
..._chunk7QVRWGBLcjs.collectFarmServerBundledPackages.call(void 0, path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd()))))
|
|
941
|
+
]
|
|
942
|
+
}
|
|
931
943
|
};
|
|
932
944
|
},
|
|
933
945
|
configResolved(config) {
|
|
@@ -944,7 +956,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
944
956
|
);
|
|
945
957
|
}
|
|
946
958
|
if (!_optionalChain([options2, 'optionalAccess', _63 => _63.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
947
|
-
return
|
|
959
|
+
return _chunk7QVRWGBLcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
948
960
|
}
|
|
949
961
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
950
962
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
@@ -966,7 +978,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
966
978
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
967
979
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
968
980
|
}
|
|
969
|
-
return _nullishCoalesce(
|
|
981
|
+
return _nullishCoalesce(_chunk7QVRWGBLcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
970
982
|
}
|
|
971
983
|
};
|
|
972
984
|
}
|
|
@@ -998,7 +1010,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
998
1010
|
if (!snapshot) return "";
|
|
999
1011
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
1000
1012
|
if (snapshot.routing === "none") return runtime;
|
|
1001
|
-
return `${
|
|
1013
|
+
return `${_chunkUJ3R2AH2cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
1002
1014
|
}
|
|
1003
1015
|
function getPublicEnvDefine(config) {
|
|
1004
1016
|
const publicEnv = _optionalChain([config, 'access', _65 => _65.env, 'optionalAccess', _66 => _66.public]);
|
|
@@ -1157,23 +1169,86 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1157
1169
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1158
1170
|
return contentType.includes("text/html") ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1159
1171
|
};
|
|
1172
|
+
let runtimeStream;
|
|
1173
|
+
const streamsThroughRuntime = () => {
|
|
1174
|
+
if (runtimeStream) return true;
|
|
1175
|
+
if (!runtimeSession || !hasRuntimeAfterHook) return false;
|
|
1176
|
+
if (!hasHTMLTransformHook) return true;
|
|
1177
|
+
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1178
|
+
return !(typeof contentTypeHeader === "string" && contentTypeHeader.includes("text/html"));
|
|
1179
|
+
};
|
|
1180
|
+
const startRuntimeStream = () => {
|
|
1181
|
+
if (runtimeStream) return runtimeStream;
|
|
1182
|
+
let controller;
|
|
1183
|
+
const body = new ReadableStream({
|
|
1184
|
+
start(streamController) {
|
|
1185
|
+
controller = streamController;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
const status = res.statusCode || 200;
|
|
1189
|
+
const canHaveBody = method !== "HEAD" && status !== 204 && status !== 205 && status !== 304;
|
|
1190
|
+
pm.copyRequestContext(req, runtimeSession.request);
|
|
1191
|
+
const done = pm.endRuntimeRequest(
|
|
1192
|
+
runtimeSession,
|
|
1193
|
+
new Response(canHaveBody ? body : null, {
|
|
1194
|
+
status,
|
|
1195
|
+
headers: createHeadersFromNodeResponse(res)
|
|
1196
|
+
})
|
|
1197
|
+
).then(async (runtimeResponse) => {
|
|
1198
|
+
applyWebResponseToNodeResponse(runtimeResponse, res);
|
|
1199
|
+
if (!res.headersSent) originalWriteHead(res.statusCode);
|
|
1200
|
+
_optionalChain([originalFlushHeaders, 'optionalCall', _72 => _72()]);
|
|
1201
|
+
if (!runtimeResponse.body) return;
|
|
1202
|
+
const reader = runtimeResponse.body.getReader();
|
|
1203
|
+
for (; ; ) {
|
|
1204
|
+
const chunk = await reader.read();
|
|
1205
|
+
if (chunk.done) break;
|
|
1206
|
+
originalWrite(chunk.value);
|
|
1207
|
+
if (typeof res.flush === "function") res.flush();
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
done.catch(() => {
|
|
1211
|
+
});
|
|
1212
|
+
runtimeStream = { controller, done };
|
|
1213
|
+
return runtimeStream;
|
|
1214
|
+
};
|
|
1215
|
+
const streamRuntimeChunk = (chunk) => {
|
|
1216
|
+
const stream = startRuntimeStream();
|
|
1217
|
+
if (!chunk || chunk.byteLength === 0) return;
|
|
1218
|
+
try {
|
|
1219
|
+
stream.controller.enqueue(new Uint8Array(chunk));
|
|
1220
|
+
} catch (e9) {
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1160
1223
|
res.writeHead = ((statusCode, ...args) => {
|
|
1161
1224
|
const statusMessage = typeof args[0] === "string" ? args[0] : void 0;
|
|
1162
1225
|
const headers = statusMessage === void 0 ? args[0] : args[1];
|
|
1163
1226
|
res.statusCode = statusCode;
|
|
1164
1227
|
if (statusMessage !== void 0) res.statusMessage = statusMessage;
|
|
1165
1228
|
applyNodeWriteHeadHeaders(res, headers);
|
|
1166
|
-
if (shouldBufferCurrentResponse()) return res;
|
|
1229
|
+
if (streamsThroughRuntime() || shouldBufferCurrentResponse()) return res;
|
|
1167
1230
|
return statusMessage === void 0 ? originalWriteHead(statusCode) : originalWriteHead(statusCode, statusMessage);
|
|
1168
1231
|
});
|
|
1169
1232
|
if (originalFlushHeaders) {
|
|
1170
|
-
res.flushHeaders = (() =>
|
|
1233
|
+
res.flushHeaders = (() => {
|
|
1234
|
+
if (streamsThroughRuntime()) {
|
|
1235
|
+
startRuntimeStream();
|
|
1236
|
+
return void 0;
|
|
1237
|
+
}
|
|
1238
|
+
return shouldBufferCurrentResponse() ? void 0 : originalFlushHeaders();
|
|
1239
|
+
});
|
|
1171
1240
|
}
|
|
1172
1241
|
res.write = ((chunk, ...args) => {
|
|
1173
1242
|
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1174
1243
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1175
1244
|
const isHtmlResponse = contentType.includes("text/html");
|
|
1176
1245
|
const bufferChunk = toNodeResponseBuffer(chunk, args[0]);
|
|
1246
|
+
if (streamsThroughRuntime()) {
|
|
1247
|
+
streamRuntimeChunk(bufferChunk);
|
|
1248
|
+
const callback = args.find((arg) => typeof arg === "function");
|
|
1249
|
+
_optionalChain([callback, 'optionalCall', _73 => _73()]);
|
|
1250
|
+
return true;
|
|
1251
|
+
}
|
|
1177
1252
|
if (isHtmlResponse && bufferChunk) {
|
|
1178
1253
|
htmlChunks.push(bufferChunk);
|
|
1179
1254
|
didStreamHtml = true;
|
|
@@ -1183,7 +1258,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1183
1258
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1184
1259
|
if (shouldBufferResponse) {
|
|
1185
1260
|
const callback = args.find((arg) => typeof arg === "function");
|
|
1186
|
-
_optionalChain([callback, 'optionalCall',
|
|
1261
|
+
_optionalChain([callback, 'optionalCall', _74 => _74()]);
|
|
1187
1262
|
return true;
|
|
1188
1263
|
}
|
|
1189
1264
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -1198,6 +1273,39 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1198
1273
|
options.logResponse(method, urlPath, res.statusCode || 200, Date.now() - startTime, "PAGE");
|
|
1199
1274
|
const originalEndArgs = [...args];
|
|
1200
1275
|
const callback = typeof originalEndArgs[originalEndArgs.length - 1] === "function" ? originalEndArgs[originalEndArgs.length - 1] : void 0;
|
|
1276
|
+
const restore = () => {
|
|
1277
|
+
res.write = originalWrite;
|
|
1278
|
+
res.end = originalEnd;
|
|
1279
|
+
res.writeHead = originalWriteHead;
|
|
1280
|
+
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1281
|
+
delete res[_chunk3EEET2Q5cjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1282
|
+
};
|
|
1283
|
+
if (streamsThroughRuntime()) {
|
|
1284
|
+
const stream = startRuntimeStream();
|
|
1285
|
+
streamRuntimeChunk(toNodeResponseBuffer(args[0], args[1]));
|
|
1286
|
+
try {
|
|
1287
|
+
stream.controller.close();
|
|
1288
|
+
} catch (e10) {
|
|
1289
|
+
}
|
|
1290
|
+
stream.done.then(
|
|
1291
|
+
() => hasAfterResponseHook ? pm.runHookParallel("afterResponse", req, res) : void 0
|
|
1292
|
+
).catch((error) => {
|
|
1293
|
+
void options.emitError(error);
|
|
1294
|
+
console.error("Error in afterResponse hook:", error);
|
|
1295
|
+
if (!res.headersSent) {
|
|
1296
|
+
res.statusCode = 500;
|
|
1297
|
+
res.removeHeader("Content-Length");
|
|
1298
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
1299
|
+
originalWriteHead(500);
|
|
1300
|
+
originalWrite("Internal Server Error");
|
|
1301
|
+
}
|
|
1302
|
+
}).finally(() => {
|
|
1303
|
+
restore();
|
|
1304
|
+
if (callback) originalEnd(callback);
|
|
1305
|
+
else originalEnd();
|
|
1306
|
+
});
|
|
1307
|
+
return res;
|
|
1308
|
+
}
|
|
1201
1309
|
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1202
1310
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1203
1311
|
const isHtmlResponse = contentType.includes("text/html");
|
|
@@ -1296,13 +1404,13 @@ function getEnvDefines(config, configEnv) {
|
|
|
1296
1404
|
_chunkHEPJIKKQcjs.getPublicFarmImageConfig.call(void 0, _chunkHEPJIKKQcjs.resolveFarmImageConfig.call(void 0, config.images))
|
|
1297
1405
|
)
|
|
1298
1406
|
};
|
|
1299
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
1407
|
+
if (_optionalChain([configEnv, 'optionalAccess', _75 => _75.isSsrBuild])) {
|
|
1300
1408
|
defines.__FARM_ENV__ = JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
1301
1409
|
}
|
|
1302
1410
|
return defines;
|
|
1303
1411
|
}
|
|
1304
1412
|
function getFarmAPIBaseURLDefine(config) {
|
|
1305
|
-
const baseURL = _optionalChain([config, 'access',
|
|
1413
|
+
const baseURL = _optionalChain([config, 'access', _76 => _76.api, 'optionalAccess', _77 => _77.baseURL]);
|
|
1306
1414
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkPMJSG4JScjs.DEFAULT_FARM_API_BASE_PATH;
|
|
1307
1415
|
}
|
|
1308
1416
|
function isResolvedEnvScope(value) {
|
|
@@ -1322,7 +1430,7 @@ function fileContainsProgrammaticPageRoute(file) {
|
|
|
1322
1430
|
}
|
|
1323
1431
|
try {
|
|
1324
1432
|
return _chunkE7QOEV5Zcjs.scanProgrammaticPagePaths.call(void 0, fs2.readFileSync(file, "utf8")).length > 0;
|
|
1325
|
-
} catch (
|
|
1433
|
+
} catch (e11) {
|
|
1326
1434
|
return false;
|
|
1327
1435
|
}
|
|
1328
1436
|
}
|
|
@@ -1335,7 +1443,7 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
1335
1443
|
let ast;
|
|
1336
1444
|
try {
|
|
1337
1445
|
ast = options.parse(options.code);
|
|
1338
|
-
} catch (
|
|
1446
|
+
} catch (e12) {
|
|
1339
1447
|
return null;
|
|
1340
1448
|
}
|
|
1341
1449
|
walkModuleAst(ast, (node) => {
|
|
@@ -1374,17 +1482,18 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1374
1482
|
from: "@farm.js/core/internal/islx-react"
|
|
1375
1483
|
});
|
|
1376
1484
|
if (rewritten) options = { ...options, code: rewritten.code };
|
|
1377
|
-
} catch (
|
|
1485
|
+
} catch (e13) {
|
|
1378
1486
|
return null;
|
|
1379
1487
|
}
|
|
1380
1488
|
}
|
|
1381
1489
|
let ast;
|
|
1382
1490
|
try {
|
|
1383
1491
|
ast = options.parse(options.code);
|
|
1384
|
-
} catch (
|
|
1492
|
+
} catch (e14) {
|
|
1385
1493
|
return null;
|
|
1386
1494
|
}
|
|
1387
1495
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
1496
|
+
const everyExportIsComponent = options.code.includes(_chunk7QVRWGBLcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunk7QVRWGBLcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
1388
1497
|
const replacements = [];
|
|
1389
1498
|
const wrapperStatements = [];
|
|
1390
1499
|
const originalEntries = [];
|
|
@@ -1403,9 +1512,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1403
1512
|
transformedExports++;
|
|
1404
1513
|
};
|
|
1405
1514
|
for (const node of body) {
|
|
1406
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1515
|
+
if (_optionalChain([node, 'optionalAccess', _78 => _78.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
1407
1516
|
const declaration2 = node.declaration;
|
|
1408
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
1517
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _79 => _79.id, 'optionalAccess', _80 => _80.name])) {
|
|
1409
1518
|
replacements.push({
|
|
1410
1519
|
start: node.start,
|
|
1411
1520
|
end: node.end,
|
|
@@ -1423,14 +1532,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1423
1532
|
}
|
|
1424
1533
|
continue;
|
|
1425
1534
|
}
|
|
1426
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1535
|
+
if (_optionalChain([node, 'optionalAccess', _81 => _81.type]) === "ExportNamedDeclaration" && !node.declaration && node.exportKind !== "type") {
|
|
1427
1536
|
const specifiers = (node.specifiers || []).filter(
|
|
1428
1537
|
(specifier) => specifier.type === "ExportSpecifier" && specifier.exportKind !== "type"
|
|
1429
1538
|
);
|
|
1430
|
-
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess',
|
|
1539
|
+
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess', _82 => _82.name]), () => ( String(_nullishCoalesce(_optionalChain([name, 'optionalAccess', _83 => _83.value]), () => ( "")))));
|
|
1431
1540
|
const isComponentExport = (specifier) => {
|
|
1432
1541
|
const exported = specifierName(specifier.exported);
|
|
1433
|
-
return exported === "default" || /^[A-Z]/.test(exported);
|
|
1542
|
+
return everyExportIsComponent || exported === "default" || /^[A-Z]/.test(exported);
|
|
1434
1543
|
};
|
|
1435
1544
|
if (!specifiers.some(isComponentExport)) continue;
|
|
1436
1545
|
const imports = [];
|
|
@@ -1454,14 +1563,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1454
1563
|
if (kept.length > 0) wrapperStatements.push(`export { ${kept.join(", ")} };`);
|
|
1455
1564
|
continue;
|
|
1456
1565
|
}
|
|
1457
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1566
|
+
if (_optionalChain([node, 'optionalAccess', _84 => _84.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
1458
1567
|
const declaration = node.declaration;
|
|
1459
1568
|
const declaredNames = [];
|
|
1460
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
1569
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _85 => _85.id, 'optionalAccess', _86 => _86.name])) {
|
|
1461
1570
|
declaredNames.push(declaration.id.name);
|
|
1462
1571
|
} else if (declaration.type === "VariableDeclaration") {
|
|
1463
1572
|
for (const declarator of declaration.declarations || []) {
|
|
1464
|
-
if (_optionalChain([declarator, 'access',
|
|
1573
|
+
if (_optionalChain([declarator, 'access', _87 => _87.id, 'optionalAccess', _88 => _88.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
1465
1574
|
}
|
|
1466
1575
|
}
|
|
1467
1576
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -1522,10 +1631,10 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
1522
1631
|
let program;
|
|
1523
1632
|
try {
|
|
1524
1633
|
program = context.parse(code);
|
|
1525
|
-
} catch (
|
|
1634
|
+
} catch (e15) {
|
|
1526
1635
|
return;
|
|
1527
1636
|
}
|
|
1528
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
1637
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _89 => _89.env, 'optionalAccess', _90 => _90.public]), () => ( {}))));
|
|
1529
1638
|
const findings = analyzeClientBoundary(program, publicKeys);
|
|
1530
1639
|
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
1531
1640
|
return;
|
|
@@ -1545,7 +1654,7 @@ function hasViteAlias(alias, find) {
|
|
|
1545
1654
|
}
|
|
1546
1655
|
function farmPlugin(options = {}, initialPluginManager) {
|
|
1547
1656
|
const imageImports = farmImageImportsPlugin();
|
|
1548
|
-
const fontImports =
|
|
1657
|
+
const fontImports = _chunk3KJPIO5Dcjs.farmFontImportsPlugin.call(void 0, {
|
|
1549
1658
|
root: options.root,
|
|
1550
1659
|
basePath: options.basePath,
|
|
1551
1660
|
publicDir: options.publicDir
|
|
@@ -1553,8 +1662,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1553
1662
|
let farmApp;
|
|
1554
1663
|
let serverFnTransformActive = false;
|
|
1555
1664
|
const islandsServerFns = () => {
|
|
1556
|
-
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1557
|
-
return _optionalChain([config, 'access',
|
|
1665
|
+
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _91 => _91.getConfig, 'call', _92 => _92()]), () => ( options));
|
|
1666
|
+
return _optionalChain([config, 'access', _93 => _93.experimental, 'optionalAccess', _94 => _94.serverActions]) === true && _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _95 => _95.experimental, 'optionalAccess', _96 => _96.serverComponents])) === "islands";
|
|
1558
1667
|
};
|
|
1559
1668
|
let reactRefreshActive = false;
|
|
1560
1669
|
let server;
|
|
@@ -1579,14 +1688,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1579
1688
|
].join(" ");
|
|
1580
1689
|
console.log(log);
|
|
1581
1690
|
};
|
|
1582
|
-
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
1691
|
+
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _97 => _97.getRouteManager, 'call', _98 => _98(), 'access', _99 => _99.getProgrammaticClientRoutes, 'call', _100 => _100()])));
|
|
1583
1692
|
return {
|
|
1584
1693
|
name: "farm",
|
|
1585
1694
|
api: { getProgrammaticClientRoutes },
|
|
1586
1695
|
config(userConfig, configEnv) {
|
|
1587
1696
|
isBuild = configEnv.command === "build";
|
|
1588
1697
|
const layerAliases = _chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
1589
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access',
|
|
1698
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _101 => _101.resolve, 'optionalAccess', _102 => _102.alias]), "@") ? {} : _chunk3KJPIO5Dcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
|
|
1590
1699
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
1591
1700
|
return {
|
|
1592
1701
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
@@ -1602,7 +1711,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1602
1711
|
server: {
|
|
1603
1712
|
fs: {
|
|
1604
1713
|
...layerRoots.length ? { allow: [path6.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
1605
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
1714
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _103 => _103.server, 'optionalAccess', _104 => _104.fs, 'optionalAccess', _105 => _105.deny]), options)
|
|
1606
1715
|
}
|
|
1607
1716
|
}
|
|
1608
1717
|
};
|
|
@@ -1615,7 +1724,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1615
1724
|
(plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
1616
1725
|
);
|
|
1617
1726
|
reactRefreshActive = _chunk65Y5SIBHcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
1618
|
-
if (_optionalChain([options, 'access',
|
|
1727
|
+
if (_optionalChain([options, 'access', _106 => _106.experimental, 'optionalAccess', _107 => _107.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
1619
1728
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
1620
1729
|
"experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
|
|
1621
1730
|
);
|
|
@@ -1624,7 +1733,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1624
1733
|
async configureServer(viteServer) {
|
|
1625
1734
|
viteServer.middlewares.use(
|
|
1626
1735
|
createFarmDevPreviewGuard(viteServer, {
|
|
1627
|
-
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1736
|
+
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _108 => _108.getConfig, 'call', _109 => _109()]), () => ( options)))
|
|
1628
1737
|
})
|
|
1629
1738
|
);
|
|
1630
1739
|
if (typeof fontImports.configureServer === "function") {
|
|
@@ -1636,10 +1745,10 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1636
1745
|
if (!pm) return;
|
|
1637
1746
|
try {
|
|
1638
1747
|
await pm.runHookParallel("onError", { phase, error, meta });
|
|
1639
|
-
} catch (
|
|
1748
|
+
} catch (e16) {
|
|
1640
1749
|
}
|
|
1641
1750
|
};
|
|
1642
|
-
farmApp = new (0,
|
|
1751
|
+
farmApp = new (0, _chunk3KJPIO5Dcjs.FarmApp)(
|
|
1643
1752
|
{
|
|
1644
1753
|
...options,
|
|
1645
1754
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -1649,17 +1758,17 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1649
1758
|
await farmApp.initialize();
|
|
1650
1759
|
const farmConfig = farmApp.getConfig();
|
|
1651
1760
|
let farmAppPackages;
|
|
1652
|
-
if (_optionalChain([farmConfig, 'access',
|
|
1761
|
+
if (_optionalChain([farmConfig, 'access', _110 => _110.agent, 'optionalAccess', _111 => _111.noindexPreviews])) {
|
|
1653
1762
|
server.middlewares.use((_req, res, next) => {
|
|
1654
|
-
if (
|
|
1655
|
-
res.setHeader("X-Robots-Tag",
|
|
1763
|
+
if (_chunkWNXVWXG3cjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
1764
|
+
res.setHeader("X-Robots-Tag", _chunkO6L3YYPMcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
1656
1765
|
}
|
|
1657
1766
|
next();
|
|
1658
1767
|
});
|
|
1659
1768
|
}
|
|
1660
1769
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
1661
1770
|
const devBuiltInRoutePaths = new Set(
|
|
1662
|
-
|
|
1771
|
+
_chunkC7DCMGC4cjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
1663
1772
|
agent: {
|
|
1664
1773
|
apiCatalog: true,
|
|
1665
1774
|
mcp: true,
|
|
@@ -1681,7 +1790,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1681
1790
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
1682
1791
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
1683
1792
|
// a caller-controlled Host header.
|
|
1684
|
-
trustedLocalOrigin: () => _optionalChain([server, 'access',
|
|
1793
|
+
trustedLocalOrigin: () => _optionalChain([server, 'access', _112 => _112.resolvedUrls, 'optionalAccess', _113 => _113.local, 'access', _114 => _114[0]]),
|
|
1685
1794
|
onError(error) {
|
|
1686
1795
|
_chunkQMNWKQL4cjs.logger.error(
|
|
1687
1796
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -1701,8 +1810,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1701
1810
|
const workflowConfig = farmConfig.workflows;
|
|
1702
1811
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
1703
1812
|
const getExtraRouteTypes = () => [
|
|
1704
|
-
..._optionalChain([options, 'access',
|
|
1705
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
1813
|
+
..._optionalChain([options, 'access', _115 => _115.openapi, 'optionalAccess', _116 => _116.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
1814
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _117 => _117.getFarmDocsRouteTypeEntries, 'call', _118 => _118(farmConfig.docs)]), () => ( []))
|
|
1706
1815
|
];
|
|
1707
1816
|
const appDirSlugs = sourceRoots.map(
|
|
1708
1817
|
(source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
@@ -1749,7 +1858,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1749
1858
|
(source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
1750
1859
|
);
|
|
1751
1860
|
const layerConfigFiles = new Set(
|
|
1752
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
1861
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _119 => _119.configFile, 'optionalAccess', _120 => _120.replace, 'call', _121 => _121(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
1753
1862
|
);
|
|
1754
1863
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
1755
1864
|
..._chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -1828,7 +1937,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1828
1937
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
1829
1938
|
}
|
|
1830
1939
|
if (isI18nCatalogFile(file)) {
|
|
1831
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
1940
|
+
_optionalChain([farmApp, 'optionalAccess', _122 => _122.getI18nRuntime, 'call', _123 => _123(), 'access', _124 => _124.reload, 'call', _125 => _125(), 'access', _126 => _126.then, 'call', _127 => _127(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _128 => _128.catch, 'call', _129 => _129((error) => _chunkQMNWKQL4cjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
1832
1941
|
}
|
|
1833
1942
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
1834
1943
|
if (isRouteRefreshEvent) {
|
|
@@ -1841,8 +1950,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1841
1950
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
1842
1951
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
1843
1952
|
Promise.all([
|
|
1844
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
1845
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
1953
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _130 => _130(`${ev} ${file}`)]),
|
|
1954
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _131 => _131.reload, 'call', _132 => _132()]) : void 0
|
|
1846
1955
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkQMNWKQL4cjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
1847
1956
|
}, 50);
|
|
1848
1957
|
}
|
|
@@ -1881,7 +1990,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1881
1990
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
1882
1991
|
const load = (file) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
1883
1992
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
1884
|
-
_optionalChain([server, 'access',
|
|
1993
|
+
_optionalChain([server, 'access', _133 => _133.httpServer, 'optionalAccess', _134 => _134.once, 'call', _135 => _135("close", () => {
|
|
1885
1994
|
const globals = globalThis;
|
|
1886
1995
|
if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
|
|
1887
1996
|
delete globals[FARM_DEV_SERVER_MODULE_LOADER];
|
|
@@ -1955,11 +2064,11 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1955
2064
|
});
|
|
1956
2065
|
}
|
|
1957
2066
|
}
|
|
1958
|
-
if (_optionalChain([options, 'access',
|
|
2067
|
+
if (_optionalChain([options, 'access', _136 => _136.openapi, 'optionalAccess', _137 => _137.enabled])) {
|
|
1959
2068
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
1960
2069
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
1961
2070
|
mode: "development",
|
|
1962
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
2071
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _138 => _138.api, 'optionalAccess', _139 => _139.baseURL]) === "string" ? options.api.baseURL : void 0
|
|
1963
2072
|
});
|
|
1964
2073
|
const spec = await openAPIManager.generateSpec();
|
|
1965
2074
|
reportOpenAPIDevGenerationResult(spec);
|
|
@@ -1988,7 +2097,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1988
2097
|
return _chunk7EPYN7GWcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
1989
2098
|
};
|
|
1990
2099
|
releaseDocsMCPServers();
|
|
1991
|
-
const isFarmDocsPathGuarded = (href) =>
|
|
2100
|
+
const isFarmDocsPathGuarded = (href) => _chunkUJ3R2AH2cjs.farmPathGuardCoversPage.call(void 0,
|
|
1992
2101
|
{
|
|
1993
2102
|
config: farmConfig,
|
|
1994
2103
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2001,19 +2110,19 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2001
2110
|
clientEntry: "/@farm/client.js",
|
|
2002
2111
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2003
2112
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2004
|
-
globalStylesheetHref:
|
|
2113
|
+
globalStylesheetHref: _chunk3KJPIO5Dcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2005
2114
|
farmConfig.root,
|
|
2006
2115
|
farmConfig.srcDir
|
|
2007
2116
|
),
|
|
2008
2117
|
loadModule: async (specifier) => {
|
|
2009
2118
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
2010
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
2119
|
+
if (specifier === _optionalChain([farmConfig, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) && _optionalChain([resolved, 'optionalAccess', _143 => _143.id])) {
|
|
2011
2120
|
return import(
|
|
2012
2121
|
/* @vite-ignore */
|
|
2013
2122
|
_url.pathToFileURL.call(void 0, resolved.id).href
|
|
2014
2123
|
);
|
|
2015
2124
|
}
|
|
2016
|
-
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
2125
|
+
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _144 => _144.id]), () => ( specifier)));
|
|
2017
2126
|
},
|
|
2018
2127
|
registerMCPServer: (mcpServer) => {
|
|
2019
2128
|
const dispose = _chunkLRB5OVRTcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -2031,21 +2140,21 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2031
2140
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2032
2141
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2033
2142
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2034
|
-
globalStylesheetHref:
|
|
2143
|
+
globalStylesheetHref: _chunk3KJPIO5Dcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2035
2144
|
farmConfig.root,
|
|
2036
2145
|
farmConfig.srcDir
|
|
2037
2146
|
),
|
|
2038
2147
|
isPathGuarded: isFarmDocsPathGuarded
|
|
2039
2148
|
}) : null;
|
|
2040
2149
|
const wrapFarmDocsResponseWithLayouts = async (request, response) => {
|
|
2041
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
2150
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _145 => _145.headers, 'access', _146 => _146.get, 'call', _147 => _147("content-type"), 'optionalAccess', _148 => _148.toLowerCase, 'call', _149 => _149(), 'access', _150 => _150.includes, 'call', _151 => _151("text/html")])) {
|
|
2042
2151
|
return response;
|
|
2043
2152
|
}
|
|
2044
2153
|
const pathname = new URL(request.url).pathname;
|
|
2045
2154
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
2046
2155
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
2047
2156
|
...layout,
|
|
2048
|
-
metadata:
|
|
2157
|
+
metadata: _chunk7QVRWGBLcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
2049
2158
|
}));
|
|
2050
2159
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
2051
2160
|
return response;
|
|
@@ -2059,7 +2168,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2059
2168
|
headers: response.headers
|
|
2060
2169
|
});
|
|
2061
2170
|
}
|
|
2062
|
-
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2171
|
+
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _152 => _152.getConfig, 'call', _153 => _153()]), () => ( options))).renderer);
|
|
2063
2172
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
2064
2173
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
2065
2174
|
Promise.all(
|
|
@@ -2088,7 +2197,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2088
2197
|
])
|
|
2089
2198
|
);
|
|
2090
2199
|
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
2091
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
2200
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _154 => _154.route, 'optionalAccess', _155 => _155.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
2092
2201
|
const bootstrapScript = `<script>
|
|
2093
2202
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
2094
2203
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -2184,7 +2293,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2184
2293
|
}
|
|
2185
2294
|
},
|
|
2186
2295
|
(request) => {
|
|
2187
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2296
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _156 => _156.getConfig, 'call', _157 => _157()]), () => ( options));
|
|
2188
2297
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2189
2298
|
return _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2190
2299
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2195,7 +2304,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2195
2304
|
withAPIRequestTracing(async (req, res, next) => {
|
|
2196
2305
|
const requestUrl = req.url || "/";
|
|
2197
2306
|
const requestMethod = req.method || "GET";
|
|
2198
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2307
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _158 => _158.getConfig, 'call', _159 => _159()]), () => ( options));
|
|
2199
2308
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2200
2309
|
const parsedRequestUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2201
2310
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2237,7 +2346,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2237
2346
|
if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_PATH)) {
|
|
2238
2347
|
launchUrl = referrerUrl;
|
|
2239
2348
|
}
|
|
2240
|
-
} catch (
|
|
2349
|
+
} catch (e17) {
|
|
2241
2350
|
}
|
|
2242
2351
|
}
|
|
2243
2352
|
launchUrl.searchParams.set(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
|
|
@@ -2263,7 +2372,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2263
2372
|
openapi: options.openapi
|
|
2264
2373
|
},
|
|
2265
2374
|
workflows: discoveredWorkflows,
|
|
2266
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
2375
|
+
plugins: _optionalChain([pm, 'optionalAccess', _160 => _160.getSortedPlugins, 'call', _161 => _161()])
|
|
2267
2376
|
});
|
|
2268
2377
|
res.statusCode = 200;
|
|
2269
2378
|
res.setHeader(
|
|
@@ -2286,7 +2395,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2286
2395
|
return;
|
|
2287
2396
|
}
|
|
2288
2397
|
const runAppMiddlewareForContentRoute = async () => {
|
|
2289
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
2398
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _162 => _162.hasMiddleware, 'call', _163 => _163()])) return false;
|
|
2290
2399
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
2291
2400
|
return runFarmMiddlewareWithNavigation(
|
|
2292
2401
|
farmApp.getServerRenderer(),
|
|
@@ -2302,16 +2411,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2302
2411
|
label
|
|
2303
2412
|
} = {}) => {
|
|
2304
2413
|
const discard = async () => {
|
|
2305
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
2414
|
+
await _optionalChain([computed, 'optionalAccess', _164 => _164.body, 'optionalAccess', _165 => _165.cancel, 'call', _166 => _166(), 'access', _167 => _167.catch, 'call', _168 => _168(() => {
|
|
2306
2415
|
})]);
|
|
2307
2416
|
};
|
|
2308
2417
|
let runtimeSession2;
|
|
2309
|
-
if (_optionalChain([pm, 'optionalAccess',
|
|
2418
|
+
if (_optionalChain([pm, 'optionalAccess', _169 => _169.hasRuntimeRequestHooks, 'call', _170 => _170()])) {
|
|
2310
2419
|
try {
|
|
2311
2420
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
2312
|
-
const route =
|
|
2421
|
+
const route = _chunkC7DCMGC4cjs.setFarmRouteLabel.call(void 0,
|
|
2313
2422
|
{ pathname: requestPathname },
|
|
2314
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
2423
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkC7DCMGC4cjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
2315
2424
|
);
|
|
2316
2425
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
2317
2426
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -2343,7 +2452,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2343
2452
|
let response;
|
|
2344
2453
|
try {
|
|
2345
2454
|
response = await respond(
|
|
2346
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
2455
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _171 => _171.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
2347
2456
|
);
|
|
2348
2457
|
} catch (error) {
|
|
2349
2458
|
if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
|
|
@@ -2356,7 +2465,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2356
2465
|
);
|
|
2357
2466
|
};
|
|
2358
2467
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
2359
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
2468
|
+
if (openAPIManager && _optionalChain([options, 'access', _172 => _172.openapi, 'optionalAccess', _173 => _173.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
2360
2469
|
const specManager = openAPIManager;
|
|
2361
2470
|
await serveBuiltInRoute(async () => {
|
|
2362
2471
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -2376,7 +2485,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2376
2485
|
});
|
|
2377
2486
|
return;
|
|
2378
2487
|
}
|
|
2379
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
2488
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _174 => _174.openapi, 'optionalAccess', _175 => _175.route])) {
|
|
2380
2489
|
const docsManager = openAPIManager;
|
|
2381
2490
|
await serveBuiltInRoute(
|
|
2382
2491
|
async () => {
|
|
@@ -2387,24 +2496,24 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2387
2496
|
);
|
|
2388
2497
|
return;
|
|
2389
2498
|
}
|
|
2390
|
-
if (_optionalChain([options, 'access',
|
|
2499
|
+
if (_optionalChain([options, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.manifest]) !== false && _chunkC7DCMGC4cjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
2391
2500
|
await serveBuiltInRoute(async () => {
|
|
2392
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
2393
|
-
const manifest = await
|
|
2501
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunk3KJPIO5Dcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
2502
|
+
const manifest = await _chunkC7DCMGC4cjs.createFarmAppManifestResponse.call(void 0,
|
|
2394
2503
|
new Request(parsedRequestUrl, {
|
|
2395
2504
|
method: requestMethod,
|
|
2396
2505
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
2397
2506
|
}),
|
|
2398
2507
|
{
|
|
2399
|
-
...
|
|
2508
|
+
..._chunkC7DCMGC4cjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
2400
2509
|
build: "development",
|
|
2401
2510
|
packages: farmAppPackages,
|
|
2402
2511
|
// Read again on each request; unchanged files come from a cache.
|
|
2403
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
2512
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _178 => _178.plugins, 'optionalAccess', _179 => _179.some, 'call', _180 => _180(({ name }) => name === "farm:webmcp")]) ? _chunk3KJPIO5Dcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
2404
2513
|
}),
|
|
2405
2514
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
2406
2515
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
2407
|
-
guardCoversPath: (path7) =>
|
|
2516
|
+
guardCoversPath: (path7) => _chunkUJ3R2AH2cjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
2408
2517
|
{
|
|
2409
2518
|
config: farmConfig,
|
|
2410
2519
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2418,11 +2527,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2418
2527
|
});
|
|
2419
2528
|
return;
|
|
2420
2529
|
}
|
|
2421
|
-
if (_optionalChain([options, 'access',
|
|
2530
|
+
if (_optionalChain([options, 'access', _181 => _181.agent, 'optionalAccess', _182 => _182.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkC7DCMGC4cjs.FARM_API_CATALOG_PATH) {
|
|
2422
2531
|
await serveBuiltInRoute(
|
|
2423
|
-
() =>
|
|
2532
|
+
() => _chunkC7DCMGC4cjs.createFarmApiCatalogResponse.call(void 0,
|
|
2424
2533
|
requestMethod,
|
|
2425
|
-
|
|
2534
|
+
_chunkC7DCMGC4cjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
2426
2535
|
new Request(parsedRequestUrl, {
|
|
2427
2536
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
2428
2537
|
})
|
|
@@ -2430,8 +2539,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2430
2539
|
);
|
|
2431
2540
|
return;
|
|
2432
2541
|
}
|
|
2433
|
-
if (_optionalChain([options, 'access',
|
|
2434
|
-
const aiCatalog =
|
|
2542
|
+
if (_optionalChain([options, 'access', _183 => _183.agent, 'optionalAccess', _184 => _184.aiCatalog]) !== false) {
|
|
2543
|
+
const aiCatalog = _chunkC7DCMGC4cjs.createFarmAiCatalogResponse.call(void 0,
|
|
2435
2544
|
new Request(parsedRequestUrl, {
|
|
2436
2545
|
method: requestMethod,
|
|
2437
2546
|
headers: {
|
|
@@ -2475,11 +2584,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2475
2584
|
{
|
|
2476
2585
|
kind: "docs",
|
|
2477
2586
|
computed: docsResponse,
|
|
2478
|
-
label:
|
|
2587
|
+
label: _chunkC7DCMGC4cjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
2479
2588
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2480
2589
|
{
|
|
2481
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2482
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
2590
|
+
path: _optionalChain([farmConfig, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.entry]) || "/docs",
|
|
2591
|
+
roots: _optionalChain([farmConfig, 'access', _187 => _187.docs, 'optionalAccess', _188 => _188.roots, 'optionalAccess', _189 => _189.map, 'call', _190 => _190((root) => root.entry)])
|
|
2483
2592
|
}
|
|
2484
2593
|
)
|
|
2485
2594
|
}
|
|
@@ -2487,10 +2596,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2487
2596
|
return;
|
|
2488
2597
|
}
|
|
2489
2598
|
}
|
|
2490
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD") && _optionalChain([req, 'access',
|
|
2491
|
-
const { createFarmNativeTreeResponse } = await import("./native-tree-
|
|
2599
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _191 => _191.headers, 'access', _192 => _192.accept, 'optionalAccess', _193 => _193.includes, 'call', _194 => _194(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
2600
|
+
const { createFarmNativeTreeResponse } = await import("./native-tree-HE2FLS72.cjs");
|
|
2601
|
+
const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
2492
2602
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
2493
|
-
request: new Request(fullUrl, {
|
|
2603
|
+
request: new Request(fullUrl, {
|
|
2604
|
+
method: requestMethod,
|
|
2605
|
+
headers: docsHeaders,
|
|
2606
|
+
...treeBodyInit
|
|
2607
|
+
}),
|
|
2494
2608
|
// As for the Markdown mirror: this server's own listener, redirects not followed.
|
|
2495
2609
|
renderPage: (request) => _chunkBNH53KOTcjs.createFarmDevServerDispatch.call(void 0, server)(
|
|
2496
2610
|
new Request(request, {
|
|
@@ -2500,15 +2614,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2500
2614
|
});
|
|
2501
2615
|
await serveBuiltInRoute(() => treeResponse, {
|
|
2502
2616
|
computed: treeResponse,
|
|
2503
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
2617
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _195 => _195.getRouteManager, 'call', _196 => _196(), 'access', _197 => _197.matchRoute, 'call', _198 => _198(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _199 => _199.route, 'optionalAccess', _200 => _200.pattern]), () => ( null))
|
|
2504
2618
|
});
|
|
2505
2619
|
return;
|
|
2506
2620
|
}
|
|
2507
|
-
const markdownRouteLabel = () =>
|
|
2621
|
+
const markdownRouteLabel = () => _chunkC7DCMGC4cjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
2508
2622
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2509
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
2623
|
+
(page) => _optionalChain([farmApp, 'access', _201 => _201.getRouteManager, 'call', _202 => _202(), 'access', _203 => _203.matchRoute, 'call', _204 => _204(page), 'access', _205 => _205.route, 'optionalAccess', _206 => _206.pattern])
|
|
2510
2624
|
);
|
|
2511
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
2625
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunk7XGWBPQQcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
2512
2626
|
request: new Request(fullUrl, {
|
|
2513
2627
|
method: requestMethod,
|
|
2514
2628
|
headers: docsHeaders
|
|
@@ -2516,7 +2630,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2516
2630
|
config: farmApp.getConfig().mdx,
|
|
2517
2631
|
resolveSource: async (pathname2) => {
|
|
2518
2632
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
2519
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
2633
|
+
const sourcePath = _optionalChain([match, 'access', _207 => _207.route, 'optionalAccess', _208 => _208.markdownSourcePath]) || (match.route && _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
2520
2634
|
if (!sourcePath) {
|
|
2521
2635
|
return null;
|
|
2522
2636
|
}
|
|
@@ -2541,7 +2655,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2541
2655
|
});
|
|
2542
2656
|
return;
|
|
2543
2657
|
}
|
|
2544
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
2658
|
+
const markdownResponse = viteModuleRequest ? null : await _chunk2C5L5RPMcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
2545
2659
|
request: new Request(fullUrl, {
|
|
2546
2660
|
method: requestMethod,
|
|
2547
2661
|
headers: docsHeaders
|
|
@@ -2572,16 +2686,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2572
2686
|
});
|
|
2573
2687
|
return;
|
|
2574
2688
|
}
|
|
2575
|
-
if (!viteModuleRequest &&
|
|
2576
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
2689
|
+
if (!viteModuleRequest && _chunk2C5L5RPMcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
2690
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunk7XGWBPQQcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
|
|
2577
2691
|
if (!markdownRoute.route) {
|
|
2578
2692
|
await serveBuiltInRoute(
|
|
2579
2693
|
() => new Response(
|
|
2580
|
-
|
|
2694
|
+
_chunk2C5L5RPMcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/"),
|
|
2581
2695
|
{
|
|
2582
2696
|
status: 404,
|
|
2583
2697
|
headers: {
|
|
2584
|
-
"Content-Type":
|
|
2698
|
+
"Content-Type": _chunk2C5L5RPMcjs.FARM_MARKDOWN_CONTENT_TYPE,
|
|
2585
2699
|
"X-Farm-Markdown-Error": "404",
|
|
2586
2700
|
"Cache-Control": "no-store"
|
|
2587
2701
|
}
|
|
@@ -2591,7 +2705,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2591
2705
|
return;
|
|
2592
2706
|
}
|
|
2593
2707
|
}
|
|
2594
|
-
const markdownPageTarget =
|
|
2708
|
+
const markdownPageTarget = _chunk2C5L5RPMcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
2595
2709
|
farmApp.getConfig().md,
|
|
2596
2710
|
requestPathname,
|
|
2597
2711
|
{
|
|
@@ -2604,7 +2718,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2604
2718
|
if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
|
|
2605
2719
|
res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
|
|
2606
2720
|
}
|
|
2607
|
-
const alternatePath =
|
|
2721
|
+
const alternatePath = _chunk2C5L5RPMcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
|
|
2608
2722
|
const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
|
|
2609
2723
|
const currentLink = res.getHeader("Link");
|
|
2610
2724
|
res.setHeader(
|
|
@@ -2656,7 +2770,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2656
2770
|
"beforeRequest",
|
|
2657
2771
|
(plugin) => {
|
|
2658
2772
|
const owner = _chunkI32V5CZLcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
2659
|
-
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
2773
|
+
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _209 => _209.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
2660
2774
|
},
|
|
2661
2775
|
req,
|
|
2662
2776
|
res
|
|
@@ -2692,7 +2806,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2692
2806
|
isProd: false
|
|
2693
2807
|
},
|
|
2694
2808
|
request,
|
|
2695
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
2809
|
+
{ clientAddress: _optionalChain([req, 'access', _210 => _210.socket, 'optionalAccess', _211 => _211.remoteAddress]) }
|
|
2696
2810
|
);
|
|
2697
2811
|
if (!result) {
|
|
2698
2812
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -2756,7 +2870,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2756
2870
|
trustProxy: currentServerConfig.trustProxy
|
|
2757
2871
|
}).pathname;
|
|
2758
2872
|
const servesLocalApiRoute = hasMatchedApiRoute || Boolean(
|
|
2759
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2873
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _212 => _212.isFarmDocsAPIRequest, 'call', _213 => _213(requestPathname)])
|
|
2760
2874
|
);
|
|
2761
2875
|
try {
|
|
2762
2876
|
if (pm) {
|
|
@@ -2800,7 +2914,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2800
2914
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
2801
2915
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
2802
2916
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
2803
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
2917
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _214 => _214.route, 'access', _215 => _215.path]) || urlPath2;
|
|
2804
2918
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
2805
2919
|
type: "route.matched",
|
|
2806
2920
|
pathname: pathname2,
|
|
@@ -2890,7 +3004,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2890
3004
|
return;
|
|
2891
3005
|
}
|
|
2892
3006
|
}
|
|
2893
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3007
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _216 => _216.isFarmDocsAPIRequest, 'call', _217 => _217(pathname2)])) {
|
|
2894
3008
|
try {
|
|
2895
3009
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
2896
3010
|
const headers = new Headers();
|
|
@@ -2928,11 +3042,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2928
3042
|
};
|
|
2929
3043
|
const docsResponse = pm ? await pm.runRuntimeRequest(request, invokeDocsAPIHandler, {
|
|
2930
3044
|
kind: "docs",
|
|
2931
|
-
route:
|
|
3045
|
+
route: _chunkC7DCMGC4cjs.setFarmRouteLabel.call(void 0,
|
|
2932
3046
|
{ pathname: pathname2, pattern: apiLifecyclePayload.routePath },
|
|
2933
|
-
|
|
2934
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2935
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3047
|
+
_chunkC7DCMGC4cjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
3048
|
+
path: _optionalChain([farmConfig, 'access', _218 => _218.docs, 'optionalAccess', _219 => _219.entry]) || "/docs",
|
|
3049
|
+
roots: _optionalChain([farmConfig, 'access', _220 => _220.docs, 'optionalAccess', _221 => _221.roots, 'optionalAccess', _222 => _222.map, 'call', _223 => _223((root) => root.entry)])
|
|
2936
3050
|
})
|
|
2937
3051
|
)
|
|
2938
3052
|
}) : await invokeDocsAPIHandler(request);
|
|
@@ -2966,18 +3080,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2966
3080
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
2967
3081
|
return;
|
|
2968
3082
|
}
|
|
2969
|
-
if (_optionalChain([req, 'access',
|
|
3083
|
+
if (_optionalChain([req, 'access', _224 => _224.url, 'optionalAccess', _225 => _225.startsWith, 'call', _226 => _226("/@")]) || _optionalChain([req, 'access', _227 => _227.url, 'optionalAccess', _228 => _228.startsWith, 'call', _229 => _229("/node_modules")])) {
|
|
2970
3084
|
return next();
|
|
2971
3085
|
}
|
|
2972
3086
|
if (shouldBypassFarmRouterForDottedPath(
|
|
2973
3087
|
requestPathname,
|
|
2974
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3088
|
+
_optionalChain([farmApp, 'optionalAccess', _230 => _230.getRouteManager, 'call', _231 => _231()]),
|
|
2975
3089
|
[server.config.publicDir, server.config.root],
|
|
2976
3090
|
farmAgentGeneratedPaths(farmConfig)
|
|
2977
3091
|
)) {
|
|
2978
3092
|
return next();
|
|
2979
3093
|
}
|
|
2980
|
-
if (_optionalChain([req, 'access',
|
|
3094
|
+
if (_optionalChain([req, 'access', _232 => _232.url, 'optionalAccess', _233 => _233.startsWith, 'call', _234 => _234("/__farm/page-data")])) {
|
|
2981
3095
|
const urlObj = parsedRequestUrl;
|
|
2982
3096
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
2983
3097
|
try {
|
|
@@ -3005,7 +3119,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3005
3119
|
});
|
|
3006
3120
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
3007
3121
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
3008
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3122
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _235 => _235.hasMiddleware, 'call', _236 => _236()])) {
|
|
3009
3123
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
3010
3124
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3011
3125
|
farmApp.getServerRenderer(),
|
|
@@ -3033,10 +3147,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3033
3147
|
if (pm) {
|
|
3034
3148
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3035
3149
|
pathname: targetPath,
|
|
3036
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
3037
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
3038
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3039
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3150
|
+
matched: !!_optionalChain([match, 'optionalAccess', _237 => _237.route]),
|
|
3151
|
+
routePattern: _optionalChain([match, 'optionalAccess', _238 => _238.route, 'optionalAccess', _239 => _239.pattern]) || null,
|
|
3152
|
+
params: _optionalChain([match, 'optionalAccess', _240 => _240.params]) || {},
|
|
3153
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _241 => _241.layouts]) || []).map((l) => l.pattern)
|
|
3040
3154
|
});
|
|
3041
3155
|
}
|
|
3042
3156
|
if (!match) {
|
|
@@ -3059,7 +3173,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3059
3173
|
);
|
|
3060
3174
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
3061
3175
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
3062
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
3176
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunk7QVRWGBLcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
3063
3177
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
3064
3178
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
3065
3179
|
let mergedMetadata = {};
|
|
@@ -3067,7 +3181,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3067
3181
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
3068
3182
|
);
|
|
3069
3183
|
const layoutHydrationMetadata = layouts.map(
|
|
3070
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
3184
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunk7QVRWGBLcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
3071
3185
|
);
|
|
3072
3186
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
3073
3187
|
(metadata) => metadata.shouldHydrate
|
|
@@ -3078,18 +3192,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3078
3192
|
(metadata) => metadata.shouldHydrate && metadata.islandStrategy ? [metadata.islandStrategy] : []
|
|
3079
3193
|
)
|
|
3080
3194
|
];
|
|
3081
|
-
const hydrationIslandStrategy =
|
|
3082
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3083
|
-
) === "islands" ?
|
|
3195
|
+
const hydrationIslandStrategy = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0,
|
|
3196
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _242 => _242.getConfig, 'call', _243 => _243()]), () => ( options))), 'access', _244 => _244.experimental, 'optionalAccess', _245 => _245.serverComponents])
|
|
3197
|
+
) === "islands" ? _chunk3KJPIO5Dcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3084
3198
|
route,
|
|
3085
3199
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
3086
3200
|
layouts.map((layout, index) => ({
|
|
3087
3201
|
pattern: layout.pattern,
|
|
3088
3202
|
modulePath: layout.modulePath,
|
|
3089
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3203
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _246 => _246[index], 'optionalAccess', _247 => _247.shouldHydrate]) === true,
|
|
3090
3204
|
// Manifest entries carry it; metadata read from source does not.
|
|
3091
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3092
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
3205
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _248 => _248[index], 'optionalAccess', _249 => _249.hasIsolatedClientBoundaries]) === true,
|
|
3206
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _250 => _250[index], 'optionalAccess', _251 => _251.islandStrategy]), () => ( null))
|
|
3093
3207
|
})),
|
|
3094
3208
|
server.config.root,
|
|
3095
3209
|
true
|
|
@@ -3137,14 +3251,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3137
3251
|
mergedMetadata = await _chunk6IOZPJ3Icjs.mergeModuleViewport.call(void 0, mergedMetadata, routeModule, routeProps);
|
|
3138
3252
|
mergedMetadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
|
|
3139
3253
|
mergedMetadata,
|
|
3140
|
-
|
|
3254
|
+
_chunk2C5L5RPMcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
|
|
3141
3255
|
);
|
|
3142
3256
|
const routeSlots = await Promise.all(
|
|
3143
3257
|
slots.map(async (slot) => {
|
|
3144
3258
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
3145
3259
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
3146
3260
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
3147
|
-
), () => (
|
|
3261
|
+
), () => ( _chunk7QVRWGBLcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
3148
3262
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
3149
3263
|
request: targetRequest,
|
|
3150
3264
|
params: slot.params,
|
|
@@ -3190,15 +3304,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3190
3304
|
);
|
|
3191
3305
|
const projectRoot = server.config.root;
|
|
3192
3306
|
const toUrlPath = (absolutePath) => _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
|
|
3193
|
-
const renderPlan =
|
|
3307
|
+
const renderPlan = _chunkUJ3R2AH2cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
3194
3308
|
pageShouldHydrate: shouldHydrate,
|
|
3195
3309
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
3196
3310
|
islandStrategy: hydrationIslandStrategy,
|
|
3197
3311
|
rendering: _chunkX4K7TYN6cjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
3198
3312
|
});
|
|
3199
3313
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
3200
|
-
const layoutStartIndex =
|
|
3201
|
-
|
|
3314
|
+
const layoutStartIndex = _chunkUJ3R2AH2cjs.getSharedLayoutPrefixLength.call(void 0,
|
|
3315
|
+
_chunkUJ3R2AH2cjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
3202
3316
|
destinationLayoutPatterns
|
|
3203
3317
|
);
|
|
3204
3318
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -3208,7 +3322,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3208
3322
|
middlewareContext,
|
|
3209
3323
|
() => renderer.renderNavigationFragment({
|
|
3210
3324
|
PageComponent: routeModule.default,
|
|
3211
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
3325
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _252 => _252.default]),
|
|
3212
3326
|
pageProps: routeProps,
|
|
3213
3327
|
params,
|
|
3214
3328
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -3279,7 +3393,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3279
3393
|
{
|
|
3280
3394
|
status: 200,
|
|
3281
3395
|
headers: {
|
|
3282
|
-
"Cache-Control":
|
|
3396
|
+
"Cache-Control": _chunkUJ3R2AH2cjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
3283
3397
|
"X-Farm-Navigation": "html-fragment",
|
|
3284
3398
|
Vary: "X-Farm-Layout-Chain",
|
|
3285
3399
|
[_chunkE552H232cjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -3316,21 +3430,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3316
3430
|
trustProxy: currentServerConfig.trustProxy
|
|
3317
3431
|
}).pathname;
|
|
3318
3432
|
const routeManager2 = farmApp.getRouteManager();
|
|
3319
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3320
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3321
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3322
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3323
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3324
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3325
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3326
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3433
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _253 => _253.hasHook, 'call', _254 => _254("beforeRouteMatch")]), () => ( false));
|
|
3434
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _255 => _255.hasHook, 'call', _256 => _256("afterRouteMatch")]), () => ( false));
|
|
3435
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _257 => _257.hasHook, 'call', _258 => _258("beforeRequest")]), () => ( false));
|
|
3436
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _259 => _259.hasHook, 'call', _260 => _260("beforeRender")]), () => ( false));
|
|
3437
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _261 => _261.hasHook, 'call', _262 => _262("afterResponse")]), () => ( false));
|
|
3438
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _263 => _263.hasHook, 'call', _264 => _264("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _265 => _265.hasHook, 'call', _266 => _266("afterRender")]), () => ( false)));
|
|
3439
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _267 => _267.hasRuntimeRequestHooks, 'call', _268 => _268()]), () => ( false));
|
|
3440
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _269 => _269.hasRuntimeHook, 'call', _270 => _270("after")]), () => ( false));
|
|
3327
3441
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
3328
3442
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
3329
3443
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
3330
|
-
const mcpLabel =
|
|
3444
|
+
const mcpLabel = _chunkC7DCMGC4cjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
3331
3445
|
if (mcpLabel) return mcpLabel;
|
|
3332
3446
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
3333
|
-
return routePathname ===
|
|
3447
|
+
return routePathname === _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH : null;
|
|
3334
3448
|
};
|
|
3335
3449
|
let runtimeSession;
|
|
3336
3450
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -3339,13 +3453,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3339
3453
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
3340
3454
|
{
|
|
3341
3455
|
kind: "page",
|
|
3342
|
-
route:
|
|
3456
|
+
route: _chunkC7DCMGC4cjs.setFarmRouteLabel.call(void 0,
|
|
3343
3457
|
{
|
|
3344
3458
|
pathname: requestedPathname,
|
|
3345
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3346
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3459
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _271 => _271.route, 'optionalAccess', _272 => _272.pattern]) || null,
|
|
3460
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _273 => _273.params]) || {}
|
|
3347
3461
|
},
|
|
3348
|
-
_optionalChain([requestedMatch, 'optionalAccess',
|
|
3462
|
+
_optionalChain([requestedMatch, 'optionalAccess', _274 => _274.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
|
|
3349
3463
|
)
|
|
3350
3464
|
}
|
|
3351
3465
|
);
|
|
@@ -3378,17 +3492,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3378
3492
|
if (pm && hasAfterRouteMatchHook) {
|
|
3379
3493
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3380
3494
|
pathname,
|
|
3381
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
3382
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3383
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3384
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
3495
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _275 => _275.route]),
|
|
3496
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _276 => _276.route, 'optionalAccess', _277 => _277.pattern]) || null,
|
|
3497
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _278 => _278.params]) || {},
|
|
3498
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _279 => _279.layouts]) || []).map((l) => l.pattern)
|
|
3385
3499
|
});
|
|
3386
3500
|
}
|
|
3387
3501
|
const renderPayload = {
|
|
3388
3502
|
pathname,
|
|
3389
3503
|
method,
|
|
3390
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3391
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3504
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _280 => _280.route, 'optionalAccess', _281 => _281.pattern]) || null,
|
|
3505
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _282 => _282.params]) || {}
|
|
3392
3506
|
};
|
|
3393
3507
|
const shouldInterceptResponse = Boolean(
|
|
3394
3508
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -3410,7 +3524,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3410
3524
|
emitError: (error) => emitPluginError("response-end", error, { pathname })
|
|
3411
3525
|
}) : void 0;
|
|
3412
3526
|
try {
|
|
3413
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3527
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _283 => _283.hasMiddleware, 'call', _284 => _284()])) {
|
|
3414
3528
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3415
3529
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3416
3530
|
farmApp.getServerRenderer(),
|
|
@@ -3420,7 +3534,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3420
3534
|
() => middlewareManager.execute(req, res)
|
|
3421
3535
|
);
|
|
3422
3536
|
if (handled) {
|
|
3423
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3537
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _285 => _285.isEnded, 'call', _286 => _286()])) {
|
|
3424
3538
|
const duration = Date.now() - startTime;
|
|
3425
3539
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3426
3540
|
}
|
|
@@ -3433,14 +3547,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3433
3547
|
req.url || "/",
|
|
3434
3548
|
`http://${req.headers.host || "localhost:3000"}`
|
|
3435
3549
|
).pathname;
|
|
3436
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
3550
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _287 => _287.matchRoute, 'call', _288 => _288(currentPathname), 'optionalAccess', _289 => _289.route]));
|
|
3437
3551
|
await pm.runHookParallelFiltered(
|
|
3438
3552
|
"beforeRequest",
|
|
3439
3553
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3440
3554
|
req,
|
|
3441
3555
|
res
|
|
3442
3556
|
);
|
|
3443
|
-
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access',
|
|
3557
|
+
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _290 => _290.url, 'optionalAccess', _291 => _291.startsWith, 'call', _292 => _292("/")]) && !res.writableEnded) {
|
|
3444
3558
|
const destinationUrl = new URL(req.url, fullUrl);
|
|
3445
3559
|
const destinationMatch = routeManager2.matchRoute(destinationUrl.pathname);
|
|
3446
3560
|
const guarded = await pm.runRuntimeBeforeForRewrite(
|
|
@@ -3450,8 +3564,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3450
3564
|
kind: "page",
|
|
3451
3565
|
route: {
|
|
3452
3566
|
pathname: destinationUrl.pathname,
|
|
3453
|
-
pattern: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3454
|
-
params: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3567
|
+
pattern: _optionalChain([destinationMatch, 'optionalAccess', _293 => _293.route, 'optionalAccess', _294 => _294.pattern]) || null,
|
|
3568
|
+
params: _optionalChain([destinationMatch, 'optionalAccess', _295 => _295.params]) || {}
|
|
3455
3569
|
}
|
|
3456
3570
|
}
|
|
3457
3571
|
);
|
|
@@ -3463,8 +3577,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3463
3577
|
}
|
|
3464
3578
|
}
|
|
3465
3579
|
}
|
|
3466
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
3467
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3580
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _296 => _296.isEnded, 'call', _297 => _297()]) || await proxyFarmExternalRewrite(req, res, currentServerConfig.bodySizeLimit)) {
|
|
3581
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _298 => _298.isEnded, 'call', _299 => _299()])) {
|
|
3468
3582
|
const duration = Date.now() - startTime;
|
|
3469
3583
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3470
3584
|
}
|
|
@@ -3528,8 +3642,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3528
3642
|
if (imageModule) return imageModule;
|
|
3529
3643
|
}
|
|
3530
3644
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
3531
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
3532
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
3645
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _300 => _300.getConfig, 'call', _301 => _301(), 'access', _302 => _302.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3646
|
+
const root = _optionalChain([server, 'optionalAccess', _303 => _303.config, 'access', _304 => _304.root]) || options.root;
|
|
3533
3647
|
if (isClientEnvironment(this, loadOptions)) {
|
|
3534
3648
|
return generateProgrammaticClientRouteModuleForId(
|
|
3535
3649
|
id,
|
|
@@ -3545,32 +3659,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3545
3659
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
3546
3660
|
}
|
|
3547
3661
|
if (isFarmClientVirtualId(id)) {
|
|
3548
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
3549
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3550
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3551
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3552
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3662
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _305 => _305.getConfig, 'call', _306 => _306()]);
|
|
3663
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _307 => _307.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3664
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _308 => _308.integrations]) || options.integrations;
|
|
3665
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _309 => _309.root]) || _optionalChain([server, 'optionalAccess', _310 => _310.config, 'access', _311 => _311.root]) || process.cwd();
|
|
3666
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _312 => _312.docs]);
|
|
3553
3667
|
const adapterOwnsDocsRuntime = Boolean(
|
|
3554
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
3668
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _313 => _313.adapter, 'optionalAccess', _314 => _314.server]) && docs.adapter.react
|
|
3555
3669
|
);
|
|
3556
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3670
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _315 => _315.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
3557
3671
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
3558
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3559
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3672
|
+
_optionalChain([docs, 'optionalAccess', _316 => _316.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
3673
|
+
_optionalChain([docs, 'optionalAccess', _317 => _317.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
3560
3674
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
3561
3675
|
]);
|
|
3562
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
3676
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _318 => _318.isFarmDocsSearchEnabled, 'call', _319 => _319(docs)]), () => ( false));
|
|
3563
3677
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
3564
3678
|
docsSearchEnabled,
|
|
3565
3679
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
3566
3680
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
3567
3681
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
3568
|
-
const generatedDevIndicatorsClientRuntime = farmApp ?
|
|
3682
|
+
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
3569
3683
|
const integrationProviders = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
3570
|
-
const isolatedHydrationMode =
|
|
3571
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3684
|
+
const isolatedHydrationMode = _chunk7QVRWGBLcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3685
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _320 => _320.experimental, 'optionalAccess', _321 => _321.isolatedClientHydration]),
|
|
3572
3686
|
{
|
|
3573
|
-
serverComponents:
|
|
3687
|
+
serverComponents: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _322 => _322.experimental, 'optionalAccess', _323 => _323.serverComponents])) === "rsc",
|
|
3574
3688
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
3575
3689
|
}
|
|
3576
3690
|
);
|
|
@@ -3578,32 +3692,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3578
3692
|
integrationProviders,
|
|
3579
3693
|
[
|
|
3580
3694
|
..._chunkI32V5CZLcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
3581
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
3695
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _324 => _324.getFarmDocsDocumentNavigationMatchers, 'call', _325 => _325(docs)]), () => ( []))
|
|
3582
3696
|
],
|
|
3583
3697
|
generatedDocsSearchRuntime,
|
|
3584
3698
|
`${generatedDevtoolsClientRuntime}
|
|
3585
3699
|
${generatedDevIndicatorsClientRuntime}`,
|
|
3586
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3700
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _326 => _326.plugins]) || [],
|
|
3587
3701
|
root,
|
|
3588
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3589
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3590
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
3702
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _327 => _327.srcDir]) || options.srcDir || "src",
|
|
3703
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _328 => _328.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
3704
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _329 => _329.adapter, 'optionalAccess', _330 => _330.react]) : void 0,
|
|
3591
3705
|
renderer,
|
|
3592
|
-
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3593
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3594
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3595
|
-
|
|
3596
|
-
|
|
3706
|
+
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _331 => _331.getRouteManager, 'call', _332 => _332(), 'access', _333 => _333.getIsolatedClientBoundaryModules, 'call', _334 => _334(root)])))), 'optionalAccess', _335 => _335.size]) > 0,
|
|
3707
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _336 => _336.trailingSlash]), () => ( false)),
|
|
3708
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _337 => _337.basePath]), () => ( "/")),
|
|
3709
|
+
_chunk3KJPIO5Dcjs.generateClientCachePersistenceCode.call(void 0,
|
|
3710
|
+
_chunk3KJPIO5Dcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _338 => _338.cache]))
|
|
3597
3711
|
),
|
|
3598
3712
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
3599
|
-
|
|
3713
|
+
_chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _339 => _339.experimental, 'optionalAccess', _340 => _340.serverComponents])) === "islands"
|
|
3600
3714
|
);
|
|
3601
3715
|
}
|
|
3602
3716
|
if (id === "/@farm/server") {
|
|
3603
3717
|
return generateServerCode();
|
|
3604
3718
|
}
|
|
3605
3719
|
if (id === "/@farm/manifest") {
|
|
3606
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3720
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _341 => _341.getRouteManager, 'call', _342 => _342()]);
|
|
3607
3721
|
if (!routeManager) {
|
|
3608
3722
|
return `
|
|
3609
3723
|
export const getManifest = () => ({
|
|
@@ -3616,9 +3730,9 @@ export const getManifest = () => ({
|
|
|
3616
3730
|
`;
|
|
3617
3731
|
}
|
|
3618
3732
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
3619
|
-
const globalStylesheetHref =
|
|
3733
|
+
const globalStylesheetHref = _chunk3KJPIO5Dcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
3620
3734
|
server.config.root,
|
|
3621
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3735
|
+
_optionalChain([farmApp, 'optionalAccess', _343 => _343.getConfig, 'call', _344 => _344(), 'access', _345 => _345.srcDir])
|
|
3622
3736
|
);
|
|
3623
3737
|
const fullManifest = {
|
|
3624
3738
|
clientEntry: "/@farm/client.js",
|
|
@@ -3644,11 +3758,11 @@ export const getManifest = () => ({
|
|
|
3644
3758
|
};
|
|
3645
3759
|
}
|
|
3646
3760
|
for (const layout of manifest.layouts) {
|
|
3647
|
-
const groupScope =
|
|
3761
|
+
const groupScope = _chunkUJ3R2AH2cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3648
3762
|
fullManifest.layouts[layout.pattern] = {
|
|
3649
3763
|
modulePath: layout.modulePath,
|
|
3650
3764
|
pattern: layout.pattern,
|
|
3651
|
-
...groupScope ? { urlPattern:
|
|
3765
|
+
...groupScope ? { urlPattern: _chunkUJ3R2AH2cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
3652
3766
|
shouldHydrate: layout.shouldHydrate,
|
|
3653
3767
|
islandStrategy: layout.islandStrategy,
|
|
3654
3768
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -3674,24 +3788,24 @@ export const manifest = getManifest();
|
|
|
3674
3788
|
}
|
|
3675
3789
|
},
|
|
3676
3790
|
async transform(code, id, transformOptions) {
|
|
3677
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3791
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _346 => _346.getConfig, 'call', _347 => _347()]), () => ( options));
|
|
3678
3792
|
let rewrotePackageImports = false;
|
|
3679
|
-
if (
|
|
3793
|
+
if (_chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _348 => _348.experimental, 'optionalAccess', _349 => _349.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _350 => _350.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunk7QVRWGBLcjs.hasUseClientDirective.call(void 0, code)) {
|
|
3680
3794
|
const file = id.split("?", 1)[0];
|
|
3681
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3682
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3795
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _351 => _351.config, 'access', _352 => _352.root]) || process.cwd();
|
|
3796
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _353 => _353.ssr]) === true) {
|
|
3683
3797
|
if (farmReactServerFiles.has(file)) {
|
|
3684
|
-
for (const child of
|
|
3798
|
+
for (const child of _chunk7QVRWGBLcjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
3685
3799
|
farmReactServerFiles.add(child);
|
|
3686
3800
|
}
|
|
3687
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
3801
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunk7QVRWGBLcjs.getFarmClientReachableModules.call(void 0,
|
|
3688
3802
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
3689
3803
|
projectRoot
|
|
3690
3804
|
).has(path6.resolve(file));
|
|
3691
|
-
const reactServer = !serverModule ? null :
|
|
3805
|
+
const reactServer = !serverModule ? null : _chunk7QVRWGBLcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
3692
3806
|
code,
|
|
3693
3807
|
file,
|
|
3694
|
-
reference: (specifier, exportName) =>
|
|
3808
|
+
reference: (specifier, exportName) => _chunk7QVRWGBLcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName),
|
|
3695
3809
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
3696
3810
|
});
|
|
3697
3811
|
if (reactServer !== null) {
|
|
@@ -3699,17 +3813,17 @@ export const manifest = getManifest();
|
|
|
3699
3813
|
rewrotePackageImports = true;
|
|
3700
3814
|
}
|
|
3701
3815
|
}
|
|
3702
|
-
const referenced =
|
|
3816
|
+
const referenced = _chunk7QVRWGBLcjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
3703
3817
|
code,
|
|
3704
3818
|
file,
|
|
3705
3819
|
root: projectRoot,
|
|
3706
|
-
isClientPackage: (specifier) =>
|
|
3820
|
+
isClientPackage: (specifier) => _chunk7QVRWGBLcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
3707
3821
|
});
|
|
3708
3822
|
if (referenced !== null) {
|
|
3709
3823
|
code = referenced;
|
|
3710
3824
|
rewrotePackageImports = true;
|
|
3711
3825
|
}
|
|
3712
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3826
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _354 => _354.ssr]) === true) {
|
|
3713
3827
|
const cached = rewriteFarmReactCacheImport(code, file);
|
|
3714
3828
|
if (cached !== null) {
|
|
3715
3829
|
code = cached;
|
|
@@ -3719,43 +3833,43 @@ export const manifest = getManifest();
|
|
|
3719
3833
|
}
|
|
3720
3834
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3721
3835
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
3722
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
3836
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _355 => _355.ssr]) === true ? "rsc" : "client"
|
|
3723
3837
|
});
|
|
3724
3838
|
if (serverFns) {
|
|
3725
3839
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
3726
3840
|
code = serverFns.code;
|
|
3727
3841
|
}
|
|
3728
3842
|
}
|
|
3729
|
-
if (
|
|
3843
|
+
if (_chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _356 => _356.experimental, 'optionalAccess', _357 => _357.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3730
3844
|
const file = id.split("?", 1)[0];
|
|
3731
3845
|
const actionModule = transformFarmFormActionModule({
|
|
3732
3846
|
code,
|
|
3733
3847
|
id,
|
|
3734
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3735
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
3848
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _358 => _358.config, 'access', _359 => _359.root]) || process.cwd(),
|
|
3849
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _360 => _360.ssr]) === true,
|
|
3736
3850
|
// Parsed by file type: page components are TSX.
|
|
3737
3851
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program
|
|
3738
3852
|
});
|
|
3739
3853
|
if (actionModule) return { code: actionModule, map: null };
|
|
3740
3854
|
}
|
|
3741
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3742
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
3743
|
-
if (
|
|
3744
|
-
const redacted =
|
|
3855
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _361 => _361.ssr])) {
|
|
3856
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _362 => _362.getConfig, 'call', _363 => _363(), 'optionalAccess', _364 => _364.docs]));
|
|
3857
|
+
if (_chunk3KJPIO5Dcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
3858
|
+
const redacted = _chunk3KJPIO5Dcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
3745
3859
|
if (redacted !== null) return { code: redacted, map: null };
|
|
3746
3860
|
}
|
|
3747
3861
|
}
|
|
3748
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3749
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3750
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
3862
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _365 => _365.ssr])) {
|
|
3863
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _366 => _366.getConfig, 'call', _367 => _367()]), () => ( options));
|
|
3864
|
+
if ((_optionalChain([currentConfig, 'access', _368 => _368.experimental, 'optionalAccess', _369 => _369.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
3751
3865
|
const violation = findClientServerFnViolation(code, id);
|
|
3752
3866
|
if (violation) {
|
|
3753
3867
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
3754
3868
|
}
|
|
3755
3869
|
}
|
|
3756
3870
|
}
|
|
3757
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3758
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3871
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _370 => _370.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
3872
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _371 => _371.getConfig, 'call', _372 => _372()]), () => ( options)));
|
|
3759
3873
|
}
|
|
3760
3874
|
if (typeof imageImports.transform === "function") {
|
|
3761
3875
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -3770,13 +3884,13 @@ export const manifest = getManifest();
|
|
|
3770
3884
|
id,
|
|
3771
3885
|
transformOptions
|
|
3772
3886
|
);
|
|
3773
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
3887
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _373 => _373.code, 'optionalAccess', _374 => _374.toString, 'call', _375 => _375()]);
|
|
3774
3888
|
if (fontCode) {
|
|
3775
3889
|
transformedCode = fontCode;
|
|
3776
3890
|
transformed = true;
|
|
3777
3891
|
}
|
|
3778
3892
|
}
|
|
3779
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3893
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _376 => _376.ssr]) && server) {
|
|
3780
3894
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
3781
3895
|
code: transformedCode,
|
|
3782
3896
|
id,
|
|
@@ -3788,25 +3902,26 @@ export const manifest = getManifest();
|
|
|
3788
3902
|
transformed = true;
|
|
3789
3903
|
}
|
|
3790
3904
|
}
|
|
3791
|
-
if (
|
|
3905
|
+
if (_chunk7QVRWGBLcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
3792
3906
|
const clientBoundarySource = transformedCode;
|
|
3793
3907
|
const moduleInfo = this.getModuleInfo(id);
|
|
3794
3908
|
if (moduleInfo) {
|
|
3795
3909
|
moduleInfo.isClientComponent = true;
|
|
3796
3910
|
}
|
|
3797
|
-
transformedCode =
|
|
3911
|
+
transformedCode = _chunk7QVRWGBLcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
3798
3912
|
transformed = true;
|
|
3799
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3913
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _377 => _377.getConfig, 'call', _378 => _378()]), () => ( options));
|
|
3800
3914
|
let isolatedModuleReference = null;
|
|
3801
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3915
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _379 => _379.config, 'access', _380 => _380.root]) || process.cwd();
|
|
3802
3916
|
const cleanId = id.split("?", 1)[0];
|
|
3803
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3804
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
3805
|
-
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration &&
|
|
3917
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _381 => _381.getRouteManager, 'call', _382 => _382(), 'access', _383 => _383.getIsolatedClientBoundaryModules, 'call', _384 => _384(root)])));
|
|
3918
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _385 => _385.has, 'call', _386 => _386(path6.resolve(cleanId))]) === true;
|
|
3919
|
+
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunk7QVRWGBLcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
3920
|
+
cleanId.replace(/\\/g, "/").includes(_chunk7QVRWGBLcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
3806
3921
|
isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
|
|
3807
|
-
const islandsMode =
|
|
3808
|
-
const explicitStrategy =
|
|
3809
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
3922
|
+
const islandsMode = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _387 => _387.experimental, 'optionalAccess', _388 => _388.serverComponents])) === "islands";
|
|
3923
|
+
const explicitStrategy = _chunk7QVRWGBLcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
3924
|
+
const inference = islandsMode && explicitStrategy === null ? _chunk3KJPIO5Dcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
3810
3925
|
if (inference) {
|
|
3811
3926
|
for (const file of inference.files) {
|
|
3812
3927
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -3819,7 +3934,7 @@ export const manifest = getManifest();
|
|
|
3819
3934
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
3820
3935
|
parse: (source) => this.parse(source),
|
|
3821
3936
|
slots: islandsMode,
|
|
3822
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
3937
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _389 => _389.strategy]) === "interaction"
|
|
3823
3938
|
});
|
|
3824
3939
|
if (!transformedBoundary) {
|
|
3825
3940
|
this.error(
|
|
@@ -3849,7 +3964,7 @@ export const manifest = getManifest();
|
|
|
3849
3964
|
);
|
|
3850
3965
|
return;
|
|
3851
3966
|
}` : "";
|
|
3852
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
3967
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _390 => _390.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
3853
3968
|
if (import.meta.hot) {
|
|
3854
3969
|
import.meta.hot.accept((newModule) => {
|
|
3855
3970
|
${isolatedHmrUpdate}
|
|
@@ -3904,14 +4019,14 @@ if (import.meta.hot) {
|
|
|
3904
4019
|
}
|
|
3905
4020
|
_chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
3906
4021
|
_chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
|
|
3907
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
4022
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _391 => _391.config, 'access', _392 => _392.root]) || process.cwd(), options.outDir || "dist");
|
|
3908
4023
|
const clientDir = path6.join(outDir, "client");
|
|
3909
4024
|
for (const page of ssgPages) {
|
|
3910
4025
|
try {
|
|
3911
4026
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
3912
4027
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
3913
4028
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
3914
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
4029
|
+
if (!_optionalChain([mod, 'optionalAccess', _393 => _393.default])) return;
|
|
3915
4030
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
3916
4031
|
const layoutModules = await Promise.all(
|
|
3917
4032
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -3943,7 +4058,7 @@ if (import.meta.hot) {
|
|
|
3943
4058
|
const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
3944
4059
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
3945
4060
|
const fullHtml = `<!DOCTYPE html>
|
|
3946
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
4061
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _394 => _394.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
3947
4062
|
<head>
|
|
3948
4063
|
<meta charset="utf-8">
|
|
3949
4064
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -3986,7 +4101,8 @@ if (import.meta.hot) {
|
|
|
3986
4101
|
}
|
|
3987
4102
|
},
|
|
3988
4103
|
watchChange() {
|
|
3989
|
-
|
|
4104
|
+
_chunk7QVRWGBLcjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
4105
|
+
_chunk7QVRWGBLcjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
3990
4106
|
},
|
|
3991
4107
|
async handleHotUpdate(ctx) {
|
|
3992
4108
|
const { file, server: server2, modules } = ctx;
|
|
@@ -4010,13 +4126,13 @@ if (import.meta.hot) {
|
|
|
4010
4126
|
server2.moduleGraph.invalidateModule(mod);
|
|
4011
4127
|
}
|
|
4012
4128
|
}
|
|
4013
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4129
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _395 => _395.getConfig, 'call', _396 => _396()]);
|
|
4014
4130
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
4015
4131
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
4016
4132
|
(appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
4017
4133
|
)) {
|
|
4018
4134
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
4019
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4135
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _397 => _397(`updated ${file}`)]);
|
|
4020
4136
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
4021
4137
|
return [];
|
|
4022
4138
|
}
|
|
@@ -4026,7 +4142,7 @@ if (import.meta.hot) {
|
|
|
4026
4142
|
for (const mod of modules) {
|
|
4027
4143
|
server2.moduleGraph.invalidateModule(mod);
|
|
4028
4144
|
}
|
|
4029
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4145
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _398 => _398(`updated ${file}`)]);
|
|
4030
4146
|
server2.ws.send({
|
|
4031
4147
|
type: "full-reload",
|
|
4032
4148
|
path: "*"
|
|
@@ -4039,7 +4155,7 @@ if (import.meta.hot) {
|
|
|
4039
4155
|
for (const mod of modules) {
|
|
4040
4156
|
server2.moduleGraph.invalidateModule(mod);
|
|
4041
4157
|
}
|
|
4042
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4158
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _399 => _399(`updated ${file}`)]);
|
|
4043
4159
|
server2.ws.send({
|
|
4044
4160
|
type: "full-reload",
|
|
4045
4161
|
path: "*"
|
|
@@ -4047,12 +4163,12 @@ if (import.meta.hot) {
|
|
|
4047
4163
|
return [];
|
|
4048
4164
|
}
|
|
4049
4165
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
4050
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4166
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _400 => _400(`updated ${file}`)]);
|
|
4051
4167
|
}
|
|
4052
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4053
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4168
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _401 => _401.experimental, 'optionalAccess', _402 => _402.isolatedClientHydration]);
|
|
4169
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _403 => _403.getRouteManager, 'call', _404 => _404()]);
|
|
4054
4170
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
4055
|
-
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4171
|
+
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _405 => _405.renderer])) && planRouteManager !== void 0;
|
|
4056
4172
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
4057
4173
|
const routeManager = planRouteManager;
|
|
4058
4174
|
if (routeManager) {
|
|
@@ -4112,7 +4228,7 @@ if (import.meta.hot) {
|
|
|
4112
4228
|
}
|
|
4113
4229
|
return [];
|
|
4114
4230
|
}
|
|
4115
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4231
|
+
_optionalChain([farmApp, 'optionalAccess', _406 => _406.getRouteManager, 'call', _407 => _407(), 'access', _408 => _408.invalidateClientManifest, 'call', _409 => _409()]);
|
|
4116
4232
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
4117
4233
|
if (manifestModule) {
|
|
4118
4234
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -4158,7 +4274,7 @@ function resolveDevelopmentRoot(farmRoot, viteRoot) {
|
|
|
4158
4274
|
if (fs2.realpathSync(farmRoot) === fs2.realpathSync(viteRoot)) {
|
|
4159
4275
|
return path6.resolve(viteRoot);
|
|
4160
4276
|
}
|
|
4161
|
-
} catch (
|
|
4277
|
+
} catch (e18) {
|
|
4162
4278
|
}
|
|
4163
4279
|
return farmRoot;
|
|
4164
4280
|
}
|
|
@@ -4177,12 +4293,12 @@ function isFarmClientVirtualId(id) {
|
|
|
4177
4293
|
}
|
|
4178
4294
|
function isClientEnvironment(context, loadOptions) {
|
|
4179
4295
|
const environment = context.environment;
|
|
4180
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4181
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4182
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
4296
|
+
if (_optionalChain([environment, 'optionalAccess', _410 => _410.config, 'optionalAccess', _411 => _411.consumer])) return environment.config.consumer === "client";
|
|
4297
|
+
if (_optionalChain([environment, 'optionalAccess', _412 => _412.name])) return environment.name === "client";
|
|
4298
|
+
return _optionalChain([loadOptions, 'optionalAccess', _413 => _413.ssr]) !== true;
|
|
4183
4299
|
}
|
|
4184
4300
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
4185
|
-
const graph = _optionalChain([server, 'access',
|
|
4301
|
+
const graph = _optionalChain([server, 'access', _414 => _414.environments, 'optionalAccess', _415 => _415.client, 'optionalAccess', _416 => _416.moduleGraph]);
|
|
4186
4302
|
if (!graph) return;
|
|
4187
4303
|
for (const [id, module] of graph.idToModuleMap) {
|
|
4188
4304
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -4192,22 +4308,22 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
4192
4308
|
const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
4193
4309
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
4194
4310
|
watchFile(routesFile);
|
|
4195
|
-
return
|
|
4311
|
+
return _chunk7QVRWGBLcjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
4196
4312
|
kind: parsed.kind,
|
|
4197
4313
|
routePath: parsed.routePath,
|
|
4198
4314
|
routesFile,
|
|
4199
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
4200
|
-
|
|
4315
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _417 => _417.routes, 'access', _418 => _418.get, 'call', _419 => _419(
|
|
4316
|
+
_chunk7QVRWGBLcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
4201
4317
|
)]),
|
|
4202
4318
|
rendererServer: renderer.server,
|
|
4203
4319
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
4204
4320
|
});
|
|
4205
4321
|
}
|
|
4206
4322
|
function resolveRealModuleFile(filePath, root) {
|
|
4207
|
-
const resolved = _nullishCoalesce(
|
|
4323
|
+
const resolved = _nullishCoalesce(_chunk7QVRWGBLcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
4208
4324
|
try {
|
|
4209
4325
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
4210
|
-
} catch (
|
|
4326
|
+
} catch (e19) {
|
|
4211
4327
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, resolved);
|
|
4212
4328
|
}
|
|
4213
4329
|
}
|
|
@@ -4518,12 +4634,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4518
4634
|
}
|
|
4519
4635
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4520
4636
|
const params = parseRouteModuleSchema(
|
|
4521
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4637
|
+
_optionalChain([schemas, 'optionalAccess', _420 => _420.params]),
|
|
4522
4638
|
input.props.params,
|
|
4523
4639
|
"params",
|
|
4524
4640
|
input.routePath
|
|
4525
4641
|
);
|
|
4526
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4642
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _421 => _421.search]), input.search, "search", input.routePath);
|
|
4527
4643
|
return {
|
|
4528
4644
|
...input.props,
|
|
4529
4645
|
params,
|
|
@@ -4543,12 +4659,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
4543
4659
|
}
|
|
4544
4660
|
}
|
|
4545
4661
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkRD623KW4cjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
4546
|
-
const providerClientCode =
|
|
4662
|
+
const providerClientCode = _chunk3KJPIO5Dcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4547
4663
|
integrationProviders,
|
|
4548
4664
|
root,
|
|
4549
4665
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
4550
4666
|
);
|
|
4551
|
-
const clientPluginEntry =
|
|
4667
|
+
const clientPluginEntry = _chunk3KJPIO5Dcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4552
4668
|
plugins,
|
|
4553
4669
|
root,
|
|
4554
4670
|
srcDir,
|
|
@@ -4596,7 +4712,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
4596
4712
|
return null;
|
|
4597
4713
|
}
|
|
4598
4714
|
}
|
|
4599
|
-
${islandValues ? `${
|
|
4715
|
+
${islandValues ? `${_chunk3KJPIO5Dcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4600
4716
|
let farmLastRouteState = null;
|
|
4601
4717
|
|
|
4602
4718
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -5407,7 +5523,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
5407
5523
|
return loadedLayouts;
|
|
5408
5524
|
}
|
|
5409
5525
|
|
|
5410
|
-
${
|
|
5526
|
+
${_chunk3KJPIO5Dcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5411
5527
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
5412
5528
|
let wrapped = element;
|
|
5413
5529
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -5764,7 +5880,7 @@ function replaceNavigationBoundary(
|
|
|
5764
5880
|
return nextTarget;
|
|
5765
5881
|
}
|
|
5766
5882
|
|
|
5767
|
-
${islandValues ? `${
|
|
5883
|
+
${islandValues ? `${_chunk3KJPIO5Dcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
5768
5884
|
|
|
5769
5885
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
5770
5886
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -6448,7 +6564,7 @@ function generateClientManifest(bundle) {
|
|
|
6448
6564
|
async function defineConfig(config = {}) {
|
|
6449
6565
|
const tailwindVitePlugin = await _chunkR53QDV6Tcjs.loadTailwindVitePlugin.call(void 0, );
|
|
6450
6566
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
6451
|
-
if (_optionalChain([config, 'access',
|
|
6567
|
+
if (_optionalChain([config, 'access', _422 => _422.extends, 'optionalAccess', _423 => _423.length])) {
|
|
6452
6568
|
const { config: layeredConfig } = await import("./layers-DMRXRL7F.cjs").then(
|
|
6453
6569
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
6454
6570
|
root: appRoot,
|
|
@@ -6458,7 +6574,7 @@ async function defineConfig(config = {}) {
|
|
|
6458
6574
|
config = layeredConfig;
|
|
6459
6575
|
}
|
|
6460
6576
|
config.renderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
6461
|
-
config.images =
|
|
6577
|
+
config.images = _chunk3KJPIO5Dcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
6462
6578
|
const rendererVitePlugins = await _chunkRD623KW4cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
6463
6579
|
ssr: true
|
|
6464
6580
|
});
|
|
@@ -6550,13 +6666,13 @@ async function defineConfig(config = {}) {
|
|
|
6550
6666
|
if (!serverStarted) {
|
|
6551
6667
|
serverStarted = true;
|
|
6552
6668
|
const elapsed = Date.now() - startTime;
|
|
6553
|
-
const address = _optionalChain([server, 'access',
|
|
6669
|
+
const address = _optionalChain([server, 'access', _424 => _424.httpServer, 'optionalAccess', _425 => _425.address, 'call', _426 => _426()]);
|
|
6554
6670
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
6555
6671
|
const hostConfig = server.config.server.host;
|
|
6556
6672
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
6557
6673
|
console.log("");
|
|
6558
6674
|
console.log(
|
|
6559
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
6675
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkA3G5IY2Wcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
6560
6676
|
);
|
|
6561
6677
|
console.log("");
|
|
6562
6678
|
console.log(
|
|
@@ -6590,7 +6706,7 @@ async function defineConfig(config = {}) {
|
|
|
6590
6706
|
plugins: [
|
|
6591
6707
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
6592
6708
|
_chunk65Y5SIBHcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
6593
|
-
|
|
6709
|
+
_chunk3KJPIO5Dcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6594
6710
|
tailwindVitePlugin,
|
|
6595
6711
|
...rendererVitePlugins,
|
|
6596
6712
|
...reactRefreshPlugins,
|
|
@@ -6598,14 +6714,14 @@ async function defineConfig(config = {}) {
|
|
|
6598
6714
|
farmI18nClientBridgePlugin(),
|
|
6599
6715
|
farmServerOnlyEntriesPlugin(),
|
|
6600
6716
|
farmPlugin(config),
|
|
6601
|
-
|
|
6717
|
+
_chunk7QVRWGBLcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
6602
6718
|
farmBrandingPlugin
|
|
6603
6719
|
],
|
|
6604
6720
|
customLogger: farmLogger,
|
|
6605
6721
|
clearScreen: false,
|
|
6606
6722
|
optimizeDeps: {
|
|
6607
|
-
...
|
|
6608
|
-
|
|
6723
|
+
..._chunk3KJPIO5Dcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
6724
|
+
_chunk3KJPIO5Dcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
6609
6725
|
appRoot,
|
|
6610
6726
|
_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
6611
6727
|
),
|
|
@@ -6648,7 +6764,7 @@ async function defineConfig(config = {}) {
|
|
|
6648
6764
|
// Stub out problematic server-only modules during dev mode
|
|
6649
6765
|
alias: {
|
|
6650
6766
|
..._chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
6651
|
-
...
|
|
6767
|
+
..._chunk3KJPIO5Dcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
6652
6768
|
// Nitro internals that should not be resolved in browser
|
|
6653
6769
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
6654
6770
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|