@farm.js/core 0.1.86 → 0.2.0-beta.0
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-7uKdOttc.d.ts → agent-mcp.d-BdM0pIrD.d.ts} +1 -1
- package/dist/{agent-mcp.d-LChlR2au.d.mts → agent-mcp.d-CMGqpUbk.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-B2TRJT3B.cjs +17 -0
- package/dist/{analyzer-I5S5YKHM.mjs → analyzer-PWHYGER6.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +5 -5
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +4 -4
- package/dist/{app-manifest.d-QMdmqqCr.d.mts → app-manifest.d-BeDB2OVm.d.mts} +1 -1
- package/dist/{app-manifest.d-CRp21oAz.d.ts → app-manifest.d-COhjPgHn.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-Bvpc2eJq.d.mts → app.d-AVZXCfcO.d.mts} +5 -4
- package/dist/{app.d-DEKpJEp4.d.ts → app.d-b3A4cca5.d.ts} +5 -4
- package/dist/{chunk-B7L24VPX.cjs → chunk-22KXTL3I.cjs} +6 -4
- package/dist/chunk-2HTNASSB.cjs +134 -0
- package/dist/{chunk-FULX5RYX.cjs → chunk-2OR5WAD5.cjs} +19 -13
- package/dist/{chunk-5P65LXGU.cjs → chunk-3MY6TNNE.cjs} +15 -14
- package/dist/{chunk-A4WWKG2B.cjs → chunk-5ZWXTIGE.cjs} +2 -2
- package/dist/{chunk-2NKNP4AH.cjs → chunk-6266WH6X.cjs} +1 -1
- package/dist/chunk-65LZRVCZ.mjs +18 -0
- package/dist/{chunk-L2IULWKV.cjs → chunk-7LBNWL3L.cjs} +3 -3
- package/dist/{chunk-KHIEGVG7.mjs → chunk-BGEA4K7C.mjs} +10 -4
- package/dist/{chunk-CVKTYG4L.mjs → chunk-BJHXFEAF.mjs} +2 -2
- package/dist/chunk-BQHIJOZM.cjs +13 -0
- package/dist/{chunk-IAERD73G.cjs → chunk-CFLRUCN7.cjs} +384 -339
- package/dist/{chunk-NXOZRI3B.cjs → chunk-CNGGEHXY.cjs} +2 -2
- package/dist/{chunk-3RVLJTFZ.mjs → chunk-D7LXBLUW.mjs} +1 -1
- package/dist/{chunk-B5QRNCIE.mjs → chunk-DATICPTO.mjs} +1 -1
- package/dist/{chunk-XMVZXZ32.cjs → chunk-ERV422FO.cjs} +2 -2
- package/dist/{chunk-BAD6T5NU.cjs → chunk-FEWCWBOF.cjs} +4 -4
- package/dist/{chunk-FLMALEY2.mjs → chunk-GGD57DJA.mjs} +3 -25
- package/dist/{chunk-HQ2VAJLW.mjs → chunk-GV5D5EM6.mjs} +1 -1
- package/dist/{chunk-6MZSTPD2.mjs → chunk-H47EH24T.mjs} +1 -1
- package/dist/{chunk-OBVBII5K.cjs → chunk-HU4R2PPW.cjs} +2 -2
- package/dist/{chunk-7H2TXT2K.mjs → chunk-HX5HLFBZ.mjs} +7 -0
- package/dist/{chunk-N3VMHPIY.mjs → chunk-HZY63K5C.mjs} +2 -2
- package/dist/{chunk-25JGHAGH.cjs → chunk-I2RBHZF7.cjs} +15 -8
- package/dist/{chunk-FDU4Q4QP.cjs → chunk-IRPXOTEN.cjs} +10 -4
- package/dist/{chunk-NAHDG6UX.mjs → chunk-JDO3X7RB.mjs} +6 -5
- package/dist/{chunk-TQJ35BBW.cjs → chunk-JGUMFTZT.cjs} +4 -4
- package/dist/chunk-JIGWHFA5.mjs +32 -0
- package/dist/{chunk-YBXIVQCE.cjs → chunk-JP5TWUK2.cjs} +4 -4
- package/dist/chunk-K6RMOB25.mjs +134 -0
- package/dist/{chunk-UGD53SNO.cjs → chunk-KQ6TYQU7.cjs} +16 -12
- package/dist/{chunk-6QYPP5KC.mjs → chunk-L6ZL35ZJ.mjs} +7 -5
- package/dist/{chunk-7UTRNV6R.mjs → chunk-LUGQUU4S.mjs} +1 -1
- package/dist/{chunk-QYWP5KDY.mjs → chunk-M4CNAZMS.mjs} +74 -29
- package/dist/{chunk-3TKGMIPX.mjs → chunk-MM4U2NNI.mjs} +91 -12
- package/dist/{chunk-CFKAYV7B.mjs → chunk-MRULVIH3.mjs} +1 -1
- package/dist/{chunk-UAQQUQWE.mjs → chunk-MZPPT5NA.mjs} +1 -1
- package/dist/{chunk-2UYYXSUS.mjs → chunk-N5NRXLCX.mjs} +4 -2
- package/dist/chunk-NDMPGFKL.cjs +47 -0
- package/dist/{chunk-YHM4PXJY.mjs → chunk-O5YM6GU3.mjs} +1 -1
- package/dist/{chunk-QYDGIXQ5.cjs → chunk-PA3VZNWU.cjs} +9 -9
- package/dist/{chunk-2PJVEL56.cjs → chunk-PCAEJNQF.cjs} +5 -27
- package/dist/{chunk-P253SZJF.cjs → chunk-PQ6DBVJ2.cjs} +360 -281
- package/dist/chunk-PTAGDZ7I.mjs +13 -0
- package/dist/{chunk-3AV4DCXY.mjs → chunk-PWTBXYJY.mjs} +12 -6
- package/dist/{chunk-PO5MZIWK.mjs → chunk-QBXS4TNG.mjs} +6 -2
- package/dist/chunk-QZUCVJZJ.cjs +18 -0
- package/dist/{chunk-45ANSCTO.mjs → chunk-SCOKBXHS.mjs} +98 -56
- package/dist/{chunk-BLZCAFGJ.cjs → chunk-SG5RFGV6.cjs} +2 -2
- package/dist/{chunk-U54REWMJ.cjs → chunk-SUACCCZG.cjs} +18 -16
- package/dist/chunk-TCGPBSVY.mjs +47 -0
- package/dist/{chunk-CN2JOTRO.cjs → chunk-THGSPDFD.cjs} +7 -7
- package/dist/{chunk-FWLXYNWA.cjs → chunk-TQFIZRON.cjs} +387 -345
- package/dist/{chunk-VGHDPEPQ.cjs → chunk-UA77C2ZA.cjs} +2 -2
- package/dist/{chunk-Q3YWQEUS.cjs → chunk-VMGQOP7X.cjs} +2 -2
- package/dist/{chunk-4SJ22WTT.mjs → chunk-W3ZBLFLU.mjs} +1 -1
- package/dist/{chunk-SB74WCKC.mjs → chunk-WOTAU3BN.mjs} +4 -4
- package/dist/{chunk-JB4BHRFK.cjs → chunk-WP77JDKI.cjs} +16 -16
- package/dist/{chunk-YMAE32O7.mjs → chunk-WPB6HJC7.mjs} +1 -1
- package/dist/{chunk-VPGEYX5Y.mjs → chunk-WX752VMN.mjs} +2 -2
- package/dist/{chunk-VTEAUQMT.mjs → chunk-X2SMVPLH.mjs} +19 -3
- package/dist/{chunk-DJ3PVHTW.cjs → chunk-XGPRM7OK.cjs} +3 -3
- package/dist/{chunk-GWPANDW3.mjs → chunk-XJJQAFZX.mjs} +1 -1
- package/dist/{chunk-UDWBTABT.cjs → chunk-XRYLMTYF.cjs} +3 -3
- package/dist/{chunk-PAENAKTC.mjs → chunk-YCHIR3X6.mjs} +1 -1
- package/dist/chunk-YIGUFJMR.cjs +32 -0
- package/dist/{chunk-CPSFDQKJ.cjs → chunk-Z43CIBUR.cjs} +20 -4
- package/dist/{chunk-RA5OUXOJ.mjs → chunk-ZOD6EYWE.mjs} +2 -2
- package/dist/{cli-runtime.d-DaElKjaL.d.ts → cli-runtime.d-jqZ7YCsm.d.ts} +5 -5
- package/dist/{cli-runtime.d-C7aMfoTq.d.mts → cli-runtime.d-qL44rqYO.d.mts} +5 -5
- package/dist/{client-component.d-miqIXyQv.d.mts → client-component.d-B2L2LyAr.d.mts} +1 -1
- package/dist/{client-component.d-CZG02pIh.d.ts → client-component.d-BDD5aiUb.d.ts} +1 -1
- package/dist/{client-plugins.d-BVXjyIkY.d.ts → client-plugins.d-Crct3m_r.d.ts} +14 -5
- package/dist/{client-plugins.d-BwKwuO_0.d.mts → client-plugins.d-Dzc3vOw_.d.mts} +14 -5
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -6
- package/dist/client.d.mts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/client.mjs +7 -5
- 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-DGC2247E.mjs → devtools-2CRVXV7E.mjs} +4 -2
- package/dist/{devtools-A3L7WNTB.cjs → devtools-RL4AU5KD.cjs} +5 -3
- package/dist/docs.cjs +6 -4
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +5 -3
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/font.cjs +4 -2
- package/dist/font.d.mts +13 -1
- package/dist/font.d.ts +13 -1
- package/dist/font.mjs +3 -1
- package/dist/{handler.d-BKTWzzNA.d.mts → handler.d-B1S1ZBqS.d.mts} +1 -1
- package/dist/{handler.d-Dzpyg3-N.d.ts → handler.d-ZweCBJD4.d.ts} +1 -1
- package/dist/{headers.d-PZyXcDAH.d.ts → headers.d-BgBdQN8x.d.ts} +1 -1
- package/dist/{headers.d-5opjyhXw.d.mts → headers.d-C-yGl_f6.d.mts} +1 -1
- package/dist/i18n/client.cjs +11 -10
- package/dist/i18n/client.mjs +3 -2
- package/dist/image-attributes.d-BMPDQO1q.d.mts +55 -0
- package/dist/image-attributes.d-BMPDQO1q.d.ts +55 -0
- package/dist/image.cjs +5 -127
- package/dist/image.d.mts +3 -13
- package/dist/image.d.ts +3 -13
- package/dist/image.mjs +5 -127
- package/dist/index.cjs +40 -36
- package/dist/{index.d-C0Mie66f.d.mts → index.d-13h3oDu7.d.mts} +1 -1
- package/dist/{index.d-DV2q-0mE.d.ts → index.d-CtoniAXT.d.ts} +1 -1
- package/dist/index.d.mts +24 -23
- package/dist/index.d.ts +24 -23
- package/dist/index.mjs +35 -31
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +22 -22
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +21 -21
- package/dist/internal/cli-runtime.cjs +8 -6
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +7 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +77 -52
- package/dist/internal/client-runtime.d.mts +9 -7
- package/dist/internal/client-runtime.d.ts +9 -7
- package/dist/internal/client-runtime.mjs +64 -39
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +6 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +5 -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 +51 -18
- package/dist/internal/islands-boot.d.mts +3 -1
- package/dist/internal/islands-boot.d.ts +3 -1
- package/dist/internal/islands-boot.mjs +34 -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-runtime.cjs +6 -6
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +5 -5
- package/dist/internal/renderer-islands.cjs +35 -8
- package/dist/internal/renderer-islands.d.mts +9 -1
- package/dist/internal/renderer-islands.d.ts +9 -1
- package/dist/internal/renderer-islands.mjs +35 -8
- package/dist/internal/spa-router.cjs +4 -3
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/spa-router.mjs +3 -2
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/{island-runtime.d-BA7EPo1v.d.ts → island-runtime.d-D2Mh5eTU.d.ts} +5 -1
- package/dist/{island-runtime.d-BBS_YUSX.d.mts → island-runtime.d-lrpEJlgg.d.mts} +5 -1
- package/dist/{manager-PX4QN4HK.cjs → manager-D4DZRBRS.cjs} +4 -4
- package/dist/{manager-OMTC5FOJ.mjs → manager-PKPQGBAE.mjs} +3 -3
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.mjs +3 -3
- package/dist/{mount.d-gWul1GA1.d.ts → mount.d-DyKlRR6z.d.ts} +1 -1
- package/dist/{mount.d-CZ_qL1iS.d.mts → mount.d-_6Un9wdK.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BBTzhJLj.d.mts → navigation-delegate.d-B9GjWbov.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BZsYEAet.d.ts → navigation-delegate.d-BbW1_pf_.d.ts} +1 -1
- package/dist/navigation.cjs +6 -5
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -4
- package/dist/{plugin-QOTAPTVV.mjs → plugin-EVKQZBNW.mjs} +1 -1
- package/dist/{plugin-3PT7I26P.cjs → plugin-MWO3G2XM.cjs} +2 -2
- package/dist/plugin.cjs +19 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +18 -18
- package/dist/query/client.cjs +8 -7
- package/dist/query/client.mjs +3 -2
- package/dist/{render-plan.d-AaJsYPX-.d.ts → render-plan.d-D0FV9lDT.d.ts} +1 -1
- package/dist/{render-plan.d-bnWxS12w.d.mts → render-plan.d-DaM1NPnm.d.mts} +1 -1
- package/dist/renderer-client.cjs +19 -13
- package/dist/renderer-client.d.mts +6 -5
- package/dist/renderer-client.d.ts +6 -5
- package/dist/renderer-client.mjs +10 -4
- package/dist/renderer.cjs +3 -3
- package/dist/renderer.mjs +2 -2
- package/dist/{request.d-CAeitOG1.d.ts → request.d-CrXC7voZ.d.ts} +1 -1
- package/dist/{request.d-C2HOn3Hi.d.mts → request.d-DVSLilGx.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-CYA-ulnX.d.mts → route-rendering.d-CWi3UYtR.d.mts} +1 -1
- package/dist/{route-rendering.d-A1dIkUK5.d.ts → route-rendering.d-OfbM_rj8.d.ts} +1 -1
- package/dist/{router.d-A_Yt6jYz.d.ts → router.d-Bm9FNSu3.d.ts} +1 -1
- package/dist/{router.d-8lxnzlkr.d.mts → router.d-YKVirmj4.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-SNGPAXGW.cjs → rsc-pipeline-3DYC5ZXW.cjs} +6 -4
- package/dist/{rsc-pipeline-BROS3NEB.mjs → rsc-pipeline-LRB4ZG6I.mjs} +5 -3
- package/dist/{runtime-SLJLW37A.mjs → runtime-3WJNNAAR.mjs} +5 -3
- package/dist/{runtime-7T5TRAWL.cjs → runtime-CRFF32H6.cjs} +7 -5
- package/dist/{runtime.d-C_rZ9_DD.d.mts → runtime.d-BVj6apd0.d.mts} +1 -1
- package/dist/{runtime.d-BPyvWrgQ.d.ts → runtime.d-D7QYVJGO.d.ts} +1 -1
- package/dist/{server-components-status.d-BpxiEMQE.d.mts → server-components-status.d-BDVcxi0z.d.mts} +1 -1
- package/dist/{server-components-status.d-C2UEKJn7.d.ts → server-components-status.d-CfKDpmCH.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +54 -40
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +34 -20
- package/dist/{spa-router.d-BD-6WX1R.d.mts → spa-router.d-DGmropfK.d.mts} +5 -3
- package/dist/{spa-router.d-Cw5i_15e.d.ts → spa-router.d-nE1jHNGt.d.ts} +5 -3
- package/dist/{ssg.d-CCE9aob5.d.mts → ssg.d-DS-gXUbf.d.mts} +2 -2
- package/dist/{ssg.d-Bifiq0EL.d.ts → ssg.d-jXlUAKzg.d.ts} +2 -2
- package/dist/{store-core.d-5tVn5vi1.d.ts → store-core.d-B5cwOd8g.d.ts} +3 -2
- package/dist/{store-core.d-BN2MxSG9.d.mts → store-core.d-C-gATBwd.d.mts} +3 -2
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{utils.d-BUjpSNIO.d.ts → utils.d-BODwBtkz.d.ts} +1 -1
- package/dist/{utils.d-wGPLeVbq.d.mts → utils.d-Cmj-fzds.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +24 -22
- package/dist/vite.d.mts +21 -7
- package/dist/vite.d.ts +21 -7
- package/dist/vite.mjs +23 -21
- package/package.json +3 -3
- package/dist/analyzer-OEMQSLYT.cjs +0 -17
- package/dist/chunk-7EPYN7GW.cjs +0 -30
- package/dist/chunk-HZOMT5DY.mjs +0 -30
- package/dist/chunk-SBDWCDS6.cjs +0 -8
- package/dist/chunk-YX6AFPXC.mjs +0 -8
- package/dist/{chunk-4B6YJ5DS.cjs → chunk-4ZVKDHS6.cjs} +3 -3
- package/dist/{chunk-4EEAPBNV.mjs → chunk-PEQJ4UUT.mjs} +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
var
|
|
3
|
+
var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
|
|
4
4
|
|
|
5
5
|
// src/deployment-environment.ts
|
|
6
6
|
function isFarmProductionDeploymentEnvironment(env = process.env) {
|
|
@@ -90,7 +90,7 @@ function createFarmProductionSiteReporter(options) {
|
|
|
90
90
|
schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
|
|
91
91
|
eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
|
|
92
92
|
packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
|
|
93
|
-
packageVersion: sanitizeDetail(
|
|
93
|
+
packageVersion: sanitizeDetail(_chunk6266WH6Xcjs.FARM_VERSION, "unknown"),
|
|
94
94
|
renderer: sanitizeDetail(options.renderer, "custom"),
|
|
95
95
|
deployTarget: sanitizeDetail(options.deployTarget, "custom")
|
|
96
96
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkZSVFI7JMcjs = require('./chunk-ZSVFI7JM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk5ZWXTIGEcjs = require('./chunk-5ZWXTIGE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -838,7 +838,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
840
|
if (shouldGenerateApi) {
|
|
841
|
-
const generator = new (0,
|
|
841
|
+
const generator = new (0, _chunk5ZWXTIGEcjs.APITypeGenerator)(appDirs);
|
|
842
842
|
const apiRoutes = generator.scanAPIRoutes();
|
|
843
843
|
const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
|
|
844
844
|
const pluginRoutes = _chunkVGVRGGP4cjs.resolvePluginRoutes.call(void 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
var
|
|
3
|
+
var _chunkJGUMFTZTcjs = require('./chunk-JGUMFTZT.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -354,7 +354,7 @@ function requestEvent(metadata, method, status, durationMs) {
|
|
|
354
354
|
id: uuid(),
|
|
355
355
|
requestId: metadata.id,
|
|
356
356
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
357
|
-
route: routeTemplate(
|
|
357
|
+
route: routeTemplate(_chunkJGUMFTZTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
358
358
|
...metadata.path ? { path: metadata.path } : {},
|
|
359
359
|
agent: metadata.agent,
|
|
360
360
|
kind: "request",
|
|
@@ -410,7 +410,7 @@ function toolEvent(metadata, event, payloads) {
|
|
|
410
410
|
id: uuid(),
|
|
411
411
|
requestId: metadata.id,
|
|
412
412
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
413
|
-
route: routeTemplate(
|
|
413
|
+
route: routeTemplate(_chunkJGUMFTZTcjs.getFarmRouteLabel.call(void 0, metadata.route)),
|
|
414
414
|
...metadata.path ? { path: metadata.path } : {},
|
|
415
415
|
agent: metadata.agent,
|
|
416
416
|
kind: "mcp.tool",
|
|
@@ -496,7 +496,7 @@ async function receiveWebMCPReport(request, exporter, options, webmcp, waitUntil
|
|
|
496
496
|
exporter.enqueue({
|
|
497
497
|
id: uuid(),
|
|
498
498
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
499
|
-
route: routeTemplate(
|
|
499
|
+
route: routeTemplate(_chunkJGUMFTZTcjs.getFarmRouteLabel.call(void 0, route)),
|
|
500
500
|
...path ? { path } : {},
|
|
501
501
|
agent: _chunk2NOHVIJ3cjs.classifyFarmClient.call(void 0, request),
|
|
502
502
|
kind: "mcp.tool",
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveFarmNavigationURL
|
|
3
|
+
} from "./chunk-JIGWHFA5.mjs";
|
|
1
4
|
import {
|
|
2
5
|
createFarmLocaleCookie
|
|
3
6
|
} from "./chunk-UJIBSFUE.mjs";
|
|
@@ -9,27 +12,6 @@ import {
|
|
|
9
12
|
resolveFarmLocalePath
|
|
10
13
|
} from "./chunk-4QBFYEDC.mjs";
|
|
11
14
|
|
|
12
|
-
// src/client/navigation-url.ts
|
|
13
|
-
var FARM_NAVIGATION_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
14
|
-
function isFarmBlockedNavigationURL(url) {
|
|
15
|
-
if (FARM_NAVIGATION_PROTOCOLS.has(url.protocol)) return false;
|
|
16
|
-
console.error(`[Farm.js] Blocked navigation to a ${url.protocol} URL as a security precaution.`);
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
function isFarmScriptURL(href) {
|
|
20
|
-
try {
|
|
21
|
-
return new URL(href, "http://farm.invalid").protocol === "javascript:";
|
|
22
|
-
} catch {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function isFarmExternalNavigationURL(url, currentOrigin) {
|
|
27
|
-
return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
|
|
28
|
-
}
|
|
29
|
-
function resolveFarmNavigationURL(href, documentUrl) {
|
|
30
|
-
return new URL(href, documentUrl);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
15
|
// src/i18n/client-state.ts
|
|
34
16
|
var listeners = /* @__PURE__ */ new Set();
|
|
35
17
|
var compiledFarmI18nMessages = /* @__PURE__ */ new Map();
|
|
@@ -76,10 +58,6 @@ function rememberFarmLinkLocale(anchor) {
|
|
|
76
58
|
}
|
|
77
59
|
|
|
78
60
|
export {
|
|
79
|
-
isFarmBlockedNavigationURL,
|
|
80
|
-
isFarmScriptURL,
|
|
81
|
-
isFarmExternalNavigationURL,
|
|
82
|
-
resolveFarmNavigationURL,
|
|
83
61
|
compiledFarmI18nMessages,
|
|
84
62
|
getFarmI18nClientState,
|
|
85
63
|
subscribeFarmI18n,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(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 = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5ZWXTIGEcjs = require('./chunk-5ZWXTIGE.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkVWIW47FWcjs = require('./chunk-VWIW47FW.cjs');
|
|
@@ -678,7 +678,7 @@ var OpenAPIManager = class {
|
|
|
678
678
|
this.config = config;
|
|
679
679
|
this.mountedRoutes = context.routes;
|
|
680
680
|
this.generator = new OpenAPIGenerator(this.appDir, config, context);
|
|
681
|
-
this.apiTypeGenerator = new (0,
|
|
681
|
+
this.apiTypeGenerator = new (0, _chunk5ZWXTIGEcjs.APITypeGenerator)(appDirs);
|
|
682
682
|
}
|
|
683
683
|
getRoutes() {
|
|
684
684
|
if (!this.mountedRoutes) return this.apiTypeGenerator.scanAPIRoutes();
|
|
@@ -8,6 +8,12 @@ async function startPluginContainer(server) {
|
|
|
8
8
|
await container.buildStart?.();
|
|
9
9
|
startedContainers.add(container);
|
|
10
10
|
}
|
|
11
|
+
function createFarmDevModuleCheck(server, exports, environmentName = "ssr") {
|
|
12
|
+
const modules = server.environments[environmentName]?.runner?.evaluatedModules;
|
|
13
|
+
const node = modules ? Array.from(modules.idToModuleMap.values()).find((module) => module.exports === exports) : void 0;
|
|
14
|
+
if (!modules || !node) return () => true;
|
|
15
|
+
return () => node.evaluated && modules.getModuleById(node.id) === node;
|
|
16
|
+
}
|
|
11
17
|
var FarmDevEnvironmentError = class extends Error {
|
|
12
18
|
};
|
|
13
19
|
async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
@@ -90,6 +96,7 @@ function invalidateFailedFarmDevModules(server) {
|
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
export {
|
|
99
|
+
createFarmDevModuleCheck,
|
|
93
100
|
FarmDevEnvironmentError,
|
|
94
101
|
loadFarmDevModule,
|
|
95
102
|
invalidateFarmDevDependents,
|
|
@@ -8,11 +8,17 @@ async function startPluginContainer(server) {
|
|
|
8
8
|
await _optionalChain([container, 'access', _7 => _7.buildStart, 'optionalCall', _8 => _8()]);
|
|
9
9
|
startedContainers.add(container);
|
|
10
10
|
}
|
|
11
|
+
function createFarmDevModuleCheck(server, exports, environmentName = "ssr") {
|
|
12
|
+
const modules = _optionalChain([server, 'access', _9 => _9.environments, 'access', _10 => _10[environmentName], 'optionalAccess', _11 => _11.runner, 'optionalAccess', _12 => _12.evaluatedModules]);
|
|
13
|
+
const node = modules ? Array.from(modules.idToModuleMap.values()).find((module) => module.exports === exports) : void 0;
|
|
14
|
+
if (!modules || !node) return () => true;
|
|
15
|
+
return () => node.evaluated && modules.getModuleById(node.id) === node;
|
|
16
|
+
}
|
|
11
17
|
var FarmDevEnvironmentError = class extends Error {
|
|
12
18
|
};
|
|
13
19
|
async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
14
20
|
const environment = server.environments[environmentName];
|
|
15
|
-
const runner = _optionalChain([environment, 'optionalAccess',
|
|
21
|
+
const runner = _optionalChain([environment, 'optionalAccess', _13 => _13.runner]);
|
|
16
22
|
if (!environment || !runner || typeof runner.import !== "function") {
|
|
17
23
|
throw new FarmDevEnvironmentError(
|
|
18
24
|
`[Farm.js] Cannot load ${JSON.stringify(id)}: the "${environmentName}" development environment must provide a module runner. Remote runtimes require a request/response adapter.`
|
|
@@ -25,7 +31,7 @@ async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
|
25
31
|
const failures = _nullishCoalesce(failedModules.get(environment), () => ( /* @__PURE__ */ new Map()));
|
|
26
32
|
failedModules.set(environment, failures);
|
|
27
33
|
await Promise.all(
|
|
28
|
-
[..._nullishCoalesce(_optionalChain([runner, 'access',
|
|
34
|
+
[..._nullishCoalesce(_optionalChain([runner, 'access', _14 => _14.evaluatedModules, 'optionalAccess', _15 => _15.idToModuleMap, 'access', _16 => _16.values, 'call', _17 => _17()]), () => ( []))].filter((module) => module.evaluated && module.promise).map(async (module) => {
|
|
29
35
|
try {
|
|
30
36
|
await module.promise;
|
|
31
37
|
} catch (e) {
|
|
@@ -38,7 +44,7 @@ async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
|
38
44
|
}
|
|
39
45
|
function invalidateFarmDevDependents(server, file, targets, environmentName = "ssr") {
|
|
40
46
|
const environment = server.environments[environmentName];
|
|
41
|
-
const graph = _optionalChain([environment, 'optionalAccess',
|
|
47
|
+
const graph = _optionalChain([environment, 'optionalAccess', _18 => _18.moduleGraph]);
|
|
42
48
|
if (!graph || targets.size === 0) return [];
|
|
43
49
|
const posix = (filePath) => filePath.replace(/\\/g, "/");
|
|
44
50
|
const byFile = new Map([...targets].map((target) => [posix(target), target]));
|
|
@@ -64,10 +70,10 @@ function invalidateFarmDevDependents(server, file, targets, environmentName = "s
|
|
|
64
70
|
if (!importer.acceptedHmrDeps.has(node)) staleQueue.push(importer);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
|
-
const evaluatedModules = _optionalChain([environment, 'access',
|
|
73
|
+
const evaluatedModules = _optionalChain([environment, 'access', _19 => _19.runner, 'optionalAccess', _20 => _20.evaluatedModules]);
|
|
68
74
|
for (const node of stale) {
|
|
69
75
|
graph.invalidateModule(node);
|
|
70
|
-
const evaluated = node.id ? _optionalChain([evaluatedModules, 'optionalAccess',
|
|
76
|
+
const evaluated = node.id ? _optionalChain([evaluatedModules, 'optionalAccess', _21 => _21.getModuleById, 'call', _22 => _22(node.id)]) : void 0;
|
|
71
77
|
if (evaluated) evaluatedModules.invalidateModule(evaluated);
|
|
72
78
|
}
|
|
73
79
|
return [...reached];
|
|
@@ -76,11 +82,11 @@ function invalidateFailedFarmDevModules(server) {
|
|
|
76
82
|
for (const entry of Object.values(server.environments)) {
|
|
77
83
|
const environment = entry;
|
|
78
84
|
const failures = failedModules.get(environment);
|
|
79
|
-
if (!_optionalChain([failures, 'optionalAccess',
|
|
85
|
+
if (!_optionalChain([failures, 'optionalAccess', _23 => _23.size])) continue;
|
|
80
86
|
const runner = environment.runner;
|
|
81
87
|
for (const [id, failed] of failures) {
|
|
82
88
|
const evaluated = runner.evaluatedModules.getModuleById(id);
|
|
83
|
-
if (_optionalChain([evaluated, 'optionalAccess',
|
|
89
|
+
if (_optionalChain([evaluated, 'optionalAccess', _24 => _24.promise]) !== failed) continue;
|
|
84
90
|
const transformed = environment.moduleGraph.getModuleById(id);
|
|
85
91
|
if (transformed) environment.moduleGraph.invalidateModule(transformed);
|
|
86
92
|
if (evaluated) runner.evaluatedModules.invalidateModule(evaluated);
|
|
@@ -94,4 +100,5 @@ function invalidateFailedFarmDevModules(server) {
|
|
|
94
100
|
|
|
95
101
|
|
|
96
102
|
|
|
97
|
-
|
|
103
|
+
|
|
104
|
+
exports.createFarmDevModuleCheck = createFarmDevModuleCheck; exports.FarmDevEnvironmentError = FarmDevEnvironmentError; exports.loadFarmDevModule = loadFarmDevModule; exports.invalidateFarmDevDependents = invalidateFarmDevDependents; exports.invalidateFailedFarmDevModules = invalidateFailedFarmDevModules;
|
|
@@ -18,6 +18,9 @@ var _chunkLSHX2H5Gcjs = require('./chunk-LSHX2H5G.cjs');
|
|
|
18
18
|
var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
var _chunkZ43CIBURcjs = require('./chunk-Z43CIBUR.cjs');
|
|
22
|
+
|
|
23
|
+
|
|
21
24
|
|
|
22
25
|
|
|
23
26
|
|
|
@@ -48,9 +51,6 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
48
51
|
var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
|
|
49
52
|
|
|
50
53
|
|
|
51
|
-
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
52
|
-
|
|
53
|
-
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
@@ -96,6 +96,9 @@ var _chunk7Q7UB4TLcjs = require('./chunk-7Q7UB4TL.cjs');
|
|
|
96
96
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
100
|
+
|
|
101
|
+
|
|
99
102
|
var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
|
|
100
103
|
|
|
101
104
|
|
|
@@ -1057,6 +1060,7 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1057
1060
|
mode
|
|
1058
1061
|
});
|
|
1059
1062
|
userConfig = layerResolution.config;
|
|
1063
|
+
const rendererServerComponentsIslands = _chunkZ43CIBURcjs.resolveFarmRendererServerComponentsIslands.call(void 0, userConfig);
|
|
1060
1064
|
if (userConfig.typescript !== void 0) {
|
|
1061
1065
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
1062
1066
|
'The top-level "typescript" option is not supported and has no effect. Configure TypeScript in `tsconfig.json` and run `tsc --noEmit` separately when builds must enforce project type errors.'
|
|
@@ -1184,7 +1188,9 @@ async function resolveConfig(userConfig, mode) {
|
|
|
1184
1188
|
// isolatedClientHydration itself.
|
|
1185
1189
|
isolatedClientHydration: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([userConfig, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.serverComponents])) === "islands" ? "enabled" : "off",
|
|
1186
1190
|
ppr: false,
|
|
1187
|
-
...userConfig.experimental
|
|
1191
|
+
...userConfig.experimental,
|
|
1192
|
+
// Another renderer's islands run without Farm's server components engine, which renders React.
|
|
1193
|
+
...rendererServerComponentsIslands ? { serverComponents: false } : {}
|
|
1188
1194
|
},
|
|
1189
1195
|
agent: resolveFarmAgentConfig(userConfig.agent, {
|
|
1190
1196
|
docs: docs.enabled,
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
findProgrammaticRouteFilesInDir
|
|
6
6
|
} from "./chunk-URBP6DLH.mjs";
|
|
7
7
|
import {
|
|
8
|
+
hasPolyroutePlugin,
|
|
8
9
|
isFarmAPIRouteFileName
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PTAGDZ7I.mjs";
|
|
10
11
|
import {
|
|
11
12
|
_runWithFarmI18nRequest
|
|
12
13
|
} from "./chunk-O7JEFGUV.mjs";
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
} from "./chunk-VHIXGZYH.mjs";
|
|
38
39
|
import {
|
|
39
40
|
loadFarmDevModule
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-HX5HLFBZ.mjs";
|
|
41
42
|
import {
|
|
42
43
|
logger
|
|
43
44
|
} from "./chunk-U6GMCDRS.mjs";
|
|
@@ -137,7 +138,7 @@ var APIRouteManager = class _APIRouteManager {
|
|
|
137
138
|
/**
|
|
138
139
|
* Recursively find all route.ts files
|
|
139
140
|
*/
|
|
140
|
-
findRouteFiles(dir) {
|
|
141
|
+
findRouteFiles(dir, polyroute = hasPolyroutePlugin(this.viteServer?.config?.plugins)) {
|
|
141
142
|
const files = [];
|
|
142
143
|
if (!fs.existsSync(dir)) {
|
|
143
144
|
return files;
|
|
@@ -146,8 +147,8 @@ var APIRouteManager = class _APIRouteManager {
|
|
|
146
147
|
for (const entry of entries) {
|
|
147
148
|
const fullPath = path.join(dir, entry.name);
|
|
148
149
|
if (entry.isDirectory()) {
|
|
149
|
-
files.push(...this.findRouteFiles(fullPath));
|
|
150
|
-
} else if (isFarmAPIRouteFileName(entry.name)) {
|
|
150
|
+
files.push(...this.findRouteFiles(fullPath, polyroute));
|
|
151
|
+
} else if (isFarmAPIRouteFileName(entry.name, polyroute)) {
|
|
151
152
|
files.push(fullPath);
|
|
152
153
|
}
|
|
153
154
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkCNGGEHXYcjs = require('./chunk-CNGGEHXY.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkBTVDYS4Bcjs = require('./chunk-BTVDYS4B.cjs');
|
|
@@ -29,7 +29,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
29
29
|
var _chunk7Q7UB4TLcjs = require('./chunk-7Q7UB4TL.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
@@ -288,7 +288,7 @@ function createFarmAppManifest(input, registered = []) {
|
|
|
288
288
|
return {
|
|
289
289
|
schemaVersion: 1,
|
|
290
290
|
app: app ? {
|
|
291
|
-
...app.version ? { farm:
|
|
291
|
+
...app.version ? { farm: _chunk6266WH6Xcjs.FARM_VERSION } : {},
|
|
292
292
|
...app.renderer ? { renderer: input.renderer } : {},
|
|
293
293
|
basePath: input.basePath,
|
|
294
294
|
...app.build ? { build: input.build } : {}
|
|
@@ -319,7 +319,7 @@ function resolveFarmSiteUrl() {
|
|
|
319
319
|
asUrl(read("RAILWAY_PUBLIC_DOMAIN"))
|
|
320
320
|
];
|
|
321
321
|
for (const candidate of candidates) {
|
|
322
|
-
const origin = candidate ?
|
|
322
|
+
const origin = candidate ? _chunkCNGGEHXYcjs.normalizeFarmProductionSiteOrigin.call(void 0, candidate) : void 0;
|
|
323
323
|
if (origin) return origin;
|
|
324
324
|
}
|
|
325
325
|
return null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/client/navigation-url.ts
|
|
2
|
+
var FARM_NAVIGATION_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "tel:"]);
|
|
3
|
+
function isFarmBlockedNavigationURL(url) {
|
|
4
|
+
if (FARM_NAVIGATION_PROTOCOLS.has(url.protocol)) return false;
|
|
5
|
+
console.error(`[Farm.js] Blocked navigation to a ${url.protocol} URL as a security precaution.`);
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
function isFarmScriptURL(href) {
|
|
9
|
+
try {
|
|
10
|
+
return new URL(href, "http://farm.invalid").protocol === "javascript:";
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function isFarmSameDocumentFragment(href, currentHref) {
|
|
16
|
+
const fragment = href.indexOf("#");
|
|
17
|
+
return fragment >= 0 && href.slice(0, fragment) === currentHref.split("#", 1)[0];
|
|
18
|
+
}
|
|
19
|
+
function isFarmExternalNavigationURL(url, currentOrigin) {
|
|
20
|
+
return url.protocol !== "http:" && url.protocol !== "https:" || url.origin !== currentOrigin;
|
|
21
|
+
}
|
|
22
|
+
function resolveFarmNavigationURL(href, documentUrl) {
|
|
23
|
+
return new URL(href, documentUrl);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
isFarmBlockedNavigationURL,
|
|
28
|
+
isFarmScriptURL,
|
|
29
|
+
isFarmSameDocumentFragment,
|
|
30
|
+
isFarmExternalNavigationURL,
|
|
31
|
+
resolveFarmNavigationURL
|
|
32
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkPCAEJNQFcjs = require('./chunk-PCAEJNQF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/i18n/client-runtime.ts
|
|
7
7
|
var _intlmessageformat = require('intl-messageformat'); var _intlmessageformat2 = _interopRequireDefault(_intlmessageformat);
|
|
@@ -11,10 +11,10 @@ var translate = (key, values, rich = false) => {
|
|
|
11
11
|
const message = readOwnMessage(snapshot.messages, key);
|
|
12
12
|
if (message === void 0) return key;
|
|
13
13
|
const cacheKey = `${snapshot.locale}\0${key}\0${message}`;
|
|
14
|
-
let formatter =
|
|
14
|
+
let formatter = _chunkPCAEJNQFcjs.compiledFarmI18nMessages.get(cacheKey);
|
|
15
15
|
if (!formatter) {
|
|
16
16
|
formatter = new (0, _intlmessageformat2.default)(message, snapshot.locale);
|
|
17
|
-
|
|
17
|
+
_chunkPCAEJNQFcjs.compiledFarmI18nMessages.set(cacheKey, formatter);
|
|
18
18
|
}
|
|
19
19
|
const result = formatter.format(values);
|
|
20
20
|
if (rich) return Array.isArray(result) && result.length === 1 ? result[0] : result;
|
|
@@ -31,7 +31,7 @@ function createFarmClientTranslator() {
|
|
|
31
31
|
return ((key, ...args) => t(key, ...args));
|
|
32
32
|
}
|
|
33
33
|
function requireSnapshot() {
|
|
34
|
-
const snapshot =
|
|
34
|
+
const snapshot = _chunkPCAEJNQFcjs.getFarmI18nClientState.call(void 0, );
|
|
35
35
|
if (!snapshot) {
|
|
36
36
|
throw new Error("Farm i18n is not configured or has not been hydrated.");
|
|
37
37
|
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_FARM_IMAGE_DEVICE_SIZES,
|
|
3
|
+
DEFAULT_FARM_IMAGE_FORMATS,
|
|
4
|
+
DEFAULT_FARM_IMAGE_PATH,
|
|
5
|
+
DEFAULT_FARM_IMAGE_QUALITIES,
|
|
6
|
+
DEFAULT_FARM_IMAGE_SIZES
|
|
7
|
+
} from "./chunk-AOIUYHPH.mjs";
|
|
8
|
+
|
|
9
|
+
// src/image-attributes.ts
|
|
10
|
+
var FALLBACK_CONFIG = {
|
|
11
|
+
provider: "auto",
|
|
12
|
+
path: DEFAULT_FARM_IMAGE_PATH,
|
|
13
|
+
deviceSizes: DEFAULT_FARM_IMAGE_DEVICE_SIZES,
|
|
14
|
+
imageSizes: DEFAULT_FARM_IMAGE_SIZES,
|
|
15
|
+
qualities: DEFAULT_FARM_IMAGE_QUALITIES,
|
|
16
|
+
formats: DEFAULT_FARM_IMAGE_FORMATS
|
|
17
|
+
};
|
|
18
|
+
function getImageConfig() {
|
|
19
|
+
return typeof __FARM_IMAGE_CONFIG__ !== "undefined" && __FARM_IMAGE_CONFIG__ ? __FARM_IMAGE_CONFIG__ : FALLBACK_CONFIG;
|
|
20
|
+
}
|
|
21
|
+
function defaultImageLoader(config) {
|
|
22
|
+
return ({ src, width, quality }) => {
|
|
23
|
+
const query = new URLSearchParams({
|
|
24
|
+
url: src,
|
|
25
|
+
w: String(width),
|
|
26
|
+
q: String(quality)
|
|
27
|
+
});
|
|
28
|
+
return `${config.path}?${query}`;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function getClosestQuality(quality, allowed) {
|
|
32
|
+
const requested = quality ?? 75;
|
|
33
|
+
return allowed.reduce(
|
|
34
|
+
(closest, candidate) => Math.abs(candidate - requested) < Math.abs(closest - requested) ? candidate : closest
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
function getCandidateWidths(config, width, sizes, fill) {
|
|
38
|
+
const allSizes = [.../* @__PURE__ */ new Set([...config.imageSizes, ...config.deviceSizes])].sort(
|
|
39
|
+
(left, right) => left - right
|
|
40
|
+
);
|
|
41
|
+
if (fill || sizes) {
|
|
42
|
+
const viewportPercentages = [...sizes?.matchAll(/(^|\s)(\d{1,3})vw/g) ?? []].map(
|
|
43
|
+
(match) => Number(match[2])
|
|
44
|
+
);
|
|
45
|
+
if (viewportPercentages.length > 0) {
|
|
46
|
+
const smallestRatio = Math.min(...viewportPercentages) / 100;
|
|
47
|
+
const minimum = config.deviceSizes[0] * smallestRatio;
|
|
48
|
+
return { widths: allSizes.filter((candidate) => candidate >= minimum), descriptor: "w" };
|
|
49
|
+
}
|
|
50
|
+
return { widths: allSizes, descriptor: "w" };
|
|
51
|
+
}
|
|
52
|
+
if (!width) return { widths: config.deviceSizes.slice(), descriptor: "w" };
|
|
53
|
+
const requested = [width, width * 2];
|
|
54
|
+
const widths = requested.map(
|
|
55
|
+
(target) => allSizes.find((candidate) => candidate >= target) ?? allSizes.at(-1)
|
|
56
|
+
);
|
|
57
|
+
return { widths: [...new Set(widths)], descriptor: "x" };
|
|
58
|
+
}
|
|
59
|
+
function isStaticImageData(value) {
|
|
60
|
+
return typeof value === "object" && value !== null && typeof value.src === "string";
|
|
61
|
+
}
|
|
62
|
+
function shouldSkipOptimization(src, config) {
|
|
63
|
+
return config.provider === "none" || src.startsWith("data:") || src.startsWith("blob:") || /\.svg(?:$|[?#])/i.test(src);
|
|
64
|
+
}
|
|
65
|
+
function resolveImageAttributes(options) {
|
|
66
|
+
const {
|
|
67
|
+
src: srcInput,
|
|
68
|
+
alt,
|
|
69
|
+
width: widthInput,
|
|
70
|
+
height: heightInput,
|
|
71
|
+
fill = false,
|
|
72
|
+
quality: qualityInput,
|
|
73
|
+
sizes: sizesInput,
|
|
74
|
+
loading,
|
|
75
|
+
preload = false,
|
|
76
|
+
placeholder = "empty",
|
|
77
|
+
blurDataURL: blurDataURLInput,
|
|
78
|
+
unoptimized: unoptimizedInput = false,
|
|
79
|
+
loader: loaderInput,
|
|
80
|
+
style,
|
|
81
|
+
...rest
|
|
82
|
+
} = options;
|
|
83
|
+
const config = getImageConfig();
|
|
84
|
+
const staticImage = isStaticImageData(srcInput) ? srcInput : void 0;
|
|
85
|
+
const src = typeof srcInput === "string" ? srcInput : srcInput.src;
|
|
86
|
+
const width = Number(widthInput ?? staticImage?.width) || void 0;
|
|
87
|
+
const height = Number(heightInput ?? staticImage?.height) || void 0;
|
|
88
|
+
const blurDataURL = blurDataURLInput ?? staticImage?.blurDataURL;
|
|
89
|
+
if (!fill && (!width || !height)) {
|
|
90
|
+
throw new TypeError(
|
|
91
|
+
"Farm Image requires width and height unless src is a static import or fill is enabled"
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
if (fill && (widthInput !== void 0 || heightInput !== void 0)) {
|
|
95
|
+
throw new TypeError("Farm Image cannot use width or height together with fill");
|
|
96
|
+
}
|
|
97
|
+
if (placeholder === "blur" && !blurDataURL) {
|
|
98
|
+
throw new TypeError("Farm Image placeholder=blur requires a static import or blurDataURL");
|
|
99
|
+
}
|
|
100
|
+
const unoptimized = unoptimizedInput || shouldSkipOptimization(src, config);
|
|
101
|
+
const quality = getClosestQuality(qualityInput, config.qualities);
|
|
102
|
+
const loader = loaderInput ?? defaultImageLoader(config);
|
|
103
|
+
const sizes = sizesInput ?? (fill ? "100vw" : void 0);
|
|
104
|
+
const candidates = getCandidateWidths(config, width, sizes, fill);
|
|
105
|
+
const srcSet = unoptimized ? void 0 : candidates.widths.map((candidate, index) => {
|
|
106
|
+
const descriptor = candidates.descriptor === "w" ? `${candidate}w` : `${index + 1}x`;
|
|
107
|
+
return `${loader({ src, width: candidate, quality })} ${descriptor}`;
|
|
108
|
+
}).join(", ");
|
|
109
|
+
const renderedSrc = unoptimized ? src : loader({ src, width: candidates.widths.at(-1) ?? width ?? config.deviceSizes[0], quality });
|
|
110
|
+
const fillStyle = fill ? { position: "absolute", inset: 0, width: "100%", height: "100%" } : void 0;
|
|
111
|
+
const placeholderStyle = placeholder === "blur" ? {
|
|
112
|
+
backgroundImage: `url("${blurDataURL}")`,
|
|
113
|
+
backgroundPosition: "50% 50%",
|
|
114
|
+
backgroundRepeat: "no-repeat",
|
|
115
|
+
backgroundSize: "cover"
|
|
116
|
+
} : void 0;
|
|
117
|
+
return {
|
|
118
|
+
...rest,
|
|
119
|
+
alt,
|
|
120
|
+
src: renderedSrc,
|
|
121
|
+
srcSet,
|
|
122
|
+
sizes,
|
|
123
|
+
width: fill ? void 0 : width,
|
|
124
|
+
height: fill ? void 0 : height,
|
|
125
|
+
loading: preload ? "eager" : loading ?? "lazy",
|
|
126
|
+
fetchPriority: preload ? "high" : rest.fetchPriority,
|
|
127
|
+
decoding: rest.decoding ?? "async",
|
|
128
|
+
style: { ...fillStyle, ...placeholderStyle, ...style }
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export {
|
|
133
|
+
resolveImageAttributes
|
|
134
|
+
};
|