@farm.js/core 0.1.63 → 0.1.65
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-handler-OV4WRFBL.cjs → agent-mcp-handler-OXT73ZBY.cjs} +5 -5
- package/dist/{agent-mcp-handler-7QMX2LUY.mjs → agent-mcp-handler-QLFDDTYN.mjs} +4 -4
- package/dist/{agent-mcp.d-CCQ-wKwg.d.mts → agent-mcp.d-CO_ABmNK.d.mts} +1 -1
- package/dist/{agent-mcp.d-DOJCBSh9.d.ts → agent-mcp.d-QD2WZ9BS.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-GHWK46LX.cjs +16 -0
- package/dist/{analyzer-WNPQPWFR.mjs → analyzer-PE33SK5W.mjs} +3 -2
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/{app-manifest.d-BaA0omsv.d.mts → app-manifest.d-BpKxiU_E.d.mts} +1 -1
- package/dist/{app-manifest.d-poayV4lq.d.ts → app-manifest.d-DDmNkYQQ.d.ts} +1 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-DdWxeIGU.d.mts → app.d-kuoVWhWM.d.mts} +4 -4
- package/dist/{app.d-D4Dn03E3.d.ts → app.d-x68Cwr0_.d.ts} +4 -4
- package/dist/{chunk-LT4VAF5Z.cjs → chunk-2C5L5RPM.cjs} +7 -6
- package/dist/{chunk-BA2IA32Q.mjs → chunk-2L54YV25.mjs} +13 -11
- package/dist/{chunk-5IKQ7BIR.cjs → chunk-32RPJAAS.cjs} +16 -16
- package/dist/{chunk-QN5WRQSQ.cjs → chunk-3KJPIO5D.cjs} +610 -3102
- package/dist/{chunk-EENTT56C.mjs → chunk-6X5NKNBE.mjs} +43 -38
- package/dist/{chunk-RFYL5OLP.mjs → chunk-72JSHQQQ.mjs} +1 -1
- package/dist/{chunk-LA45FN37.mjs → chunk-7GYCZRTH.mjs} +386 -2878
- package/dist/chunk-7QVRWGBL.cjs +3704 -0
- package/dist/{chunk-PRFNLQSP.cjs → chunk-7XGWBPQQ.cjs} +4 -4
- package/dist/{chunk-FNHN3RBD.cjs → chunk-A3G5IY2W.cjs} +1 -1
- package/dist/{chunk-EYLC6GD6.cjs → chunk-C7DCMGC4.cjs} +12 -12
- package/dist/chunk-CJNAUEVC.mjs +34 -0
- package/dist/{chunk-LFFSDZ4Y.cjs → chunk-CZF4XIRZ.cjs} +3 -3
- package/dist/{chunk-7FFW7DC4.mjs → chunk-E2TSYUHV.mjs} +4 -4
- package/dist/{chunk-55U5QIXQ.mjs → chunk-FIR62CR3.mjs} +1 -1
- package/dist/{chunk-MEQN6DDA.cjs → chunk-FJWN7RV4.cjs} +5 -5
- package/dist/{chunk-VVTJTMGQ.cjs → chunk-GL7N5UHF.cjs} +4 -4
- package/dist/{chunk-4DIKLG56.mjs → chunk-GRBJ7VKH.mjs} +1 -1
- package/dist/{chunk-UR25Z5Z6.mjs → chunk-HCGWDRZO.mjs} +1 -1
- package/dist/{chunk-GPKBUME5.mjs → chunk-HKNYNSOK.mjs} +2 -2
- package/dist/{chunk-U6WCUVSV.cjs → chunk-IMK32ERL.cjs} +23 -21
- package/dist/chunk-IOEXXZK3.mjs +88 -0
- package/dist/{chunk-IOF4KXMP.mjs → chunk-IP2KHSGF.mjs} +205 -26
- package/dist/{chunk-YSXTNSXS.mjs → chunk-K7OZAVOI.mjs} +7 -6
- package/dist/{chunk-KVW2M6PI.mjs → chunk-KL7SHLQB.mjs} +1 -1
- package/dist/{chunk-UZZ6IEQP.mjs → chunk-MESQF2JC.mjs} +2 -2
- package/dist/{chunk-DZPR2W6U.cjs → chunk-O6L3YYPM.cjs} +5 -5
- package/dist/{chunk-6BJJYOFL.cjs → chunk-OLIGNTWU.cjs} +7 -7
- package/dist/{chunk-5L7I6AMY.cjs → chunk-OSFIUSYK.cjs} +5 -5
- package/dist/{chunk-LA6O5EL2.mjs → chunk-Q75QPLBA.mjs} +1 -1
- package/dist/{chunk-O5FCWI6O.mjs → chunk-QHRCR44V.mjs} +2 -2
- package/dist/{chunk-E72UD6ME.mjs → chunk-RVGSVQWT.mjs} +1 -1
- package/dist/{chunk-Z74NNER4.cjs → chunk-T4M52BA5.cjs} +164 -159
- package/dist/{chunk-PCXIJKPM.mjs → chunk-TNBJ4LZG.mjs} +2 -2
- package/dist/{chunk-PAKCHVUS.mjs → chunk-TPA2PV5J.mjs} +3 -35
- package/dist/{chunk-Y2YBNQ3D.cjs → chunk-TRIDJQ6A.cjs} +6 -6
- package/dist/{chunk-PVJX4UPA.cjs → chunk-TZOGZKI7.cjs} +411 -295
- package/dist/{chunk-O27PLNQZ.cjs → chunk-UJ3R2AH2.cjs} +4 -4
- package/dist/{chunk-BPNOYILC.cjs → chunk-UVV3I5QA.cjs} +3 -35
- package/dist/{chunk-CBDRR3J3.mjs → chunk-VHHLKIDZ.mjs} +166 -50
- package/dist/{chunk-T4TBK5NY.mjs → chunk-VQ4NWOWO.mjs} +2 -2
- package/dist/{chunk-ZZ2QKCKW.mjs → chunk-WAY6LOQH.mjs} +1 -1
- package/dist/chunk-WBTHHTBO.cjs +88 -0
- package/dist/{chunk-IWRLV46X.cjs → chunk-WMTBBQHY.cjs} +4 -4
- package/dist/{chunk-LWWDTBGL.cjs → chunk-WNXVWXG3.cjs} +2 -2
- package/dist/{chunk-CI4UNQHO.cjs → chunk-XBSKPLHF.cjs} +2 -2
- package/dist/{chunk-QAS7KE7J.cjs → chunk-Y5TOT5F6.cjs} +5 -5
- package/dist/{chunk-ANXU3D32.cjs → chunk-YD4J37RN.cjs} +403 -32
- package/dist/{chunk-XICXQXYE.mjs → chunk-YUW7F6SK.mjs} +2 -2
- package/dist/chunk-ZAUOOGER.mjs +3704 -0
- package/dist/{chunk-DPE53XWL.mjs → chunk-ZEXE4TGY.mjs} +1 -1
- package/dist/chunk-ZIHWAN55.cjs +34 -0
- package/dist/{chunk-GVOMPU3Y.cjs → chunk-ZQQK4U66.cjs} +213 -34
- package/dist/{chunk-S2NUYHRY.mjs → chunk-ZX2JHEWW.mjs} +384 -13
- package/dist/{client-component.d-CSEFlHfG.d.mts → client-component.d-D74pqdea.d.mts} +2 -2
- package/dist/{client-component.d-CQLvqLAJ.d.ts → client-component.d-D8VcypQA.d.ts} +2 -2
- package/dist/{client-plugins.d-BgPUYPc9.d.ts → client-plugins.d-CXElzotB.d.ts} +8 -1
- package/dist/{client-plugins.d-BTF0gZm4.d.mts → client-plugins.d-D4-6hNx7.d.mts} +8 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-HDKTYIZF.mjs → devtools-PUVZB3F2.mjs} +7 -6
- package/dist/{devtools-ZHN5JLVI.cjs → devtools-SGYOG36E.cjs} +8 -7
- package/dist/docs.cjs +10 -9
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +9 -8
- package/dist/environment/vite.cjs +9 -2
- package/dist/environment/vite.d.mts +3 -0
- package/dist/environment/vite.d.ts +3 -0
- package/dist/environment/vite.mjs +8 -1
- package/dist/index.cjs +29 -27
- package/dist/{index.d-Coow7bD4.d.ts → index.d-A_x10zGS.d.ts} +1 -1
- package/dist/{index.d-Dbjx0ku7.d.mts → index.d-SSgYDv4D.d.mts} +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +28 -26
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +27 -25
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +26 -24
- package/dist/internal/cli-runtime.cjs +10 -9
- package/dist/internal/cli-runtime.mjs +9 -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 +4 -4
- package/dist/internal/client-runtime.d.ts +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -8
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +8 -7
- package/dist/internal/infra-analytics-runtime.cjs +9 -9
- package/dist/internal/infra-analytics-runtime.mjs +7 -7
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -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 +11 -11
- package/dist/internal/production-runtime.d.mts +20 -12
- package/dist/internal/production-runtime.d.ts +20 -12
- package/dist/internal/production-runtime.mjs +10 -10
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/mobile.d.mts +2 -2
- package/dist/mobile.d.ts +2 -2
- package/dist/{native-tree-Z2WYUJEV.cjs → native-tree-HE2FLS72.cjs} +3 -3
- package/dist/{native-tree-AS5L3ID3.mjs → native-tree-YF2DSPKM.mjs} +2 -2
- package/dist/{navigation-delegate.d-Ca_BV0Wu.d.mts → navigation-delegate.d-DQVYKoaZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-aHiPI6GL.d.ts → navigation-delegate.d-GghbHJuK.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +18 -17
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +17 -16
- package/dist/{production-runtime.d-C0rF7a10.d.ts → production-runtime.d-Bzns3NW9.d.ts} +1 -1
- package/dist/{production-runtime.d-CnAsSWgF.d.mts → production-runtime.d-DiFa5vHW.d.mts} +1 -1
- package/dist/{render-plan.d-BxeITFT1.d.ts → render-plan.d-CL_Ikfg_.d.ts} +1 -1
- package/dist/{render-plan.d-Z-93m5GZ.d.mts → render-plan.d-CcF0MeCf.d.mts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-X7Q1vmGF.d.ts → request.d-B1RnTLri.d.ts} +1 -1
- package/dist/{request.d-8_fMFNEb.d.mts → request.d-DarDOCk9.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-BUr3Jp8S.d.ts → route-rendering.d-BTUYCIj4.d.ts} +1 -1
- package/dist/{route-rendering.d-BInmBmul.d.mts → route-rendering.d-D_2Ual0-.d.mts} +1 -1
- package/dist/{router.d-crorSRiW.d.ts → router.d-CMANF6da.d.ts} +1 -1
- package/dist/{router.d-CZQmbpHx.d.mts → router.d-Cuv1jntg.d.mts} +1 -1
- package/dist/{routes.d-BknKQcTu.d.ts → routes.d-B6yFe6jm.d.ts} +1 -1
- package/dist/{routes.d-D1IrO9KK.d.mts → routes.d-c2HKfrfL.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-3MPRULGA.mjs → rsc-pipeline-T3PWURLJ.mjs} +9 -8
- package/dist/{rsc-pipeline-RHEZNBFQ.cjs → rsc-pipeline-V4ANLRAA.cjs} +10 -9
- package/dist/{runtime-OZKFZQCU.cjs → runtime-5AROV2C3.cjs} +29 -17
- package/dist/{runtime-X5UR7VHP.mjs → runtime-LRIQ3XH7.mjs} +26 -14
- package/dist/{runtime.d-CCsjTZJW.d.ts → runtime.d-C3RQUj6_.d.ts} +1 -1
- package/dist/{runtime.d-CETtpLb-.d.mts → runtime.d-wvh4ngU0.d.mts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +42 -41
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +26 -25
- package/dist/{spa-router.d-CtSHzXlC.d.mts → spa-router.d-WU_qS5gJ.d.mts} +2 -2
- package/dist/{spa-router.d-CCADbSqJ.d.ts → spa-router.d-m8H_Kl_B.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-CjyE-npA.d.ts → utils.d-C9dQD5Zg.d.ts} +1 -1
- package/dist/{utils.d-zFPHKFFJ.d.mts → utils.d-W9IiEqmW.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -19
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +20 -18
- package/package.json +1 -1
- package/dist/analyzer-KEA5JVDR.cjs +0 -15
- package/dist/chunk-NK2VWS7P.cjs +0 -954
- package/dist/chunk-ZQ5BDNKW.mjs +0 -954
|
@@ -6,10 +6,10 @@ var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
|
|
|
6
6
|
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkWT6RAN2Icjs = require('./chunk-WT6RAN2I.cjs');
|
|
@@ -603,12 +603,12 @@ function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options
|
|
|
603
603
|
return new Response(null, { status: 405, headers: { Allow: "GET, HEAD" } });
|
|
604
604
|
}
|
|
605
605
|
if ((kind === "llms" || kind === "llms-full") && options.request) {
|
|
606
|
-
|
|
606
|
+
_chunk2C5L5RPMcjs.emitFarmAgentRead.call(void 0, options.request, kind, isResponse(value) ? value.status : 200);
|
|
607
607
|
}
|
|
608
608
|
if (isResponse(value)) {
|
|
609
609
|
return method === "HEAD" ? _chunk4DCWVSL2cjs.omitFarmResponseBody.call(void 0, value) : value;
|
|
610
610
|
}
|
|
611
|
-
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ?
|
|
611
|
+
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunkFJWN7RV4cjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
|
|
612
612
|
const contentType = kind === "sitemap" ? "application/xml; charset=utf-8" : kind === "robots" || kind === "llms" || kind === "llms-full" ? "text/plain; charset=utf-8" : "application/manifest+json; charset=utf-8";
|
|
613
613
|
return new Response(method === "HEAD" ? null : body, {
|
|
614
614
|
headers: {
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; }// src/
|
|
2
|
-
function resolveFarmServerComponentsMode(value) {
|
|
3
|
-
if (value === void 0 || value === null || value === false) return void 0;
|
|
4
|
-
if (value === true) return "rsc";
|
|
5
|
-
const mode = typeof value === "object" ? value.mode : void 0;
|
|
6
|
-
if (mode === "rsc" || mode === "islands") return mode;
|
|
7
|
-
throw new TypeError(
|
|
8
|
-
'experimental.serverComponents must be true, false, { mode: "rsc" } or { mode: "islands" }.'
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
function isExplicitFarmServerComponentsMode(value) {
|
|
12
|
-
return typeof value === "object" && value !== null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// src/dev-indicators.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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; }// src/dev-indicators.ts
|
|
16
2
|
function resolveFarmDevIndicatorsConfig(config, mode = "development") {
|
|
17
3
|
return {
|
|
18
4
|
buildActivity: mode === "development" && (_nullishCoalesce(_optionalChain([config, 'optionalAccess', _ => _.buildActivity]), () => ( true))),
|
|
@@ -312,23 +298,9 @@ if (import.meta.hot) {
|
|
|
312
298
|
`;
|
|
313
299
|
}
|
|
314
300
|
|
|
315
|
-
// src/utils/source-dir.ts
|
|
316
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
317
|
-
var FARM_PROJECT_SOURCE_DIRS = /* @__PURE__ */ Symbol.for("farm.projectSourceDirs");
|
|
318
|
-
function getProjectSourceDirs() {
|
|
319
|
-
const globalState = globalThis;
|
|
320
|
-
return _nullishCoalesce(globalState[FARM_PROJECT_SOURCE_DIRS], () => ( (globalState[FARM_PROJECT_SOURCE_DIRS] = /* @__PURE__ */ new Map())));
|
|
321
|
-
}
|
|
322
|
-
function setFarmProjectSourceDir(root, srcDir) {
|
|
323
|
-
getProjectSourceDirs().set(_path2.default.resolve(root), srcDir);
|
|
324
|
-
}
|
|
325
|
-
function getFarmProjectSourceDir(root) {
|
|
326
|
-
return _nullishCoalesce(getProjectSourceDirs().get(_path2.default.resolve(root)), () => ( "src"));
|
|
327
|
-
}
|
|
328
|
-
|
|
329
301
|
// src/auth-config.ts
|
|
330
302
|
var _module = require('module');
|
|
331
|
-
|
|
303
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
332
304
|
var _url = require('url');
|
|
333
305
|
function resolveFarmAuthConfig(input) {
|
|
334
306
|
const config = input === true ? {} : input && typeof input === "object" ? input : {};
|
|
@@ -443,8 +415,4 @@ function validateFarmAuthConfig(config) {
|
|
|
443
415
|
|
|
444
416
|
|
|
445
417
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
exports.resolveFarmServerComponentsMode = resolveFarmServerComponentsMode; exports.isExplicitFarmServerComponentsMode = isExplicitFarmServerComponentsMode; exports.setFarmProjectSourceDir = setFarmProjectSourceDir; exports.getFarmProjectSourceDir = getFarmProjectSourceDir; exports.resolveFarmDevIndicatorsConfig = resolveFarmDevIndicatorsConfig; exports.generateFarmDevIndicatorsClientRuntime = generateFarmDevIndicatorsClientRuntime; exports.resolveFarmAuthConfig = resolveFarmAuthConfig; exports.resolveFarmAuthIntegration = resolveFarmAuthIntegration;
|
|
418
|
+
exports.resolveFarmDevIndicatorsConfig = resolveFarmDevIndicatorsConfig; exports.generateFarmDevIndicatorsClientRuntime = generateFarmDevIndicatorsClientRuntime; exports.resolveFarmAuthConfig = resolveFarmAuthConfig; exports.resolveFarmAuthIntegration = resolveFarmAuthIntegration;
|
|
@@ -16,33 +16,19 @@ import {
|
|
|
16
16
|
createFarmClientOptimizeDepsEntries,
|
|
17
17
|
createFarmSourceAlias,
|
|
18
18
|
createFarmThemeCssPlugin,
|
|
19
|
-
ensureFarmPackageClientReference,
|
|
20
19
|
farmFontImportsPlugin,
|
|
21
|
-
farmRelativeImportFiles,
|
|
22
20
|
generateClientCachePersistenceCode,
|
|
23
21
|
generateFarmClientPluginEntryCode,
|
|
24
22
|
generateFarmIntegrationProviderClientCode,
|
|
25
|
-
getClientModuleMetadata,
|
|
26
|
-
getFarmClientReachableModules,
|
|
27
|
-
getIslandStrategyExport,
|
|
28
|
-
hasUseClientDirective,
|
|
29
23
|
inferFarmIslandStrategy,
|
|
30
|
-
invalidateFarmClientReachableModules,
|
|
31
24
|
isFarmDocsClientConfigModule,
|
|
32
|
-
isFarmPackageClientBoundary,
|
|
33
|
-
isIsolatableClientBoundarySource,
|
|
34
25
|
redactFarmDocsClientConfig,
|
|
35
26
|
resolveDevGlobalStylesheetHref,
|
|
36
27
|
resolveFarmAppPackages,
|
|
37
28
|
resolveFarmClientCacheAdapterEntry,
|
|
38
29
|
resolveFarmImageProviderForRuntime,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
resolveModuleSourcePath,
|
|
42
|
-
rewriteFarmPackageClientImports,
|
|
43
|
-
rewriteFarmReactServerImports,
|
|
44
|
-
stripUseClientDirective
|
|
45
|
-
} from "./chunk-LA45FN37.mjs";
|
|
30
|
+
resolveFarmRouteRootStrategy
|
|
31
|
+
} from "./chunk-7GYCZRTH.mjs";
|
|
46
32
|
import {
|
|
47
33
|
loadTailwindVitePlugin
|
|
48
34
|
} from "./chunk-OM7WILES.mjs";
|
|
@@ -66,7 +52,7 @@ import {
|
|
|
66
52
|
parseFarmLayoutChainHeader,
|
|
67
53
|
renderFarmLocaleAlternateLinks,
|
|
68
54
|
stripRouteGroups
|
|
69
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-TNBJ4LZG.mjs";
|
|
70
56
|
import {
|
|
71
57
|
FARM_NATIVE_TREE_CONTENT_TYPE
|
|
72
58
|
} from "./chunk-LLZSYFOM.mjs";
|
|
@@ -84,13 +70,13 @@ import {
|
|
|
84
70
|
resolveFarmMCPRouteLabel,
|
|
85
71
|
resolveFarmMarkdownRouteLabel,
|
|
86
72
|
setFarmRouteLabel
|
|
87
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-E2TSYUHV.mjs";
|
|
88
74
|
import {
|
|
89
75
|
FARM_DEFAULT_MCP_PATH
|
|
90
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-MESQF2JC.mjs";
|
|
91
77
|
import {
|
|
92
78
|
isFarmPreviewDeploymentEnvironment
|
|
93
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-Q75QPLBA.mjs";
|
|
94
80
|
import {
|
|
95
81
|
createFarmServerFnBoundaryModule,
|
|
96
82
|
isFarmServerFnBoundaryId,
|
|
@@ -100,13 +86,31 @@ import {
|
|
|
100
86
|
resolveFarmLayoutFonts
|
|
101
87
|
} from "./chunk-HZOMT5DY.mjs";
|
|
102
88
|
import {
|
|
89
|
+
FARM_CLIENT_REFERENCE_DIRECTORY,
|
|
90
|
+
FARM_CLIENT_REFERENCE_PRAGMA,
|
|
91
|
+
collectFarmServerBundledPackages,
|
|
92
|
+
ensureFarmPackageClientReference,
|
|
103
93
|
farmBrowserBuiltinsOptimizerPlugin,
|
|
104
94
|
farmEnvironmentFunctionsPlugin,
|
|
95
|
+
farmRelativeImportFiles,
|
|
105
96
|
generateProgrammaticClientRouteModule,
|
|
97
|
+
getClientModuleMetadata,
|
|
98
|
+
getFarmClientReachableModules,
|
|
99
|
+
getIslandStrategyExport,
|
|
100
|
+
hasUseClientDirective,
|
|
101
|
+
invalidateFarmClientOnlyScan,
|
|
102
|
+
invalidateFarmClientReachableModules,
|
|
103
|
+
isFarmPackageClientBoundary,
|
|
104
|
+
isIsolatableClientBoundarySource,
|
|
106
105
|
loadFarmBrowserBuiltin,
|
|
107
106
|
programmaticClientRouteKey,
|
|
108
|
-
resolveFarmBrowserBuiltin
|
|
109
|
-
|
|
107
|
+
resolveFarmBrowserBuiltin,
|
|
108
|
+
resolveFarmIsolatedClientHydrationMode,
|
|
109
|
+
resolveModuleSourcePath,
|
|
110
|
+
rewriteFarmPackageClientImports,
|
|
111
|
+
rewriteFarmReactServerImports,
|
|
112
|
+
stripUseClientDirective
|
|
113
|
+
} from "./chunk-ZAUOOGER.mjs";
|
|
110
114
|
import {
|
|
111
115
|
generateFarmDocsAdapterClientRuntime,
|
|
112
116
|
getFarmDocsAdapterConfigModule
|
|
@@ -116,36 +120,38 @@ import {
|
|
|
116
120
|
toFarmDocsPublicFontAssets
|
|
117
121
|
} from "./chunk-NRNAHZ57.mjs";
|
|
118
122
|
import {
|
|
119
|
-
generateFarmDevIndicatorsClientRuntime
|
|
120
|
-
|
|
121
|
-
} from "./chunk-PAKCHVUS.mjs";
|
|
123
|
+
generateFarmDevIndicatorsClientRuntime
|
|
124
|
+
} from "./chunk-TPA2PV5J.mjs";
|
|
122
125
|
import {
|
|
123
126
|
FARM_DEVTOOLS_LAUNCH_PARAM,
|
|
124
127
|
FARM_DEVTOOLS_PATH,
|
|
125
128
|
resolveFarmDevtoolsConfig
|
|
126
129
|
} from "./chunk-CU5SYTJG.mjs";
|
|
127
|
-
import {
|
|
128
|
-
REACT_RENDERER,
|
|
129
|
-
getFarmRendererCapabilities,
|
|
130
|
-
isReactRenderer,
|
|
131
|
-
loadFarmRendererVitePlugins,
|
|
132
|
-
resolveFarmComponentExtensions,
|
|
133
|
-
resolveFarmRenderer,
|
|
134
|
-
resolveFarmRendererAppSetup
|
|
135
|
-
} from "./chunk-ES2LD2YD.mjs";
|
|
136
130
|
import {
|
|
137
131
|
FARM_PREVIEW_ROBOTS_TAG,
|
|
138
132
|
resolveFarmAgentCrawlers,
|
|
139
133
|
resolveFarmAgentSitemap
|
|
140
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-VQ4NWOWO.mjs";
|
|
141
135
|
import {
|
|
142
136
|
resolveFarmLlmsTxtConfig
|
|
143
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-KL7SHLQB.mjs";
|
|
138
|
+
import {
|
|
139
|
+
resolveFarmServerComponentsMode
|
|
140
|
+
} from "./chunk-CJNAUEVC.mjs";
|
|
144
141
|
import {
|
|
145
142
|
getFarmAppDirectories,
|
|
146
143
|
getFarmLayerAliases,
|
|
147
144
|
getFarmSourceRoots
|
|
148
145
|
} from "./chunk-52Y3C3HG.mjs";
|
|
146
|
+
import {
|
|
147
|
+
REACT_RENDERER,
|
|
148
|
+
getFarmRendererCapabilities,
|
|
149
|
+
isReactRenderer,
|
|
150
|
+
loadFarmRendererVitePlugins,
|
|
151
|
+
resolveFarmComponentExtensions,
|
|
152
|
+
resolveFarmRenderer,
|
|
153
|
+
resolveFarmRendererAppSetup
|
|
154
|
+
} from "./chunk-ES2LD2YD.mjs";
|
|
149
155
|
import {
|
|
150
156
|
getPublicFarmImageConfig,
|
|
151
157
|
resolveFarmImageConfig
|
|
@@ -157,7 +163,7 @@ import {
|
|
|
157
163
|
createFarmMarkdownSourceResponse,
|
|
158
164
|
isFarmMarkdownPageFile,
|
|
159
165
|
normalizeFarmMarkdownRoutePath
|
|
160
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-RVGSVQWT.mjs";
|
|
161
167
|
import {
|
|
162
168
|
FARM_MARKDOWN_CONTENT_TYPE,
|
|
163
169
|
createFarmMarkdownErrorBody,
|
|
@@ -166,7 +172,7 @@ import {
|
|
|
166
172
|
getFarmMarkdownAlternatePath,
|
|
167
173
|
getFarmMarkdownMirrorPath,
|
|
168
174
|
resolveMarkdownMirrorTarget
|
|
169
|
-
} from "./chunk-
|
|
175
|
+
} from "./chunk-K7OZAVOI.mjs";
|
|
170
176
|
import {
|
|
171
177
|
resolveFarmRouteContext,
|
|
172
178
|
withFarmRouteContext
|
|
@@ -257,7 +263,7 @@ import {
|
|
|
257
263
|
} from "./chunk-QDWMCFTH.mjs";
|
|
258
264
|
import {
|
|
259
265
|
FARM_VERSION
|
|
260
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-72JSHQQQ.mjs";
|
|
261
267
|
import {
|
|
262
268
|
DEFAULT_FARM_API_BASE_PATH
|
|
263
269
|
} from "./chunk-W6QLRQ3V.mjs";
|
|
@@ -880,7 +886,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
880
886
|
return import("./workflows.mjs");
|
|
881
887
|
}
|
|
882
888
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
883
|
-
return import("./devtools-
|
|
889
|
+
return import("./devtools-PUVZB3F2.mjs");
|
|
884
890
|
}
|
|
885
891
|
function loadFarmDevtoolsUIRuntime() {
|
|
886
892
|
return import("./devtools-ui-CYBVFLPH.mjs");
|
|
@@ -923,11 +929,17 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
923
929
|
return {
|
|
924
930
|
name: "farm:server-only-entries",
|
|
925
931
|
enforce: "pre",
|
|
926
|
-
config() {
|
|
932
|
+
config(config) {
|
|
927
933
|
return {
|
|
928
934
|
optimizeDeps: { rolldownOptions: { plugins: [farmBrowserBuiltinsOptimizerPlugin()] } },
|
|
929
|
-
|
|
930
|
-
|
|
935
|
+
ssr: {
|
|
936
|
+
noExternal: [
|
|
937
|
+
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
938
|
+
SERVER_ONLY_PACKAGE,
|
|
939
|
+
// Packages Node cannot load as a bundler does (stylesheet imports, `module`-only ESM).
|
|
940
|
+
...collectFarmServerBundledPackages(path6.resolve(config.root ?? process.cwd()))
|
|
941
|
+
]
|
|
942
|
+
}
|
|
931
943
|
};
|
|
932
944
|
},
|
|
933
945
|
configResolved(config) {
|
|
@@ -1157,23 +1169,86 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1157
1169
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1158
1170
|
return contentType.includes("text/html") ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1159
1171
|
};
|
|
1172
|
+
let runtimeStream;
|
|
1173
|
+
const streamsThroughRuntime = () => {
|
|
1174
|
+
if (runtimeStream) return true;
|
|
1175
|
+
if (!runtimeSession || !hasRuntimeAfterHook) return false;
|
|
1176
|
+
if (!hasHTMLTransformHook) return true;
|
|
1177
|
+
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1178
|
+
return !(typeof contentTypeHeader === "string" && contentTypeHeader.includes("text/html"));
|
|
1179
|
+
};
|
|
1180
|
+
const startRuntimeStream = () => {
|
|
1181
|
+
if (runtimeStream) return runtimeStream;
|
|
1182
|
+
let controller;
|
|
1183
|
+
const body = new ReadableStream({
|
|
1184
|
+
start(streamController) {
|
|
1185
|
+
controller = streamController;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
const status = res.statusCode || 200;
|
|
1189
|
+
const canHaveBody = method !== "HEAD" && status !== 204 && status !== 205 && status !== 304;
|
|
1190
|
+
pm.copyRequestContext(req, runtimeSession.request);
|
|
1191
|
+
const done = pm.endRuntimeRequest(
|
|
1192
|
+
runtimeSession,
|
|
1193
|
+
new Response(canHaveBody ? body : null, {
|
|
1194
|
+
status,
|
|
1195
|
+
headers: createHeadersFromNodeResponse(res)
|
|
1196
|
+
})
|
|
1197
|
+
).then(async (runtimeResponse) => {
|
|
1198
|
+
applyWebResponseToNodeResponse(runtimeResponse, res);
|
|
1199
|
+
if (!res.headersSent) originalWriteHead(res.statusCode);
|
|
1200
|
+
originalFlushHeaders?.();
|
|
1201
|
+
if (!runtimeResponse.body) return;
|
|
1202
|
+
const reader = runtimeResponse.body.getReader();
|
|
1203
|
+
for (; ; ) {
|
|
1204
|
+
const chunk = await reader.read();
|
|
1205
|
+
if (chunk.done) break;
|
|
1206
|
+
originalWrite(chunk.value);
|
|
1207
|
+
if (typeof res.flush === "function") res.flush();
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
done.catch(() => {
|
|
1211
|
+
});
|
|
1212
|
+
runtimeStream = { controller, done };
|
|
1213
|
+
return runtimeStream;
|
|
1214
|
+
};
|
|
1215
|
+
const streamRuntimeChunk = (chunk) => {
|
|
1216
|
+
const stream = startRuntimeStream();
|
|
1217
|
+
if (!chunk || chunk.byteLength === 0) return;
|
|
1218
|
+
try {
|
|
1219
|
+
stream.controller.enqueue(new Uint8Array(chunk));
|
|
1220
|
+
} catch {
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1160
1223
|
res.writeHead = ((statusCode, ...args) => {
|
|
1161
1224
|
const statusMessage = typeof args[0] === "string" ? args[0] : void 0;
|
|
1162
1225
|
const headers = statusMessage === void 0 ? args[0] : args[1];
|
|
1163
1226
|
res.statusCode = statusCode;
|
|
1164
1227
|
if (statusMessage !== void 0) res.statusMessage = statusMessage;
|
|
1165
1228
|
applyNodeWriteHeadHeaders(res, headers);
|
|
1166
|
-
if (shouldBufferCurrentResponse()) return res;
|
|
1229
|
+
if (streamsThroughRuntime() || shouldBufferCurrentResponse()) return res;
|
|
1167
1230
|
return statusMessage === void 0 ? originalWriteHead(statusCode) : originalWriteHead(statusCode, statusMessage);
|
|
1168
1231
|
});
|
|
1169
1232
|
if (originalFlushHeaders) {
|
|
1170
|
-
res.flushHeaders = (() =>
|
|
1233
|
+
res.flushHeaders = (() => {
|
|
1234
|
+
if (streamsThroughRuntime()) {
|
|
1235
|
+
startRuntimeStream();
|
|
1236
|
+
return void 0;
|
|
1237
|
+
}
|
|
1238
|
+
return shouldBufferCurrentResponse() ? void 0 : originalFlushHeaders();
|
|
1239
|
+
});
|
|
1171
1240
|
}
|
|
1172
1241
|
res.write = ((chunk, ...args) => {
|
|
1173
1242
|
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1174
1243
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1175
1244
|
const isHtmlResponse = contentType.includes("text/html");
|
|
1176
1245
|
const bufferChunk = toNodeResponseBuffer(chunk, args[0]);
|
|
1246
|
+
if (streamsThroughRuntime()) {
|
|
1247
|
+
streamRuntimeChunk(bufferChunk);
|
|
1248
|
+
const callback = args.find((arg) => typeof arg === "function");
|
|
1249
|
+
callback?.();
|
|
1250
|
+
return true;
|
|
1251
|
+
}
|
|
1177
1252
|
if (isHtmlResponse && bufferChunk) {
|
|
1178
1253
|
htmlChunks.push(bufferChunk);
|
|
1179
1254
|
didStreamHtml = true;
|
|
@@ -1198,6 +1273,39 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1198
1273
|
options.logResponse(method, urlPath, res.statusCode || 200, Date.now() - startTime, "PAGE");
|
|
1199
1274
|
const originalEndArgs = [...args];
|
|
1200
1275
|
const callback = typeof originalEndArgs[originalEndArgs.length - 1] === "function" ? originalEndArgs[originalEndArgs.length - 1] : void 0;
|
|
1276
|
+
const restore = () => {
|
|
1277
|
+
res.write = originalWrite;
|
|
1278
|
+
res.end = originalEnd;
|
|
1279
|
+
res.writeHead = originalWriteHead;
|
|
1280
|
+
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1281
|
+
delete res[FARM_NODE_RESPONSE_END_PENDING];
|
|
1282
|
+
};
|
|
1283
|
+
if (streamsThroughRuntime()) {
|
|
1284
|
+
const stream = startRuntimeStream();
|
|
1285
|
+
streamRuntimeChunk(toNodeResponseBuffer(args[0], args[1]));
|
|
1286
|
+
try {
|
|
1287
|
+
stream.controller.close();
|
|
1288
|
+
} catch {
|
|
1289
|
+
}
|
|
1290
|
+
stream.done.then(
|
|
1291
|
+
() => hasAfterResponseHook ? pm.runHookParallel("afterResponse", req, res) : void 0
|
|
1292
|
+
).catch((error) => {
|
|
1293
|
+
void options.emitError(error);
|
|
1294
|
+
console.error("Error in afterResponse hook:", error);
|
|
1295
|
+
if (!res.headersSent) {
|
|
1296
|
+
res.statusCode = 500;
|
|
1297
|
+
res.removeHeader("Content-Length");
|
|
1298
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
1299
|
+
originalWriteHead(500);
|
|
1300
|
+
originalWrite("Internal Server Error");
|
|
1301
|
+
}
|
|
1302
|
+
}).finally(() => {
|
|
1303
|
+
restore();
|
|
1304
|
+
if (callback) originalEnd(callback);
|
|
1305
|
+
else originalEnd();
|
|
1306
|
+
});
|
|
1307
|
+
return res;
|
|
1308
|
+
}
|
|
1201
1309
|
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1202
1310
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1203
1311
|
const isHtmlResponse = contentType.includes("text/html");
|
|
@@ -1385,6 +1493,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1385
1493
|
return null;
|
|
1386
1494
|
}
|
|
1387
1495
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
1496
|
+
const everyExportIsComponent = options.code.includes(FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
1388
1497
|
const replacements = [];
|
|
1389
1498
|
const wrapperStatements = [];
|
|
1390
1499
|
const originalEntries = [];
|
|
@@ -1430,7 +1539,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1430
1539
|
const specifierName = (name) => name?.name ?? String(name?.value ?? "");
|
|
1431
1540
|
const isComponentExport = (specifier) => {
|
|
1432
1541
|
const exported = specifierName(specifier.exported);
|
|
1433
|
-
return exported === "default" || /^[A-Z]/.test(exported);
|
|
1542
|
+
return everyExportIsComponent || exported === "default" || /^[A-Z]/.test(exported);
|
|
1434
1543
|
};
|
|
1435
1544
|
if (!specifiers.some(isComponentExport)) continue;
|
|
1436
1545
|
const imports = [];
|
|
@@ -2487,10 +2596,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2487
2596
|
return;
|
|
2488
2597
|
}
|
|
2489
2598
|
}
|
|
2490
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD") && req.headers.accept?.includes(FARM_NATIVE_TREE_CONTENT_TYPE)) {
|
|
2491
|
-
const { createFarmNativeTreeResponse } = await import("./native-tree-
|
|
2599
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && req.headers.accept?.includes(FARM_NATIVE_TREE_CONTENT_TYPE)) {
|
|
2600
|
+
const { createFarmNativeTreeResponse } = await import("./native-tree-YF2DSPKM.mjs");
|
|
2601
|
+
const treeBodyInit = requestMethod === "POST" ? { body: createFarmNodeRequestBodyStream(req), duplex: "half" } : {};
|
|
2492
2602
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
2493
|
-
request: new Request(fullUrl, {
|
|
2603
|
+
request: new Request(fullUrl, {
|
|
2604
|
+
method: requestMethod,
|
|
2605
|
+
headers: docsHeaders,
|
|
2606
|
+
...treeBodyInit
|
|
2607
|
+
}),
|
|
2494
2608
|
// As for the Markdown mirror: this server's own listener, redirects not followed.
|
|
2495
2609
|
renderPage: (request) => createFarmDevServerDispatch(server)(
|
|
2496
2610
|
new Request(request, {
|
|
@@ -3802,7 +3916,8 @@ export const manifest = getManifest();
|
|
|
3802
3916
|
const cleanId = id.split("?", 1)[0];
|
|
3803
3917
|
const selectedIsolatedModules = options.isolatedClientBoundaryModules ?? farmApp?.getRouteManager().getIsolatedClientBoundaryModules(root);
|
|
3804
3918
|
const selectedForIsolatedHydration = selectedIsolatedModules?.has(path6.resolve(cleanId)) === true;
|
|
3805
|
-
if (isReactRenderer(resolveFarmRenderer(currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)
|
|
3919
|
+
if (isReactRenderer(resolveFarmRenderer(currentConfig.renderer)) && selectedForIsolatedHydration && (isIsolatableClientBoundarySource(clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
3920
|
+
cleanId.replace(/\\/g, "/").includes(FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
3806
3921
|
isolatedModuleReference = toViteModuleId(cleanId, root);
|
|
3807
3922
|
const islandsMode = resolveFarmServerComponentsMode(currentConfig.experimental?.serverComponents) === "islands";
|
|
3808
3923
|
const explicitStrategy = getIslandStrategyExport(clientBoundarySource);
|
|
@@ -3987,6 +4102,7 @@ if (import.meta.hot) {
|
|
|
3987
4102
|
},
|
|
3988
4103
|
watchChange() {
|
|
3989
4104
|
invalidateFarmClientReachableModules();
|
|
4105
|
+
invalidateFarmClientOnlyScan();
|
|
3990
4106
|
},
|
|
3991
4107
|
async handleHotUpdate(ctx) {
|
|
3992
4108
|
const { file, server: server2, modules } = ctx;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isFarmMetadataNoIndex
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KL7SHLQB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
matchesFarmMarkdownRoutePattern
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K7OZAVOI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
applyFarmBasePath
|
|
9
9
|
} from "./chunk-SF3JB56B.mjs";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/mobile/component-blocks.ts
|
|
2
|
+
function farmComponentKind(file) {
|
|
3
|
+
return file.endsWith(".vue") ? "vue" : file.endsWith(".svelte") ? "svelte" : void 0;
|
|
4
|
+
}
|
|
5
|
+
function readAttributes(text) {
|
|
6
|
+
const attributes = {};
|
|
7
|
+
for (const match of text.matchAll(
|
|
8
|
+
/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g
|
|
9
|
+
)) {
|
|
10
|
+
attributes[match[1].toLowerCase()] = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(match[2], () => ( match[3])), () => ( match[4])), () => ( true));
|
|
11
|
+
}
|
|
12
|
+
return attributes;
|
|
13
|
+
}
|
|
14
|
+
function readFarmComponentBlocks(file, source) {
|
|
15
|
+
const kind = farmComponentKind(file);
|
|
16
|
+
if (!kind) throw new TypeError(`${file} is not a .vue or .svelte component`);
|
|
17
|
+
const scripts = [];
|
|
18
|
+
const styles = [];
|
|
19
|
+
const taken = [];
|
|
20
|
+
for (const name of ["script", "style"]) {
|
|
21
|
+
const open = new RegExp(`<${name}\\b((?:[^>"']|"[^"]*"|'[^']*')*)>`, "gi");
|
|
22
|
+
let match;
|
|
23
|
+
while (match = open.exec(source)) {
|
|
24
|
+
const start = match.index + match[0].length;
|
|
25
|
+
const close = source.toLowerCase().indexOf(`</${name}>`, start);
|
|
26
|
+
const end = close === -1 ? source.length : close;
|
|
27
|
+
(name === "script" ? scripts : styles).push({
|
|
28
|
+
start,
|
|
29
|
+
end,
|
|
30
|
+
attributes: readAttributes(_nullishCoalesce(match[1], () => ( "")))
|
|
31
|
+
});
|
|
32
|
+
taken.push({ start: match.index, end: close === -1 ? end : close + name.length + 3 });
|
|
33
|
+
open.lastIndex = end;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
taken.sort((left, right) => left.start - right.start);
|
|
37
|
+
const markup = [];
|
|
38
|
+
if (kind === "svelte") {
|
|
39
|
+
let cursor = 0;
|
|
40
|
+
for (const range of taken) {
|
|
41
|
+
if (range.start > cursor) markup.push({ start: cursor, end: range.start });
|
|
42
|
+
cursor = Math.max(cursor, range.end);
|
|
43
|
+
}
|
|
44
|
+
if (cursor < source.length) markup.push({ start: cursor, end: source.length });
|
|
45
|
+
} else {
|
|
46
|
+
const tag = /<(\/?)template\b(?:[^>"']|"[^"]*"|'[^']*')*?(\/?)>/gi;
|
|
47
|
+
let depth = 0;
|
|
48
|
+
let start = -1;
|
|
49
|
+
let match;
|
|
50
|
+
while (match = tag.exec(source)) {
|
|
51
|
+
if (taken.some((range) => match.index >= range.start && match.index < range.end)) continue;
|
|
52
|
+
if (match[2]) continue;
|
|
53
|
+
if (!match[1]) {
|
|
54
|
+
if (depth === 0) start = match.index + match[0].length;
|
|
55
|
+
depth += 1;
|
|
56
|
+
} else if (depth > 0) {
|
|
57
|
+
depth -= 1;
|
|
58
|
+
if (depth === 0) {
|
|
59
|
+
markup.push({ start, end: match.index });
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return { kind, scripts, styles, markup };
|
|
66
|
+
}
|
|
67
|
+
function keepFarmComponentRanges(source, ranges) {
|
|
68
|
+
let out = "";
|
|
69
|
+
let cursor = 0;
|
|
70
|
+
const blank = (text) => text.replace(/[^\n]/g, " ");
|
|
71
|
+
for (const range of [...ranges].sort((left, right) => left.start - right.start)) {
|
|
72
|
+
out += blank(source.slice(cursor, range.start)) + source.slice(range.start, range.end);
|
|
73
|
+
cursor = range.end;
|
|
74
|
+
}
|
|
75
|
+
return out + blank(source.slice(cursor));
|
|
76
|
+
}
|
|
77
|
+
function farmComponentModuleScripts(blocks) {
|
|
78
|
+
return blocks.scripts.filter(
|
|
79
|
+
(script) => blocks.kind === "vue" ? script.attributes.setup === void 0 : script.attributes.module !== void 0 || script.attributes.context === "module"
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
exports.farmComponentKind = farmComponentKind; exports.readFarmComponentBlocks = readFarmComponentBlocks; exports.keepFarmComponentRanges = keepFarmComponentRanges; exports.farmComponentModuleScripts = farmComponentModuleScripts;
|
|
@@ -18,7 +18,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
|
18
18
|
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
@@ -1179,11 +1179,11 @@ function shouldReturnMarkdown(request) {
|
|
|
1179
1179
|
if (url.pathname.endsWith(".md")) return true;
|
|
1180
1180
|
const accept = request.headers.get("accept");
|
|
1181
1181
|
const markdown = Math.max(
|
|
1182
|
-
|
|
1183
|
-
|
|
1182
|
+
_chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
|
|
1183
|
+
_chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
|
|
1184
1184
|
);
|
|
1185
1185
|
if (markdown <= 0) return false;
|
|
1186
|
-
return markdown >=
|
|
1186
|
+
return markdown >= _chunk2C5L5RPMcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
|
|
1187
1187
|
}
|
|
1188
1188
|
function escapeAttribute(value) {
|
|
1189
1189
|
return escapeHtml(value).replace(/'/g, "'");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkA3G5IY2Wcjs = require('./chunk-A3G5IY2W.cjs');
|
|
4
4
|
|
|
5
5
|
// src/deployment-environment.ts
|
|
6
6
|
function isFarmProductionDeploymentEnvironment(env = process.env) {
|
|
@@ -90,7 +90,7 @@ function createFarmProductionSiteReporter(options) {
|
|
|
90
90
|
schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
|
|
91
91
|
eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
|
|
92
92
|
packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
|
|
93
|
-
packageVersion: sanitizeDetail(
|
|
93
|
+
packageVersion: sanitizeDetail(_chunkA3G5IY2Wcjs.FARM_VERSION, "unknown"),
|
|
94
94
|
renderer: sanitizeDetail(options.renderer, "custom"),
|
|
95
95
|
deployTarget: sanitizeDetail(options.deployTarget, "custom")
|
|
96
96
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7XGWBPQQcjs = require('./chunk-7XGWBPQQ.cjs');
|
|
4
4
|
|
|
5
5
|
// src/app-markdown.ts
|
|
6
6
|
var _promises = require('fs/promises');
|
|
@@ -8,7 +8,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
8
8
|
var _url = require('url');
|
|
9
9
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
10
10
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
11
|
-
return
|
|
11
|
+
return _chunk7XGWBPQQcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
12
12
|
source,
|
|
13
13
|
filePath,
|
|
14
14
|
components: options.components,
|