@farm.js/core 0.1.60 → 0.1.62
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-C-2S9bnP.d.mts → agent-mcp.d-BKZ3UNbt.d.mts} +1 -1
- package/dist/{agent-mcp.d-SIoCUP1I.d.ts → agent-mcp.d-C1zr_nGS.d.ts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.mjs +2 -2
- package/dist/analyzer-2AHWJJR7.cjs +15 -0
- package/dist/analyzer-YESYU3GK.mjs +15 -0
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.cjs +3 -3
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +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-DrSAHskY.d.mts → app-manifest.d-BpvhfKRH.d.mts} +1 -1
- package/dist/{app-manifest.d-Tb3CJpL4.d.ts → app-manifest.d-ntch_bvA.d.ts} +1 -1
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/{app.d-CmWlYpZJ.d.ts → app.d-AE8_v3Db.d.ts} +4 -10
- package/dist/{app.d-D6QQM_kk.d.mts → app.d-CysWA_8v.d.mts} +4 -10
- package/dist/{chunk-FORSVMEJ.mjs → chunk-2CNKQC3G.mjs} +1 -1
- package/dist/{chunk-ZFUKPWFC.mjs → chunk-2JYBLE63.mjs} +416 -208
- package/dist/{chunk-QRX4JRBO.cjs → chunk-3CCAICF7.cjs} +5 -5
- package/dist/{chunk-ANHZ6SUL.mjs → chunk-3TXKFRSO.mjs} +1 -1
- package/dist/{chunk-BHJAYPYU.mjs → chunk-3UZVPO72.mjs} +1 -1
- package/dist/{chunk-6UUH4N4J.mjs → chunk-43V3ANPQ.mjs} +1 -1
- package/dist/chunk-4EBC7EMW.cjs +8 -0
- package/dist/{chunk-VZY7MAVS.cjs → chunk-4IHMHFQB.cjs} +27 -1
- package/dist/{chunk-FK25QSVC.cjs → chunk-4P5634G6.cjs} +2 -2
- package/dist/{chunk-4JTQPOKO.cjs → chunk-53ZCZ46B.cjs} +2 -2
- package/dist/{chunk-NQJDO7K7.cjs → chunk-545WJ5UG.cjs} +321 -37
- package/dist/{chunk-VU3MYZPO.mjs → chunk-5FE5YT2N.mjs} +26 -0
- package/dist/{chunk-A5BJKSZE.cjs → chunk-5IQ2ERQA.cjs} +2 -2
- package/dist/{chunk-SJRCWF4Z.mjs → chunk-5Y22WNTO.mjs} +2 -2
- package/dist/{chunk-U4BJKNIR.cjs → chunk-752XUZIM.cjs} +11 -6
- package/dist/{chunk-JBK7UJOI.cjs → chunk-AJB3DHN6.cjs} +2 -2
- package/dist/{chunk-YB44NKC2.cjs → chunk-AXVRUDMB.cjs} +2 -2
- package/dist/{chunk-LJVNMGE3.mjs → chunk-BM2LH2JM.mjs} +8 -3
- package/dist/{chunk-YI6FKTTN.cjs → chunk-BT4SEFLC.cjs} +261 -38
- package/dist/{chunk-LIFUPCXW.cjs → chunk-CFG4QERR.cjs} +13 -2
- package/dist/{chunk-3OWVWZ6R.cjs → chunk-CLFEQGET.cjs} +6 -6
- package/dist/{chunk-OZK2DS44.mjs → chunk-CROAFCMW.mjs} +1 -1
- package/dist/{chunk-2KTYMMWT.mjs → chunk-DPE53XWL.mjs} +1 -1
- package/dist/{chunk-3PX4AIXO.mjs → chunk-DQF3QLOH.mjs} +258 -35
- package/dist/{chunk-FSQMN2MQ.mjs → chunk-E46NXBNJ.mjs} +1 -1
- package/dist/{chunk-EGVC4LIG.mjs → chunk-E4RDMG3K.mjs} +1 -1
- package/dist/{chunk-X2CZTWQA.mjs → chunk-ECKQFEX2.mjs} +1 -1
- package/dist/{chunk-MTWXOEI4.cjs → chunk-EXXFSZOC.cjs} +246 -193
- package/dist/{chunk-UYSTTPYJ.cjs → chunk-GGNJAGGE.cjs} +643 -435
- package/dist/{chunk-XTG73QZA.cjs → chunk-GVOMPU3Y.cjs} +12 -8
- package/dist/{chunk-ZP32GNJQ.cjs → chunk-I32V5CZL.cjs} +14 -13
- package/dist/{chunk-37PYUEK5.mjs → chunk-IOF4KXMP.mjs} +7 -3
- package/dist/{chunk-ILMTRGBG.mjs → chunk-IQIKPKFP.mjs} +157 -45
- package/dist/{chunk-5JNUYGNF.cjs → chunk-IWRLV46X.cjs} +2 -2
- package/dist/{chunk-KPOMS5RO.cjs → chunk-J3GFOQOL.cjs} +3 -3
- package/dist/{chunk-NHD7BAKD.mjs → chunk-JCEFKP5M.mjs} +41 -25
- package/dist/{analyzer-LCSI3NSH.cjs → chunk-JEJQGZI7.cjs} +16 -13
- package/dist/{chunk-LB3DPQP6.cjs → chunk-JLDNXURZ.cjs} +23 -23
- package/dist/{chunk-VGG74PSU.cjs → chunk-L2JG337G.cjs} +2 -2
- package/dist/chunk-L4RTTTVE.mjs +8 -0
- package/dist/chunk-LEJDW34D.cjs +115 -0
- package/dist/{analyzer-22BEYV7S.mjs → chunk-LVWGURLD.mjs} +6 -3
- package/dist/{chunk-Z5A6CNV2.mjs → chunk-MK5E44WP.mjs} +1 -1
- package/dist/{chunk-T4EW7AAD.mjs → chunk-NKRZLQUK.mjs} +2 -2
- package/dist/{chunk-HPWB57PZ.mjs → chunk-NT3QDN2E.mjs} +1 -1
- package/dist/{chunk-T7I62A4C.mjs → chunk-OUWRNHTV.mjs} +81 -28
- package/dist/{chunk-GFT5AHAT.mjs → chunk-QDWMCFTH.mjs} +12 -1
- package/dist/{chunk-AER5I65K.mjs → chunk-QTD6EMN2.mjs} +1 -1
- package/dist/{chunk-UDJY2ZGY.cjs → chunk-RMUD75WT.cjs} +413 -301
- package/dist/chunk-RZNCMRD3.mjs +141 -0
- package/dist/{chunk-D7LTCK3U.mjs → chunk-SA7MLSP4.mjs} +11 -6
- package/dist/{chunk-2FRLSDBT.cjs → chunk-SM25ZC4S.cjs} +1 -1
- package/dist/{chunk-3YMLUNL2.cjs → chunk-SVXOCTQ2.cjs} +1 -1
- package/dist/{chunk-W2RZ73IU.cjs → chunk-SYXPWJ7N.cjs} +8 -8
- package/dist/{chunk-F6Y7ZAPQ.mjs → chunk-T46NNU4D.mjs} +6 -3
- package/dist/{chunk-IFHPDLIS.mjs → chunk-TGULJSHD.mjs} +5 -4
- package/dist/{chunk-JPIUGDK4.mjs → chunk-TZVUF5JJ.mjs} +1 -1
- package/dist/chunk-UWI3SJAK.cjs +141 -0
- package/dist/{chunk-JI5D7MXY.mjs → chunk-UYRI6U3P.mjs} +1 -1
- package/dist/{chunk-D2X5MUF5.cjs → chunk-V727H3RI.cjs} +47 -31
- package/dist/{chunk-ZMHAFH4R.mjs → chunk-VM7X5CKC.mjs} +2 -2
- package/dist/{chunk-VPTWKOCY.mjs → chunk-VWW4Q3BJ.mjs} +287 -6
- package/dist/{chunk-4P23B7DU.cjs → chunk-WKJQ2FJA.cjs} +3 -3
- package/dist/{chunk-HASX6DC7.cjs → chunk-WKPBIT5Q.cjs} +8 -8
- package/dist/{chunk-RAWWCDCT.cjs → chunk-WYAXRIYP.cjs} +3 -3
- package/dist/{chunk-3TL3AH25.cjs → chunk-X4K7TYN6.cjs} +12 -7
- package/dist/chunk-XCXHQBMM.mjs +115 -0
- package/dist/{chunk-DPJ66FSI.cjs → chunk-XX32BOMM.cjs} +7 -7
- package/dist/{chunk-2IAPKPEB.cjs → chunk-YN6BHOYY.cjs} +6 -6
- package/dist/{chunk-CBKRS3M4.cjs → chunk-Z7P2BTZ3.cjs} +7 -6
- package/dist/{chunk-SX7EECTS.mjs → chunk-ZBUAOGMY.mjs} +1 -1
- package/dist/{chunk-RPUJHJHE.mjs → chunk-ZFWYCVKS.mjs} +4 -3
- package/dist/{chunk-IFXSBJPN.cjs → chunk-ZVIEFTUA.cjs} +20 -17
- package/dist/{chunk-EXUONJYV.mjs → chunk-ZZI56IUY.mjs} +3 -3
- package/dist/{programmatic-routes-client.d-CLG2N1yH.d.ts → client-component.d-Bgt3x5Fu.d.ts} +18 -3
- package/dist/{programmatic-routes-client.d-CPbNqtIi.d.mts → client-component.d-BoqC2MLC.d.mts} +18 -3
- package/dist/{client-plugins.d-vXrbcfJ1.d.ts → client-plugins.d-BcqIy4au.d.ts} +1 -1
- package/dist/{client-plugins.d-CgQQ-EAv.d.mts → client-plugins.d-CWyYBxXf.d.mts} +1 -1
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/{config.d-DqZkLwef.d.ts → config.d-qt-mE8O5.d.mts} +6 -2
- package/dist/{config.d-DqZkLwef.d.mts → config.d-qt-mE8O5.d.ts} +6 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/cron.cjs +12 -2
- package/dist/cron.d.mts +101 -3
- package/dist/cron.d.ts +101 -3
- package/dist/cron.mjs +11 -1
- package/dist/desktop.d.mts +3 -3
- package/dist/desktop.d.ts +3 -3
- package/dist/{devtools-KQZ6SRCJ.mjs → devtools-NUVXYG7I.mjs} +6 -6
- package/dist/{devtools-UF6JYHUN.cjs → devtools-SVRSGPNC.cjs} +8 -8
- package/dist/docs.cjs +9 -9
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +8 -8
- package/dist/image/server.cjs +3 -3
- package/dist/image/server.mjs +2 -2
- package/dist/image/sharp.cjs +10 -10
- package/dist/image/sharp.mjs +2 -2
- package/dist/index.cjs +42 -27
- package/dist/{index.d-Dmfb7Kb_.d.mts → index.d-BDaiu2i5.d.mts} +1 -1
- package/dist/{index.d-DlCELfhf.d.ts → index.d-nAncqTXz.d.ts} +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +42 -27
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.cjs +27 -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 +26 -21
- package/dist/internal/cli-runtime.cjs +12 -11
- package/dist/internal/cli-runtime.mjs +11 -10
- 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 +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +5 -5
- package/dist/internal/config-runtime.d.ts +5 -5
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/form-actions.cjs +4 -4
- package/dist/internal/form-actions.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/metadata-image-runtime.cjs +3 -3
- package/dist/internal/metadata-image-runtime.mjs +2 -2
- package/dist/internal/native-server-fns.cjs +25 -0
- package/dist/internal/native-server-fns.d.mts +42 -0
- package/dist/internal/native-server-fns.d.ts +42 -0
- package/dist/internal/native-server-fns.mjs +25 -0
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-node-env.cjs +2 -2
- package/dist/internal/production-node-env.mjs +1 -1
- package/dist/internal/production-runtime.cjs +16 -10
- package/dist/internal/production-runtime.d.mts +39 -12
- package/dist/internal/production-runtime.d.ts +39 -12
- package/dist/internal/production-runtime.mjs +15 -9
- package/dist/internal/react-cache.cjs +51 -0
- package/dist/internal/react-cache.d.mts +3 -0
- package/dist/internal/react-cache.d.ts +3 -0
- package/dist/internal/react-cache.mjs +51 -0
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/middleware.cjs +3 -3
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +2 -2
- package/dist/mobile.d.mts +10 -4
- package/dist/mobile.d.ts +10 -4
- package/dist/{modules-VHD7BELU.mjs → modules-KOKD4XS6.mjs} +2 -2
- package/dist/modules-QTP7WJPD.cjs +13 -0
- package/dist/native-server-fn-handler-GLRHAYWV.mjs +28 -0
- package/dist/native-server-fn-handler-J5MYRXN6.cjs +28 -0
- package/dist/native-specs-5OLED4MM.cjs +15 -0
- package/dist/{native-specs-BD7HOTMJ.mjs → native-specs-LDV6IZ4N.mjs} +1 -1
- package/dist/{native-tree-VWNW2MQ2.mjs → native-tree-AS5L3ID3.mjs} +2 -2
- package/dist/{native-tree-6G5O53O3.cjs → native-tree-Z2WYUJEV.cjs} +3 -3
- package/dist/native.cjs +1 -1
- package/dist/native.d.mts +5 -5
- package/dist/native.d.ts +5 -5
- package/dist/native.mjs +1 -1
- package/dist/{navigation-delegate.d-JXx40JzR.d.ts → navigation-delegate.d-BbUHRXxG.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CnOTWOyi.d.mts → navigation-delegate.d-CSCm8ZxL.d.mts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/{nitro-FLN6DRGJ.mjs → nitro-DD4QCA66.mjs} +5 -5
- package/dist/{nitro-HXAZZQKY.cjs → nitro-VRDX2H4M.cjs} +8 -8
- package/dist/plugin.cjs +19 -18
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +18 -17
- package/dist/{port-WOOQ3V56.mjs → port-UFUZL6RI.mjs} +2 -2
- package/dist/{port-C6GBH4C6.cjs → port-VTLHPZOI.cjs} +10 -10
- package/dist/{production-runtime.d-CP5s6RuY.d.mts → production-runtime.d-CcQiDko5.d.mts} +1 -1
- package/dist/{production-runtime.d-N-cE3pmy.d.ts → production-runtime.d-DgT24A0f.d.ts} +1 -1
- package/dist/{render-plan.d-DZ-qjjdG.d.mts → render-plan.d-BH9WF-JZ.d.mts} +1 -1
- package/dist/{render-plan.d-B9lAP3uX.d.ts → render-plan.d-CyrX6MDs.d.ts} +1 -1
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/{request.d-BiicaNxb.d.ts → request.d-BB8M8bcD.d.ts} +1 -1
- package/dist/{request.d-DV0oeUit.d.mts → request.d-CUrPnCW7.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/{route-rendering.d-BrIKA51A.d.mts → route-rendering.d-CYxlzaFm.d.mts} +1 -1
- package/dist/{route-rendering.d-Iss0C7GR.d.ts → route-rendering.d-DYqZMIf4.d.ts} +1 -1
- package/dist/{router.d-mNTbOGV_.d.mts → router.d-7o24CD8u.d.mts} +1 -1
- package/dist/{router.d-DjGn_al7.d.ts → router.d-DaKo507j.d.ts} +1 -1
- package/dist/{routes.d-BKSjHuH9.d.ts → routes.d-BknKQcTu.d.ts} +7 -1
- package/dist/{routes.d-qd8Qf4LG.d.mts → routes.d-D1IrO9KK.d.mts} +7 -1
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/{rsc-pipeline-SVLBTY7H.cjs → rsc-pipeline-OF2I7PCX.cjs} +8 -8
- package/dist/{rsc-pipeline-WBLBDQXA.mjs → rsc-pipeline-RFLHDAKD.mjs} +7 -7
- package/dist/{runtime-DGUOWSMF.cjs → runtime-LBTK62AD.cjs} +70 -47
- package/dist/{runtime-HFZTVNFF.mjs → runtime-M6UJCSLA.mjs} +38 -15
- package/dist/{runtime.d-Bm_4hP5T.d.ts → runtime.d-CN73a-IL.d.ts} +1 -1
- package/dist/{runtime.d-BNVbojF1.d.mts → runtime.d-CcNuzhX6.d.mts} +1 -1
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +38 -37
- package/dist/server.d.mts +10 -10
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +23 -22
- package/dist/{spa-router.d-DHDoXxDE.d.mts → spa-router.d-CNi77LZm.d.mts} +2 -2
- package/dist/{spa-router.d-DAtnNoBe.d.ts → spa-router.d-Cvgf5QP4.d.ts} +2 -2
- package/dist/testing.cjs +6 -6
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +4 -4
- package/dist/{utils.d-DwZ-KLSB.d.ts → utils.d-C3H-14_Y.d.ts} +1 -1
- package/dist/{utils.d-uKZcKJk4.d.mts → utils.d-D8VfzZYn.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -18
- package/dist/vite.d.mts +5 -5
- package/dist/vite.d.ts +5 -5
- package/dist/vite.mjs +20 -17
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +12 -2
- package/dist/modules-WT5D3AWY.cjs +0 -13
- package/dist/native-specs-IQQRJOOW.cjs +0 -15
|
@@ -5,18 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkV727H3RIcjs = require('./chunk-V727H3RI.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-BTZ5O6VM.cjs');
|
|
11
|
+
var _chunkSM25ZC4Scjs = require('./chunk-SM25ZC4S.cjs');
|
|
13
12
|
|
|
14
13
|
// src/mobile/analyzer.ts
|
|
15
14
|
var _crypto = require('crypto');
|
|
16
15
|
var _fs = require('fs');
|
|
17
16
|
var _promises = require('fs/promises');
|
|
18
17
|
var _path = require('path'); var path = _interopRequireWildcard(_path);
|
|
19
|
-
var ANALYZER_VERSION = `5:${
|
|
18
|
+
var ANALYZER_VERSION = `5:${_chunkSM25ZC4Scjs.FARM_VERSION}`;
|
|
20
19
|
var INTRINSIC_KINDS = {};
|
|
21
20
|
for (const tag of "div section main article header footer nav aside figure hr li".split(" ")) {
|
|
22
21
|
INTRINSIC_KINDS[tag] = "View";
|
|
@@ -140,13 +139,13 @@ var INLINE_BOX_TAGS = new Set("span strong em b i small label code".split(" "));
|
|
|
140
139
|
function hasBoxStyle(node) {
|
|
141
140
|
const tokens = _nullishCoalesce(node.style, () => ( []));
|
|
142
141
|
const classes = tokens.filter((token) => !token.startsWith("style."));
|
|
143
|
-
const resolved =
|
|
142
|
+
const resolved = _chunkV727H3RIcjs.resolveFarmNativeClasses.call(void 0, classes.join(" "));
|
|
144
143
|
const keys = [
|
|
145
144
|
...Object.keys(resolved.style),
|
|
146
145
|
...Object.keys(_nullishCoalesce(resolved.dark, () => ( {}))),
|
|
147
146
|
...tokens.filter((token) => token.startsWith("style.")).map((token) => token.slice(6))
|
|
148
147
|
];
|
|
149
|
-
return keys.some((key) => !
|
|
148
|
+
return keys.some((key) => !_chunkV727H3RIcjs.FARM_NATIVE_TEXT_KEYS.has(key));
|
|
150
149
|
}
|
|
151
150
|
var MAPPED_COMPONENTS = {
|
|
152
151
|
"@farm.js/core": { Link: "Pressable" },
|
|
@@ -512,7 +511,7 @@ function analyzeSource(file, source, parseSync) {
|
|
|
512
511
|
} else if (problem) block(attribute, "class-name", problem);
|
|
513
512
|
else {
|
|
514
513
|
style.push(token);
|
|
515
|
-
const native =
|
|
514
|
+
const native = _chunkV727H3RIcjs.farmNativeClassProblem.call(void 0, token);
|
|
516
515
|
if (native) block(attribute, "class-name", native, "native");
|
|
517
516
|
}
|
|
518
517
|
}
|
|
@@ -534,7 +533,7 @@ function analyzeSource(file, source, parseSync) {
|
|
|
534
533
|
block(property, "style", `style.${key} has no native mapping`);
|
|
535
534
|
continue;
|
|
536
535
|
}
|
|
537
|
-
if (!
|
|
536
|
+
if (!_chunkV727H3RIcjs.FARM_NATIVE_STYLE_PROPERTIES.has(key)) {
|
|
538
537
|
block(property, "style", `style.${key} has no native-tier style`, "native");
|
|
539
538
|
}
|
|
540
539
|
const literal2 = staticString(property.value);
|
|
@@ -1037,7 +1036,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1037
1036
|
const readStylesheet = (file) => {
|
|
1038
1037
|
let sheet = parsedSheets.get(file);
|
|
1039
1038
|
if (!sheet) {
|
|
1040
|
-
sheet =
|
|
1039
|
+
sheet = _chunkV727H3RIcjs.parseFarmNativeStylesheet.call(void 0, _fs.readFileSync.call(void 0, file, "utf8"));
|
|
1041
1040
|
parsedSheets.set(file, sheet);
|
|
1042
1041
|
}
|
|
1043
1042
|
return sheet;
|
|
@@ -1049,6 +1048,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1049
1048
|
const allStylesheets = /* @__PURE__ */ new Set();
|
|
1050
1049
|
const unreadStylesheets = /* @__PURE__ */ new Set();
|
|
1051
1050
|
for (const [route, { page, layouts }] of entries) {
|
|
1051
|
+
if (!page && _optionalChain([options, 'access', _34 => _34.nativeOnlyRoutes, 'optionalAccess', _35 => _35.has, 'call', _36 => _36(route)])) continue;
|
|
1052
1052
|
const blockers = [];
|
|
1053
1053
|
const wins = /* @__PURE__ */ new Set();
|
|
1054
1054
|
const elements = { total: 0, mapped: 0, byKind: {} };
|
|
@@ -1127,7 +1127,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1127
1127
|
if (entryImport.stylesheet) {
|
|
1128
1128
|
stylesheets.add(entryImport.stylesheet);
|
|
1129
1129
|
allStylesheets.add(entryImport.stylesheet);
|
|
1130
|
-
} else if (_optionalChain([entryImport, 'access',
|
|
1130
|
+
} else if (_optionalChain([entryImport, 'access', _37 => _37.blocker, 'optionalAccess', _38 => _38.rule]) === "css-import") {
|
|
1131
1131
|
unreadStylesheets.add(entryImport.fact.source);
|
|
1132
1132
|
}
|
|
1133
1133
|
if (entryImport.blocker) add({ file: label, ...entryImport.blocker });
|
|
@@ -1157,7 +1157,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1157
1157
|
for (const layout of layouts) walk(layout, true, true);
|
|
1158
1158
|
const sheets = [...stylesheets].map(readStylesheet);
|
|
1159
1159
|
for (const appClass of appClasses) {
|
|
1160
|
-
const { styled, problems } =
|
|
1160
|
+
const { styled, problems } = _chunkV727H3RIcjs.inspectFarmNativeStylesheets.call(void 0, sheets, { class: appClass.name });
|
|
1161
1161
|
const at = { file: appClass.file, line: appClass.line, column: appClass.column };
|
|
1162
1162
|
if (!styled) {
|
|
1163
1163
|
blockers.push({
|
|
@@ -1172,7 +1172,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
1174
|
for (const tag of tags) {
|
|
1175
|
-
for (const message of
|
|
1175
|
+
for (const message of _chunkV727H3RIcjs.inspectFarmNativeStylesheets.call(void 0, sheets, { tag }).problems) {
|
|
1176
1176
|
blockers.push({
|
|
1177
1177
|
file: relative2(root, _nullishCoalesce(page, () => ( ""))),
|
|
1178
1178
|
line: 1,
|
|
@@ -1226,4 +1226,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1226
1226
|
|
|
1227
1227
|
|
|
1228
1228
|
|
|
1229
|
-
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
exports.CORE_PORTABLE = CORE_PORTABLE; exports.readAliases = readAliases; exports.resolveFile = resolveFile; exports.analyzeFarmMobileRoutes = analyzeFarmMobileRoutes;
|
|
@@ -9,7 +9,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
9
9
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkSYXPWJ7Ncjs = require('./chunk-SYXPWJ7N.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkNWUHS6GVcjs = require('./chunk-NWUHS6GV.cjs');
|
|
@@ -24,7 +24,7 @@ var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkZ7P2BTZ3cjs = require('./chunk-Z7P2BTZ3.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
|
|
@@ -45,7 +45,7 @@ var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
var _chunkHNAISJFDcjs = require('./chunk-HNAISJFD.cjs');
|
|
@@ -61,7 +61,7 @@ function farmApiPlugin(options = {}) {
|
|
|
61
61
|
const srcDir = _nullishCoalesce(options.srcDir, () => ( "src"));
|
|
62
62
|
const apiDirFromRoot = _nullishCoalesce(options.apiDir, () => ( _path2.default.join(srcDir, "api")));
|
|
63
63
|
const debug = _nullishCoalesce(options.debug, () => ( false));
|
|
64
|
-
const bodySizeLimit =
|
|
64
|
+
const bodySizeLimit = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, {
|
|
65
65
|
bodySizeLimit: options.bodySizeLimit
|
|
66
66
|
}).bodySizeLimit;
|
|
67
67
|
const basePath = options.basePath;
|
|
@@ -114,7 +114,7 @@ function farmApiPlugin(options = {}) {
|
|
|
114
114
|
const existing = apiRoutesCache.get(routePath);
|
|
115
115
|
const existingFile = _optionalChain([endpointSources, 'access', _ => _.get, 'call', _2 => _2(routePath), 'optionalAccess', _3 => _3.get, 'call', _4 => _4(normalizedMethod)]);
|
|
116
116
|
if (existingFile) {
|
|
117
|
-
throw new (0,
|
|
117
|
+
throw new (0, _chunkSYXPWJ7Ncjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
118
118
|
}
|
|
119
119
|
if (existing) {
|
|
120
120
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -190,7 +190,7 @@ function farmApiPlugin(options = {}) {
|
|
|
190
190
|
const createRouter = async () => {
|
|
191
191
|
const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
|
|
192
192
|
pluginMergedRoutes = plugins.length ? new Map(
|
|
193
|
-
|
|
193
|
+
_chunkZ7P2BTZ3cjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
|
|
194
194
|
bodySizeLimit,
|
|
195
195
|
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
196
196
|
// so the middleware that guards the endpoint's path runs for it.
|
|
@@ -210,7 +210,7 @@ function farmApiPlugin(options = {}) {
|
|
|
210
210
|
const url = new URL(request.url);
|
|
211
211
|
const method = request.method.toUpperCase();
|
|
212
212
|
const pathname = url.pathname;
|
|
213
|
-
const match =
|
|
213
|
+
const match = _chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
|
|
214
214
|
if (!match) {
|
|
215
215
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
216
216
|
status: 404,
|
|
@@ -218,18 +218,18 @@ function farmApiPlugin(options = {}) {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
const { route, params } = match;
|
|
221
|
-
const endpoint =
|
|
221
|
+
const endpoint = _chunkZ7P2BTZ3cjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
222
222
|
if (!endpoint) {
|
|
223
223
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
224
224
|
status: 405,
|
|
225
225
|
headers: {
|
|
226
|
-
Allow:
|
|
226
|
+
Allow: _chunkZ7P2BTZ3cjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
227
227
|
"Content-Type": "application/json"
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
try {
|
|
232
|
-
return await
|
|
232
|
+
return await _chunkZ7P2BTZ3cjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
|
|
233
233
|
} catch (error) {
|
|
234
234
|
return new Response(JSON.stringify({ error: error.message || "Internal Server Error" }), {
|
|
235
235
|
status: 500,
|
|
@@ -278,7 +278,7 @@ function farmApiPlugin(options = {}) {
|
|
|
278
278
|
const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, filePath);
|
|
279
279
|
const endpoints = {};
|
|
280
280
|
const availableMethods = [];
|
|
281
|
-
for (const method of
|
|
281
|
+
for (const method of _chunkZ7P2BTZ3cjs.API_ROUTE_METHODS) {
|
|
282
282
|
if (routeModule[method]) {
|
|
283
283
|
availableMethods.push(method);
|
|
284
284
|
endpoints[method] = routeModule[method];
|
|
@@ -291,7 +291,7 @@ function farmApiPlugin(options = {}) {
|
|
|
291
291
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
292
292
|
}
|
|
293
293
|
} catch (e) {
|
|
294
|
-
if (e instanceof
|
|
294
|
+
if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
295
295
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
@@ -318,7 +318,7 @@ function farmApiPlugin(options = {}) {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
} catch (e) {
|
|
321
|
-
if (e instanceof
|
|
321
|
+
if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
322
322
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
323
323
|
}
|
|
324
324
|
break;
|
|
@@ -349,7 +349,7 @@ function farmApiPlugin(options = {}) {
|
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
} catch (e) {
|
|
352
|
-
if (e instanceof
|
|
352
|
+
if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
353
353
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -403,15 +403,15 @@ function farmApiPlugin(options = {}) {
|
|
|
403
403
|
if (discoveryPromise) await waitForDiscovery();
|
|
404
404
|
const farmMiddleware = server.__farmMiddleware__;
|
|
405
405
|
let middlewareRan = false;
|
|
406
|
-
if (!
|
|
407
|
-
if (!farmMiddleware || !apiRouterHandler || !
|
|
406
|
+
if (!_chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
|
|
407
|
+
if (!farmMiddleware || !apiRouterHandler || !_chunkZ7P2BTZ3cjs.isFarmAPIPathname.call(void 0, pathname, basePath)) {
|
|
408
408
|
return next();
|
|
409
409
|
}
|
|
410
410
|
await _optionalChain([farmMiddleware, 'access', _5 => _5.waitForDiscovery, 'optionalCall', _6 => _6()]);
|
|
411
411
|
if (await farmMiddleware.execute(req, res, pathname, /* @__PURE__ */ new Map())) return;
|
|
412
412
|
middlewareRan = true;
|
|
413
413
|
const rewrittenPathname = (req.url || url).split("?")[0];
|
|
414
|
-
if (rewrittenPathname === pathname || !
|
|
414
|
+
if (rewrittenPathname === pathname || !_chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), rewrittenPathname, basePath)) {
|
|
415
415
|
return next();
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -432,7 +432,7 @@ function farmApiPlugin(options = {}) {
|
|
|
432
432
|
}
|
|
433
433
|
const currentUrl = req.url || url;
|
|
434
434
|
const currentPathname = currentUrl.split("?")[0];
|
|
435
|
-
if (currentPathname !== pathname && !
|
|
435
|
+
if (currentPathname !== pathname && !_chunkZ7P2BTZ3cjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
|
|
436
436
|
return next();
|
|
437
437
|
}
|
|
438
438
|
const fullUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req);
|
|
@@ -444,7 +444,7 @@ function farmApiPlugin(options = {}) {
|
|
|
444
444
|
}
|
|
445
445
|
let body;
|
|
446
446
|
if (method !== "GET" && method !== "HEAD") {
|
|
447
|
-
body = await
|
|
447
|
+
body = await _chunkCFG4QERRcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
|
|
448
448
|
}
|
|
449
449
|
const request = new Request(fullUrl, {
|
|
450
450
|
method,
|
|
@@ -459,7 +459,7 @@ function farmApiPlugin(options = {}) {
|
|
|
459
459
|
logResponse(method, currentPathname, response.status, duration);
|
|
460
460
|
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
461
461
|
} catch (error) {
|
|
462
|
-
const bodyErrorResponse =
|
|
462
|
+
const bodyErrorResponse = _chunkCFG4QERRcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
463
463
|
if (bodyErrorResponse) {
|
|
464
464
|
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
465
465
|
return;
|
|
@@ -536,7 +536,7 @@ function farmApiPlugin(options = {}) {
|
|
|
536
536
|
log(`API router recreated`);
|
|
537
537
|
} catch (e) {
|
|
538
538
|
restoreRouteState(previousState);
|
|
539
|
-
if (e instanceof
|
|
539
|
+
if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
540
540
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
541
541
|
}
|
|
542
542
|
return [];
|
|
@@ -564,7 +564,7 @@ function farmApiPlugin(options = {}) {
|
|
|
564
564
|
const routeModule = await _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
565
565
|
removeEndpointsFromFile(file);
|
|
566
566
|
const availableMethods = [];
|
|
567
|
-
for (const method of
|
|
567
|
+
for (const method of _chunkZ7P2BTZ3cjs.API_ROUTE_METHODS) {
|
|
568
568
|
if (!routeModule[method]) continue;
|
|
569
569
|
availableMethods.push(method);
|
|
570
570
|
addEndpoint(routePath, file, method, routeModule[method]);
|
|
@@ -574,7 +574,7 @@ function farmApiPlugin(options = {}) {
|
|
|
574
574
|
log(`API router recreated`);
|
|
575
575
|
} catch (e) {
|
|
576
576
|
restoreRouteState(previousState);
|
|
577
|
-
if (e instanceof
|
|
577
|
+
if (e instanceof _chunkSYXPWJ7Ncjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
|
|
578
578
|
log(`API route HMR failed: ${e.message}`);
|
|
579
579
|
}
|
|
580
580
|
return [];
|
|
@@ -29,7 +29,7 @@ var _chunkSYW346ZNcjs = require('./chunk-SYW346ZN.cjs');
|
|
|
29
29
|
var _chunkGBMWLDCCcjs = require('./chunk-GBMWLDCC.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkI32V5CZLcjs = require('./chunk-I32V5CZL.cjs');
|
|
33
33
|
|
|
34
34
|
// src/schema-dependencies.ts
|
|
35
35
|
function collectSchemaDependencies(owners) {
|
|
@@ -115,7 +115,7 @@ async function withTimeout(work, timeoutMs) {
|
|
|
115
115
|
var formatSeconds = (ms) => ms < 1e3 ? `${ms}ms` : `${Number((ms / 1e3).toFixed(1))}s`;
|
|
116
116
|
function collectSchemaOwners(config) {
|
|
117
117
|
const owners = [];
|
|
118
|
-
const integrationSchemas =
|
|
118
|
+
const integrationSchemas = _chunkI32V5CZLcjs.getIntegrationSchemas.call(void 0, config.integrations);
|
|
119
119
|
let integrationClient;
|
|
120
120
|
for (const [name, schema] of Object.entries(integrationSchemas)) {
|
|
121
121
|
owners.push({
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkYN6BHOYYcjs = require('./chunk-YN6BHOYY.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunk4P5634G6cjs = require('./chunk-4P5634G6.cjs');
|
|
12
|
+
|
|
13
|
+
// src/mobile/native-server-fn-handler.ts
|
|
14
|
+
var MOBILE_APP_HEADER = "x-farm-mobile";
|
|
15
|
+
var FETCH_METADATA = ["sec-fetch-site", "sec-fetch-mode", "sec-fetch-dest", "sec-fetch-user"];
|
|
16
|
+
var ID = /^[\w-]{1,64}$/;
|
|
17
|
+
var UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
18
|
+
function hasUnsafeKey(value, depth = 0) {
|
|
19
|
+
if (depth > 64) return true;
|
|
20
|
+
if (Array.isArray(value)) return value.some((item) => hasUnsafeKey(item, depth + 1));
|
|
21
|
+
if (!value || typeof value !== "object") return false;
|
|
22
|
+
return Object.keys(value).some(
|
|
23
|
+
(key) => UNSAFE_KEYS.has(key) || hasUnsafeKey(value[key], depth + 1)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function json(status, body) {
|
|
27
|
+
return new Response(JSON.stringify(body), {
|
|
28
|
+
status,
|
|
29
|
+
headers: { "content-type": "application/json", "cache-control": "private, no-store" }
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function refuse(status, code, message) {
|
|
33
|
+
return json(status, { error: { code, message } });
|
|
34
|
+
}
|
|
35
|
+
async function handleFarmNativeServerFnRequest(request, options, parsed) {
|
|
36
|
+
if (request.method !== "POST") {
|
|
37
|
+
return refuse(405, "method_not_allowed", "Call server functions with POST.");
|
|
38
|
+
}
|
|
39
|
+
const origin = request.headers.get("origin");
|
|
40
|
+
if (!request.headers.get(MOBILE_APP_HEADER) || FETCH_METADATA.some((name) => request.headers.has(name)) || origin !== null && origin !== new URL(request.url).origin) {
|
|
41
|
+
return refuse(403, "not_native", "Only the app's native screens call server functions here.");
|
|
42
|
+
}
|
|
43
|
+
const length = Number(_nullishCoalesce(request.headers.get("content-length"), () => ( "0")));
|
|
44
|
+
if (length > _chunk4P5634G6cjs.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT) {
|
|
45
|
+
return refuse(413, "body_too_large", "The call's input is too large.");
|
|
46
|
+
}
|
|
47
|
+
let call;
|
|
48
|
+
if (parsed !== void 0) call = parsed;
|
|
49
|
+
else {
|
|
50
|
+
const text = await request.text();
|
|
51
|
+
if (text.length > _chunk4P5634G6cjs.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT) {
|
|
52
|
+
return refuse(413, "body_too_large", "The call's input is too large.");
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
call = JSON.parse(text);
|
|
56
|
+
} catch (e) {
|
|
57
|
+
return refuse(400, "invalid_body", 'Send { "id", "input" } as JSON.');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (typeof _optionalChain([call, 'optionalAccess', _ => _.id]) !== "string" || !ID.test(call.id)) {
|
|
61
|
+
return refuse(400, "invalid_body", 'Send { "id", "input" } as JSON.');
|
|
62
|
+
}
|
|
63
|
+
if (hasUnsafeKey(call.input)) {
|
|
64
|
+
return refuse(400, "invalid_body", "The input has a key that is not allowed.");
|
|
65
|
+
}
|
|
66
|
+
const fn = await options.resolve(call.id);
|
|
67
|
+
if (fn === void 0 || _chunkYN6BHOYYcjs._describeServerFunction.call(void 0, fn) === void 0) {
|
|
68
|
+
return refuse(
|
|
69
|
+
404,
|
|
70
|
+
"unknown_function",
|
|
71
|
+
"No server function with this id is open to native screens."
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
const outcome = await _chunkYN6BHOYYcjs._invokeServerFunction.call(void 0, fn, call.input, request);
|
|
75
|
+
if (outcome.ok) {
|
|
76
|
+
try {
|
|
77
|
+
return json(200, { data: _nullishCoalesce(outcome.data, () => ( null)) });
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error("[Farm] A server function's result for a native screen is not JSON:", error);
|
|
80
|
+
return refuse(500, "server_error", "Server function failed");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
switch (outcome.reason) {
|
|
84
|
+
case "input":
|
|
85
|
+
return refuse(
|
|
86
|
+
400,
|
|
87
|
+
"invalid_input",
|
|
88
|
+
outcome.error instanceof Error ? outcome.error.message : "The input is invalid."
|
|
89
|
+
);
|
|
90
|
+
case "failure": {
|
|
91
|
+
const { code, status, message, data } = outcome.failure;
|
|
92
|
+
return json(status, { error: { code, status, message, data } });
|
|
93
|
+
}
|
|
94
|
+
case "redirect":
|
|
95
|
+
return json(200, { redirect: { url: outcome.url, status: outcome.status } });
|
|
96
|
+
default:
|
|
97
|
+
console.error("[Farm] A server function called from a native screen failed:", outcome.error);
|
|
98
|
+
return refuse(500, "server_error", "Server function failed");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function createFarmNativeServerFnPlugin(options) {
|
|
102
|
+
return {
|
|
103
|
+
name: _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN,
|
|
104
|
+
routes: ({ route }) => [
|
|
105
|
+
route.post(_chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PATH, {
|
|
106
|
+
handler: (request, { input }) => handleFarmNativeServerFnRequest(request, options, input.body)
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
exports.handleFarmNativeServerFnRequest = handleFarmNativeServerFnRequest; exports.createFarmNativeServerFnPlugin = createFarmNativeServerFnPlugin;
|
|
@@ -5,11 +5,10 @@ import {
|
|
|
5
5
|
inspectFarmNativeStylesheets,
|
|
6
6
|
parseFarmNativeStylesheet,
|
|
7
7
|
resolveFarmNativeClasses
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JCEFKP5M.mjs";
|
|
9
9
|
import {
|
|
10
10
|
FARM_VERSION
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-Y6FXYEAI.mjs";
|
|
11
|
+
} from "./chunk-NT3QDN2E.mjs";
|
|
13
12
|
|
|
14
13
|
// src/mobile/analyzer.ts
|
|
15
14
|
import { createHash } from "crypto";
|
|
@@ -1049,6 +1048,7 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1049
1048
|
const allStylesheets = /* @__PURE__ */ new Set();
|
|
1050
1049
|
const unreadStylesheets = /* @__PURE__ */ new Set();
|
|
1051
1050
|
for (const [route, { page, layouts }] of entries) {
|
|
1051
|
+
if (!page && options.nativeOnlyRoutes?.has(route)) continue;
|
|
1052
1052
|
const blockers = [];
|
|
1053
1053
|
const wins = /* @__PURE__ */ new Set();
|
|
1054
1054
|
const elements = { total: 0, mapped: 0, byKind: {} };
|
|
@@ -1223,7 +1223,10 @@ async function analyzeFarmMobileRoutes(options) {
|
|
|
1223
1223
|
unreadStylesheets: [...unreadStylesheets].sort()
|
|
1224
1224
|
};
|
|
1225
1225
|
}
|
|
1226
|
+
|
|
1226
1227
|
export {
|
|
1227
1228
|
CORE_PORTABLE,
|
|
1229
|
+
readAliases,
|
|
1230
|
+
resolveFile,
|
|
1228
1231
|
analyzeFarmMobileRoutes
|
|
1229
1232
|
};
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
_runServerFunctionForCaller,
|
|
5
5
|
createServerFn,
|
|
6
6
|
createServerFunctionDescriptor
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QTD6EMN2.mjs";
|
|
8
8
|
import {
|
|
9
9
|
createFarmServerQueryResult
|
|
10
10
|
} from "./chunk-N7XWC6BN.mjs";
|
|
11
11
|
import {
|
|
12
12
|
getServerActionExecutionContext
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-E46NXBNJ.mjs";
|
|
14
14
|
import {
|
|
15
15
|
createRouteDataCacheTag,
|
|
16
16
|
getFarmDataCache
|