@farm.js/core 0.1.67 → 0.1.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-Uh5xr7aX.d.ts} +1 -1
- package/dist/{agent-mcp.d-DWyWkTSy.d.mts → agent-mcp.d-wkVPK1GA.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +5 -3
- package/dist/agent-runtime.d.ts +5 -3
- package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-CQDU7E3Y.mjs} +2 -2
- package/dist/analyzer-PPAHM4AW.cjs +16 -0
- package/dist/api/node.d.mts +7 -5
- package/dist/api/node.d.ts +7 -5
- package/dist/api/route-manager.d.mts +7 -5
- package/dist/api/route-manager.d.ts +7 -5
- package/dist/api/runtime.d.mts +6 -4
- package/dist/api/runtime.d.ts +6 -4
- package/dist/api.d.mts +8 -6
- package/dist/api.d.ts +8 -6
- package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-BT5i2F-o.d.ts} +1 -1
- package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-Dd4q5CFx.d.mts} +1 -1
- package/dist/app-markdown.cjs +3 -3
- package/dist/app-markdown.d.mts +10 -10
- package/dist/app-markdown.d.ts +10 -10
- package/dist/app-markdown.mjs +2 -2
- package/dist/{app.d-BX9LVTiP.d.ts → app.d-BVOpL_f2.d.ts} +6 -6
- package/dist/{app.d-uBBUxwyV.d.mts → app.d-BhiDXex_.d.mts} +6 -6
- package/dist/{chunk-23PVOIPT.cjs → chunk-225APHKC.cjs} +3 -3
- package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
- package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
- package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
- package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
- package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
- package/dist/{chunk-WGHY3OL5.mjs → chunk-4UAQB5LB.mjs} +232 -49
- package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
- package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
- package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
- package/dist/{chunk-PL6RTBDE.cjs → chunk-5JKDFRTK.cjs} +2 -2
- package/dist/{chunk-CO3YMZFD.mjs → chunk-6OFOIMNS.mjs} +1 -1
- package/dist/{chunk-556H7JCE.cjs → chunk-7LK5CTUM.cjs} +14 -14
- package/dist/{chunk-E6CD45JK.mjs → chunk-A3T445WK.mjs} +19 -5
- package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
- package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
- package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
- package/dist/{chunk-XNZWMXCF.mjs → chunk-DIXFKAPM.mjs} +183 -76
- package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
- package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
- package/dist/{chunk-N5DQMOAG.cjs → chunk-F36LS2C7.cjs} +273 -90
- package/dist/{chunk-H37MDCPR.mjs → chunk-F6CMGWAL.mjs} +1 -1
- package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
- package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
- package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
- package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
- package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
- package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
- package/dist/chunk-HHLEYA4B.cjs +17 -0
- package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
- package/dist/chunk-ICFPTHXM.mjs +97 -0
- package/dist/{chunk-6V5YWI4W.cjs → chunk-IGDYL2IA.cjs} +2 -2
- package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
- package/dist/{chunk-JVM3DKZE.mjs → chunk-KDO6T6OB.mjs} +1 -1
- package/dist/{chunk-QITSS4TD.cjs → chunk-KWCZKJYU.cjs} +352 -245
- package/dist/{chunk-DCXSIEFE.cjs → chunk-LDEXTX4I.cjs} +51 -37
- package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
- package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
- package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
- package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
- package/dist/{chunk-HP2DQGQH.mjs → chunk-MNJDNTGO.mjs} +1 -1
- package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
- package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
- package/dist/{chunk-4DRINDGN.cjs → chunk-MZ4CRSY7.cjs} +254 -125
- package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
- package/dist/{chunk-WDD5CTZW.mjs → chunk-NT4W4H52.mjs} +6 -6
- package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
- package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
- package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
- package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
- package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
- package/dist/chunk-QYNZ3CTI.mjs +17 -0
- package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
- package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
- package/dist/{chunk-HM7AGSKU.cjs → chunk-SQ6IWJ3H.cjs} +1 -1
- package/dist/{chunk-V5MQMQ2P.mjs → chunk-T5XFZQCL.mjs} +1 -1
- package/dist/{chunk-Q5UX55YA.cjs → chunk-TNK2TVRS.cjs} +831 -470
- package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
- package/dist/{chunk-V5RTHYJB.cjs → chunk-URN7VFO7.cjs} +91 -22
- package/dist/{chunk-HRPTMX5C.mjs → chunk-VFNAK6A5.mjs} +2 -2
- package/dist/{chunk-VK54PDQ6.mjs → chunk-VRGY3X2I.mjs} +86 -17
- package/dist/chunk-W44X6IC2.cjs +97 -0
- package/dist/{chunk-GTV2ABO7.mjs → chunk-WPB67LE5.mjs} +162 -33
- package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
- package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
- package/dist/{chunk-LPIZMU7D.cjs → chunk-YTNBCXCW.cjs} +4 -4
- package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
- package/dist/{chunk-6R53ZWX2.cjs → chunk-Z3PW3DIR.cjs} +3 -3
- package/dist/{chunk-UHNSY2PQ.mjs → chunk-Z6SOXHAD.mjs} +772 -411
- package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
- package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-BvQOxSqh.d.mts} +2 -2
- package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-DNVSLEPi.d.ts} +2 -2
- package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-CE1lVK2R.d.mts} +23 -234
- package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-CNDqcAuf.d.ts} +23 -234
- package/dist/client-plugins.d.mts +5 -3
- package/dist/client-plugins.d.ts +5 -3
- package/dist/client.cjs +6 -6
- package/dist/client.d.mts +10 -8
- package/dist/client.d.ts +10 -8
- package/dist/client.mjs +5 -5
- package/dist/config.d.mts +5 -3
- package/dist/config.d.ts +5 -3
- package/dist/deployment.cjs +4 -2
- package/dist/deployment.d.mts +15 -1
- package/dist/deployment.d.ts +15 -1
- package/dist/deployment.mjs +3 -1
- package/dist/desktop.d.mts +6 -4
- package/dist/desktop.d.ts +6 -4
- package/dist/{devtools-UFQYT3VA.mjs → devtools-2A2GPC7B.mjs} +6 -6
- package/dist/{devtools-RZVT4JVN.cjs → devtools-R27T3BRY.cjs} +7 -7
- package/dist/docs.cjs +9 -9
- package/dist/docs.d.mts +6 -4
- package/dist/docs.d.ts +6 -4
- package/dist/docs.mjs +8 -8
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/environment/vite.mjs +4 -4
- package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
- package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
- package/dist/index.cjs +41 -36
- package/dist/{index.d-Bdm6866n.d.mts → index.d-Bt3kl19W.d.mts} +1 -1
- package/dist/{index.d-Dey5T14f.d.ts → index.d-Cx_-DaKV.d.ts} +1 -1
- package/dist/index.d.mts +25 -22
- package/dist/index.d.ts +25 -22
- package/dist/index.mjs +43 -38
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/integrations/orm.d.mts +5 -3
- package/dist/integrations/orm.d.ts +5 -3
- package/dist/integrations.d.mts +5 -3
- package/dist/integrations.d.ts +5 -3
- package/dist/internal/app-markdown-runtime.cjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +12 -5
- package/dist/internal/app-markdown-runtime.d.ts +12 -5
- package/dist/internal/app-markdown-runtime.mjs +1 -1
- package/dist/internal/build-runtime.cjs +33 -30
- package/dist/internal/build-runtime.d.mts +7 -5
- package/dist/internal/build-runtime.d.ts +7 -5
- package/dist/internal/build-runtime.mjs +32 -29
- package/dist/internal/cli-runtime.cjs +10 -10
- package/dist/internal/cli-runtime.mjs +9 -9
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +31 -36
- package/dist/internal/client-runtime.d.mts +8 -6
- package/dist/internal/client-runtime.d.ts +8 -6
- package/dist/internal/client-runtime.mjs +22 -27
- package/dist/internal/compression-runtime.d.mts +5 -3
- package/dist/internal/compression-runtime.d.ts +5 -3
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +9 -7
- package/dist/internal/config-runtime.d.ts +9 -7
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/form-actions.cjs +7 -2
- package/dist/internal/form-actions.d.mts +10 -3
- package/dist/internal/form-actions.d.ts +10 -3
- package/dist/internal/form-actions.mjs +8 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +6 -1
- package/dist/internal/islands-boot.mjs +6 -1
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-node-env.cjs +4 -2
- package/dist/internal/production-node-env.d.mts +22 -1
- package/dist/internal/production-node-env.d.ts +22 -1
- package/dist/internal/production-node-env.mjs +3 -1
- package/dist/internal/production-runtime.cjs +13 -9
- package/dist/internal/production-runtime.d.mts +21 -16
- package/dist/internal/production-runtime.d.ts +21 -16
- package/dist/internal/production-runtime.mjs +13 -9
- package/dist/internal/server-tree.cjs +2 -2
- package/dist/internal/server-tree.d.mts +0 -5
- package/dist/internal/server-tree.d.ts +0 -5
- package/dist/internal/server-tree.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +87 -0
- package/dist/internal/vercel-edge-middleware.d.mts +39 -0
- package/dist/internal/vercel-edge-middleware.d.ts +39 -0
- package/dist/internal/vercel-edge-middleware.mjs +87 -0
- package/dist/layers-7P4RLKVX.cjs +20 -0
- package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
- package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
- package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
- package/dist/markdown.d.mts +5 -3
- package/dist/markdown.d.ts +5 -3
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +8 -5
- package/dist/middleware.d.ts +8 -5
- package/dist/middleware.mjs +6 -6
- package/dist/mobile.d.mts +4 -4
- package/dist/mobile.d.ts +4 -4
- package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-Bki4pOaJ.d.mts} +1 -1
- package/dist/{mount.d-CkiPky_F.d.ts → mount.d-DjR5aerM.d.ts} +1 -1
- package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CtghaSP3.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-VDkziXTK.d.mts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +8 -6
- package/dist/navigation.d.ts +8 -6
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
- package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
- package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
- package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
- package/dist/plugin.cjs +20 -20
- package/dist/plugin.d.mts +7 -5
- package/dist/plugin.d.ts +7 -5
- package/dist/plugin.mjs +19 -19
- package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
- package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-BSwV8PE4.d.mts} +1 -1
- package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-i9sI4tc9.d.ts} +1 -1
- package/dist/renderer/react/server.cjs +2 -2
- package/dist/renderer/react/server.mjs +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +8 -6
- package/dist/renderer-client.d.ts +8 -6
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +5 -0
- package/dist/renderer.d.ts +5 -0
- package/dist/{request.d-KG-4d2eG.d.mts → request.d-C24FNQ_7.d.mts} +1 -1
- package/dist/{request.d-B928QjWy.d.ts → request.d-Dgln8tuI.d.ts} +1 -1
- package/dist/request.d.mts +6 -4
- package/dist/request.d.ts +6 -4
- package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-CUylZKJA.d.ts} +1 -1
- package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-Ds0BfwQi.d.mts} +1 -1
- package/dist/{router.d-DYnRHQwz.d.ts → router.d-B56rMOFm.d.ts} +1 -1
- package/dist/{router.d-B8PkJSGp.d.mts → router.d-CFPcbqzc.d.mts} +1 -1
- package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
- package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
- package/dist/routes.d.mts +5 -3
- package/dist/routes.d.ts +5 -3
- package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-3T7V6OUT.cjs} +10 -9
- package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-GA4AQWZI.mjs} +9 -8
- package/dist/{runtime-X52Q7JFR.cjs → runtime-REUTNTI5.cjs} +20 -20
- package/dist/{runtime-U7O3HZOZ.mjs → runtime-ZYCKKY7L.mjs} +12 -12
- package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DLRO-ExG.d.mts} +1 -1
- package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-H7k9hOQE.d.ts} +1 -1
- package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
- package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
- package/dist/server-plugins.d.mts +6 -4
- package/dist/server-plugins.d.ts +6 -4
- package/dist/server.cjs +46 -44
- package/dist/server.d-C5FFrZAo.d.ts +57 -0
- package/dist/server.d-DgC8xew5.d.mts +57 -0
- package/dist/server.d.mts +13 -11
- package/dist/server.d.ts +13 -11
- package/dist/server.mjs +28 -26
- package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-Dr7oanhl.d.ts} +2 -2
- package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-g4CzhEH1.d.mts} +2 -2
- package/dist/testing.d.mts +5 -3
- package/dist/testing.d.ts +5 -3
- package/dist/types.d-xCIhyjOq.d.mts +233 -0
- package/dist/types.d-xCIhyjOq.d.ts +233 -0
- package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BxxyDEb8.d.ts} +1 -1
- package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-HIla3pD_.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +20 -20
- package/dist/vite.d.mts +10 -8
- package/dist/vite.d.ts +10 -8
- package/dist/vite.mjs +19 -19
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.d.mts +121 -1
- package/dist/workflows.d.ts +121 -1
- package/dist/workflows.mjs +1 -1
- package/package.json +7 -2
- package/dist/analyzer-KVZGVY5Q.cjs +0 -16
- package/dist/chunk-CLFEQGET.cjs +0 -60
- package/dist/chunk-MK5E44WP.mjs +0 -60
- package/dist/layers-DMRXRL7F.cjs +0 -18
- package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
- package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
- package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
- package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
|
@@ -443,6 +443,33 @@ async function withProductionNodeEnv(operation) {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
+
var REACT_RUNTIME_DIRECTORIES = [
|
|
447
|
+
"/node_modules/react/",
|
|
448
|
+
"/node_modules/react-dom/",
|
|
449
|
+
"/node_modules/react-server-dom-webpack/",
|
|
450
|
+
"/node_modules/@vitejs/plugin-rsc/dist/vendor/react-server-dom/"
|
|
451
|
+
];
|
|
452
|
+
function createReactProductionModePlugin() {
|
|
453
|
+
const nodeEnvExpression = ["process", "env", "NODE_ENV"].join(".");
|
|
454
|
+
return {
|
|
455
|
+
name: "farm-react-production-mode",
|
|
456
|
+
transform: {
|
|
457
|
+
filter: {
|
|
458
|
+
id: /\/node_modules\/(?:react(?:-dom|-server-dom-webpack)?|@vitejs\/plugin-rsc\/dist\/vendor\/react-server-dom)\//,
|
|
459
|
+
code: new RegExp(nodeEnvExpression.replace(/\./g, "\\."))
|
|
460
|
+
},
|
|
461
|
+
handler(code, id) {
|
|
462
|
+
const normalizedId = id.replace(/\\/g, "/");
|
|
463
|
+
const isReactRuntime = REACT_RUNTIME_DIRECTORIES.some(
|
|
464
|
+
(directory) => normalizedId.includes(directory)
|
|
465
|
+
);
|
|
466
|
+
if (!isReactRuntime || !code.includes(nodeEnvExpression)) return null;
|
|
467
|
+
return { code: code.split(nodeEnvExpression).join('"production"'), map: null };
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
|
|
446
473
|
|
|
447
474
|
|
|
448
475
|
|
|
@@ -455,4 +482,4 @@ async function withProductionNodeEnv(operation) {
|
|
|
455
482
|
|
|
456
483
|
|
|
457
484
|
|
|
458
|
-
exports.FARM_NODE_ENV_MODULE_FILE = FARM_NODE_ENV_MODULE_FILE; exports.FARM_NODE_ENV_MODULE_SOURCE = FARM_NODE_ENV_MODULE_SOURCE; exports.FARM_DESKTOP_ENV_MODULE_FILE = FARM_DESKTOP_ENV_MODULE_FILE; exports.FARM_DESKTOP_ENV_MODULE_SOURCE = FARM_DESKTOP_ENV_MODULE_SOURCE; exports.FARM_SERVER_MODULE_FILE = FARM_SERVER_MODULE_FILE; exports.FARM_COMPILE_CACHE_DIR = FARM_COMPILE_CACHE_DIR; exports.createFarmCompileCacheLauncher = createFarmCompileCacheLauncher; exports.createFarmNodeServerEntry = createFarmNodeServerEntry; exports.createFarmBunServerEntry = createFarmBunServerEntry; exports.withProductionNodeEnv = withProductionNodeEnv;
|
|
485
|
+
exports.FARM_NODE_ENV_MODULE_FILE = FARM_NODE_ENV_MODULE_FILE; exports.FARM_NODE_ENV_MODULE_SOURCE = FARM_NODE_ENV_MODULE_SOURCE; exports.FARM_DESKTOP_ENV_MODULE_FILE = FARM_DESKTOP_ENV_MODULE_FILE; exports.FARM_DESKTOP_ENV_MODULE_SOURCE = FARM_DESKTOP_ENV_MODULE_SOURCE; exports.FARM_SERVER_MODULE_FILE = FARM_SERVER_MODULE_FILE; exports.FARM_COMPILE_CACHE_DIR = FARM_COMPILE_CACHE_DIR; exports.createFarmCompileCacheLauncher = createFarmCompileCacheLauncher; exports.createFarmNodeServerEntry = createFarmNodeServerEntry; exports.createFarmBunServerEntry = createFarmBunServerEntry; exports.withProductionNodeEnv = withProductionNodeEnv; exports.createReactProductionModePlugin = createReactProductionModePlugin;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
normalizeRouteRules,
|
|
8
8
|
routeRulesToHeaders,
|
|
9
9
|
routeRulesToRedirects
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-R2ZHU37O.mjs";
|
|
11
11
|
import {
|
|
12
12
|
assertPluginDependencies
|
|
13
13
|
} from "./chunk-XR2ZIBQK.mjs";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
import {
|
|
39
39
|
loadFarmConfigFile,
|
|
40
40
|
resolveFarmLayers
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-E7VF3LQ5.mjs";
|
|
42
42
|
import {
|
|
43
43
|
isFarmRendererDisabled,
|
|
44
44
|
isReactRenderer,
|
|
@@ -67,10 +67,10 @@ import {
|
|
|
67
67
|
} from "./chunk-IFR74W6S.mjs";
|
|
68
68
|
import {
|
|
69
69
|
bundleNodeModule
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-MGKWYPE3.mjs";
|
|
71
71
|
import {
|
|
72
72
|
resolveWorkflowsConfig
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-MGZVDX4R.mjs";
|
|
74
74
|
import {
|
|
75
75
|
resolveFarmThemeConfig
|
|
76
76
|
} from "./chunk-YWPNIYUP.mjs";
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
} from "./chunk-W6QLRQ3V.mjs";
|
|
95
95
|
import {
|
|
96
96
|
normalizeFarmDeploymentId
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-NVOMQLI2.mjs";
|
|
98
98
|
import {
|
|
99
99
|
validateConfigRouteSource
|
|
100
100
|
} from "./chunk-JZGL2PIH.mjs";
|
|
@@ -1223,7 +1223,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1223
1223
|
};
|
|
1224
1224
|
assertPluginDependencies(resolved.plugins, resolved.integrations);
|
|
1225
1225
|
if (nativeServerFnPlugin) {
|
|
1226
|
-
nativeServerFnAppDirs = (await import("./layers-
|
|
1226
|
+
nativeServerFnAppDirs = (await import("./layers-XQ7VFMWO.mjs")).getFarmAppDirectories(resolved);
|
|
1227
1227
|
}
|
|
1228
1228
|
return resolved;
|
|
1229
1229
|
}
|
|
@@ -132,6 +132,19 @@ function readCookie(cookieHeader, name) {
|
|
|
132
132
|
function isSafeRequestMethod(method) {
|
|
133
133
|
return ["GET", "HEAD", "OPTIONS", "QUERY"].includes(method.toUpperCase());
|
|
134
134
|
}
|
|
135
|
+
var CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG = "nodejs_compat_populate_process_env";
|
|
136
|
+
var CLOUDFLARE_DO_NOT_POPULATE_PROCESS_ENV_FLAG = "nodejs_compat_do_not_populate_process_env";
|
|
137
|
+
var CLOUDFLARE_POPULATE_PROCESS_ENV_DATE = "2025-04-01";
|
|
138
|
+
function resolveCloudflareProcessEnvFlags(wrangler) {
|
|
139
|
+
const date = wrangler.compatibility_date;
|
|
140
|
+
const flags = wrangler.compatibility_flags;
|
|
141
|
+
if (typeof date !== "string" || date >= CLOUDFLARE_POPULATE_PROCESS_ENV_DATE) return void 0;
|
|
142
|
+
if (!Array.isArray(flags) || !flags.includes("nodejs_compat")) return void 0;
|
|
143
|
+
if (flags.includes(CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG) || flags.includes(CLOUDFLARE_DO_NOT_POPULATE_PROCESS_ENV_FLAG)) {
|
|
144
|
+
return void 0;
|
|
145
|
+
}
|
|
146
|
+
return [...flags, CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG];
|
|
147
|
+
}
|
|
135
148
|
|
|
136
149
|
export {
|
|
137
150
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
@@ -150,5 +163,6 @@ export {
|
|
|
150
163
|
getFarmResponseDeploymentId,
|
|
151
164
|
isFarmDeploymentMismatchResponse,
|
|
152
165
|
createFarmDeploymentMismatchError,
|
|
153
|
-
createFarmDeploymentCookie
|
|
166
|
+
createFarmDeploymentCookie,
|
|
167
|
+
resolveCloudflareProcessEnvFlags
|
|
154
168
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
|
|
@@ -10,6 +10,10 @@ var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
|
|
|
10
10
|
|
|
11
11
|
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
12
12
|
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
16
|
+
|
|
13
17
|
// src/route-rules.ts
|
|
14
18
|
function normalizeRouteRules(routeRules) {
|
|
15
19
|
if (!routeRules) return {};
|
|
@@ -102,6 +106,20 @@ function routeRulesToNitroRouteRules(routeRules) {
|
|
|
102
106
|
}
|
|
103
107
|
return nitroRules;
|
|
104
108
|
}
|
|
109
|
+
function nitroRouteRulesBelowBasePath(nitroRules, basePath, apiServerBasePath) {
|
|
110
|
+
const prefix = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, basePath);
|
|
111
|
+
if (!prefix) return nitroRules;
|
|
112
|
+
const isAPISource = (source) => source === apiServerBasePath || source.startsWith(`${apiServerBasePath}/`);
|
|
113
|
+
const rules = { ...nitroRules };
|
|
114
|
+
for (const [source, rule] of Object.entries(nitroRules)) {
|
|
115
|
+
if (isAPISource(source)) continue;
|
|
116
|
+
const publicSource = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, source, prefix);
|
|
117
|
+
if (publicSource in nitroRules) continue;
|
|
118
|
+
const to = _optionalChain([rule, 'access', _ => _.redirect, 'optionalAccess', _2 => _2.to]);
|
|
119
|
+
rules[publicSource] = typeof to === "string" && to.startsWith("/") && !to.startsWith("//") ? { ...rule, redirect: { ...rule.redirect, to: _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, to, prefix) } } : rule;
|
|
120
|
+
}
|
|
121
|
+
return rules;
|
|
122
|
+
}
|
|
105
123
|
function resolveRouteRuleCorsPreflightHeaders(routeRules, pathname) {
|
|
106
124
|
if (!routeRules) return void 0;
|
|
107
125
|
let cors;
|
|
@@ -152,4 +170,5 @@ function hasExplicitQuery(destination) {
|
|
|
152
170
|
|
|
153
171
|
|
|
154
172
|
|
|
155
|
-
|
|
173
|
+
|
|
174
|
+
exports.normalizeRouteRules = normalizeRouteRules; exports.routeRulesToRedirects = routeRulesToRedirects; exports.routeRulesToHeaders = routeRulesToHeaders; exports.routeRulesToNitroRouteRules = routeRulesToNitroRouteRules; exports.nitroRouteRulesBelowBasePath = nitroRouteRulesBelowBasePath; exports.resolveRouteRuleCorsPreflightHeaders = resolveRouteRuleCorsPreflightHeaders;
|
|
@@ -14,6 +14,7 @@ var _chunkCQL5ZGFUcjs = require('./chunk-CQL5ZGFU.cjs');
|
|
|
14
14
|
var MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
15
15
|
var FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
16
16
|
var SERVER_HTML_TAG = "f-html";
|
|
17
|
+
var SERVER_HTML_TEMPLATE_TAG = "template";
|
|
17
18
|
var FARM_SERVER_TREE_SCRIPT_TYPE = "f/tree";
|
|
18
19
|
var FARM_NOT_A_MARKER = /* @__PURE__ */ Symbol.for("farm.codec.not-a-marker");
|
|
19
20
|
var SERVER_TREE_CHUNK_SCRIPT_TYPE = "f/chunk";
|
|
@@ -312,52 +313,79 @@ function fulfilledThenable(value) {
|
|
|
312
313
|
promise.value = value;
|
|
313
314
|
return promise;
|
|
314
315
|
}
|
|
315
|
-
function createTreeChildren(ReactRuntime, children, resolver) {
|
|
316
|
+
function createTreeChildren(ReactRuntime, children, resolver, inClient) {
|
|
316
317
|
if (children === void 0) return [];
|
|
317
|
-
const node = createTreeValue(ReactRuntime, children, resolver);
|
|
318
|
+
const node = createTreeValue(ReactRuntime, children, resolver, inClient);
|
|
318
319
|
return Array.isArray(children) ? node : [node];
|
|
319
320
|
}
|
|
320
|
-
function createTreeProps(ReactRuntime, props, resolver, key) {
|
|
321
|
+
function createTreeProps(ReactRuntime, props, resolver, key, inClient) {
|
|
321
322
|
const { children, ...rest } = props;
|
|
322
323
|
const created = {};
|
|
323
324
|
for (const [name, value] of Object.entries(rest)) {
|
|
324
|
-
created[name] = createTreeValue(ReactRuntime, value, resolver);
|
|
325
|
+
created[name] = createTreeValue(ReactRuntime, value, resolver, inClient);
|
|
325
326
|
}
|
|
326
327
|
if (typeof key === "string") created.key = key;
|
|
327
|
-
return {
|
|
328
|
+
return {
|
|
329
|
+
props: created,
|
|
330
|
+
children: createTreeChildren(ReactRuntime, children, resolver, inClient)
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function collectServerHtml(value, ids) {
|
|
334
|
+
if (value === null || typeof value !== "object") return ids;
|
|
335
|
+
if (Array.isArray(value)) {
|
|
336
|
+
for (const entry of value) collectServerHtml(entry, ids);
|
|
337
|
+
return ids;
|
|
338
|
+
}
|
|
339
|
+
if (value.$ === "x") {
|
|
340
|
+
ids.push(value.i);
|
|
341
|
+
return ids;
|
|
342
|
+
}
|
|
343
|
+
const object = value.$ === "o" ? value.v : value;
|
|
344
|
+
for (const entry of Object.values(object)) collectServerHtml(entry, ids);
|
|
345
|
+
return ids;
|
|
328
346
|
}
|
|
329
|
-
function createTreeValue(ReactRuntime, value, resolver) {
|
|
347
|
+
function createTreeValue(ReactRuntime, value, resolver, inClient = false) {
|
|
330
348
|
if (value === null || typeof value !== "object") return value;
|
|
331
349
|
if (Array.isArray(value))
|
|
332
|
-
return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver));
|
|
350
|
+
return value.map((entry) => createTreeValue(ReactRuntime, entry, resolver, inClient));
|
|
333
351
|
switch (value.$) {
|
|
334
352
|
case "h": {
|
|
335
353
|
const { props, children } = createTreeProps(
|
|
336
354
|
ReactRuntime,
|
|
337
355
|
value.p,
|
|
338
356
|
resolver,
|
|
339
|
-
value.k
|
|
357
|
+
value.k,
|
|
358
|
+
inClient
|
|
340
359
|
);
|
|
341
360
|
return ReactRuntime.createElement(value.t, props, ...children);
|
|
342
361
|
}
|
|
343
362
|
case "c": {
|
|
363
|
+
const ids = inClient ? [] : collectServerHtml(value.p, []);
|
|
344
364
|
const { props, children } = createTreeProps(
|
|
345
365
|
ReactRuntime,
|
|
346
366
|
value.p,
|
|
347
367
|
resolver,
|
|
348
|
-
value.k
|
|
368
|
+
ids.length > 0 ? void 0 : value.k,
|
|
369
|
+
true
|
|
349
370
|
);
|
|
350
|
-
|
|
371
|
+
const element = ReactRuntime.createElement(
|
|
351
372
|
resolver.component(value.r, value.e),
|
|
352
373
|
props,
|
|
353
374
|
...children
|
|
354
375
|
);
|
|
376
|
+
if (ids.length === 0) return element;
|
|
377
|
+
return ReactRuntime.createElement(
|
|
378
|
+
ReactRuntime.Fragment,
|
|
379
|
+
typeof value.k === "string" ? { key: value.k } : null,
|
|
380
|
+
element,
|
|
381
|
+
resolver.unrendered(ids)
|
|
382
|
+
);
|
|
355
383
|
}
|
|
356
384
|
case "f":
|
|
357
385
|
return ReactRuntime.createElement(
|
|
358
386
|
ReactRuntime.Fragment,
|
|
359
387
|
typeof value.k === "string" ? { key: value.k } : null,
|
|
360
|
-
...createTreeChildren(ReactRuntime, value.c, resolver)
|
|
388
|
+
...createTreeChildren(ReactRuntime, value.c, resolver, inClient)
|
|
361
389
|
);
|
|
362
390
|
case "p":
|
|
363
391
|
return ReactRuntime.createElement(
|
|
@@ -367,7 +395,8 @@ function createTreeValue(ReactRuntime, value, resolver) {
|
|
|
367
395
|
fallback: createTreeValue(
|
|
368
396
|
ReactRuntime,
|
|
369
397
|
value.f,
|
|
370
|
-
resolver
|
|
398
|
+
resolver,
|
|
399
|
+
inClient
|
|
371
400
|
)
|
|
372
401
|
},
|
|
373
402
|
ReactRuntime.createElement(getChunkComponent(ReactRuntime), {
|
|
@@ -381,13 +410,15 @@ function createTreeValue(ReactRuntime, value, resolver) {
|
|
|
381
410
|
case "a":
|
|
382
411
|
return resolver.action(value.v);
|
|
383
412
|
case "P":
|
|
384
|
-
return fulfilledThenable(
|
|
413
|
+
return fulfilledThenable(
|
|
414
|
+
createTreeValue(ReactRuntime, value.v, resolver, inClient)
|
|
415
|
+
);
|
|
385
416
|
case "o": {
|
|
386
417
|
const object = value.v;
|
|
387
418
|
return Object.fromEntries(
|
|
388
419
|
Object.entries(object).map(([name, entry]) => [
|
|
389
420
|
name,
|
|
390
|
-
createTreeValue(ReactRuntime, entry, resolver)
|
|
421
|
+
createTreeValue(ReactRuntime, entry, resolver, inClient)
|
|
391
422
|
])
|
|
392
423
|
);
|
|
393
424
|
}
|
|
@@ -396,14 +427,14 @@ function createTreeValue(ReactRuntime, value, resolver) {
|
|
|
396
427
|
if (!resolver.decode) throw new Error("typed props need islands mode");
|
|
397
428
|
const decoded = resolver.decode(
|
|
398
429
|
value,
|
|
399
|
-
(child) => createTreeValue(ReactRuntime, child, resolver)
|
|
430
|
+
(child) => createTreeValue(ReactRuntime, child, resolver, inClient)
|
|
400
431
|
);
|
|
401
432
|
if (decoded !== FARM_NOT_A_MARKER) return decoded;
|
|
402
433
|
}
|
|
403
434
|
return Object.fromEntries(
|
|
404
435
|
Object.entries(value).map(([name, entry]) => [
|
|
405
436
|
name,
|
|
406
|
-
createTreeValue(ReactRuntime, entry, resolver)
|
|
437
|
+
createTreeValue(ReactRuntime, entry, resolver, inClient)
|
|
407
438
|
])
|
|
408
439
|
);
|
|
409
440
|
}
|
|
@@ -493,6 +524,49 @@ async function createPayloadOnlyPage(state, payload, encode, resolver) {
|
|
|
493
524
|
})
|
|
494
525
|
);
|
|
495
526
|
}
|
|
527
|
+
function RenderedServerHtml({
|
|
528
|
+
id,
|
|
529
|
+
rendered,
|
|
530
|
+
children
|
|
531
|
+
}) {
|
|
532
|
+
rendered.add(id);
|
|
533
|
+
return children;
|
|
534
|
+
}
|
|
535
|
+
function UnrenderedServerHtml({
|
|
536
|
+
ReactRuntime,
|
|
537
|
+
ids,
|
|
538
|
+
rendered,
|
|
539
|
+
part
|
|
540
|
+
}) {
|
|
541
|
+
const unrendered = ids.filter((id) => !rendered.has(id));
|
|
542
|
+
if (unrendered.length === 0) return null;
|
|
543
|
+
return ReactRuntime.createElement(
|
|
544
|
+
SERVER_HTML_TEMPLATE_TAG,
|
|
545
|
+
{ [SERVER_HTML_ATTRIBUTE]: String(unrendered[0]) },
|
|
546
|
+
unrendered.map((id) => part(id, `h${id}`))
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
function createServerHtmlParts(state, isolate) {
|
|
550
|
+
const ReactRuntime = state.ReactRuntime;
|
|
551
|
+
const rendered = /* @__PURE__ */ new Set();
|
|
552
|
+
const part = (id, key) => ReactRuntime.createElement(
|
|
553
|
+
SERVER_HTML_TAG,
|
|
554
|
+
{
|
|
555
|
+
...key === null ? {} : { key },
|
|
556
|
+
[SERVER_HTML_ATTRIBUTE]: String(id),
|
|
557
|
+
style: { display: "contents" }
|
|
558
|
+
},
|
|
559
|
+
isolate(state.serverHtml.get(id))
|
|
560
|
+
);
|
|
561
|
+
return {
|
|
562
|
+
serverHtml: (id, key) => ReactRuntime.createElement(
|
|
563
|
+
RenderedServerHtml,
|
|
564
|
+
{ ...key === null ? {} : { key }, id, rendered },
|
|
565
|
+
part(id, null)
|
|
566
|
+
),
|
|
567
|
+
unrendered: (ids) => ReactRuntime.createElement(UnrenderedServerHtml, { ReactRuntime, ids, rendered, part })
|
|
568
|
+
};
|
|
569
|
+
}
|
|
496
570
|
async function renderFarmServerTreePage(ReactRuntime, element, options) {
|
|
497
571
|
const state = {
|
|
498
572
|
ReactRuntime,
|
|
@@ -558,17 +632,7 @@ async function renderFarmServerTreePage(ReactRuntime, element, options) {
|
|
|
558
632
|
entry.chunk = chunk;
|
|
559
633
|
return chunk;
|
|
560
634
|
},
|
|
561
|
-
|
|
562
|
-
return ReactRuntime.createElement(
|
|
563
|
-
SERVER_HTML_TAG,
|
|
564
|
-
{
|
|
565
|
-
...key === null ? {} : { key },
|
|
566
|
-
[SERVER_HTML_ATTRIBUTE]: String(id),
|
|
567
|
-
style: { display: "contents" }
|
|
568
|
-
},
|
|
569
|
-
options.isolate(state.serverHtml.get(id))
|
|
570
|
-
);
|
|
571
|
-
},
|
|
635
|
+
...createServerHtmlParts(state, options.isolate),
|
|
572
636
|
action(id) {
|
|
573
637
|
return state.actions.get(id);
|
|
574
638
|
},
|
|
@@ -645,8 +709,19 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
|
|
|
645
709
|
})
|
|
646
710
|
);
|
|
647
711
|
const serverHtml = /* @__PURE__ */ new Map();
|
|
648
|
-
|
|
649
|
-
|
|
712
|
+
const readParts = (parts) => {
|
|
713
|
+
for (const container of parts) {
|
|
714
|
+
if (container.localName !== SERVER_HTML_TAG) continue;
|
|
715
|
+
serverHtml.set(Number(container.getAttribute(SERVER_HTML_ATTRIBUTE)), container.innerHTML);
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
readParts(root.querySelectorAll(`${SERVER_HTML_TAG}[${SERVER_HTML_ATTRIBUTE}]`));
|
|
719
|
+
const templates = /* @__PURE__ */ new Map();
|
|
720
|
+
for (const template of root.querySelectorAll(
|
|
721
|
+
`${SERVER_HTML_TEMPLATE_TAG}[${SERVER_HTML_ATTRIBUTE}]`
|
|
722
|
+
)) {
|
|
723
|
+
templates.set(Number(template.getAttribute(SERVER_HTML_ATTRIBUTE)), template.innerHTML);
|
|
724
|
+
readParts(template.content.children);
|
|
650
725
|
}
|
|
651
726
|
const resolver = {
|
|
652
727
|
component(reference, exportName) {
|
|
@@ -683,6 +758,15 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
|
|
|
683
758
|
dangerouslySetInnerHTML: { __html: html }
|
|
684
759
|
});
|
|
685
760
|
},
|
|
761
|
+
unrendered(ids) {
|
|
762
|
+
const id = ids.find((candidate) => templates.has(candidate));
|
|
763
|
+
if (id === void 0) return null;
|
|
764
|
+
return ReactRuntime.createElement(SERVER_HTML_TEMPLATE_TAG, {
|
|
765
|
+
[SERVER_HTML_ATTRIBUTE]: String(id),
|
|
766
|
+
suppressHydrationWarning: true,
|
|
767
|
+
dangerouslySetInnerHTML: { __html: templates.get(id) }
|
|
768
|
+
});
|
|
769
|
+
},
|
|
686
770
|
action(id) {
|
|
687
771
|
if (!options.actions) throw new Error("server action props need islands mode");
|
|
688
772
|
return options.actions(id);
|
|
@@ -25,7 +25,7 @@ var _chunkAQIRXBBYcjs = require('./chunk-AQIRXBBY.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkMTBDJ326cjs = require('./chunk-MTBDJ326.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
|
|
@@ -785,8 +785,8 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
785
785
|
const shouldGenerateEnv = options.env !== false;
|
|
786
786
|
const shouldGenerateImages = options.images !== false;
|
|
787
787
|
const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _48 => _48.i18nConfig, 'optionalAccess', _49 => _49.enabled]);
|
|
788
|
-
const sourceRoots =
|
|
789
|
-
const appDirs =
|
|
788
|
+
const sourceRoots = _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
|
|
789
|
+
const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
|
|
790
790
|
const result = {
|
|
791
791
|
apiRoutes: [],
|
|
792
792
|
stalePaths: []
|
|
@@ -7,7 +7,7 @@ var _chunk53EHWHT2cjs = require('./chunk-53EHWHT2.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk437QZIC2cjs = require('./chunk-437QZIC2.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkRI3EVPKDcjs = require('./chunk-RI3EVPKD.cjs');
|
|
@@ -52,7 +52,7 @@ function shouldBlockUnload(options) {
|
|
|
52
52
|
function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
53
53
|
if (typeof window === "undefined") return;
|
|
54
54
|
const url = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href, basePath);
|
|
55
|
-
const spaRouter =
|
|
55
|
+
const spaRouter = _chunk437QZIC2cjs.getInstalledFarmSPARouter.call(void 0, );
|
|
56
56
|
if (spaRouter) {
|
|
57
57
|
void spaRouter.navigate(url, {
|
|
58
58
|
replace,
|
|
@@ -72,7 +72,7 @@ function writeHistory(url, replace) {
|
|
|
72
72
|
} else {
|
|
73
73
|
window.history.pushState(null, "", url);
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
_chunk437QZIC2cjs.notifyHistoryChange.call(void 0, "url-search");
|
|
76
76
|
}
|
|
77
77
|
async function writeHistoryUnlessDelegated(url, replace) {
|
|
78
78
|
const target = new URL(url, window.location.href);
|
|
@@ -105,7 +105,7 @@ function useRouter(options = {}) {
|
|
|
105
105
|
setState(readRouterState(basePath, routeMatcher));
|
|
106
106
|
};
|
|
107
107
|
handlePopState();
|
|
108
|
-
const unsubscribe =
|
|
108
|
+
const unsubscribe = _chunk437QZIC2cjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
109
109
|
return unsubscribe;
|
|
110
110
|
}, [basePath, routeMatcher]);
|
|
111
111
|
const push = (href, navigateOptions) => {
|
|
@@ -116,11 +116,11 @@ function useRouter(options = {}) {
|
|
|
116
116
|
};
|
|
117
117
|
const pushState = (pageState, href) => {
|
|
118
118
|
if (typeof window === "undefined") return;
|
|
119
|
-
|
|
119
|
+
_chunk437QZIC2cjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
|
|
120
120
|
};
|
|
121
121
|
const replaceState = (pageState, href) => {
|
|
122
122
|
if (typeof window === "undefined") return;
|
|
123
|
-
|
|
123
|
+
_chunk437QZIC2cjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
|
|
124
124
|
};
|
|
125
125
|
const back = () => {
|
|
126
126
|
if (typeof window !== "undefined") {
|
|
@@ -143,24 +143,24 @@ function useRouter(options = {}) {
|
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
function usePageState() {
|
|
146
|
-
const [state, setState] = _react.useState.call(void 0, () =>
|
|
146
|
+
const [state, setState] = _react.useState.call(void 0, () => _chunk437QZIC2cjs.readPageState.call(void 0, ));
|
|
147
147
|
_react.useEffect.call(void 0, () => {
|
|
148
148
|
if (typeof window === "undefined") return;
|
|
149
149
|
const handlePopState = () => {
|
|
150
|
-
setState(
|
|
150
|
+
setState(_chunk437QZIC2cjs.readPageState.call(void 0, ));
|
|
151
151
|
};
|
|
152
152
|
handlePopState();
|
|
153
|
-
return
|
|
153
|
+
return _chunk437QZIC2cjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
154
154
|
}, []);
|
|
155
155
|
return state;
|
|
156
156
|
}
|
|
157
157
|
function useNavigation() {
|
|
158
158
|
const [state, setState] = _react.useState.call(void 0,
|
|
159
|
-
() =>
|
|
159
|
+
() => _chunk437QZIC2cjs.getRouter.call(void 0, ).getNavigationState()
|
|
160
160
|
);
|
|
161
161
|
_react.useEffect.call(void 0, () => {
|
|
162
162
|
if (typeof window === "undefined") return;
|
|
163
|
-
return
|
|
163
|
+
return _chunk437QZIC2cjs.getRouter.call(void 0, ).subscribeNavigation(setState);
|
|
164
164
|
}, []);
|
|
165
165
|
return state;
|
|
166
166
|
}
|
|
@@ -172,7 +172,7 @@ function useBlocker(options) {
|
|
|
172
172
|
if (typeof window === "undefined" || !active) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
return
|
|
175
|
+
return _chunk437QZIC2cjs.getRouter.call(void 0, ).addBlocker(
|
|
176
176
|
async (context) => {
|
|
177
177
|
const current = optionsRef.current;
|
|
178
178
|
const when = typeof current.when === "function" ? current.when(context) : current.when;
|
|
@@ -195,7 +195,7 @@ function useScrollRestoration(key) {
|
|
|
195
195
|
_react.useEffect.call(void 0, () => {
|
|
196
196
|
const element = ref.current;
|
|
197
197
|
if (!element) return;
|
|
198
|
-
return
|
|
198
|
+
return _chunk437QZIC2cjs.getRouter.call(void 0, ).registerScrollElement(key, element);
|
|
199
199
|
}, [key]);
|
|
200
200
|
return ref;
|
|
201
201
|
}
|
|
@@ -216,7 +216,7 @@ function readRouterState(basePath, routeMatcher) {
|
|
|
216
216
|
pathname,
|
|
217
217
|
searchParams: url.searchParams,
|
|
218
218
|
params: _optionalChain([routeMatcher, 'optionalAccess', _5 => _5.match, 'call', _6 => _6(routePathname), 'optionalAccess', _7 => _7.params]) || {},
|
|
219
|
-
pageState: typeof window === "undefined" ? null :
|
|
219
|
+
pageState: typeof window === "undefined" ? null : _chunk437QZIC2cjs.readPageState.call(void 0, )
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
222
|
function readCurrentUrl() {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFarmIntegrationPluginServerRuntime
|
|
3
|
+
} from "./chunk-AJNBTOVQ.mjs";
|
|
4
|
+
|
|
5
|
+
// src/plugin-server-runtime.ts
|
|
6
|
+
function hasFarmServerRuntimePlugins(plugins) {
|
|
7
|
+
return (plugins || []).some((plugin) => {
|
|
8
|
+
if (getFarmIntegrationPluginServerRuntime(plugin) === false) return false;
|
|
9
|
+
return Boolean(
|
|
10
|
+
plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
|
|
11
|
+
);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
hasFarmServerRuntimePlugins
|
|
17
|
+
};
|
|
@@ -9,6 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
isFarmRedirectStatus
|
|
11
11
|
} from "./chunk-JNYFXL7X.mjs";
|
|
12
|
+
import {
|
|
13
|
+
applyFarmBasePath,
|
|
14
|
+
normalizeFarmBasePath
|
|
15
|
+
} from "./chunk-SF3JB56B.mjs";
|
|
12
16
|
|
|
13
17
|
// src/route-rules.ts
|
|
14
18
|
function normalizeRouteRules(routeRules) {
|
|
@@ -102,6 +106,20 @@ function routeRulesToNitroRouteRules(routeRules) {
|
|
|
102
106
|
}
|
|
103
107
|
return nitroRules;
|
|
104
108
|
}
|
|
109
|
+
function nitroRouteRulesBelowBasePath(nitroRules, basePath, apiServerBasePath) {
|
|
110
|
+
const prefix = normalizeFarmBasePath(basePath);
|
|
111
|
+
if (!prefix) return nitroRules;
|
|
112
|
+
const isAPISource = (source) => source === apiServerBasePath || source.startsWith(`${apiServerBasePath}/`);
|
|
113
|
+
const rules = { ...nitroRules };
|
|
114
|
+
for (const [source, rule] of Object.entries(nitroRules)) {
|
|
115
|
+
if (isAPISource(source)) continue;
|
|
116
|
+
const publicSource = applyFarmBasePath(source, prefix);
|
|
117
|
+
if (publicSource in nitroRules) continue;
|
|
118
|
+
const to = rule.redirect?.to;
|
|
119
|
+
rules[publicSource] = typeof to === "string" && to.startsWith("/") && !to.startsWith("//") ? { ...rule, redirect: { ...rule.redirect, to: applyFarmBasePath(to, prefix) } } : rule;
|
|
120
|
+
}
|
|
121
|
+
return rules;
|
|
122
|
+
}
|
|
105
123
|
function resolveRouteRuleCorsPreflightHeaders(routeRules, pathname) {
|
|
106
124
|
if (!routeRules) return void 0;
|
|
107
125
|
let cors;
|
|
@@ -151,5 +169,6 @@ export {
|
|
|
151
169
|
routeRulesToRedirects,
|
|
152
170
|
routeRulesToHeaders,
|
|
153
171
|
routeRulesToNitroRouteRules,
|
|
172
|
+
nitroRouteRulesBelowBasePath,
|
|
154
173
|
resolveRouteRuleCorsPreflightHeaders
|
|
155
174
|
};
|