@farm.js/core 0.1.82 → 0.1.84
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-C2Su3x4D.d.ts → agent-mcp.d-7uKdOttc.d.ts} +1 -1
- package/dist/{agent-mcp.d-Yak-LqRd.d.mts → agent-mcp.d-LChlR2au.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/{analyzer-RPU2KG4J.mjs → analyzer-7RNO3XKC.mjs} +2 -2
- package/dist/analyzer-PFKA5NI6.cjs +17 -0
- package/dist/api/node.d.mts +4 -3
- package/dist/api/node.d.ts +4 -3
- package/dist/api/route-manager.d.mts +4 -3
- package/dist/api/route-manager.d.ts +4 -3
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api.d.mts +5 -4
- package/dist/api.d.ts +5 -4
- package/dist/{app-manifest.d-DZyXaICz.d.ts → app-manifest.d-CRp21oAz.d.ts} +1 -1
- package/dist/{app-manifest.d-BcyOFMrg.d.mts → app-manifest.d-QMdmqqCr.d.mts} +1 -1
- package/dist/app-markdown.d.mts +3 -2
- package/dist/app-markdown.d.ts +3 -2
- package/dist/{app.d-CIoXsAbN.d.ts → app.d-CVPu_hoD.d.ts} +34 -4
- package/dist/{app.d-C0ePpuaG.d.mts → app.d-eSm7jgoc.d.mts} +34 -4
- package/dist/{chunk-B2PGVHBG.cjs → chunk-22BTYPIX.cjs} +4 -4
- package/dist/{chunk-BCTHOQPP.cjs → chunk-3OKSEJ33.cjs} +98 -10
- package/dist/{chunk-QSMUMK7Y.mjs → chunk-3WM7VBGW.mjs} +2 -2
- package/dist/{chunk-XMHERKSE.mjs → chunk-42IBGQTN.mjs} +5 -12
- package/dist/{chunk-RMPUEH5T.cjs → chunk-57EEWWUS.cjs} +2 -2
- package/dist/{chunk-Q2VOT3K2.cjs → chunk-5I4ZGKP2.cjs} +395 -333
- package/dist/{chunk-TPA2PV5J.mjs → chunk-5V6HSJFG.mjs} +24 -1
- package/dist/{chunk-RMLR5RMH.mjs → chunk-BCCCPFHQ.mjs} +92 -4
- package/dist/{chunk-LM2ZDNDD.cjs → chunk-BOEDYXAX.cjs} +30 -25
- package/dist/{chunk-NRCKBDYP.mjs → chunk-BRDGINBB.mjs} +153 -47
- package/dist/chunk-BUQR7KKO.mjs +17 -0
- package/dist/{chunk-63ZE6B6M.mjs → chunk-BZY3SRRD.mjs} +1 -1
- package/dist/{chunk-724WT3NI.mjs → chunk-CRE642TW.mjs} +1 -1
- package/dist/{chunk-JK26IMT7.cjs → chunk-CVZY4TLW.cjs} +1 -1
- package/dist/{chunk-ZIZRIZLP.mjs → chunk-CWUQBECF.mjs} +3 -1
- package/dist/{chunk-DAXU2NBE.mjs → chunk-DFDQGHPU.mjs} +104 -42
- package/dist/{chunk-AIPZDBP6.cjs → chunk-DSWSDDP2.cjs} +844 -553
- package/dist/{chunk-DRO3NXA3.cjs → chunk-EBSL5TW7.cjs} +203 -93
- package/dist/{chunk-CJDBTTLB.mjs → chunk-EDBIBO67.mjs} +18 -13
- package/dist/{chunk-BBVLOEND.cjs → chunk-F7JVO3OZ.cjs} +4 -4
- package/dist/chunk-FZ7OUN5M.cjs +30 -0
- package/dist/chunk-GLNVLCUH.cjs +426 -0
- package/dist/{chunk-5MMKNW7Q.cjs → chunk-H7REG7OX.cjs} +15 -8
- package/dist/{chunk-N2EFMN2K.cjs → chunk-HOQ2MYBJ.cjs} +10 -10
- package/dist/{chunk-OP5VI4TP.mjs → chunk-I5CVJ24H.mjs} +1 -1
- package/dist/{chunk-I4DR3HCH.mjs → chunk-INU4K4U4.mjs} +5 -5
- package/dist/{chunk-4X7LSGM6.mjs → chunk-IRJSZAJB.mjs} +1 -1
- package/dist/{chunk-EX6ZSN5P.cjs → chunk-IZYFP7IN.cjs} +17 -24
- package/dist/chunk-J6RFB324.cjs +17 -0
- package/dist/{chunk-47I2MYIR.mjs → chunk-KXVMWLTC.mjs} +484 -193
- package/dist/{chunk-UVV3I5QA.cjs → chunk-L2GUEYHR.cjs} +29 -6
- package/dist/{chunk-VMBIKDKW.cjs → chunk-L3BSHASB.cjs} +6 -4
- package/dist/chunk-L5HDCDFT.mjs +426 -0
- package/dist/{chunk-GXLNARPO.mjs → chunk-M5XU22PQ.mjs} +1 -1
- package/dist/chunk-M6AJZ4XR.mjs +30 -0
- package/dist/chunk-MAPHNGTF.cjs +98 -0
- package/dist/{chunk-RE5E2G5S.cjs → chunk-MNUYXZV7.cjs} +2 -18
- package/dist/{chunk-C3VCYOU4.mjs → chunk-MUUDHWQZ.mjs} +1 -1
- package/dist/{chunk-YSU3WCW6.mjs → chunk-MYSH5Y4E.mjs} +1 -1
- package/dist/{chunk-OMB7UGVW.mjs → chunk-NLHSKKTT.mjs} +14 -9
- package/dist/{chunk-ARORZ3MH.cjs → chunk-OFVBMS6I.cjs} +439 -333
- package/dist/{chunk-5MUFW5UU.cjs → chunk-OP7BIEUW.cjs} +2 -2
- package/dist/{chunk-I4WZRG73.mjs → chunk-RB5IGN3N.mjs} +13 -6
- package/dist/chunk-RJBUI5AN.mjs +18 -0
- package/dist/chunk-RQ6XX5IN.mjs +98 -0
- package/dist/{chunk-EJCVG25Z.mjs → chunk-S3R4JDRO.mjs} +17 -9
- package/dist/{chunk-WFVSAT7Y.cjs → chunk-T7HGXF7D.cjs} +3 -3
- package/dist/{chunk-HHQEKLZL.cjs → chunk-USMRAC72.cjs} +36 -31
- package/dist/{chunk-SM2SYWAR.cjs → chunk-XJDB564A.cjs} +18 -10
- package/dist/{chunk-EL2Z6YFZ.mjs → chunk-XLULEFRW.mjs} +180 -70
- package/dist/{chunk-6BPFIYGY.cjs → chunk-YU6VL7H5.cjs} +3 -3
- package/dist/{chunk-CD5Z7RR5.cjs → chunk-Z37PDUJR.cjs} +4 -4
- package/dist/{cli-runtime.d-Hnvvadz7.d.mts → cli-runtime.d-C7aMfoTq.d.mts} +8 -6
- package/dist/{cli-runtime.d-I0MphTbc.d.ts → cli-runtime.d-DaElKjaL.d.ts} +8 -6
- package/dist/{client-component.d-DapRqtSC.d.mts → client-component.d-DLMCzmUx.d.mts} +1 -1
- package/dist/{client-component.d-5QEvtJsg.d.ts → client-component.d-DLknFP8l.d.ts} +1 -1
- package/dist/{client-plugins.d-DcmDzcSC.d.ts → client-plugins.d-BVXjyIkY.d.ts} +14 -0
- package/dist/{client-plugins.d-C1WM3ieD.d.mts → client-plugins.d-BwKwuO_0.d.mts} +14 -0
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +4 -3
- package/dist/client.d.mts +10 -9
- package/dist/client.d.ts +10 -9
- package/dist/client.mjs +3 -2
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/desktop.d.mts +3 -2
- package/dist/desktop.d.ts +3 -2
- package/dist/{devtools-5B7NZE6F.cjs → devtools-4SVIRV4P.cjs} +7 -7
- package/dist/{devtools-C5GXZZ7E.mjs → devtools-MWQA5LVN.mjs} +5 -5
- package/dist/docs.cjs +10 -9
- package/dist/docs.d.mts +15 -6
- package/dist/docs.d.ts +15 -6
- package/dist/docs.mjs +9 -8
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.d.mts +1 -0
- package/dist/environment/vite.d.ts +1 -0
- package/dist/environment/vite.mjs +4 -4
- package/dist/{generate-route-types.d-CaGMIaNI.d.mts → generate-route-types.d-BFOMM8Ef.d.mts} +3 -0
- package/dist/{generate-route-types.d-B76M5R11.d.ts → generate-route-types.d-C2m8myHb.d.ts} +3 -0
- package/dist/{handler.d-B8bPCBzl.d.mts → handler.d-BKTWzzNA.d.mts} +1 -1
- package/dist/{handler.d-Cliwo6Nu.d.ts → handler.d-Dzpyg3-N.d.ts} +1 -1
- package/dist/{headers.d-CVwSpSGX.d.mts → headers.d-5opjyhXw.d.mts} +1 -1
- package/dist/{headers.d-C_btqjV6.d.ts → headers.d-PZyXcDAH.d.ts} +1 -1
- package/dist/index.cjs +32 -29
- package/dist/{index.d-DFuMZk9-.d.mts → index.d-C0Mie66f.d.mts} +1 -1
- package/dist/{index.d-hOEbMcLk.d.ts → index.d-DV2q-0mE.d.ts} +1 -1
- package/dist/index.d.mts +26 -25
- package/dist/index.d.ts +26 -25
- package/dist/index.mjs +32 -29
- package/dist/integrations/orm.d.mts +2 -1
- package/dist/integrations/orm.d.ts +2 -1
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/internal/app-markdown-runtime.d.mts +3 -2
- package/dist/internal/app-markdown-runtime.d.ts +3 -2
- package/dist/internal/build-runtime.cjs +28 -27
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +27 -26
- package/dist/internal/cli-runtime.cjs +9 -9
- package/dist/internal/cli-runtime.d.mts +8 -7
- package/dist/internal/cli-runtime.d.ts +8 -7
- package/dist/internal/cli-runtime.mjs +8 -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 +8 -42
- package/dist/internal/client-runtime.d.ts +8 -42
- package/dist/internal/compression-runtime.d.mts +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +7 -7
- package/dist/internal/config-runtime.d.mts +6 -5
- package/dist/internal/config-runtime.d.ts +6 -5
- package/dist/internal/config-runtime.mjs +6 -6
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-action-client.cjs +18 -0
- package/dist/internal/islands-action-client.d.mts +18 -0
- package/dist/internal/islands-action-client.d.ts +18 -0
- package/dist/internal/islands-action-client.mjs +18 -0
- package/dist/internal/islands-runtime.cjs +3 -8
- package/dist/internal/islands-runtime.mjs +4 -9
- package/dist/internal/islx-actions-client.cjs +4 -3
- package/dist/internal/islx-actions-client.mjs +3 -2
- package/dist/internal/islx-actions-server.d.mts +0 -2
- package/dist/internal/islx-actions-server.d.ts +0 -2
- package/dist/internal/islx-client.cjs +13 -1
- package/dist/internal/islx-client.d.mts +11 -0
- package/dist/internal/islx-client.d.ts +11 -0
- package/dist/internal/islx-client.mjs +14 -0
- package/dist/internal/metadata-image-runtime.d.mts +1 -0
- package/dist/internal/metadata-image-runtime.d.ts +1 -0
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +13 -13
- package/dist/internal/production-runtime.d.mts +11 -11
- package/dist/internal/production-runtime.d.ts +11 -11
- package/dist/internal/production-runtime.mjs +19 -19
- package/dist/internal/renderer-islands.cjs +47 -0
- package/dist/internal/renderer-islands.d.mts +32 -0
- package/dist/internal/renderer-islands.d.ts +32 -0
- package/dist/internal/renderer-islands.mjs +47 -0
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +2 -1
- package/dist/internal/start-manifest.d.ts +2 -1
- package/dist/island-runtime.d-BA7EPo1v.d.ts +38 -0
- package/dist/island-runtime.d-BBS_YUSX.d.mts +38 -0
- package/dist/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/middleware.d.mts +2 -1
- package/dist/middleware.d.ts +2 -1
- package/dist/mobile.d.mts +6 -3
- package/dist/mobile.d.ts +6 -3
- package/dist/{mount.d-DLeYxeRR.d.mts → mount.d-CZ_qL1iS.d.mts} +1 -1
- package/dist/{mount.d-CAovYKfs.d.ts → mount.d-gWul1GA1.d.ts} +1 -1
- package/dist/{navigation-delegate.d-Chv93QS6.d.mts → navigation-delegate.d-BBTzhJLj.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BLM-8Q3Z.d.ts → navigation-delegate.d-BZsYEAet.d.ts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/plugin.cjs +23 -22
- package/dist/plugin.d.mts +6 -6
- package/dist/plugin.d.ts +6 -6
- package/dist/plugin.mjs +22 -21
- package/dist/{render-plan.d-BSTjTH8h.d.ts → render-plan.d-AaJsYPX-.d.ts} +1 -1
- package/dist/{render-plan.d-CK5Lggyb.d.mts → render-plan.d-bnWxS12w.d.mts} +1 -1
- package/dist/renderer-client.cjs +6 -5
- package/dist/renderer-client.d.mts +8 -7
- package/dist/renderer-client.d.ts +8 -7
- package/dist/renderer-client.mjs +2 -1
- package/dist/renderer.cjs +12 -2
- package/dist/renderer.d.mts +167 -4
- package/dist/renderer.d.ts +167 -4
- package/dist/renderer.mjs +11 -1
- package/dist/{request.d-BhggxQf3.d.mts → request.d-C2HOn3Hi.d.mts} +1 -1
- package/dist/{request.d-CyJS9bjm.d.ts → request.d-CAeitOG1.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering.d-BLPPmI5I.d.ts → route-rendering.d-A1dIkUK5.d.ts} +1 -1
- package/dist/{route-rendering.d-CUpG2mZJ.d.mts → route-rendering.d-CYA-ulnX.d.mts} +1 -1
- package/dist/{router.d-2NQM1Kgw.d.mts → router.d-8lxnzlkr.d.mts} +1 -1
- package/dist/{router.d-0X2Ki6rf.d.ts → router.d-A_Yt6jYz.d.ts} +1 -1
- package/dist/{routes.d-CCccJRrp.d.mts → routes.d-BWvpUoYu.d.mts} +1 -1
- package/dist/{routes.d-b7khoRoU.d.ts → routes.d-D7RWvfqL.d.ts} +1 -1
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/{rsc-pipeline-5AOF64FL.cjs → rsc-pipeline-OWBEZ7HB.cjs} +10 -10
- package/dist/{rsc-pipeline-DNRLYOJ7.mjs → rsc-pipeline-UT3Z2GDO.mjs} +9 -9
- package/dist/{runtime-EHG2FRXZ.mjs → runtime-F5I3WY3B.mjs} +12 -12
- package/dist/{runtime-ZVHG5SRB.cjs → runtime-SRMQ46SK.cjs} +15 -15
- package/dist/{runtime.d-CXuwkUgr.d.ts → runtime.d-BPyvWrgQ.d.ts} +1 -1
- package/dist/{runtime.d-CaFXcu_Q.d.mts → runtime.d-C_rZ9_DD.d.mts} +1 -1
- package/dist/{server-components-status.d-Cp7zvBm5.d.mts → server-components-status.d-BpxiEMQE.d.mts} +1 -1
- package/dist/{server-components-status.d-BdeFD8ZH.d.ts → server-components-status.d-C2UEKJn7.d.ts} +1 -1
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-query-call.d-rVM_lsYk.d.mts +15 -0
- package/dist/server-query-call.d-rVM_lsYk.d.ts +15 -0
- package/dist/server-query-client.cjs +5 -3
- package/dist/server-query-client.d.mts +3 -2
- package/dist/server-query-client.d.ts +3 -2
- package/dist/server-query-client.mjs +5 -3
- package/dist/{server-query-runtime.d-DXRNhX_3.d.ts → server-query-runtime.d-BlHd90D0.d.ts} +2 -8
- package/dist/{server-query-runtime.d-aP52iuL5.d.mts → server-query-runtime.d-CCLGkQtE.d.mts} +2 -8
- package/dist/server.cjs +52 -52
- package/dist/server.d.mts +12 -12
- package/dist/server.d.ts +12 -12
- package/dist/server.mjs +30 -30
- package/dist/{spa-router.d-l3G38xHa.d.mts → spa-router.d-BD-6WX1R.d.mts} +2 -2
- package/dist/{spa-router.d-Bjgl-Osi.d.ts → spa-router.d-Cw5i_15e.d.ts} +2 -2
- package/dist/{ssg.d-DDca17Lc.d.ts → ssg.d-Bifiq0EL.d.ts} +2 -2
- package/dist/{ssg.d-RnlHOqUL.d.mts → ssg.d-CCE9aob5.d.mts} +2 -2
- package/dist/{store-core.d-BaOUOPf7.d.ts → store-core.d-5tVn5vi1.d.ts} +3 -3
- package/dist/{store-core.d-BZjuC6Zc.d.mts → store-core.d-BN2MxSG9.d.mts} +3 -3
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/{utils.d-D8TWmpWo.d.ts → utils.d-BUjpSNIO.d.ts} +1 -1
- package/dist/{utils.d-tdzw0_zQ.d.mts → utils.d-wGPLeVbq.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +23 -22
- package/dist/vite.d.mts +12 -6
- package/dist/vite.d.ts +12 -6
- package/dist/vite.mjs +22 -21
- package/package.json +13 -3
- package/dist/analyzer-LV23T6QN.cjs +0 -17
- package/dist/chunk-4QENVMG7.mjs +0 -34
- package/dist/chunk-AUFEM3FB.mjs +0 -229
- package/dist/chunk-S7WZUK3B.cjs +0 -229
- package/dist/{chunk-NEKO3HM2.cjs → chunk-4B6YJ5DS.cjs} +2 -2
- package/dist/{chunk-CA2HBLXP.mjs → chunk-4EEAPBNV.mjs} +3 -3
|
@@ -298,6 +298,25 @@ if (import.meta.hot) {
|
|
|
298
298
|
`;
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
// src/docs/adapter-descriptor.ts
|
|
302
|
+
function getFarmDocsAdapterUIModule(adapter) {
|
|
303
|
+
return adapter?.ui || adapter?.react || void 0;
|
|
304
|
+
}
|
|
305
|
+
function getFarmDocsAdapterRenderer(adapter) {
|
|
306
|
+
return adapter.renderer || "react";
|
|
307
|
+
}
|
|
308
|
+
function hasFarmDocsRuntimeAdapter(docs) {
|
|
309
|
+
return Boolean(docs?.enabled && docs.adapter?.server && getFarmDocsAdapterUIModule(docs.adapter));
|
|
310
|
+
}
|
|
311
|
+
function assertFarmDocsAdapterRenderer(docs, renderer) {
|
|
312
|
+
if (!hasFarmDocsRuntimeAdapter(docs)) return;
|
|
313
|
+
const adapterRenderer = getFarmDocsAdapterRenderer(docs.adapter);
|
|
314
|
+
if (adapterRenderer === renderer) return;
|
|
315
|
+
throw new Error(
|
|
316
|
+
`The docs adapter ${JSON.stringify(docs.adapter.id)} has a ${JSON.stringify(adapterRenderer)} UI, and this app's renderer is ${JSON.stringify(renderer)}. An adapter runs only under the renderer its UI is written for: use an adapter release with a ${JSON.stringify(renderer)} UI, or remove the adapter (for @farming-labs/farmjs, the withDocs() wrapper) to serve docs with Farm's built-in renderer.`
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
301
320
|
// src/auth-config.ts
|
|
302
321
|
import { createRequire } from "module";
|
|
303
322
|
import path from "path";
|
|
@@ -414,5 +433,9 @@ export {
|
|
|
414
433
|
resolveFarmDevIndicatorsConfig,
|
|
415
434
|
generateFarmDevIndicatorsClientRuntime,
|
|
416
435
|
resolveFarmAuthConfig,
|
|
417
|
-
resolveFarmAuthIntegration
|
|
436
|
+
resolveFarmAuthIntegration,
|
|
437
|
+
getFarmDocsAdapterUIModule,
|
|
438
|
+
getFarmDocsAdapterRenderer,
|
|
439
|
+
hasFarmDocsRuntimeAdapter,
|
|
440
|
+
assertFarmDocsAdapterRenderer
|
|
418
441
|
};
|
|
@@ -9,7 +9,8 @@ var DEFAULT_RENDERER_CAPABILITIES = Object.freeze({
|
|
|
9
9
|
// otherwise, so callers do not silently rely on reconciliation.
|
|
10
10
|
reconcilesRerenders: false,
|
|
11
11
|
functionComponents: false,
|
|
12
|
-
hydrationFallback: false
|
|
12
|
+
hydrationFallback: false,
|
|
13
|
+
islands: false
|
|
13
14
|
});
|
|
14
15
|
function getFarmRendererCapabilities(renderer) {
|
|
15
16
|
const defaultStreaming = {
|
|
@@ -38,7 +39,8 @@ function getFarmRendererCapabilities(renderer) {
|
|
|
38
39
|
},
|
|
39
40
|
reconcilesRerenders: renderer?.capabilities?.reconcilesRerenders ?? DEFAULT_RENDERER_CAPABILITIES.reconcilesRerenders,
|
|
40
41
|
functionComponents: renderer?.capabilities?.functionComponents ?? DEFAULT_RENDERER_CAPABILITIES.functionComponents,
|
|
41
|
-
hydrationFallback: renderer?.capabilities?.hydrationFallback ?? DEFAULT_RENDERER_CAPABILITIES.hydrationFallback
|
|
42
|
+
hydrationFallback: renderer?.capabilities?.hydrationFallback ?? DEFAULT_RENDERER_CAPABILITIES.hydrationFallback,
|
|
43
|
+
islands: renderer?.capabilities?.islands ?? DEFAULT_RENDERER_CAPABILITIES.islands
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
46
|
function getFarmRendererStreamingCapabilitiesForRuntime(renderer, runtime) {
|
|
@@ -64,11 +66,14 @@ function assertFarmRendererServerModule(runtime, renderer) {
|
|
|
64
66
|
const missing = FARM_RENDERER_SERVER_EXPORTS.filter(
|
|
65
67
|
(key) => isMissingServerExport(key, exports[key])
|
|
66
68
|
);
|
|
69
|
+
if (renderer.capabilities?.islands === true && typeof exports.withIsland !== "function") {
|
|
70
|
+
missing.push("withIsland");
|
|
71
|
+
}
|
|
67
72
|
if (missing.length === 0) return;
|
|
68
73
|
const names = missing.map((key) => `\`${key}\``);
|
|
69
74
|
const list = names.length === 1 ? names[0] : `${names.slice(0, -1).join(", ")}${names.length > 2 ? "," : ""} and ${names[names.length - 1]}`;
|
|
70
75
|
throw new Error(
|
|
71
|
-
`Renderer \`${renderer.name}\` server module \`${renderer.server}\` does not export ${list}. Export ${missing.length === 1 ? "it" : "them"} by name from that module: https://farmjs.dev/docs/renderers#renderer-modules`
|
|
76
|
+
`Renderer \`${renderer.name}\` server module \`${renderer.server}\` does not export ${list}. ` + (missing.includes("withIsland") ? "Its descriptor declares `capabilities.islands`, which needs `withIsland`. " : "") + `Export ${missing.length === 1 ? "it" : "them"} by name from that module: https://farmjs.dev/docs/renderers#renderer-modules`
|
|
72
77
|
);
|
|
73
78
|
}
|
|
74
79
|
function assertFarmRendererStreamingRuntime(name, renderer, runtimeModule, runtime) {
|
|
@@ -152,6 +157,15 @@ function isFarmRendererDisabled(renderer) {
|
|
|
152
157
|
function defineRenderer(renderer) {
|
|
153
158
|
return renderer;
|
|
154
159
|
}
|
|
160
|
+
var FARM_RENDERER_STRATEGIES = {
|
|
161
|
+
load: true,
|
|
162
|
+
idle: true,
|
|
163
|
+
visible: true,
|
|
164
|
+
interaction: true
|
|
165
|
+
};
|
|
166
|
+
function isFarmRendererStrategy(value) {
|
|
167
|
+
return typeof value === "string" && Object.prototype.hasOwnProperty.call(FARM_RENDERER_STRATEGIES, value);
|
|
168
|
+
}
|
|
155
169
|
function resolveFarmRenderer(renderer) {
|
|
156
170
|
if (renderer === false || isFarmRendererDisabled(renderer)) renderer = NO_RENDERER;
|
|
157
171
|
const resolved = renderer || REACT_RENDERER;
|
|
@@ -164,6 +178,37 @@ function resolveFarmRenderer(renderer) {
|
|
|
164
178
|
if (resolved.appSetup !== void 0 && (typeof resolved.appSetup !== "string" || resolved.appSetup.trim().length === 0)) {
|
|
165
179
|
throw new TypeError("Farm renderer `appSetup` must be a non-empty module path.");
|
|
166
180
|
}
|
|
181
|
+
const issues = [];
|
|
182
|
+
if (resolved.routes !== void 0 && typeof resolved.routes !== "function") {
|
|
183
|
+
issues.push("`routes` must be a method that returns `{ dir?, resolve(file) }`.");
|
|
184
|
+
}
|
|
185
|
+
const hydration = resolved.hydration;
|
|
186
|
+
if (hydration !== void 0) {
|
|
187
|
+
if (!hydration || typeof hydration !== "object" || Array.isArray(hydration)) {
|
|
188
|
+
issues.push("`hydration` must be an object.");
|
|
189
|
+
} else {
|
|
190
|
+
const options = hydration;
|
|
191
|
+
for (const key of ["pages", "layouts"]) {
|
|
192
|
+
if (options[key] !== void 0 && typeof options[key] !== "boolean") {
|
|
193
|
+
issues.push(`\`hydration.${key}\` must be true or false.`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (options.strategy !== void 0 && !isFarmRendererStrategy(options.strategy)) {
|
|
197
|
+
issues.push(
|
|
198
|
+
`\`hydration.strategy\` must be "load", "idle", "visible", or "interaction"; got ${JSON.stringify(options.strategy)}.`
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
if (options.resolve !== void 0 && typeof options.resolve !== "function") {
|
|
202
|
+
issues.push("`hydration.resolve` must be a method that reads a file's source.");
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (issues.length > 0) {
|
|
207
|
+
throw new TypeError(
|
|
208
|
+
`Farm renderer \`${resolved.name}\` is invalid:
|
|
209
|
+
${issues.map((issue) => `- ${issue}`).join("\n")}`
|
|
210
|
+
);
|
|
211
|
+
}
|
|
167
212
|
return {
|
|
168
213
|
...resolved,
|
|
169
214
|
componentExtensions: [...resolved.componentExtensions || []],
|
|
@@ -174,6 +219,31 @@ function resolveFarmRenderer(renderer) {
|
|
|
174
219
|
options: resolved.options ? { ...resolved.options } : void 0
|
|
175
220
|
};
|
|
176
221
|
}
|
|
222
|
+
function createFarmRendererHookError(message, cause) {
|
|
223
|
+
const error = new Error(message);
|
|
224
|
+
error.cause = cause;
|
|
225
|
+
return error;
|
|
226
|
+
}
|
|
227
|
+
function readFarmRendererHydration(value, where) {
|
|
228
|
+
const result = {};
|
|
229
|
+
if (value.hydrate !== void 0) {
|
|
230
|
+
if (typeof value.hydrate !== "boolean") {
|
|
231
|
+
throw new TypeError(
|
|
232
|
+
`${where} returned \`hydrate: ${JSON.stringify(value.hydrate)}\`. Return true or false, or leave it out.`
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
result.hydrate = value.hydrate;
|
|
236
|
+
}
|
|
237
|
+
if (value.strategy !== void 0) {
|
|
238
|
+
if (!isFarmRendererStrategy(value.strategy)) {
|
|
239
|
+
throw new TypeError(
|
|
240
|
+
`${where} returned \`strategy: ${JSON.stringify(value.strategy)}\`. Return "load", "idle", "visible", or "interaction", or leave it out.`
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
result.strategy = value.strategy;
|
|
244
|
+
}
|
|
245
|
+
return result;
|
|
246
|
+
}
|
|
177
247
|
async function readFarmRendererWebStream(stream) {
|
|
178
248
|
const reader = stream.getReader();
|
|
179
249
|
const decoder = new TextDecoder();
|
|
@@ -228,6 +298,20 @@ async function loadFarmRendererVitePlugins(renderer, root, options = {}) {
|
|
|
228
298
|
return Array.isArray(created) ? [...created] : [created];
|
|
229
299
|
}
|
|
230
300
|
|
|
301
|
+
// src/server-components-mode.ts
|
|
302
|
+
function resolveFarmServerComponentsMode(value) {
|
|
303
|
+
if (value === void 0 || value === null || value === false) return void 0;
|
|
304
|
+
if (value === true) return "islands";
|
|
305
|
+
const mode = typeof value === "object" ? value.mode : void 0;
|
|
306
|
+
if (mode === "rsc" || mode === "islands") return mode;
|
|
307
|
+
throw new TypeError(
|
|
308
|
+
'experimental.serverComponents must be true, false, { mode: "rsc" } or { mode: "islands" }.'
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
function isExplicitFarmServerComponentsMode(value) {
|
|
312
|
+
return typeof value === "object" && value !== null;
|
|
313
|
+
}
|
|
314
|
+
|
|
231
315
|
export {
|
|
232
316
|
getFarmRendererCapabilities,
|
|
233
317
|
getFarmRendererStreamingCapabilitiesForRuntime,
|
|
@@ -241,9 +325,13 @@ export {
|
|
|
241
325
|
isFarmRendererDisabled,
|
|
242
326
|
defineRenderer,
|
|
243
327
|
resolveFarmRenderer,
|
|
328
|
+
createFarmRendererHookError,
|
|
329
|
+
readFarmRendererHydration,
|
|
244
330
|
readFarmRendererWebStream,
|
|
245
331
|
isReactRenderer,
|
|
246
332
|
resolveFarmRendererAppSetup,
|
|
247
333
|
resolveFarmRendererModule,
|
|
248
|
-
loadFarmRendererVitePlugins
|
|
334
|
+
loadFarmRendererVitePlugins,
|
|
335
|
+
resolveFarmServerComponentsMode,
|
|
336
|
+
isExplicitFarmServerComponentsMode
|
|
249
337
|
};
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkL2GUEYHRcjs = require('./chunk-L2GUEYHR.cjs');
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
|
|
@@ -22,19 +24,18 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
22
24
|
var _chunkEACD6ND7cjs = require('./chunk-EACD6ND7.cjs');
|
|
23
25
|
|
|
24
26
|
|
|
27
|
+
var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
|
|
25
28
|
|
|
26
29
|
|
|
27
|
-
var
|
|
28
|
-
|
|
30
|
+
var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
|
|
29
31
|
|
|
30
|
-
var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
|
|
31
32
|
|
|
32
33
|
|
|
33
|
-
var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
|
|
34
34
|
|
|
35
|
+
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
var
|
|
38
|
+
var _chunkMNUYXZV7cjs = require('./chunk-MNUYXZV7.cjs');
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
|
@@ -43,7 +44,8 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
|
|
48
|
+
var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
|
|
47
49
|
|
|
48
50
|
|
|
49
51
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
@@ -480,7 +482,7 @@ function docsWantsFrameworkDetection(docs) {
|
|
|
480
482
|
function isSupportedAdapterDescriptor(value) {
|
|
481
483
|
if (!value || typeof value !== "object") return false;
|
|
482
484
|
const descriptor = value;
|
|
483
|
-
return descriptor.protocol === SUPPORTED_ADAPTER_PROTOCOL && typeof descriptor.server === "string" && descriptor.server.length > 0 && typeof
|
|
485
|
+
return descriptor.protocol === SUPPORTED_ADAPTER_PROTOCOL && typeof descriptor.server === "string" && descriptor.server.length > 0 && typeof _chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, descriptor) === "string";
|
|
484
486
|
}
|
|
485
487
|
async function applyFarmDocsFrameworkAutoDetection(userConfig, options) {
|
|
486
488
|
if (!docsWantsFrameworkDetection(userConfig.docs)) return userConfig;
|
|
@@ -915,7 +917,8 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
915
917
|
configOverrides
|
|
916
918
|
}
|
|
917
919
|
);
|
|
918
|
-
|
|
920
|
+
const adapter = docsOptions.adapter || void 0;
|
|
921
|
+
if (roots.length > 0 && !(_optionalChain([adapter, 'optionalAccess', _42 => _42.server]) && _chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, adapter))) {
|
|
919
922
|
throw new Error(
|
|
920
923
|
`Docs roots require a docs adapter such as @farming-labs/farmjs; Farm's built-in docs renderer serves a single docs root. Install the adapter, or remove the roots from ${configFileName} and docs.roots.`
|
|
921
924
|
);
|
|
@@ -926,7 +929,7 @@ async function resolveDocsConfig(userDocs, options = {}) {
|
|
|
926
929
|
...docsOptions.adapter ? { adapter: docsOptions.adapter } : {},
|
|
927
930
|
...docsOptions.prerender === true ? { prerender: true } : {},
|
|
928
931
|
contentDir,
|
|
929
|
-
configPath: _optionalChain([loadedConfig, 'optionalAccess',
|
|
932
|
+
configPath: _optionalChain([loadedConfig, 'optionalAccess', _43 => _43.configPath]),
|
|
930
933
|
config: {
|
|
931
934
|
...mergedDocsConfig,
|
|
932
935
|
entry: docsEntry,
|
|
@@ -1047,7 +1050,7 @@ function validateConfigRouteSources(routes, field) {
|
|
|
1047
1050
|
return routes;
|
|
1048
1051
|
}
|
|
1049
1052
|
async function resolveConfig(userConfig, mode) {
|
|
1050
|
-
|
|
1053
|
+
_chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _44 => _44.experimental, 'optionalAccess', _45 => _45.serverComponents]));
|
|
1051
1054
|
const projectRoot = userConfig.root || process.cwd();
|
|
1052
1055
|
const layerResolution = await _chunk52Q4OB4Acjs.resolveFarmLayers.call(void 0, userConfig, {
|
|
1053
1056
|
root: projectRoot,
|
|
@@ -1064,7 +1067,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1064
1067
|
'The top-level "output" option is not supported and has no effect. Configure `deploy.target`, `deploy.preset`, or `deploy.outputDir` for deployment output, and use route rendering configuration for static pages.'
|
|
1065
1068
|
);
|
|
1066
1069
|
}
|
|
1067
|
-
if (
|
|
1070
|
+
if (_chunk3OKSEJ33cjs.isReactRenderer.call(void 0, _chunk3OKSEJ33cjs.resolveFarmRenderer.call(void 0, userConfig.renderer))) {
|
|
1068
1071
|
userConfig = await applyFarmDocsFrameworkAutoDetection(userConfig, {
|
|
1069
1072
|
root: userConfig.root || projectRoot
|
|
1070
1073
|
});
|
|
@@ -1088,31 +1091,33 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1088
1091
|
);
|
|
1089
1092
|
}
|
|
1090
1093
|
const root = userConfig.root || process.cwd();
|
|
1091
|
-
const desktopSetup = await _optionalChain([globalThis, 'access',
|
|
1094
|
+
const desktopSetup = await _optionalChain([globalThis, 'access', _46 => _46[/* @__PURE__ */ Symbol.for("@farm.js/core/desktop-setup")], 'optionalCall', _47 => _47(userConfig, root, mode)]);
|
|
1092
1095
|
if (desktopSetup) userConfig = desktopSetup.userConfig;
|
|
1093
|
-
const deploy = resolveDeployConfig(userConfig, _optionalChain([desktopSetup, 'optionalAccess',
|
|
1096
|
+
const deploy = resolveDeployConfig(userConfig, _optionalChain([desktopSetup, 'optionalAccess', _48 => _48.deploy]));
|
|
1094
1097
|
const srcDir = userConfig.srcDir || "src";
|
|
1095
|
-
|
|
1098
|
+
_chunkMNUYXZV7cjs.setFarmProjectSourceDir.call(void 0, root, srcDir);
|
|
1096
1099
|
const docs = await resolveDocsConfig(userConfig.docs, { root, srcDir });
|
|
1100
|
+
const renderer = _chunk3OKSEJ33cjs.resolveFarmRenderer.call(void 0, userConfig.renderer);
|
|
1101
|
+
_chunkL2GUEYHRcjs.assertFarmDocsAdapterRenderer.call(void 0, docs, renderer.name);
|
|
1097
1102
|
const md = _chunk2NOHVIJ3cjs.resolveMarkdownConfig.call(void 0, userConfig.md);
|
|
1098
1103
|
const mdx = _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, userConfig.mdx);
|
|
1099
1104
|
const env = _chunk3EIPOTZVcjs.resolveEnv.call(void 0, userConfig.env, process.env);
|
|
1100
1105
|
_chunk3EIPOTZVcjs.setEnv.call(void 0, env);
|
|
1101
1106
|
const api = await _chunkPMJSG4JScjs.resolveFarmAPIConfig.call(void 0, userConfig.api, { root, mode, env });
|
|
1102
1107
|
const cron = await resolveProjectCronJobs({ root, srcDir, cron: userConfig.cron });
|
|
1103
|
-
const auth =
|
|
1108
|
+
const auth = _chunkL2GUEYHRcjs.resolveFarmAuthConfig.call(void 0, userConfig.auth);
|
|
1104
1109
|
const mcp = resolveFarmMCPConfig(userConfig.mcp);
|
|
1105
|
-
if (auth.enabled && _optionalChain([userConfig, 'access',
|
|
1110
|
+
if (auth.enabled && _optionalChain([userConfig, 'access', _49 => _49.integrations, 'optionalAccess', _50 => _50.auth])) {
|
|
1106
1111
|
throw new Error(
|
|
1107
1112
|
"Choose either the top-level `auth` config or `integrations.auth`; they cannot both own the auth route."
|
|
1108
1113
|
);
|
|
1109
1114
|
}
|
|
1110
|
-
const nativeAuthIntegration = await
|
|
1115
|
+
const nativeAuthIntegration = await _chunkL2GUEYHRcjs.resolveFarmAuthIntegration.call(void 0, auth, {
|
|
1111
1116
|
root,
|
|
1112
1117
|
mode
|
|
1113
1118
|
});
|
|
1114
1119
|
const nativeMCPPlugin = await resolveFarmMCPPlugin(mcp, { root });
|
|
1115
|
-
if (nativeMCPPlugin && _optionalChain([userConfig, 'access',
|
|
1120
|
+
if (nativeMCPPlugin && _optionalChain([userConfig, 'access', _51 => _51.plugins, 'optionalAccess', _52 => _52.some, 'call', _53 => _53((plugin) => _optionalChain([plugin, 'optionalAccess', _54 => _54.name]) === "farm:api-mcp")])) {
|
|
1116
1121
|
throw new Error(
|
|
1117
1122
|
"Choose either the top-level `mcp` config or `apiMcp()` in `plugins`; they configure the same MCP transport."
|
|
1118
1123
|
);
|
|
@@ -1152,7 +1157,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1152
1157
|
layers: layerResolution.layers,
|
|
1153
1158
|
outDir: userConfig.outDir || "dist",
|
|
1154
1159
|
basePath,
|
|
1155
|
-
renderer
|
|
1160
|
+
renderer,
|
|
1156
1161
|
preset: deploy.preset || "node-server",
|
|
1157
1162
|
deploy,
|
|
1158
1163
|
docs,
|
|
@@ -1177,15 +1182,15 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1177
1182
|
serverActions: false,
|
|
1178
1183
|
// Islands mode hydrates client components as islands (RFC 0003); an app can still pick
|
|
1179
1184
|
// isolatedClientHydration itself.
|
|
1180
|
-
isolatedClientHydration:
|
|
1185
|
+
isolatedClientHydration: _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" ? "enabled" : "off",
|
|
1181
1186
|
ppr: false,
|
|
1182
1187
|
...userConfig.experimental
|
|
1183
1188
|
},
|
|
1184
1189
|
agent: resolveFarmAgentConfig(userConfig.agent, {
|
|
1185
1190
|
docs: docs.enabled,
|
|
1186
|
-
pages: !
|
|
1191
|
+
pages: !_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, userConfig.renderer)
|
|
1187
1192
|
}),
|
|
1188
|
-
desktop: _nullishCoalesce(_optionalChain([desktopSetup, 'optionalAccess',
|
|
1193
|
+
desktop: _nullishCoalesce(_optionalChain([desktopSetup, 'optionalAccess', _57 => _57.desktop]), () => ( null)),
|
|
1189
1194
|
...userConfig.mobile !== void 0 ? { mobileClient: true } : {},
|
|
1190
1195
|
plugins: [
|
|
1191
1196
|
...mobileSessionPlugin ? [mobileSessionPlugin] : [],
|
|
@@ -1206,7 +1211,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1206
1211
|
routeRules,
|
|
1207
1212
|
images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
1208
1213
|
userConfig.images,
|
|
1209
|
-
|
|
1214
|
+
_chunk3OKSEJ33cjs.isFarmRendererDisabled.call(void 0, userConfig.renderer) ? "none" : void 0
|
|
1210
1215
|
),
|
|
1211
1216
|
performance: _chunkEACD6ND7cjs.resolveFarmPerformanceConfig.call(void 0, userConfig.performance),
|
|
1212
1217
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, userConfig.theme, basePath),
|
|
@@ -1228,7 +1233,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1228
1233
|
distDir: userConfig.distDir || ".farm",
|
|
1229
1234
|
generateBuildId,
|
|
1230
1235
|
compress: _nullishCoalesce(userConfig.compress, () => ( true)),
|
|
1231
|
-
devIndicators:
|
|
1236
|
+
devIndicators: _chunkL2GUEYHRcjs.resolveFarmDevIndicatorsConfig.call(void 0, userConfig.devIndicators, mode),
|
|
1232
1237
|
serverRuntimeConfig: userConfig.serverRuntimeConfig || {},
|
|
1233
1238
|
publicRuntimeConfig: userConfig.publicRuntimeConfig || {},
|
|
1234
1239
|
env,
|