@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
|
@@ -7,15 +7,17 @@ var _chunkWMRGIQTAcjs = require('./chunk-WMRGIQTA.cjs');
|
|
|
7
7
|
var _chunk7KJJ4SBScjs = require('./chunk-7KJJ4SBS.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
|
|
10
|
+
var _chunkMNUYXZV7cjs = require('./chunk-MNUYXZV7.cjs');
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var _chunk3OKSEJ33cjs = require('./chunk-3OKSEJ33.cjs');
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
|
|
@@ -26,7 +28,7 @@ var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
|
|
|
26
28
|
var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
var
|
|
31
|
+
var _chunkCVZY4TLWcjs = require('./chunk-CVZY4TLW.cjs');
|
|
30
32
|
|
|
31
33
|
// src/environment-vite.ts
|
|
32
34
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
@@ -883,7 +885,7 @@ function usePackageScanCacheFile(file) {
|
|
|
883
885
|
const stored = /* @__PURE__ */ new Map();
|
|
884
886
|
try {
|
|
885
887
|
const value = JSON.parse(_fs2.default.readFileSync(file, "utf8"));
|
|
886
|
-
if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm ===
|
|
888
|
+
if (_optionalChain([value, 'optionalAccess', _68 => _68.schema]) === PACKAGE_SCAN_CACHE_SCHEMA && value.farm === _chunkCVZY4TLWcjs.FARM_VERSION && value.scans && typeof value.scans === "object") {
|
|
887
889
|
for (const [directory, scan] of Object.entries(value.scans)) {
|
|
888
890
|
if (isStoredPackageScan(scan)) stored.set(directory, scan);
|
|
889
891
|
}
|
|
@@ -912,7 +914,7 @@ function persistPackageScanCache() {
|
|
|
912
914
|
_fs2.default.mkdirSync(_path2.default.dirname(cache2.file), { recursive: true });
|
|
913
915
|
_fs2.default.writeFileSync(
|
|
914
916
|
temporary,
|
|
915
|
-
JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm:
|
|
917
|
+
JSON.stringify({ schema: PACKAGE_SCAN_CACHE_SCHEMA, farm: _chunkCVZY4TLWcjs.FARM_VERSION, scans })
|
|
916
918
|
);
|
|
917
919
|
_fs2.default.renameSync(temporary, cache2.file);
|
|
918
920
|
cache2.dirty = false;
|
|
@@ -2212,7 +2214,7 @@ var PackageClientBoundaryCache = class {
|
|
|
2212
2214
|
}
|
|
2213
2215
|
const contents = JSON.stringify({
|
|
2214
2216
|
schema: SCHEMA_VERSION,
|
|
2215
|
-
farm:
|
|
2217
|
+
farm: _chunkCVZY4TLWcjs.FARM_VERSION,
|
|
2216
2218
|
paths,
|
|
2217
2219
|
entries
|
|
2218
2220
|
});
|
|
@@ -2252,7 +2254,7 @@ function readStoredCache(file) {
|
|
|
2252
2254
|
} catch (e37) {
|
|
2253
2255
|
return null;
|
|
2254
2256
|
}
|
|
2255
|
-
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !==
|
|
2257
|
+
if (!isRecord(value) || value.schema !== SCHEMA_VERSION || value.farm !== _chunkCVZY4TLWcjs.FARM_VERSION) {
|
|
2256
2258
|
return null;
|
|
2257
2259
|
}
|
|
2258
2260
|
const { paths, entries } = value;
|
|
@@ -2263,7 +2265,7 @@ function readStoredCache(file) {
|
|
|
2263
2265
|
const usable = variants.filter((entry) => isStoredEntry(entry, paths.length));
|
|
2264
2266
|
if (usable.length > 0) valid[key] = usable;
|
|
2265
2267
|
}
|
|
2266
|
-
return { schema: SCHEMA_VERSION, farm:
|
|
2268
|
+
return { schema: SCHEMA_VERSION, farm: _chunkCVZY4TLWcjs.FARM_VERSION, paths, entries: valid };
|
|
2267
2269
|
}
|
|
2268
2270
|
function isRecord(value) {
|
|
2269
2271
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -2330,6 +2332,101 @@ function dropLatestPackageClientBoundaryCache() {
|
|
|
2330
2332
|
latestDevCache = void 0;
|
|
2331
2333
|
}
|
|
2332
2334
|
|
|
2335
|
+
// src/utils/renderer-hydration.ts
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
var scopes = /* @__PURE__ */ new Map();
|
|
2339
|
+
function realPath(file) {
|
|
2340
|
+
try {
|
|
2341
|
+
return _fs2.default.realpathSync(file);
|
|
2342
|
+
} catch (e38) {
|
|
2343
|
+
return _path2.default.resolve(file);
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
function setFarmRendererHydrationScope(roots, renderer, routeModules) {
|
|
2347
|
+
const keys = roots.map(realPath);
|
|
2348
|
+
const ruleSetsHydration = routeModules.some(
|
|
2349
|
+
(entry) => _optionalChain([entry, 'access', _120 => _120.hydration, 'optionalAccess', _121 => _121.hydrate]) !== void 0 || _optionalChain([entry, 'access', _122 => _122.hydration, 'optionalAccess', _123 => _123.strategy]) !== void 0
|
|
2350
|
+
);
|
|
2351
|
+
if (!_optionalChain([renderer, 'optionalAccess', _124 => _124.hydration]) && !ruleSetsHydration) {
|
|
2352
|
+
for (const key of keys) scopes.delete(key);
|
|
2353
|
+
return () => {
|
|
2354
|
+
};
|
|
2355
|
+
}
|
|
2356
|
+
const scope = {
|
|
2357
|
+
renderer,
|
|
2358
|
+
extensions: new Set((_nullishCoalesce(renderer.componentExtensions, () => ( []))).map(normalizeExtension)),
|
|
2359
|
+
routeModules: new Map(
|
|
2360
|
+
routeModules.map((entry) => [
|
|
2361
|
+
realPath(entry.modulePath),
|
|
2362
|
+
{ kind: entry.kind, hydration: _nullishCoalesce(entry.hydration, () => ( {})) }
|
|
2363
|
+
])
|
|
2364
|
+
)
|
|
2365
|
+
};
|
|
2366
|
+
for (const key of keys) scopes.set(key, scope);
|
|
2367
|
+
return () => {
|
|
2368
|
+
for (const key of keys) if (scopes.get(key) === scope) scopes.delete(key);
|
|
2369
|
+
};
|
|
2370
|
+
}
|
|
2371
|
+
function normalizeExtension(extension) {
|
|
2372
|
+
const lowered = extension.trim().toLowerCase();
|
|
2373
|
+
return lowered.startsWith(".") ? lowered : `.${lowered}`;
|
|
2374
|
+
}
|
|
2375
|
+
function findScope(file) {
|
|
2376
|
+
if (scopes.size === 0) return null;
|
|
2377
|
+
let match = null;
|
|
2378
|
+
for (const [root, scope] of scopes) {
|
|
2379
|
+
if (file !== root && !file.startsWith(`${root}${_path2.default.sep}`)) continue;
|
|
2380
|
+
if (!match || root.length > match.length) match = { length: root.length, scope };
|
|
2381
|
+
}
|
|
2382
|
+
return _nullishCoalesce(_optionalChain([match, 'optionalAccess', _125 => _125.scope]), () => ( null));
|
|
2383
|
+
}
|
|
2384
|
+
function resolveFarmRendererModuleHydration(content, sourcePath, readSource) {
|
|
2385
|
+
if (scopes.size === 0) return null;
|
|
2386
|
+
const file = realPath(sourcePath);
|
|
2387
|
+
const scope = findScope(file);
|
|
2388
|
+
if (!scope) return null;
|
|
2389
|
+
const route = scope.routeModules.get(file);
|
|
2390
|
+
const options = scope.renderer.hydration;
|
|
2391
|
+
const own = _optionalChain([options, 'optionalAccess', _126 => _126.resolve]) && scope.extensions.has(_path2.default.extname(file).toLowerCase()) ? readOwnHydration(scope, content, file) : {};
|
|
2392
|
+
if (!route && own.hydrate === void 0 && own.strategy === void 0) return null;
|
|
2393
|
+
const source = readSource();
|
|
2394
|
+
const where = `${file} sets its hydration twice`;
|
|
2395
|
+
if (own.hydrate !== void 0 && source.hydrate !== void 0 && own.hydrate !== source.hydrate) {
|
|
2396
|
+
throw new Error(
|
|
2397
|
+
`${where}: \`export const hydrate = ${source.hydrate}\` and renderer \`${scope.renderer.name}\`'s syntax, which says ${own.hydrate}. Keep one of them.`
|
|
2398
|
+
);
|
|
2399
|
+
}
|
|
2400
|
+
if (own.strategy !== void 0 && source.strategy !== null && own.strategy !== source.strategy) {
|
|
2401
|
+
throw new Error(
|
|
2402
|
+
`${where}: \`export const island = "${source.strategy}"\` and renderer \`${scope.renderer.name}\`'s syntax, which says "${own.strategy}". Keep one of them.`
|
|
2403
|
+
);
|
|
2404
|
+
}
|
|
2405
|
+
const kindDefault = _optionalChain([route, 'optionalAccess', _127 => _127.kind]) === "page" ? _optionalChain([options, 'optionalAccess', _128 => _128.pages]) : _optionalChain([route, 'optionalAccess', _129 => _129.kind]) === "layout" ? _optionalChain([options, 'optionalAccess', _130 => _130.layouts]) : void 0;
|
|
2406
|
+
const hydrate = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(own.hydrate, () => ( source.hydrate)), () => ( _optionalChain([route, 'optionalAccess', _131 => _131.hydration, 'access', _132 => _132.hydrate]))), () => ( kindDefault)), () => ( false));
|
|
2407
|
+
const strategy = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(own.strategy, () => ( source.strategy)), () => ( _optionalChain([route, 'optionalAccess', _133 => _133.hydration, 'access', _134 => _134.strategy]))), () => ( ((hydrate || source.clientDirective) && route ? _optionalChain([options, 'optionalAccess', _135 => _135.strategy]) : void 0))), () => ( null));
|
|
2408
|
+
return { hydrate, strategy };
|
|
2409
|
+
}
|
|
2410
|
+
function readOwnHydration(scope, content, file) {
|
|
2411
|
+
const where = `Renderer \`${scope.renderer.name}\` hydration.resolve() for ${file}`;
|
|
2412
|
+
let value;
|
|
2413
|
+
try {
|
|
2414
|
+
value = scope.renderer.hydration.resolve(content, file);
|
|
2415
|
+
} catch (error) {
|
|
2416
|
+
throw _chunk3OKSEJ33cjs.createFarmRendererHookError.call(void 0,
|
|
2417
|
+
`${where} threw: ${error instanceof Error ? error.message : String(error)}`,
|
|
2418
|
+
error
|
|
2419
|
+
);
|
|
2420
|
+
}
|
|
2421
|
+
if (value === null || value === void 0) return {};
|
|
2422
|
+
if (typeof value !== "object" || Array.isArray(value)) {
|
|
2423
|
+
throw new TypeError(
|
|
2424
|
+
`${where} returned ${JSON.stringify(value)}. Return \`{ hydrate?, strategy? }\`, or nothing to leave the file to Farm.`
|
|
2425
|
+
);
|
|
2426
|
+
}
|
|
2427
|
+
return _chunk3OKSEJ33cjs.readFarmRendererHydration.call(void 0, value, where);
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2333
2430
|
// src/utils/client-component.ts
|
|
2334
2431
|
function readIfExists(filePath) {
|
|
2335
2432
|
if (filePath.replace(/\\/g, "/").includes(FARM_CLIENT_REFERENCE_DIRECTORY)) {
|
|
@@ -2360,9 +2457,9 @@ function scanMarkdownCode(content) {
|
|
|
2360
2457
|
let inCode = false;
|
|
2361
2458
|
for (; index < lines.length; index++) {
|
|
2362
2459
|
const line = lines[index];
|
|
2363
|
-
const marker = _optionalChain([/^ {0,3}(`{3,}|~{3,})/, 'access',
|
|
2460
|
+
const marker = _optionalChain([/^ {0,3}(`{3,}|~{3,})/, 'access', _136 => _136.exec, 'call', _137 => _137(line), 'optionalAccess', _138 => _138[1]]);
|
|
2364
2461
|
if (fence) {
|
|
2365
|
-
if (_optionalChain([marker, 'optionalAccess',
|
|
2462
|
+
if (_optionalChain([marker, 'optionalAccess', _139 => _139[0]]) === fence[0] && marker.length >= fence.length && line.trim() === marker) {
|
|
2366
2463
|
fence = null;
|
|
2367
2464
|
}
|
|
2368
2465
|
} else if (inCode) {
|
|
@@ -2388,7 +2485,7 @@ function readSourceFileContents(filePath) {
|
|
|
2388
2485
|
return null;
|
|
2389
2486
|
}
|
|
2390
2487
|
return _fs2.default.readFileSync(filePath, "utf-8");
|
|
2391
|
-
} catch (
|
|
2488
|
+
} catch (e39) {
|
|
2392
2489
|
return null;
|
|
2393
2490
|
}
|
|
2394
2491
|
}
|
|
@@ -2401,7 +2498,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
2401
2498
|
if (modulePath.startsWith("file://")) {
|
|
2402
2499
|
try {
|
|
2403
2500
|
candidates.add(_url.fileURLToPath.call(void 0, modulePath));
|
|
2404
|
-
} catch (
|
|
2501
|
+
} catch (e40) {
|
|
2405
2502
|
}
|
|
2406
2503
|
}
|
|
2407
2504
|
if (modulePath.startsWith("/@fs/")) {
|
|
@@ -2414,7 +2511,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
2414
2511
|
candidates.add(_path2.default.join(root, normalized));
|
|
2415
2512
|
candidates.add(_path2.default.resolve(root, normalized));
|
|
2416
2513
|
}
|
|
2417
|
-
if (_optionalChain([withoutQuery, 'optionalAccess',
|
|
2514
|
+
if (_optionalChain([withoutQuery, 'optionalAccess', _140 => _140.startsWith, 'call', _141 => _141("/src/")])) {
|
|
2418
2515
|
const normalized = withoutQuery.replace(/^\/+/, "");
|
|
2419
2516
|
candidates.add(_path2.default.join(process.cwd(), normalized));
|
|
2420
2517
|
candidates.add(_path2.default.resolve(process.cwd(), normalized));
|
|
@@ -2427,7 +2524,7 @@ function resolveModuleSourcePath(modulePath, root) {
|
|
|
2427
2524
|
return null;
|
|
2428
2525
|
}
|
|
2429
2526
|
function getFarmClientHydrationPlanOptions(renderer, hasUnsupportedIntegrationProvider) {
|
|
2430
|
-
return { asyncOwnerIslands:
|
|
2527
|
+
return { asyncOwnerIslands: _chunk3OKSEJ33cjs.isReactRenderer.call(void 0, renderer) && !hasUnsupportedIntegrationProvider };
|
|
2431
2528
|
}
|
|
2432
2529
|
function describeSuppressedAsyncHydration(subject, reason) {
|
|
2433
2530
|
const remediation = reason ? "Fix the reason above, or render the interactive UI from a synchronous owner." : 'Move the interactive UI into an eligible "use client" boundary, or render it from a synchronous owner.';
|
|
@@ -2484,7 +2581,7 @@ function hasUseClientDirective(content) {
|
|
|
2484
2581
|
return false;
|
|
2485
2582
|
}
|
|
2486
2583
|
function hasHydrateExport(content) {
|
|
2487
|
-
return _optionalChain([_chunkWMRGIQTAcjs.readFarmHydrateExport.call(void 0, content), 'optionalAccess',
|
|
2584
|
+
return _optionalChain([_chunkWMRGIQTAcjs.readFarmHydrateExport.call(void 0, content), 'optionalAccess', _142 => _142.value]) === true;
|
|
2488
2585
|
}
|
|
2489
2586
|
var REGEXP_PREFIX_PUNCTUATION = /* @__PURE__ */ new Set([
|
|
2490
2587
|
"(",
|
|
@@ -2673,7 +2770,7 @@ function isIslandExportStart(tokens, index) {
|
|
|
2673
2770
|
const token = tokens[index];
|
|
2674
2771
|
const previous = tokens[index - 1];
|
|
2675
2772
|
const startsStatement = !previous || previous.value === ";" || previous.value === "{" || previous.value === "}" || token.line > previous.line;
|
|
2676
|
-
return startsStatement && token.value === "export" && _optionalChain([tokens, 'access',
|
|
2773
|
+
return startsStatement && token.value === "export" && _optionalChain([tokens, 'access', _143 => _143[index + 1], 'optionalAccess', _144 => _144.value]) === "const" && _optionalChain([tokens, 'access', _145 => _145[index + 2], 'optionalAccess', _146 => _146.value]) === "island";
|
|
2677
2774
|
}
|
|
2678
2775
|
function getIslandStrategyExport(content) {
|
|
2679
2776
|
if (!content) return null;
|
|
@@ -2681,15 +2778,15 @@ function getIslandStrategyExport(content) {
|
|
|
2681
2778
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2682
2779
|
if (!isIslandExportStart(tokens, index)) continue;
|
|
2683
2780
|
let valueIndex = index + 3;
|
|
2684
|
-
if (_optionalChain([tokens, 'access',
|
|
2781
|
+
if (_optionalChain([tokens, 'access', _147 => _147[valueIndex], 'optionalAccess', _148 => _148.value]) === ":") {
|
|
2685
2782
|
while (valueIndex < tokens.length && tokens[valueIndex].value !== "=") valueIndex++;
|
|
2686
2783
|
}
|
|
2687
|
-
if (_optionalChain([tokens, 'access',
|
|
2784
|
+
if (_optionalChain([tokens, 'access', _149 => _149[valueIndex], 'optionalAccess', _150 => _150.value]) !== "=") break;
|
|
2688
2785
|
valueIndex++;
|
|
2689
2786
|
const literal = tokens[valueIndex];
|
|
2690
2787
|
if (!literal || literal.kind !== "string" || !_chunk7KJJ4SBScjs.isFarmIslandStrategy.call(void 0, literal.value)) break;
|
|
2691
2788
|
let trailingIndex = valueIndex + 1;
|
|
2692
|
-
if (_optionalChain([tokens, 'access',
|
|
2789
|
+
if (_optionalChain([tokens, 'access', _151 => _151[trailingIndex], 'optionalAccess', _152 => _152.value]) === "as" && _optionalChain([tokens, 'access', _153 => _153[trailingIndex + 1], 'optionalAccess', _154 => _154.value]) === "const") {
|
|
2693
2790
|
trailingIndex += 2;
|
|
2694
2791
|
}
|
|
2695
2792
|
const trailing = tokens[trailingIndex];
|
|
@@ -2715,13 +2812,13 @@ function hasAsyncDefaultExport(content) {
|
|
|
2715
2812
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2716
2813
|
const token = tokens[index];
|
|
2717
2814
|
if (token.kind !== "identifier" || token.value !== "export") continue;
|
|
2718
|
-
if (_optionalChain([tokens, 'access',
|
|
2719
|
-
if (_optionalChain([tokens, 'access',
|
|
2815
|
+
if (_optionalChain([tokens, 'access', _155 => _155[index - 1], 'optionalAccess', _156 => _156.value]) === ".") continue;
|
|
2816
|
+
if (_optionalChain([tokens, 'access', _157 => _157[index + 1], 'optionalAccess', _158 => _158.value]) !== "default") continue;
|
|
2720
2817
|
const exported = tokens[index + 2];
|
|
2721
2818
|
if (exported.kind === "identifier" && exported.value === "async") {
|
|
2722
2819
|
return true;
|
|
2723
2820
|
}
|
|
2724
|
-
if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access',
|
|
2821
|
+
if (exported.kind === "identifier" && !["function", "class"].includes(exported.value) && _optionalChain([tokens, 'access', _159 => _159[index + 3], 'optionalAccess', _160 => _160.value]) !== "(" && isAsyncLocalDeclaration(tokens, exported.value)) {
|
|
2725
2822
|
return true;
|
|
2726
2823
|
}
|
|
2727
2824
|
}
|
|
@@ -2729,10 +2826,10 @@ function hasAsyncDefaultExport(content) {
|
|
|
2729
2826
|
}
|
|
2730
2827
|
function isAsyncLocalDeclaration(tokens, name) {
|
|
2731
2828
|
for (let index = 0; index < tokens.length - 2; index++) {
|
|
2732
|
-
if (tokens[index].value === "async" && _optionalChain([tokens, 'access',
|
|
2829
|
+
if (tokens[index].value === "async" && _optionalChain([tokens, 'access', _161 => _161[index + 1], 'optionalAccess', _162 => _162.value]) === "function" && _optionalChain([tokens, 'access', _163 => _163[index + 2], 'optionalAccess', _164 => _164.value]) === name) {
|
|
2733
2830
|
return true;
|
|
2734
2831
|
}
|
|
2735
|
-
if (tokens[index].value === name && _optionalChain([tokens, 'access',
|
|
2832
|
+
if (tokens[index].value === name && _optionalChain([tokens, 'access', _165 => _165[index + 1], 'optionalAccess', _166 => _166.value]) === "=" && _optionalChain([tokens, 'access', _167 => _167[index + 2], 'optionalAccess', _168 => _168.value]) === "async") {
|
|
2736
2833
|
return true;
|
|
2737
2834
|
}
|
|
2738
2835
|
}
|
|
@@ -2751,7 +2848,19 @@ function parseClientModuleMetadata(content, inspectIslandExport, sourcePath) {
|
|
|
2751
2848
|
if (inspectIslandExport && hydrate && hydrate.value === null) {
|
|
2752
2849
|
throw new Error(_chunkWMRGIQTAcjs.formatFarmHydrateExportError.call(void 0, hydrate, sourcePath));
|
|
2753
2850
|
}
|
|
2754
|
-
const
|
|
2851
|
+
const rendererHydration = inspectIslandExport && sourcePath ? resolveFarmRendererModuleHydration(content, sourcePath, () => ({
|
|
2852
|
+
hydrate: typeof _optionalChain([hydrate, 'optionalAccess', _169 => _169.value]) === "boolean" ? hydrate.value : void 0,
|
|
2853
|
+
strategy: getIslandStrategyExport(content),
|
|
2854
|
+
clientDirective: isClientComponent
|
|
2855
|
+
})) : null;
|
|
2856
|
+
if (rendererHydration) {
|
|
2857
|
+
return {
|
|
2858
|
+
isClientComponent,
|
|
2859
|
+
hasHydrateExport: rendererHydration.hydrate,
|
|
2860
|
+
islandStrategy: rendererHydration.strategy
|
|
2861
|
+
};
|
|
2862
|
+
}
|
|
2863
|
+
const hasHydrate = _optionalChain([hydrate, 'optionalAccess', _170 => _170.value]) === true;
|
|
2755
2864
|
return {
|
|
2756
2865
|
isClientComponent,
|
|
2757
2866
|
hasHydrateExport: hasHydrate,
|
|
@@ -2954,7 +3063,7 @@ function planClientModuleHydration(modulePath, root, mode, options) {
|
|
|
2954
3063
|
return plan;
|
|
2955
3064
|
}
|
|
2956
3065
|
function usesFarmServerTree(plan) {
|
|
2957
|
-
return _optionalChain([plan, 'optionalAccess',
|
|
3066
|
+
return _optionalChain([plan, 'optionalAccess', _171 => _171.asyncOwnerIslands]) === true && plan.isolatedBoundaries.length > 0;
|
|
2958
3067
|
}
|
|
2959
3068
|
function getMarkdownPageHydrationPlan(componentsModulePath, root, mode = "off", options = {}) {
|
|
2960
3069
|
const plan = {
|
|
@@ -3084,7 +3193,7 @@ function clientModulePlanSignature(content) {
|
|
|
3084
3193
|
isIsolatableClientBoundarySource(content),
|
|
3085
3194
|
getImportSpecifiers(content).sort()
|
|
3086
3195
|
]);
|
|
3087
|
-
} catch (
|
|
3196
|
+
} catch (e41) {
|
|
3088
3197
|
return null;
|
|
3089
3198
|
}
|
|
3090
3199
|
}
|
|
@@ -3109,7 +3218,7 @@ function getStaticImportBindings(content) {
|
|
|
3109
3218
|
if (!content) return bindings;
|
|
3110
3219
|
const tokens = tokenizeModuleSource(content);
|
|
3111
3220
|
for (let index = 0; index < tokens.length; index++) {
|
|
3112
|
-
if (tokens[index].value !== "import" || _optionalChain([tokens, 'access',
|
|
3221
|
+
if (tokens[index].value !== "import" || _optionalChain([tokens, 'access', _172 => _172[index - 1], 'optionalAccess', _173 => _173.value]) === ".") continue;
|
|
3113
3222
|
const first = tokens[index + 1];
|
|
3114
3223
|
if (!first || first.value === "type" || first.value === "(" || first.kind === "string") {
|
|
3115
3224
|
continue;
|
|
@@ -3117,7 +3226,7 @@ function getStaticImportBindings(content) {
|
|
|
3117
3226
|
let fromIndex = -1;
|
|
3118
3227
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
3119
3228
|
if (tokens[cursor].value === ";") break;
|
|
3120
|
-
if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access',
|
|
3229
|
+
if (tokens[cursor].value === "from" && _optionalChain([tokens, 'access', _174 => _174[cursor + 1], 'optionalAccess', _175 => _175.kind]) === "string") {
|
|
3121
3230
|
fromIndex = cursor;
|
|
3122
3231
|
break;
|
|
3123
3232
|
}
|
|
@@ -3126,13 +3235,13 @@ function getStaticImportBindings(content) {
|
|
|
3126
3235
|
const specifier = tokens[fromIndex + 1].value;
|
|
3127
3236
|
const clause = tokens.slice(index + 1, fromIndex);
|
|
3128
3237
|
const localNames = [];
|
|
3129
|
-
if (_optionalChain([clause, 'access',
|
|
3238
|
+
if (_optionalChain([clause, 'access', _176 => _176[0], 'optionalAccess', _177 => _177.kind]) === "identifier" && clause[0].value !== "type") {
|
|
3130
3239
|
localNames.push(clause[0].value);
|
|
3131
3240
|
}
|
|
3132
3241
|
const namespaceAs = clause.findIndex(
|
|
3133
|
-
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access',
|
|
3242
|
+
(token, clauseIndex) => token.value === "*" && _optionalChain([clause, 'access', _178 => _178[clauseIndex + 1], 'optionalAccess', _179 => _179.value]) === "as"
|
|
3134
3243
|
);
|
|
3135
|
-
if (namespaceAs !== -1 && _optionalChain([clause, 'access',
|
|
3244
|
+
if (namespaceAs !== -1 && _optionalChain([clause, 'access', _180 => _180[namespaceAs + 2], 'optionalAccess', _181 => _181.kind]) === "identifier") {
|
|
3136
3245
|
localNames.push(clause[namespaceAs + 2].value);
|
|
3137
3246
|
}
|
|
3138
3247
|
const openingBrace = clause.findIndex((token) => token.value === "{");
|
|
@@ -3142,11 +3251,11 @@ function getStaticImportBindings(content) {
|
|
|
3142
3251
|
if (openingBrace !== -1 && closingBrace !== -1) {
|
|
3143
3252
|
let entryStart = openingBrace + 1;
|
|
3144
3253
|
for (let cursor = entryStart; cursor <= closingBrace; cursor++) {
|
|
3145
|
-
if (cursor !== closingBrace && _optionalChain([clause, 'access',
|
|
3254
|
+
if (cursor !== closingBrace && _optionalChain([clause, 'access', _182 => _182[cursor], 'optionalAccess', _183 => _183.value]) !== ",") continue;
|
|
3146
3255
|
const entry = clause.slice(entryStart, cursor).filter((token) => token.value !== "type");
|
|
3147
3256
|
const asIndex = entry.findIndex((token) => token.value === "as");
|
|
3148
3257
|
const local = asIndex === -1 ? entry[0] : entry[asIndex + 1];
|
|
3149
|
-
if (_optionalChain([local, 'optionalAccess',
|
|
3258
|
+
if (_optionalChain([local, 'optionalAccess', _184 => _184.kind]) === "identifier") localNames.push(local.value);
|
|
3150
3259
|
entryStart = cursor + 1;
|
|
3151
3260
|
}
|
|
3152
3261
|
}
|
|
@@ -3183,7 +3292,7 @@ function findParserSensitiveJsxContainer(content, localBindings) {
|
|
|
3183
3292
|
const open = [];
|
|
3184
3293
|
const isSelfClosing = (openingIndex) => {
|
|
3185
3294
|
for (let index = openingIndex; index < tokens.length; index++) {
|
|
3186
|
-
if (tokens[index].value === ">") return _optionalChain([tokens, 'access',
|
|
3295
|
+
if (tokens[index].value === ">") return _optionalChain([tokens, 'access', _185 => _185[index - 1], 'optionalAccess', _186 => _186.value]) === "/";
|
|
3187
3296
|
}
|
|
3188
3297
|
return false;
|
|
3189
3298
|
};
|
|
@@ -3191,7 +3300,7 @@ function findParserSensitiveJsxContainer(content, localBindings) {
|
|
|
3191
3300
|
if (tokens[index].value !== "<") continue;
|
|
3192
3301
|
if (tokens[index + 1].value === "/") {
|
|
3193
3302
|
const closing = tokens[index + 2];
|
|
3194
|
-
const at = _optionalChain([closing, 'optionalAccess',
|
|
3303
|
+
const at = _optionalChain([closing, 'optionalAccess', _187 => _187.kind]) === "identifier" ? open.lastIndexOf(closing.value) : -1;
|
|
3195
3304
|
if (at !== -1) open.length = at;
|
|
3196
3305
|
continue;
|
|
3197
3306
|
}
|
|
@@ -3234,7 +3343,7 @@ function findMatchingToken(tokens, openingIndex, opening, closing) {
|
|
|
3234
3343
|
}
|
|
3235
3344
|
function containsClientJsx(tokens, start, end, clientBindings) {
|
|
3236
3345
|
for (let index = start; index < end; index++) {
|
|
3237
|
-
if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access',
|
|
3346
|
+
if (tokens[index].value === "<" && clientBindings.has(_optionalChain([tokens, 'access', _188 => _188[index + 1], 'optionalAccess', _189 => _189.value]))) return true;
|
|
3238
3347
|
}
|
|
3239
3348
|
return false;
|
|
3240
3349
|
}
|
|
@@ -3272,7 +3381,7 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
3272
3381
|
let helperName;
|
|
3273
3382
|
let bodyStart = -1;
|
|
3274
3383
|
let bodyEnd = -1;
|
|
3275
|
-
if (tokens[index].value === "function" && _optionalChain([tokens, 'access',
|
|
3384
|
+
if (tokens[index].value === "function" && _optionalChain([tokens, 'access', _190 => _190[index + 1], 'optionalAccess', _191 => _191.kind]) === "identifier") {
|
|
3276
3385
|
helperName = tokens[index + 1].value;
|
|
3277
3386
|
const parametersStart = tokens.findIndex(
|
|
3278
3387
|
(token, tokenIndex) => tokenIndex > index + 1 && token.value === "("
|
|
@@ -3282,21 +3391,21 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
3282
3391
|
(token, tokenIndex) => tokenIndex > parametersEnd && token.value === "{"
|
|
3283
3392
|
);
|
|
3284
3393
|
if (bodyStart !== -1) bodyEnd = findMatchingToken(tokens, bodyStart, "{", "}");
|
|
3285
|
-
} else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access',
|
|
3394
|
+
} else if ((tokens[index].value === "const" || tokens[index].value === "let" || tokens[index].value === "var") && _optionalChain([tokens, 'access', _192 => _192[index + 1], 'optionalAccess', _193 => _193.kind]) === "identifier") {
|
|
3286
3395
|
helperName = tokens[index + 1].value;
|
|
3287
3396
|
let assignmentIndex = -1;
|
|
3288
3397
|
let arrowIndex = -1;
|
|
3289
3398
|
for (let cursor = index + 2; cursor < tokens.length; cursor++) {
|
|
3290
3399
|
if (tokens[cursor].value === ";") break;
|
|
3291
3400
|
if (assignmentIndex === -1 && tokens[cursor].value === "=") assignmentIndex = cursor;
|
|
3292
|
-
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access',
|
|
3401
|
+
if (tokens[cursor].value === "=" && _optionalChain([tokens, 'access', _194 => _194[cursor + 1], 'optionalAccess', _195 => _195.value]) === ">") {
|
|
3293
3402
|
arrowIndex = cursor;
|
|
3294
3403
|
break;
|
|
3295
3404
|
}
|
|
3296
3405
|
}
|
|
3297
3406
|
if (arrowIndex !== -1) {
|
|
3298
3407
|
bodyStart = arrowIndex + 2;
|
|
3299
|
-
bodyEnd = _optionalChain([tokens, 'access',
|
|
3408
|
+
bodyEnd = _optionalChain([tokens, 'access', _196 => _196[bodyStart], 'optionalAccess', _197 => _197.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : findStatementEnd(tokens, bodyStart);
|
|
3300
3409
|
} else if (assignmentIndex !== -1) {
|
|
3301
3410
|
bodyStart = assignmentIndex + 1;
|
|
3302
3411
|
bodyEnd = findStatementEnd(tokens, bodyStart);
|
|
@@ -3336,14 +3445,14 @@ function passesElementValuedProps(content, localBindings) {
|
|
|
3336
3445
|
else if (value === "}") braceDepth--;
|
|
3337
3446
|
else if (value === "<" && braceDepth > 0) return true;
|
|
3338
3447
|
else if (value === ">" && braceDepth === 0) {
|
|
3339
|
-
selfClosing = _optionalChain([tokens, 'access',
|
|
3448
|
+
selfClosing = _optionalChain([tokens, 'access', _198 => _198[cursor - 1], 'optionalAccess', _199 => _199.value]) === "/";
|
|
3340
3449
|
break;
|
|
3341
3450
|
}
|
|
3342
3451
|
}
|
|
3343
3452
|
if (selfClosing || cursor >= tokens.length) continue;
|
|
3344
3453
|
for (let child = cursor + 1; child < tokens.length; child++) {
|
|
3345
3454
|
if (tokens[child].value !== "<") continue;
|
|
3346
|
-
const closesBoundary = _optionalChain([tokens, 'access',
|
|
3455
|
+
const closesBoundary = _optionalChain([tokens, 'access', _200 => _200[child + 1], 'optionalAccess', _201 => _201.value]) === "/" && _optionalChain([tokens, 'access', _202 => _202[child + 2], 'optionalAccess', _203 => _203.value]) === name;
|
|
3347
3456
|
if (!closesBoundary) return true;
|
|
3348
3457
|
break;
|
|
3349
3458
|
}
|
|
@@ -3365,7 +3474,7 @@ function rendersOnlyLeafElements(content, localBindings) {
|
|
|
3365
3474
|
else if (value === "<" && braceDepth > 0) return false;
|
|
3366
3475
|
else if (value === ">" && braceDepth === 0) break;
|
|
3367
3476
|
}
|
|
3368
|
-
if (cursor >= tokens.length || _optionalChain([tokens, 'access',
|
|
3477
|
+
if (cursor >= tokens.length || _optionalChain([tokens, 'access', _204 => _204[cursor - 1], 'optionalAccess', _205 => _205.value]) !== "/") return false;
|
|
3369
3478
|
}
|
|
3370
3479
|
return true;
|
|
3371
3480
|
}
|
|
@@ -3377,9 +3486,9 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
3377
3486
|
const containsDynamicRenderer = (start, end) => containsClientJsx(tokens, start, end, clientBindings) || tokens.slice(start, end).some((token) => renderingHelpers.has(token.value));
|
|
3378
3487
|
for (let index = 0; index < tokens.length; index++) {
|
|
3379
3488
|
let callStart = -1;
|
|
3380
|
-
if (tokens[index].value === "." && (_optionalChain([tokens, 'access',
|
|
3489
|
+
if (tokens[index].value === "." && (_optionalChain([tokens, 'access', _206 => _206[index + 1], 'optionalAccess', _207 => _207.value]) === "map" || _optionalChain([tokens, 'access', _208 => _208[index + 1], 'optionalAccess', _209 => _209.value]) === "flatMap") && _optionalChain([tokens, 'access', _210 => _210[index + 2], 'optionalAccess', _211 => _211.value]) === "(") {
|
|
3381
3490
|
callStart = index + 2;
|
|
3382
|
-
} else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access',
|
|
3491
|
+
} else if (tokens[index].value === "Array" && _optionalChain([tokens, 'access', _212 => _212[index + 1], 'optionalAccess', _213 => _213.value]) === "." && _optionalChain([tokens, 'access', _214 => _214[index + 2], 'optionalAccess', _215 => _215.value]) === "from" && _optionalChain([tokens, 'access', _216 => _216[index + 3], 'optionalAccess', _217 => _217.value]) === "(") {
|
|
3383
3492
|
callStart = index + 3;
|
|
3384
3493
|
}
|
|
3385
3494
|
if (callStart !== -1) {
|
|
@@ -3388,10 +3497,10 @@ function hasDynamicJsxCardinality(content, localBindings) {
|
|
|
3388
3497
|
index = callEnd;
|
|
3389
3498
|
continue;
|
|
3390
3499
|
}
|
|
3391
|
-
if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access',
|
|
3500
|
+
if ((tokens[index].value === "for" || tokens[index].value === "while") && _optionalChain([tokens, 'access', _218 => _218[index + 1], 'optionalAccess', _219 => _219.value]) === "(") {
|
|
3392
3501
|
const conditionEnd = findMatchingToken(tokens, index + 1, "(", ")");
|
|
3393
3502
|
const bodyStart = conditionEnd + 1;
|
|
3394
|
-
const bodyEnd = _optionalChain([tokens, 'access',
|
|
3503
|
+
const bodyEnd = _optionalChain([tokens, 'access', _220 => _220[bodyStart], 'optionalAccess', _221 => _221.value]) === "{" ? findMatchingToken(tokens, bodyStart, "{", "}") : tokens.findIndex((token, tokenIndex) => tokenIndex > bodyStart && token.value === ";");
|
|
3395
3504
|
if (containsDynamicRenderer(bodyStart, bodyEnd === -1 ? tokens.length : bodyEnd)) return true;
|
|
3396
3505
|
}
|
|
3397
3506
|
}
|
|
@@ -3510,7 +3619,7 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
3510
3619
|
const localBindings = _nullishCoalesce(importedBindings.get(specifier), () => ( []));
|
|
3511
3620
|
const staticUses = countStaticJsxUses(content, localBindings);
|
|
3512
3621
|
if (staticUses > 0) {
|
|
3513
|
-
const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call',
|
|
3622
|
+
const grows = options.packageReferences === true && projectRoot !== void 0 && (_nullishCoalesce(_optionalChain([findFarmIslandContainers, 'call', _222 => _222(_nullishCoalesce(content, () => ( "")), moduleSourcePath, localBindings), 'optionalAccess', _223 => _223.length]), () => ( 0))) > 0;
|
|
3514
3623
|
if (grows) visit(ensureFarmIslandContainerReference(projectRoot));
|
|
3515
3624
|
const container = grows ? void 0 : findParserSensitiveJsxContainer(content, localBindings);
|
|
3516
3625
|
if (container) {
|
|
@@ -3606,7 +3715,7 @@ function farmWorkspaceServerEntry(entry) {
|
|
|
3606
3715
|
function realpathOrSelf(file) {
|
|
3607
3716
|
try {
|
|
3608
3717
|
return _fs2.default.realpathSync(file);
|
|
3609
|
-
} catch (
|
|
3718
|
+
} catch (e42) {
|
|
3610
3719
|
return file;
|
|
3611
3720
|
}
|
|
3612
3721
|
}
|
|
@@ -3636,7 +3745,7 @@ function inspectPackageClientBoundary(resolvedPath, root, visited) {
|
|
|
3636
3745
|
}
|
|
3637
3746
|
function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
3638
3747
|
if (!resolvedPath || visited.has(resolvedPath)) {
|
|
3639
|
-
if (resolvedPath) _optionalChain([trace2, 'optionalAccess',
|
|
3748
|
+
if (resolvedPath) _optionalChain([trace2, 'optionalAccess', _224 => _224.stop, 'call', _225 => _225(resolvedPath)]);
|
|
3640
3749
|
return {
|
|
3641
3750
|
isClientComponent: false,
|
|
3642
3751
|
shouldHydrate: false,
|
|
@@ -3644,13 +3753,13 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
|
3644
3753
|
};
|
|
3645
3754
|
}
|
|
3646
3755
|
visited.add(resolvedPath);
|
|
3647
|
-
_optionalChain([trace2, 'optionalAccess',
|
|
3756
|
+
_optionalChain([trace2, 'optionalAccess', _226 => _226.visit, 'call', _227 => _227(resolvedPath)]);
|
|
3648
3757
|
const content = readIfExists(resolvedPath);
|
|
3649
3758
|
const parsed = parseClientModuleMetadata(content, false);
|
|
3650
3759
|
let importsClientBoundary = false;
|
|
3651
3760
|
let importedIslandStrategy = null;
|
|
3652
3761
|
const reexports = getBarePackageReexports(content);
|
|
3653
|
-
const
|
|
3762
|
+
const realPath2 = reexports.length > 0 ? realpathOrSelf(resolvedPath) : resolvedPath;
|
|
3654
3763
|
const followed = [
|
|
3655
3764
|
...getImportSpecifiers(content).filter(
|
|
3656
3765
|
(specifier) => specifier.startsWith(".") || specifier.startsWith("/")
|
|
@@ -3659,7 +3768,7 @@ function traversePackageClientBoundary(resolvedPath, root, visited, trace2) {
|
|
|
3659
3768
|
];
|
|
3660
3769
|
for (const specifier of followed) {
|
|
3661
3770
|
const importedPath = resolveImportedModuleSourcePath(
|
|
3662
|
-
reexports.includes(specifier) ?
|
|
3771
|
+
reexports.includes(specifier) ? realPath2 : resolvedPath,
|
|
3663
3772
|
specifier,
|
|
3664
3773
|
root
|
|
3665
3774
|
);
|
|
@@ -3702,7 +3811,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3702
3811
|
braceDepth = Math.max(0, braceDepth - 1);
|
|
3703
3812
|
continue;
|
|
3704
3813
|
}
|
|
3705
|
-
if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access',
|
|
3814
|
+
if (dynamic && keyword.kind === "identifier" && keyword.value === "import" && _optionalChain([tokens, 'access', _228 => _228[index - 1], 'optionalAccess', _229 => _229.value]) !== "." && _optionalChain([tokens, 'access', _230 => _230[index + 1], 'optionalAccess', _231 => _231.value]) === "(" && _optionalChain([tokens, 'access', _232 => _232[index + 2], 'optionalAccess', _233 => _233.kind]) === "string") {
|
|
3706
3815
|
matches.add(tokens[index + 2].value);
|
|
3707
3816
|
continue;
|
|
3708
3817
|
}
|
|
@@ -3712,7 +3821,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3712
3821
|
}
|
|
3713
3822
|
if (reexportsOnly && keyword.value !== "export") continue;
|
|
3714
3823
|
const previous = tokens[index - 1];
|
|
3715
|
-
if (_optionalChain([previous, 'optionalAccess',
|
|
3824
|
+
if (_optionalChain([previous, 'optionalAccess', _234 => _234.value]) === ".") continue;
|
|
3716
3825
|
const first = tokens[index + 1];
|
|
3717
3826
|
if (!first || first.value === "type" || first.value === "(" || first.value === ".") {
|
|
3718
3827
|
continue;
|
|
@@ -3728,7 +3837,7 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3728
3837
|
for (let cursor = index + 1; cursor < tokens.length; cursor++) {
|
|
3729
3838
|
const token = tokens[cursor];
|
|
3730
3839
|
if (token.value === ";") break;
|
|
3731
|
-
if (token.value === "from" && _optionalChain([tokens, 'access',
|
|
3840
|
+
if (token.value === "from" && _optionalChain([tokens, 'access', _235 => _235[cursor + 1], 'optionalAccess', _236 => _236.kind]) === "string") {
|
|
3732
3841
|
fromIndex = cursor;
|
|
3733
3842
|
break;
|
|
3734
3843
|
}
|
|
@@ -3746,14 +3855,14 @@ function scanImportSpecifiers(content, { reexportsOnly = false, dynamic = false
|
|
|
3746
3855
|
return Array.from(matches);
|
|
3747
3856
|
}
|
|
3748
3857
|
function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
3749
|
-
if (_optionalChain([tokens, 'access',
|
|
3858
|
+
if (_optionalChain([tokens, 'access', _237 => _237[startIndex], 'optionalAccess', _238 => _238.value]) !== "{") return false;
|
|
3750
3859
|
const closingBraceIndex = tokens.findIndex(
|
|
3751
3860
|
(token, index) => index > startIndex && index < endIndex && token.value === "}"
|
|
3752
3861
|
);
|
|
3753
3862
|
if (closingBraceIndex === -1) return false;
|
|
3754
3863
|
let entryStartsAt = startIndex + 1;
|
|
3755
3864
|
for (let index = entryStartsAt; index <= closingBraceIndex; index++) {
|
|
3756
|
-
if (index !== closingBraceIndex && _optionalChain([tokens, 'access',
|
|
3865
|
+
if (index !== closingBraceIndex && _optionalChain([tokens, 'access', _239 => _239[index], 'optionalAccess', _240 => _240.value]) !== ",") continue;
|
|
3757
3866
|
const entry = tokens.slice(entryStartsAt, index);
|
|
3758
3867
|
if (entry.length > 0 && entry[0].value !== "type") return false;
|
|
3759
3868
|
entryStartsAt = index + 1;
|
|
@@ -3827,14 +3936,14 @@ function getProjectImportAliases(projectRoot) {
|
|
|
3827
3936
|
const stamp = PROJECT_ALIAS_FILES.map((file) => {
|
|
3828
3937
|
try {
|
|
3829
3938
|
return String(_fs2.default.statSync(_path2.default.join(projectRoot, file)).mtimeMs);
|
|
3830
|
-
} catch (
|
|
3939
|
+
} catch (e43) {
|
|
3831
3940
|
return "-";
|
|
3832
3941
|
}
|
|
3833
3942
|
}).join(":");
|
|
3834
|
-
const sourceDir =
|
|
3943
|
+
const sourceDir = _chunkMNUYXZV7cjs.getFarmProjectSourceDir.call(void 0, projectRoot);
|
|
3835
3944
|
const cacheStamp = `${stamp}:${sourceDir}`;
|
|
3836
3945
|
const cached = projectImportAliasCache.get(projectRoot);
|
|
3837
|
-
if (_optionalChain([cached, 'optionalAccess',
|
|
3946
|
+
if (_optionalChain([cached, 'optionalAccess', _241 => _241.stamp]) === cacheStamp) return cached.aliases;
|
|
3838
3947
|
const aliases = [
|
|
3839
3948
|
...readTsconfigPathAliases(projectRoot),
|
|
3840
3949
|
...readPackageImportAliases(projectRoot)
|
|
@@ -3855,7 +3964,7 @@ function readTsconfigPathAliases(projectRoot) {
|
|
|
3855
3964
|
const configPath = _path2.default.join(projectRoot, name);
|
|
3856
3965
|
if (!_fs2.default.existsSync(configPath)) continue;
|
|
3857
3966
|
const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
|
|
3858
|
-
if (!_optionalChain([resolved, 'optionalAccess',
|
|
3967
|
+
if (!_optionalChain([resolved, 'optionalAccess', _242 => _242.paths])) return [];
|
|
3859
3968
|
const base2 = _nullishCoalesce(resolved.baseUrl, () => ( resolved.pathsDirectory));
|
|
3860
3969
|
return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
|
|
3861
3970
|
if (!Array.isArray(targets)) return [];
|
|
@@ -3890,18 +3999,18 @@ function readTsconfigPaths(configPath, visited) {
|
|
|
3890
3999
|
inherited = _nullishCoalesce(readTsconfigPaths(parentPath, visited), () => ( inherited));
|
|
3891
4000
|
}
|
|
3892
4001
|
const options = _nullishCoalesce(config.compilerOptions, () => ( {}));
|
|
3893
|
-
const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess',
|
|
4002
|
+
const baseUrl = typeof options.baseUrl === "string" ? _path2.default.resolve(directory, options.baseUrl) : _optionalChain([inherited, 'optionalAccess', _243 => _243.baseUrl]);
|
|
3894
4003
|
if (options.paths && typeof options.paths === "object") {
|
|
3895
4004
|
return { paths: options.paths, pathsDirectory: directory, baseUrl };
|
|
3896
4005
|
}
|
|
3897
4006
|
return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
|
|
3898
4007
|
}
|
|
3899
4008
|
function readPackageImportAliases(projectRoot) {
|
|
3900
|
-
const imports = _optionalChain([readPackageJson, 'call',
|
|
4009
|
+
const imports = _optionalChain([readPackageJson, 'call', _244 => _244(_path2.default.join(projectRoot, "package.json")), 'optionalAccess', _245 => _245.imports]);
|
|
3901
4010
|
if (!imports || typeof imports !== "object") return [];
|
|
3902
4011
|
return Object.entries(imports).flatMap(([pattern, value]) => {
|
|
3903
4012
|
const target = resolveConditionalExportTarget(value);
|
|
3904
|
-
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess',
|
|
4013
|
+
if (!pattern.startsWith("#") || !_optionalChain([target, 'optionalAccess', _246 => _246.startsWith, 'call', _247 => _247("./")])) return [];
|
|
3905
4014
|
const wildcardIndex = pattern.indexOf("*");
|
|
3906
4015
|
return [
|
|
3907
4016
|
{
|
|
@@ -3917,7 +4026,7 @@ function readJsonWithComments(filePath) {
|
|
|
3917
4026
|
let source;
|
|
3918
4027
|
try {
|
|
3919
4028
|
source = _fs2.default.readFileSync(filePath, "utf8");
|
|
3920
|
-
} catch (
|
|
4029
|
+
} catch (e44) {
|
|
3921
4030
|
return null;
|
|
3922
4031
|
}
|
|
3923
4032
|
let output = "";
|
|
@@ -3945,7 +4054,7 @@ function readJsonWithComments(filePath) {
|
|
|
3945
4054
|
}
|
|
3946
4055
|
try {
|
|
3947
4056
|
return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
|
|
3948
|
-
} catch (
|
|
4057
|
+
} catch (e45) {
|
|
3949
4058
|
return null;
|
|
3950
4059
|
}
|
|
3951
4060
|
}
|
|
@@ -3967,15 +4076,15 @@ function resolvePackageModuleSourcePath(importerPath, specifier, root) {
|
|
|
3967
4076
|
const packageJsonPath = _path2.default.join(packageDirectory, "package.json");
|
|
3968
4077
|
const packageJson = readPackageJson(packageJsonPath);
|
|
3969
4078
|
const exportKey = packageSubpath ? `./${packageSubpath}` : ".";
|
|
3970
|
-
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess',
|
|
4079
|
+
const exportTarget = resolvePackageExport(_optionalChain([packageJson, 'optionalAccess', _248 => _248.exports]), exportKey);
|
|
3971
4080
|
const candidates = /* @__PURE__ */ new Set();
|
|
3972
|
-
if (_optionalChain([exportTarget, 'optionalAccess',
|
|
4081
|
+
if (_optionalChain([exportTarget, 'optionalAccess', _249 => _249.startsWith, 'call', _250 => _250("./")])) {
|
|
3973
4082
|
candidates.add(_path2.default.resolve(packageDirectory, exportTarget));
|
|
3974
4083
|
}
|
|
3975
4084
|
if (packageSubpath) {
|
|
3976
4085
|
candidates.add(_path2.default.join(packageDirectory, packageSubpath));
|
|
3977
4086
|
} else {
|
|
3978
|
-
for (const entry of [_optionalChain([packageJson, 'optionalAccess',
|
|
4087
|
+
for (const entry of [_optionalChain([packageJson, 'optionalAccess', _251 => _251.browser]), _optionalChain([packageJson, 'optionalAccess', _252 => _252.module]), _optionalChain([packageJson, 'optionalAccess', _253 => _253.main])]) {
|
|
3979
4088
|
if (typeof entry === "string") candidates.add(_path2.default.resolve(packageDirectory, entry));
|
|
3980
4089
|
}
|
|
3981
4090
|
candidates.add(_path2.default.join(packageDirectory, "index"));
|
|
@@ -4011,7 +4120,7 @@ function findPackageDirectory2(importerPath, packageName, root) {
|
|
|
4011
4120
|
function readPackageJson(packageJsonPath) {
|
|
4012
4121
|
try {
|
|
4013
4122
|
return JSON.parse(_fs2.default.readFileSync(packageJsonPath, "utf8"));
|
|
4014
|
-
} catch (
|
|
4123
|
+
} catch (e46) {
|
|
4015
4124
|
return null;
|
|
4016
4125
|
}
|
|
4017
4126
|
}
|
|
@@ -4040,7 +4149,7 @@ function resolvePackageExport(exportsField, exportKey) {
|
|
|
4040
4149
|
if (!exportKey.startsWith(prefix) || !exportKey.endsWith(suffix)) continue;
|
|
4041
4150
|
const wildcard = exportKey.slice(prefix.length, exportKey.length - suffix.length);
|
|
4042
4151
|
const target = resolveConditionalExportTarget(value);
|
|
4043
|
-
return _nullishCoalesce(_optionalChain([target, 'optionalAccess',
|
|
4152
|
+
return _nullishCoalesce(_optionalChain([target, 'optionalAccess', _254 => _254.replace, 'call', _255 => _255("*", wildcard)]), () => ( null));
|
|
4044
4153
|
}
|
|
4045
4154
|
return null;
|
|
4046
4155
|
}
|
|
@@ -4083,8 +4192,8 @@ function resolveSourceCandidatePath(candidate) {
|
|
|
4083
4192
|
}
|
|
4084
4193
|
for (const sourcePath of paths) {
|
|
4085
4194
|
try {
|
|
4086
|
-
if (_optionalChain([_fs2.default, 'access',
|
|
4087
|
-
} catch (
|
|
4195
|
+
if (_optionalChain([_fs2.default, 'access', _256 => _256.statSync, 'call', _257 => _257(sourcePath, { throwIfNoEntry: false }), 'optionalAccess', _258 => _258.isFile, 'call', _259 => _259()])) return sourcePath;
|
|
4196
|
+
} catch (e47) {
|
|
4088
4197
|
}
|
|
4089
4198
|
}
|
|
4090
4199
|
return null;
|
|
@@ -4126,7 +4235,7 @@ function scanFarmPackageImports(directory, root) {
|
|
|
4126
4235
|
let entries;
|
|
4127
4236
|
try {
|
|
4128
4237
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
4129
|
-
} catch (
|
|
4238
|
+
} catch (e48) {
|
|
4130
4239
|
return;
|
|
4131
4240
|
}
|
|
4132
4241
|
for (const entry of entries) {
|
|
@@ -4159,7 +4268,7 @@ function collectFarmServerBundledPackageInfo(directory) {
|
|
|
4159
4268
|
let entries;
|
|
4160
4269
|
try {
|
|
4161
4270
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
4162
|
-
} catch (
|
|
4271
|
+
} catch (e49) {
|
|
4163
4272
|
return;
|
|
4164
4273
|
}
|
|
4165
4274
|
for (const entry of entries) {
|
|
@@ -4198,7 +4307,7 @@ function getFarmClientReachableModules(directory, root) {
|
|
|
4198
4307
|
let entries;
|
|
4199
4308
|
try {
|
|
4200
4309
|
entries = _fs2.default.readdirSync(current, { withFileTypes: true });
|
|
4201
|
-
} catch (
|
|
4310
|
+
} catch (e50) {
|
|
4202
4311
|
return;
|
|
4203
4312
|
}
|
|
4204
4313
|
for (const entry of entries) {
|
|
@@ -4297,20 +4406,20 @@ function transformEnvironmentFunctions(options) {
|
|
|
4297
4406
|
function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
4298
4407
|
let routesFiles = /* @__PURE__ */ new Set();
|
|
4299
4408
|
const componentExtensions = new Set(
|
|
4300
|
-
|
|
4409
|
+
_chunk3OKSEJ33cjs.getFarmRendererComponentExtensions.call(void 0, options.renderer || void 0)
|
|
4301
4410
|
);
|
|
4302
4411
|
let farmApi;
|
|
4303
4412
|
let isBuild = false;
|
|
4304
4413
|
let projectRoot = process.cwd();
|
|
4305
4414
|
let sources;
|
|
4306
4415
|
const routeSourceFiles = () => {
|
|
4307
|
-
const clientRoutes = _optionalChain([farmApi, 'optionalAccess',
|
|
4308
|
-
if (_optionalChain([sources, 'optionalAccess',
|
|
4416
|
+
const clientRoutes = _optionalChain([farmApi, 'optionalAccess', _260 => _260.getProgrammaticClientRoutes, 'call', _261 => _261()]);
|
|
4417
|
+
if (_optionalChain([sources, 'optionalAccess', _262 => _262.for]) !== clientRoutes || !sources) {
|
|
4309
4418
|
sources = {
|
|
4310
4419
|
for: clientRoutes,
|
|
4311
4420
|
files: /* @__PURE__ */ new Set([
|
|
4312
4421
|
...routesFiles,
|
|
4313
|
-
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess',
|
|
4422
|
+
...[..._nullishCoalesce(_optionalChain([clientRoutes, 'optionalAccess', _263 => _263.routeSourceFiles]), () => ( []))].map(resolvedFile)
|
|
4314
4423
|
])
|
|
4315
4424
|
};
|
|
4316
4425
|
}
|
|
@@ -4331,7 +4440,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4331
4440
|
configResolved(config) {
|
|
4332
4441
|
isBuild = config.command === "build";
|
|
4333
4442
|
projectRoot = config.root;
|
|
4334
|
-
farmApi = _optionalChain([config, 'access',
|
|
4443
|
+
farmApi = _optionalChain([config, 'access', _264 => _264.plugins, 'access', _265 => _265.find, 'call', _266 => _266((plugin) => plugin.name === "farm"), 'optionalAccess', _267 => _267.api]);
|
|
4335
4444
|
sources = void 0;
|
|
4336
4445
|
routesFiles = new Set(
|
|
4337
4446
|
_chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, { ...options, root: _nullishCoalesce(options.root, () => ( config.root)) }).flatMap(
|
|
@@ -4344,7 +4453,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4344
4453
|
transform(code, id, transformOptions) {
|
|
4345
4454
|
const environment = resolveBuildEnvironment(
|
|
4346
4455
|
this,
|
|
4347
|
-
_optionalChain([transformOptions, 'optionalAccess',
|
|
4456
|
+
_optionalChain([transformOptions, 'optionalAccess', _268 => _268.ssr])
|
|
4348
4457
|
);
|
|
4349
4458
|
const parse3 = (source) => this.parse(source);
|
|
4350
4459
|
const result = transformEnvironmentFunctions({
|
|
@@ -4357,7 +4466,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4357
4466
|
if (environment === "client" && !isBuild && !_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id) && routeSourceFiles().has(moduleFile(id)) && !isProgrammaticRouteActionProxy(code)) {
|
|
4358
4467
|
this.error(routeSourceError(moduleFile(id)));
|
|
4359
4468
|
}
|
|
4360
|
-
if (environment === "server" &&
|
|
4469
|
+
if (environment === "server" && _chunk3OKSEJ33cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([options, 'access', _269 => _269.experimental, 'optionalAccess', _270 => _270.serverComponents])) === "islands" && isApplicationScript(id)) {
|
|
4361
4470
|
const file = id.split("?", 1)[0];
|
|
4362
4471
|
const root = _fs.realpathSync.call(void 0, _nullishCoalesce(options.root, () => ( projectRoot)));
|
|
4363
4472
|
const clientCode = getFarmClientReachableModules(root, root).has(_path2.default.resolve(file)) || _fs.existsSync.call(void 0, file) && hasUseClientDirective(_fs.readFileSync.call(void 0, file, "utf8"));
|
|
@@ -4391,7 +4500,7 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4391
4500
|
for (const id of this.getModuleIds()) {
|
|
4392
4501
|
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4393
4502
|
const chain = findClientNodeBuiltinChain(id, (moduleId) => {
|
|
4394
|
-
return _optionalChain([this, 'access',
|
|
4503
|
+
return _optionalChain([this, 'access', _271 => _271.getModuleInfo, 'call', _272 => _272(moduleId), 'optionalAccess', _273 => _273.importedIds]);
|
|
4395
4504
|
});
|
|
4396
4505
|
if (chain) {
|
|
4397
4506
|
this.error(
|
|
@@ -4409,8 +4518,8 @@ function farmEnvironmentFunctionsPlugin(options = {}) {
|
|
|
4409
4518
|
}
|
|
4410
4519
|
if (!forbidden.has(moduleFile(id))) continue;
|
|
4411
4520
|
const info = this.getModuleInfo(id);
|
|
4412
|
-
if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess',
|
|
4413
|
-
this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess',
|
|
4521
|
+
if (isProgrammaticRouteActionProxy(_optionalChain([info, 'optionalAccess', _274 => _274.code]))) continue;
|
|
4522
|
+
this.error(routeSourceError(moduleFile(id), _optionalChain([info, 'optionalAccess', _275 => _275.importers, 'access', _276 => _276.map, 'call', _277 => _277(moduleFile)])));
|
|
4414
4523
|
}
|
|
4415
4524
|
}
|
|
4416
4525
|
};
|
|
@@ -4424,13 +4533,13 @@ function moduleFile(id) {
|
|
|
4424
4533
|
function resolvedFile(filePath) {
|
|
4425
4534
|
try {
|
|
4426
4535
|
return moduleFile(_fs.realpathSync.call(void 0, filePath));
|
|
4427
|
-
} catch (
|
|
4536
|
+
} catch (e51) {
|
|
4428
4537
|
return moduleFile(filePath);
|
|
4429
4538
|
}
|
|
4430
4539
|
}
|
|
4431
4540
|
function resolveBuildEnvironment(context, ssr) {
|
|
4432
|
-
if (_optionalChain([context, 'access',
|
|
4433
|
-
if (_optionalChain([context, 'access',
|
|
4541
|
+
if (_optionalChain([context, 'access', _278 => _278.environment, 'optionalAccess', _279 => _279.name]) === "client") return "client";
|
|
4542
|
+
if (_optionalChain([context, 'access', _280 => _280.environment, 'optionalAccess', _281 => _281.name]) === "rsc" || _optionalChain([context, 'access', _282 => _282.environment, 'optionalAccess', _283 => _283.name]) === "ssr") {
|
|
4434
4543
|
return "server";
|
|
4435
4544
|
}
|
|
4436
4545
|
return ssr ? "server" : "client";
|
|
@@ -4756,4 +4865,5 @@ function transformError(id, message) {
|
|
|
4756
4865
|
|
|
4757
4866
|
|
|
4758
4867
|
|
|
4759
|
-
|
|
4868
|
+
|
|
4869
|
+
exports.FARM_BROWSER_BUILTIN_PREFIX = FARM_BROWSER_BUILTIN_PREFIX; exports.resolveFarmBrowserBuiltin = resolveFarmBrowserBuiltin; exports.loadFarmBrowserBuiltin = loadFarmBrowserBuiltin; exports.farmBrowserBuiltinsOptimizerPlugin = farmBrowserBuiltinsOptimizerPlugin; exports.programmaticClientRouteKey = programmaticClientRouteKey; exports.resolveProgrammaticClientRoutes = resolveProgrammaticClientRoutes; exports.createEvaluatedRouteGraph = createEvaluatedRouteGraph; exports.mergeProgrammaticClientRoutes = mergeProgrammaticClientRoutes; exports.generateProgrammaticClientRouteModule = generateProgrammaticClientRouteModule; exports.getFarmSourceStamp = getFarmSourceStamp; exports.FarmSourceSnapshotStore = FarmSourceSnapshotStore; exports.withFarmSourceSnapshot = withFarmSourceSnapshot; exports.withFarmSourceSnapshotOf = withFarmSourceSnapshotOf; exports.memoizeInFarmSourceSnapshot = memoizeInFarmSourceSnapshot; exports.noteFarmSourceRead = noteFarmSourceRead; exports.traceFarmSourceReads = traceFarmSourceReads; exports.rewriteFarmReactServerClientModuleImports = rewriteFarmReactServerClientModuleImports; exports.rewriteFarmReactServerImports = rewriteFarmReactServerImports; exports.invalidateFarmClientOnlyScan = invalidateFarmClientOnlyScan; exports.farmRelativeImportFiles = farmRelativeImportFiles; exports.usePackageScanCacheFile = usePackageScanCacheFile; exports.persistPackageScanCache = persistPackageScanCache; exports.FARM_CLIENT_REFERENCE_PRAGMA = FARM_CLIENT_REFERENCE_PRAGMA; exports.FARM_CLIENT_REFERENCE_DIRECTORY = FARM_CLIENT_REFERENCE_DIRECTORY; exports.FARM_RESOLVE_FROM_PREFIX = FARM_RESOLVE_FROM_PREFIX; exports.parseFarmResolveFrom = parseFarmResolveFrom; exports.ensureFarmPackageClientReference = ensureFarmPackageClientReference; exports.ensureFarmInternalClientReference = ensureFarmInternalClientReference; exports.rewriteFarmPackageClientImports = rewriteFarmPackageClientImports; exports.farmIslandContainerReferencePath = farmIslandContainerReferencePath; exports.ensureFarmIslandContainerReference = ensureFarmIslandContainerReference; exports.wrapFarmIslandContainers = wrapFarmIslandContainers; exports.withPackageClientBoundaryCache = withPackageClientBoundaryCache; exports.usePackageClientBoundaryCacheFile = usePackageClientBoundaryCacheFile; exports.resolvePackageClientBoundaryCacheFile = resolvePackageClientBoundaryCacheFile; exports.runWithPackageClientBoundaryCacheFile = runWithPackageClientBoundaryCacheFile; exports.runWithLatestPackageClientBoundaryCache = runWithLatestPackageClientBoundaryCache; exports.dropLatestPackageClientBoundaryCache = dropLatestPackageClientBoundaryCache; exports.setFarmRendererHydrationScope = setFarmRendererHydrationScope; exports.resolveModuleSourcePath = resolveModuleSourcePath; exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.hasUseClientDirective = hasUseClientDirective; exports.getIslandStrategyExport = getIslandStrategyExport; exports.stripUseClientDirective = stripUseClientDirective; exports.getFarmClientRenderingBindings = getFarmClientRenderingBindings; exports.collectFarmRenderedClientModules = collectFarmRenderedClientModules; exports.collectFarmServerStylesheets = collectFarmServerStylesheets; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlanKey = getClientModuleHydrationPlanKey; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.usesFarmServerTree = usesFarmServerTree; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.isIsolatableClientBoundarySource = isIsolatableClientBoundarySource; exports.isFarmClientModulePlanUnchanged = isFarmClientModulePlanUnchanged; exports.resolveImportedModule = resolveImportedModule; exports.isFarmPackageClientBoundary = isFarmPackageClientBoundary; exports.collectFarmClientPackageImports = collectFarmClientPackageImports; exports.collectFarmServerBundledPackageInfo = collectFarmServerBundledPackageInfo; exports.invalidateFarmClientReachableModules = invalidateFarmClientReachableModules; exports.getFarmClientReachableModules = getFarmClientReachableModules; exports.resolveFarmClientOptimizeDeps = resolveFarmClientOptimizeDeps; exports.createFarmDiagnostic = createFarmDiagnostic; exports.formatFarmDiagnostic = formatFarmDiagnostic; exports.createFarmSourceLocator = createFarmSourceLocator; exports.transformEnvironmentFunctions = transformEnvironmentFunctions; exports.farmEnvironmentFunctionsPlugin = farmEnvironmentFunctionsPlugin;
|