@farm.js/core 0.1.75 → 0.1.77
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-Djvao5eV.d.ts → agent-mcp.d-B1h3RznZ.d.ts} +1 -1
- package/dist/{agent-mcp.d-wA13pwmS.d.mts → agent-mcp.d-WFQotg8M.d.mts} +1 -1
- package/dist/agent-runtime.cjs +2 -2
- package/dist/agent-runtime.d.mts +7 -5
- package/dist/agent-runtime.d.ts +7 -5
- package/dist/agent-runtime.mjs +1 -1
- package/dist/{analyzer-LJHMFCDW.mjs → analyzer-64YS2OXQ.mjs} +2 -2
- package/dist/analyzer-HTNXLX6N.cjs +16 -0
- package/dist/api/node.d.mts +9 -7
- package/dist/api/node.d.ts +9 -7
- package/dist/api/route-manager.d.mts +9 -7
- package/dist/api/route-manager.d.ts +9 -7
- package/dist/api/runtime.d.mts +8 -6
- package/dist/api/runtime.d.ts +8 -6
- package/dist/api.d.mts +10 -8
- package/dist/api.d.ts +10 -8
- package/dist/{app-manifest.d-DIuqSi9k.d.mts → app-manifest.d-EZEYG-tD.d.mts} +1 -1
- package/dist/{app-manifest.d-BukcP_EV.d.ts → app-manifest.d-Ktsqsuk9.d.ts} +1 -1
- package/dist/app-markdown.d.mts +8 -6
- package/dist/app-markdown.d.ts +8 -6
- package/dist/{app.d-BQqmM6Gy.d.ts → app.d-CSh3y8w8.d.ts} +5 -4
- package/dist/{app.d-YVuFb10p.d.mts → app.d-DTkqYcIr.d.mts} +5 -4
- package/dist/{chunk-CL2ONP73.cjs → chunk-2PE5STAR.cjs} +36 -27
- package/dist/{chunk-HV2WZFUW.mjs → chunk-2QPTZMGK.mjs} +1 -1
- package/dist/{chunk-E7VF3LQ5.mjs → chunk-4STJ6LGR.mjs} +13 -1
- package/dist/{chunk-LQBV2Y37.mjs → chunk-65XXHTVJ.mjs} +38 -2
- package/dist/{chunk-XGDI4OUB.cjs → chunk-6ZFGWB75.cjs} +13 -1
- package/dist/{chunk-IDOUCM2X.mjs → chunk-7EXFAJST.mjs} +57 -44
- package/dist/{chunk-HVJ7IACB.cjs → chunk-7SAGHWWU.cjs} +2 -2
- package/dist/{chunk-GNY7BO7R.mjs → chunk-BTHNOAOF.mjs} +2 -2
- package/dist/{chunk-TJVUTGED.mjs → chunk-D2RLADWN.mjs} +285 -93
- package/dist/chunk-DS2KZ5BT.mjs +16 -0
- package/dist/{chunk-WHCNJVYU.cjs → chunk-DSRWQ4SJ.cjs} +3 -3
- package/dist/{chunk-ZPCZWEU3.cjs → chunk-FCHEO3LG.cjs} +2 -2
- package/dist/{chunk-75XSZIRE.mjs → chunk-FD6BMUA3.mjs} +35 -26
- package/dist/{chunk-4T2RB4JA.mjs → chunk-FNVGK72M.mjs} +5 -5
- package/dist/{chunk-TFEODQLG.mjs → chunk-FPGSIOWS.mjs} +2 -2
- package/dist/{chunk-4BS3HSY7.cjs → chunk-FTQUNBRN.cjs} +2 -2
- package/dist/{chunk-ZV76IQG7.cjs → chunk-FVVGEGQ2.cjs} +2 -2
- package/dist/{chunk-7564NP5Z.cjs → chunk-GC2BSXQS.cjs} +39 -3
- package/dist/{chunk-HT2SZKXG.mjs → chunk-H76C5AOU.mjs} +12 -0
- package/dist/{chunk-OFIFRB62.mjs → chunk-IHMSLS2O.mjs} +36 -20
- package/dist/{chunk-BUC3FDYC.cjs → chunk-IIVZTGGP.cjs} +2 -2
- package/dist/{chunk-6MATGOEF.mjs → chunk-IXC6WDMT.mjs} +1 -1
- package/dist/{chunk-KPYQ32BA.cjs → chunk-JD42G6BN.cjs} +2 -2
- package/dist/{chunk-WJ5CCQBM.cjs → chunk-LTDMJD2F.cjs} +4 -4
- package/dist/{chunk-XX6ZA2IO.cjs → chunk-MQW4LHJR.cjs} +1 -1
- package/dist/{chunk-BNTRXJL4.cjs → chunk-NQZWLIPT.cjs} +3 -3
- package/dist/{chunk-QGYHE6VJ.mjs → chunk-NTHAZLVS.mjs} +28 -27
- package/dist/{chunk-OCLCA3X3.mjs → chunk-OCKQ3YOH.mjs} +1 -1
- package/dist/{chunk-PBQGIA27.cjs → chunk-OQZF6H6G.cjs} +4 -4
- package/dist/{chunk-YSTKSZD2.mjs → chunk-ORWXJDUN.mjs} +1 -1
- package/dist/{chunk-JNZDTE75.cjs → chunk-PMKUTZGR.cjs} +8 -8
- package/dist/{chunk-4ZSZI6XL.cjs → chunk-PUEPDMWY.cjs} +16 -16
- package/dist/{chunk-MTBDJ326.cjs → chunk-QMR2TUVZ.cjs} +13 -1
- package/dist/{chunk-A5F55ZFA.mjs → chunk-QODXWUGQ.mjs} +2 -2
- package/dist/chunk-RFXEQYPH.cjs +723 -0
- package/dist/{chunk-IK33N2AN.cjs → chunk-SIYELCIX.cjs} +158 -142
- package/dist/{chunk-MFU7SXAB.mjs → chunk-SL2BSPDJ.mjs} +1 -1
- package/dist/{chunk-H7QY7ZE4.mjs → chunk-SMYDCZBW.mjs} +1 -1
- package/dist/{chunk-GLF44JKY.mjs → chunk-TQOYIPMQ.mjs} +1 -1
- package/dist/{chunk-IVBDRAOR.cjs → chunk-UYACD4SH.cjs} +1 -1
- package/dist/{chunk-B4CWYGCG.mjs → chunk-WHNNDFCJ.mjs} +1 -1
- package/dist/{chunk-4MU4QCX4.mjs → chunk-WXMR3OHY.mjs} +1 -1
- package/dist/{chunk-YL7BKHYE.cjs → chunk-WZVESREI.cjs} +291 -278
- package/dist/chunk-XRRHPBG2.cjs +16 -0
- package/dist/{chunk-NPGXX7HN.cjs → chunk-YROK6CJC.cjs} +7 -7
- package/dist/{chunk-OZARLCYQ.cjs → chunk-YRQ44JTF.cjs} +179 -178
- package/dist/{chunk-2NQ3S2SJ.mjs → chunk-YTGNMKRA.mjs} +1 -1
- package/dist/{chunk-YCNKS6SD.mjs → chunk-ZBE5EHVJ.mjs} +4 -4
- package/dist/cli-runtime.d-DljFfr8T.d.ts +537 -0
- package/dist/cli-runtime.d-HSkdfvoq.d.mts +537 -0
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-BeqVuqy2.d.mts → client-component.d-B-1dIlsw.d.mts} +2 -137
- package/dist/{client-component.d-CZ1NpHAY.d.ts → client-component.d-_otXB__v.d.ts} +2 -137
- package/dist/{client-plugins.d-ChceYO9t.d.mts → client-plugins.d-BmBzvfSP.d.mts} +4 -4
- package/dist/{client-plugins.d-D9kWC0QB.d.ts → client-plugins.d-MjxlvbCK.d.ts} +4 -4
- package/dist/client-plugins.d.mts +7 -5
- package/dist/client-plugins.d.ts +7 -5
- package/dist/client.d.mts +12 -10
- package/dist/client.d.ts +12 -10
- package/dist/config.d.mts +7 -5
- package/dist/config.d.ts +7 -5
- package/dist/desktop.d.mts +8 -6
- package/dist/desktop.d.ts +8 -6
- package/dist/{devtools-B3W3DLPG.mjs → devtools-7LHXG2VS.mjs} +4 -3
- package/dist/{devtools-T5I2WHRX.cjs → devtools-NNQN66EZ.cjs} +5 -4
- package/dist/docs.cjs +6 -5
- package/dist/docs.d.mts +10 -65
- package/dist/docs.d.ts +10 -65
- package/dist/docs.mjs +5 -4
- package/dist/environment/vite.cjs +5 -4
- package/dist/environment/vite.mjs +4 -3
- package/dist/handler.d-C53zFDmp.d.ts +62 -0
- package/dist/handler.d-CaYopqaD.d.mts +62 -0
- package/dist/{headers.d-Aux4JVnm.d.ts → headers.d-BvtpC90T.d.ts} +1 -1
- package/dist/{headers.d-BawakaPv.d.mts → headers.d-MBkD9ZLf.d.mts} +1 -1
- package/dist/index.cjs +31 -24
- package/dist/index.d-2hQpPZ-P.d.ts +16 -0
- package/dist/index.d-Mikf-tdP.d.mts +16 -0
- package/dist/index.d.mts +39 -556
- package/dist/index.d.ts +39 -556
- package/dist/index.mjs +30 -23
- package/dist/integrations/orm.cjs +4 -3
- package/dist/integrations/orm.d.mts +6 -4
- package/dist/integrations/orm.d.ts +6 -4
- package/dist/integrations/orm.mjs +3 -2
- package/dist/integrations.cjs +2 -2
- package/dist/integrations.d.mts +7 -5
- package/dist/integrations.d.ts +7 -5
- package/dist/integrations.mjs +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +8 -6
- package/dist/internal/app-markdown-runtime.d.ts +8 -6
- package/dist/internal/build-runtime.cjs +23 -22
- package/dist/internal/build-runtime.d.mts +10 -7
- package/dist/internal/build-runtime.d.ts +10 -7
- package/dist/internal/build-runtime.mjs +22 -21
- package/dist/internal/cli-runtime.cjs +17 -9
- package/dist/internal/cli-runtime.d.mts +46 -0
- package/dist/internal/cli-runtime.d.ts +46 -0
- package/dist/internal/cli-runtime.mjs +16 -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 +11 -9
- package/dist/internal/client-runtime.d.ts +11 -9
- package/dist/internal/compression-runtime.cjs +2 -2
- package/dist/internal/compression-runtime.d.mts +11 -6
- package/dist/internal/compression-runtime.d.ts +11 -6
- package/dist/internal/compression-runtime.mjs +1 -1
- package/dist/internal/config-runtime.cjs +6 -5
- package/dist/internal/config-runtime.d.mts +9 -7
- package/dist/internal/config-runtime.d.ts +9 -7
- package/dist/internal/config-runtime.mjs +5 -4
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- 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 +8 -7
- package/dist/internal/production-runtime.d.mts +16 -14
- package/dist/internal/production-runtime.d.ts +16 -14
- package/dist/internal/production-runtime.mjs +7 -6
- package/dist/internal/start-manifest.d.mts +7 -5
- package/dist/internal/start-manifest.d.ts +7 -5
- package/dist/{layers-XQ7VFMWO.mjs → layers-I7VE5Q2Y.mjs} +2 -1
- package/dist/layers-WP5K5F7W.cjs +21 -0
- package/dist/{lifecycle.d-OtGWAvJT.d.ts → lifecycle.d-VzcXyEyn.d.mts} +1 -1
- package/dist/{lifecycle.d-OtGWAvJT.d.mts → lifecycle.d-VzcXyEyn.d.ts} +1 -1
- package/dist/markdown.d.mts +7 -5
- package/dist/markdown.d.ts +7 -5
- package/dist/middleware.d.mts +7 -5
- package/dist/middleware.d.ts +7 -5
- package/dist/{mount.d-BomEt2kV.d.mts → mount.d-DsP46XCy.d.mts} +1 -1
- package/dist/{mount.d-Ca8eb9GB.d.ts → mount.d-GU-tNxbE.d.ts} +1 -1
- package/dist/{navigation-delegate.d-B1ujRkYo.d.mts → navigation-delegate.d-CUtNOYLi.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DJCC2jXF.d.ts → navigation-delegate.d-DsxNPrLT.d.ts} +1 -1
- package/dist/navigation.d.mts +10 -8
- package/dist/navigation.d.ts +10 -8
- package/dist/{plugin-FD4S2QEJ.mjs → plugin-2KWR2X4B.mjs} +1 -1
- package/dist/{plugin-5BNPYCER.cjs → plugin-MW7IDV76.cjs} +2 -2
- package/dist/plugin.cjs +15 -14
- package/dist/plugin.d.mts +11 -8
- package/dist/plugin.d.ts +11 -8
- package/dist/plugin.mjs +14 -13
- package/dist/{render-plan.d-BxRbaxYA.d.ts → render-plan.d-8K6S0h0L.d.ts} +1 -1
- package/dist/{render-plan.d-CFod_Zf-.d.mts → render-plan.d-B7Xp-PPW.d.mts} +1 -1
- package/dist/renderer-client.d.mts +10 -8
- package/dist/renderer-client.d.ts +10 -8
- package/dist/{request.d-DRQgaXGG.d.ts → request.d-CuQxmOqX.d.ts} +1 -1
- package/dist/{request.d-DG4TeXMM.d.mts → request.d-nhqciCAz.d.mts} +1 -1
- package/dist/request.d.mts +8 -6
- package/dist/request.d.ts +8 -6
- package/dist/{route-rendering.d-Db07UNVG.d.ts → route-rendering.d-BSsdDYC1.d.ts} +1 -1
- package/dist/{route-rendering.d-BXtZKgqu.d.mts → route-rendering.d-CeF1FOnl.d.mts} +1 -1
- package/dist/{router.d-BC3hyjf0.d.ts → router.d-C7yGlhDL.d.ts} +1 -1
- package/dist/{router.d-B61kXqxJ.d.mts → router.d-D462OX24.d.mts} +1 -1
- package/dist/routes.d.mts +7 -5
- package/dist/routes.d.ts +7 -5
- package/dist/{rsc-pipeline-VENBFYXW.cjs → rsc-pipeline-7PV6ARDS.cjs} +8 -7
- package/dist/{rsc-pipeline-LJ7YCGY6.mjs → rsc-pipeline-EZU4W4RL.mjs} +7 -6
- package/dist/{runtime-UNDTYGQS.cjs → runtime-QOE3NRXF.cjs} +8 -7
- package/dist/{runtime-4DWUXZHS.mjs → runtime-RWLFEPS3.mjs} +5 -4
- package/dist/{runtime.d-Cl6EBGmC.d.mts → runtime.d-C-BHQMy5.d.mts} +1 -1
- package/dist/{runtime.d-SC95yDzr.d.ts → runtime.d-CORDJQMy.d.ts} +1 -1
- package/dist/{schema.d-Dny9pnrm.d.mts → schema.d-BM-uVGpx.d.mts} +1 -1
- package/dist/{schema.d-Dny9pnrm.d.ts → schema.d-BM-uVGpx.d.ts} +1 -1
- package/dist/schema.d.mts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/{index.d-r1MLpgeE.d.ts → server-components-status.d-BJ6huueH.d.mts} +2 -15
- package/dist/{index.d-Ccq42CPU.d.mts → server-components-status.d-BbADqqjq.d.ts} +2 -15
- package/dist/server-plugins.cjs +2 -2
- package/dist/server-plugins.d.mts +9 -7
- package/dist/server-plugins.d.ts +9 -7
- package/dist/server-plugins.mjs +1 -1
- package/dist/server.cjs +46 -39
- package/dist/server.d.mts +17 -14
- package/dist/server.d.ts +17 -14
- package/dist/server.mjs +24 -17
- package/dist/session-OU7M4CIF.cjs +24 -0
- package/dist/{session-QZXZOPR2.mjs → session-WPAT6H76.mjs} +3 -2
- package/dist/{spa-router.d-DrlXgDqY.d.mts → spa-router.d-DfjafHyX.d.mts} +4 -4
- package/dist/{spa-router.d-DwM02Mwd.d.ts → spa-router.d-DyGJLQc_.d.ts} +4 -4
- package/dist/ssg.d-D11lz_wr.d.ts +138 -0
- package/dist/ssg.d-iiLTyLAO.d.mts +138 -0
- package/dist/storage.cjs +9 -2
- package/dist/storage.d.mts +266 -34
- package/dist/storage.d.ts +266 -34
- package/dist/storage.mjs +8 -1
- package/dist/testing.d.mts +7 -5
- package/dist/testing.d.ts +7 -5
- package/dist/types.d-DC97bnjj.d.mts +131 -0
- package/dist/types.d-DC97bnjj.d.ts +131 -0
- package/dist/{utils.d-C6KXz3uB.d.ts → utils.d-D-GQeEfa.d.ts} +1 -1
- package/dist/{utils.d-CHzxAshz.d.mts → utils.d-fW-95yEh.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +15 -14
- package/dist/vite.d.mts +12 -9
- package/dist/vite.d.ts +12 -9
- package/dist/vite.mjs +14 -13
- package/package.json +11 -4
- package/dist/analyzer-23GCBYFI.cjs +0 -16
- package/dist/chunk-JMYXO572.cjs +0 -531
- package/dist/layers-7P4RLKVX.cjs +0 -20
- package/dist/session-2Q72D4QV.cjs +0 -23
- package/dist/types.d-BnIqOn9w.d.mts +0 -73
- package/dist/types.d-BnIqOn9w.d.ts +0 -73
- /package/dist/{chunk-6DBBMQWT.cjs → chunk-AF3PNVVF.cjs} +0 -0
- /package/dist/{chunk-5O3SK3ZC.mjs → chunk-BEXH6BGH.mjs} +0 -0
- /package/dist/{chunk-PMU4U2W2.cjs → chunk-PC5OZ4YR.cjs} +0 -0
- /package/dist/{chunk-Z5ZZAGIH.mjs → chunk-RL47VZ6J.mjs} +0 -0
|
@@ -4,6 +4,7 @@ var _chunkA25FXJ7Dcjs = require('./chunk-A25FXJ7D.cjs');
|
|
|
4
4
|
|
|
5
5
|
// src/plugins/compression.ts
|
|
6
6
|
var _stream = require('stream');
|
|
7
|
+
var _util = require('util');
|
|
7
8
|
var _zlib = require('zlib');
|
|
8
9
|
var Q_VALUE = /^(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?)$/;
|
|
9
10
|
function parseEncodingQuality(header) {
|
|
@@ -28,10 +29,10 @@ function selectEncoding(header) {
|
|
|
28
29
|
const qualities = parseEncodingQuality(header);
|
|
29
30
|
const wildcard = _nullishCoalesce(qualities.get("*"), () => ( 0));
|
|
30
31
|
const quality = (encoding) => _nullishCoalesce(qualities.get(encoding), () => ( wildcard));
|
|
31
|
-
const
|
|
32
|
+
const brotli2 = quality("br");
|
|
32
33
|
const gzip2 = quality("gzip");
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
34
|
+
if (brotli2 <= 0 && gzip2 <= 0) return void 0;
|
|
35
|
+
return brotli2 >= gzip2 ? "br" : "gzip";
|
|
35
36
|
}
|
|
36
37
|
var COMPRESSIBLE_MEDIA_TYPES = /* @__PURE__ */ new Set([
|
|
37
38
|
"application/javascript",
|
|
@@ -86,32 +87,40 @@ function compressedHeaders(response, encoding) {
|
|
|
86
87
|
}
|
|
87
88
|
return headers;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
var compressedShells = /* @__PURE__ */ new WeakMap();
|
|
91
|
+
var brotli = _util.promisify.call(void 0, _zlib.brotliCompress);
|
|
92
|
+
var gzipBuffer = _util.promisify.call(void 0, _zlib.gzip);
|
|
93
|
+
function encodeText(text, encoding) {
|
|
94
|
+
const input = Buffer.from(text);
|
|
95
|
+
return encoding === "br" ? brotli(input, { params: { [_zlib.constants.BROTLI_PARAM_QUALITY]: BROTLI_QUALITY } }) : gzipBuffer(input);
|
|
96
|
+
}
|
|
97
|
+
function getEncodedShell(shell, encoding) {
|
|
98
|
+
let entry = compressedShells.get(shell);
|
|
99
|
+
if (_optionalChain([entry, 'optionalAccess', _28 => _28.html]) !== shell.html) {
|
|
100
|
+
entry = { html: shell.html };
|
|
101
|
+
compressedShells.set(shell, entry);
|
|
102
|
+
}
|
|
103
|
+
const variants = entry;
|
|
104
|
+
return _nullishCoalesce(variants[encoding], () => ( (variants[encoding] = encodeText(shell.html, encoding).catch((error) => {
|
|
105
|
+
delete variants[encoding];
|
|
106
|
+
throw error;
|
|
107
|
+
}))));
|
|
108
|
+
}
|
|
109
|
+
function compressBufferedResponse(response, text, encoding, lazyBody, shell) {
|
|
90
110
|
const headers = compressedHeaders(response, encoding);
|
|
91
|
-
if (!lazyBody) _optionalChain([response, 'access',
|
|
111
|
+
if (!lazyBody) _optionalChain([response, 'access', _29 => _29.body, 'optionalAccess', _30 => _30.cancel, 'call', _31 => _31(), 'access', _32 => _32.catch, 'call', _33 => _33(() => {
|
|
92
112
|
})]);
|
|
93
|
-
const
|
|
113
|
+
const reuse = shell && shell.html === text;
|
|
114
|
+
const bytes = reuse ? getEncodedShell(shell, encoding) : encodeText(text, encoding);
|
|
94
115
|
let cancelled = false;
|
|
95
116
|
const body = new ReadableStream({
|
|
96
|
-
start(controller) {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
controller.enqueue(new Uint8Array(output.buffer, output.byteOffset, output.byteLength));
|
|
104
|
-
controller.close();
|
|
105
|
-
};
|
|
106
|
-
if (encoding === "br") {
|
|
107
|
-
_zlib.brotliCompress.call(void 0,
|
|
108
|
-
input,
|
|
109
|
-
{ params: { [_zlib.constants.BROTLI_PARAM_QUALITY]: BROTLI_QUALITY } },
|
|
110
|
-
done
|
|
111
|
-
);
|
|
112
|
-
} else {
|
|
113
|
-
_zlib.gzip.call(void 0, input, done);
|
|
114
|
-
}
|
|
117
|
+
async start(controller) {
|
|
118
|
+
const output = await bytes;
|
|
119
|
+
if (cancelled) return;
|
|
120
|
+
controller.enqueue(
|
|
121
|
+
reuse ? new Uint8Array(output) : new Uint8Array(output.buffer, output.byteOffset, output.byteLength)
|
|
122
|
+
);
|
|
123
|
+
controller.close();
|
|
115
124
|
},
|
|
116
125
|
cancel() {
|
|
117
126
|
cancelled = true;
|
|
@@ -141,12 +150,12 @@ function compressResponse(response, encoding) {
|
|
|
141
150
|
function varyIdentityResponse(response) {
|
|
142
151
|
return _chunkA25FXJ7Dcjs._withFarmResponseHeaders.call(void 0, response, (headers) => appendVary(headers, "Accept-Encoding"));
|
|
143
152
|
}
|
|
144
|
-
function compressFarmResponse(request, response, bufferedText, lazyBody = false) {
|
|
153
|
+
function compressFarmResponse(request, response, bufferedText, lazyBody = false, shell) {
|
|
145
154
|
if (!isCompressionEligible(request, response, bufferedText)) return response;
|
|
146
155
|
if (request.method === "HEAD") return varyIdentityResponse(response);
|
|
147
156
|
const encoding = selectEncoding(_nullishCoalesce(request.headers.get("accept-encoding"), () => ( "")));
|
|
148
157
|
if (!encoding) return varyIdentityResponse(response);
|
|
149
|
-
return bufferedText === void 0 ? compressResponse(response, encoding) : compressBufferedResponse(response, bufferedText, encoding, lazyBody);
|
|
158
|
+
return bufferedText === void 0 ? compressResponse(response, encoding) : compressBufferedResponse(response, bufferedText, encoding, lazyBody, shell);
|
|
150
159
|
}
|
|
151
160
|
function createCompressionPlugin({
|
|
152
161
|
beforeRequest: overrideBeforeRequest,
|
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
isDeclarationFile,
|
|
4
4
|
resolvePackageWithoutTsconfig
|
|
5
5
|
} from "./chunk-MGKWYPE3.mjs";
|
|
6
|
+
import {
|
|
7
|
+
hasManagedMountSchema
|
|
8
|
+
} from "./chunk-DS2KZ5BT.mjs";
|
|
6
9
|
|
|
7
10
|
// src/layers.ts
|
|
8
11
|
import { existsSync, readFileSync, realpathSync, statSync } from "fs";
|
|
@@ -373,7 +376,16 @@ function mergeFarmLayerConfig(base, override) {
|
|
|
373
376
|
continue;
|
|
374
377
|
}
|
|
375
378
|
if (isPlainObject(output[key]) && isPlainObject(value)) {
|
|
376
|
-
|
|
379
|
+
const merged = mergePlainObjects(output[key], value);
|
|
380
|
+
if (key === "storage" && isPlainObject(value.mounts) && isPlainObject(output[key].mounts)) {
|
|
381
|
+
for (const [name, mount] of Object.entries(value.mounts)) {
|
|
382
|
+
const previous = output[key].mounts[name];
|
|
383
|
+
if (mount !== void 0 && (hasManagedMountSchema(previous) || hasManagedMountSchema(mount))) {
|
|
384
|
+
merged.mounts[name] = mount;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
output[key] = merged;
|
|
377
389
|
continue;
|
|
378
390
|
}
|
|
379
391
|
output[key] = value;
|
|
@@ -23,9 +23,10 @@ import {
|
|
|
23
23
|
writeFileIfChanged
|
|
24
24
|
} from "./chunk-YFTGIHNC.mjs";
|
|
25
25
|
import {
|
|
26
|
+
findFarmConfigFile,
|
|
26
27
|
getFarmAppDirectories,
|
|
27
28
|
getFarmSourceRoots
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-4STJ6LGR.mjs";
|
|
29
30
|
import {
|
|
30
31
|
isFarmMarkdownPageFile
|
|
31
32
|
} from "./chunk-BGUTIQII.mjs";
|
|
@@ -35,6 +36,9 @@ import {
|
|
|
35
36
|
import {
|
|
36
37
|
readSchemaTables
|
|
37
38
|
} from "./chunk-K63OWRY2.mjs";
|
|
39
|
+
import {
|
|
40
|
+
isManagedMount
|
|
41
|
+
} from "./chunk-DS2KZ5BT.mjs";
|
|
38
42
|
import {
|
|
39
43
|
readFarmI18nCatalogs
|
|
40
44
|
} from "./chunk-VO55MMBX.mjs";
|
|
@@ -604,7 +608,7 @@ function argumentType(kind) {
|
|
|
604
608
|
|
|
605
609
|
// src/type-artifacts.ts
|
|
606
610
|
import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync2, unlinkSync } from "fs";
|
|
607
|
-
import { dirname as dirname3, isAbsolute as isAbsolute2, join as join3, resolve as resolve3 } from "path";
|
|
611
|
+
import { dirname as dirname3, isAbsolute as isAbsolute2, join as join3, relative as relative2, resolve as resolve3 } from "path";
|
|
608
612
|
|
|
609
613
|
// src/content-types.ts
|
|
610
614
|
import * as fs from "fs";
|
|
@@ -937,6 +941,8 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
937
941
|
}
|
|
938
942
|
}
|
|
939
943
|
if (shouldRefreshUnifiedTypes) {
|
|
944
|
+
const storageTypes = createStorageMountDeclarations(options, unifiedTypesPath);
|
|
945
|
+
if (storageTypes) unifiedSections.push(storageTypes);
|
|
940
946
|
const syncModelTypes = createSyncModelTypeDeclarations(options.plugins);
|
|
941
947
|
if (syncModelTypes) unifiedSections.push(syncModelTypes);
|
|
942
948
|
}
|
|
@@ -983,6 +989,36 @@ ${unifiedSections.map(normalizeUnifiedTypeSection).join("\n\n")}
|
|
|
983
989
|
}
|
|
984
990
|
return result;
|
|
985
991
|
}
|
|
992
|
+
function createStorageMountDeclarations(options, outPath) {
|
|
993
|
+
const storage = options.storage;
|
|
994
|
+
if (!storage || !("mounts" in storage) || !Object.values(storage.mounts ?? {}).some(isManagedMount))
|
|
995
|
+
return;
|
|
996
|
+
const project = findFarmConfigFile(
|
|
997
|
+
options.root,
|
|
998
|
+
options.configPath && resolve3(options.root, options.configPath)
|
|
999
|
+
);
|
|
1000
|
+
const configs = [...(options.layers ?? []).map((layer) => layer.configFile), project].filter(
|
|
1001
|
+
(file) => Boolean(file)
|
|
1002
|
+
);
|
|
1003
|
+
if (!configs.length) return;
|
|
1004
|
+
const lines = ["type FarmMountsOf<C> = C extends { storage: { mounts: infer M } } ? M : {};"];
|
|
1005
|
+
let mounts = "{}";
|
|
1006
|
+
for (const [index, file] of configs.entries()) {
|
|
1007
|
+
const path3 = relative2(dirname3(outPath), file).replace(/\\/g, "/").replace(/\.([cm]?)tsx?$/, ".$1js");
|
|
1008
|
+
const specifier = JSON.stringify(path3.startsWith(".") ? path3 : "./" + path3);
|
|
1009
|
+
const next = `FarmStorageMounts${index}`;
|
|
1010
|
+
lines.push(`type ${next} = FarmMountsOf<typeof import(${specifier}).default>;`);
|
|
1011
|
+
mounts = index === 0 ? next : `Omit<${mounts}, keyof ${next}> & ${next}`;
|
|
1012
|
+
}
|
|
1013
|
+
lines.push(`declare global {
|
|
1014
|
+
namespace FarmJS {
|
|
1015
|
+
interface StorageRegistry {
|
|
1016
|
+
mounts: ${mounts};
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}`);
|
|
1020
|
+
return lines.join("\n");
|
|
1021
|
+
}
|
|
986
1022
|
function normalizeUnifiedTypeSection(section) {
|
|
987
1023
|
return section.trimEnd().replace(/\n+export \{\};$/, "");
|
|
988
1024
|
}
|
|
@@ -212,6 +212,17 @@ function peelDocumentPrefix(markup) {
|
|
|
212
212
|
}
|
|
213
213
|
return { inner, hoisted, layoutPatterns };
|
|
214
214
|
}
|
|
215
|
+
function takeFarmNavigationOutlet(markup, tag) {
|
|
216
|
+
const open = `<${tag}>`;
|
|
217
|
+
const close = `</${tag}>`;
|
|
218
|
+
const start = markup.indexOf(open);
|
|
219
|
+
if (start === -1) return markup;
|
|
220
|
+
const end = markup.indexOf(close, start + open.length);
|
|
221
|
+
if (end === -1 || markup.includes(open, end + close.length)) {
|
|
222
|
+
return markup.split(open).join("").split(close).join("");
|
|
223
|
+
}
|
|
224
|
+
return peelDocumentPrefix(markup).hoisted + markup.slice(start + open.length, end);
|
|
225
|
+
}
|
|
215
226
|
function markFarmDocumentLayouts(markup) {
|
|
216
227
|
const { inner, layoutPatterns } = peelDocumentPrefix(markup);
|
|
217
228
|
if (layoutPatterns.length === 0) return markup;
|
|
@@ -1007,4 +1018,5 @@ function serializeInlineValue(value) {
|
|
|
1007
1018
|
|
|
1008
1019
|
|
|
1009
1020
|
|
|
1010
|
-
|
|
1021
|
+
|
|
1022
|
+
exports.formatRouteSegment = formatRouteSegment; exports.createRouteDirectoryPattern = createRouteDirectoryPattern; exports.stripRouteGroups = stripRouteGroups; exports.getRouteGroupScope = getRouteGroupScope; exports.isInRouteGroupScope = isInRouteGroupScope; exports.getRouteDirectoryDepth = getRouteDirectoryDepth; exports.routeBoundaryCoversDirectory = routeBoundaryCoversDirectory; exports.createFarmLayoutSelector = createFarmLayoutSelector; exports.layoutsCanCoverSamePage = layoutsCanCoverSamePage; exports.getFarmServerTreeLayoutPatterns = getFarmServerTreeLayoutPatterns; exports.createFarmRouteRenderPlan = createFarmRouteRenderPlan; exports.getFarmFragmentCacheControl = getFarmFragmentCacheControl; exports.parseFarmLayoutChainHeader = parseFarmLayoutChainHeader; exports.getSharedLayoutPrefixLength = getSharedLayoutPrefixLength; exports.HOISTED_HEAD_ELEMENT = HOISTED_HEAD_ELEMENT; exports.takeFarmNavigationOutlet = takeFarmNavigationOutlet; exports.markFarmDocumentLayouts = markFarmDocumentLayouts; exports.extractFarmFullDocument = extractFarmFullDocument; exports.classifyFarmDocumentPrefix = classifyFarmDocumentPrefix; exports.takeFarmHoistedHead = takeFarmHoistedHead; exports.appendFarmHead = appendFarmHead; exports.removeFarmDocumentTitles = removeFarmDocumentTitles; exports.ensureFarmDocumentMeta = ensureFarmDocumentMeta; exports.composeFarmFullDocument = composeFarmFullDocument; exports.openFarmStreamedDocument = openFarmStreamedDocument; exports.createFarmStreamedDocumentTransform = createFarmStreamedDocumentTransform; exports.createFarmLayoutBoundary = createFarmLayoutBoundary; exports.farmDocsLayoutsWrapPage = farmDocsLayoutsWrapPage; exports.resolveFarmDocsLayoutIslandStrategy = resolveFarmDocsLayoutIslandStrategy; exports.createFarmDocsLayoutTree = createFarmDocsLayoutTree; exports.placeFarmDocsLayoutRoot = placeFarmDocsLayoutRoot; exports.hasFarmMiddlewareConfig = hasFarmMiddlewareConfig; exports.configMiddlewareMayHandlePath = configMiddlewareMayHandlePath; exports.appMiddlewareMayHandlePath = appMiddlewareMayHandlePath; exports.farmPathGuardCoversPage = farmPathGuardCoversPage; exports.farmPathGuardCoversEndpoint = farmPathGuardCoversEndpoint; exports.renderFarmLocaleAlternateLinks = renderFarmLocaleAlternateLinks; exports.createLateRedirectRecovery = createLateRedirectRecovery; exports.createLateNotFoundRecovery = createLateNotFoundRecovery; exports.createFarmMetadataRouteResponse = createFarmMetadataRouteResponse; exports.resolveDefaultErrorStatus = resolveDefaultErrorStatus; exports.getDefaultErrorStatusText = getDefaultErrorStatusText; exports.createDefaultErrorMarkup = createDefaultErrorMarkup; exports.createFarmThemeDocumentParts = createFarmThemeDocumentParts; exports.applyFarmThemeDocument = applyFarmThemeDocument;
|
|
@@ -40,22 +40,22 @@ import {
|
|
|
40
40
|
resolveFarmImageProviderForRuntime,
|
|
41
41
|
resolveFarmRouteRootStrategy,
|
|
42
42
|
toBakedMarkdownSourcePath
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-IHMSLS2O.mjs";
|
|
44
44
|
import {
|
|
45
45
|
generateFarmClientPluginEntryCode,
|
|
46
46
|
hasFarmServerRuntimePlugins,
|
|
47
47
|
loadTailwindVitePlugin
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-SL2BSPDJ.mjs";
|
|
49
49
|
import {
|
|
50
50
|
FARM_NODE_RESPONSE_END_PENDING
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-RL47VZ6J.mjs";
|
|
52
52
|
import {
|
|
53
53
|
resolveFarmPlatform
|
|
54
54
|
} from "./chunk-SMUW7UST.mjs";
|
|
55
55
|
import {
|
|
56
56
|
generateFarmTypeArtifacts,
|
|
57
57
|
resolveRouteRenderingConfig
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-65XXHTVJ.mjs";
|
|
59
59
|
import {
|
|
60
60
|
createFarmRouteRenderPlan,
|
|
61
61
|
farmPathGuardCoversEndpoint,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
getSharedLayoutPrefixLength,
|
|
65
65
|
parseFarmLayoutChainHeader,
|
|
66
66
|
renderFarmLocaleAlternateLinks
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-H76C5AOU.mjs";
|
|
68
68
|
import {
|
|
69
69
|
FARM_NATIVE_TREE_CONTENT_TYPE
|
|
70
70
|
} from "./chunk-LLZSYFOM.mjs";
|
|
@@ -82,13 +82,13 @@ import {
|
|
|
82
82
|
resolveFarmMCPRouteLabel,
|
|
83
83
|
resolveFarmMarkdownRouteLabel,
|
|
84
84
|
setFarmRouteLabel
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-BTHNOAOF.mjs";
|
|
86
86
|
import {
|
|
87
87
|
FARM_DEFAULT_MCP_PATH
|
|
88
88
|
} from "./chunk-JA6RML7C.mjs";
|
|
89
89
|
import {
|
|
90
90
|
isFarmPreviewDeploymentEnvironment
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-ORWXJDUN.mjs";
|
|
92
92
|
import {
|
|
93
93
|
createFarmServerFnBoundaryModule,
|
|
94
94
|
isFarmServerFnBoundaryId,
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
usePackageScanCacheFile,
|
|
140
140
|
withFarmSourceSnapshotOf,
|
|
141
141
|
wrapFarmIslandContainers
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-QODXWUGQ.mjs";
|
|
143
143
|
import {
|
|
144
144
|
generateFarmDocsAdapterClientRuntime,
|
|
145
145
|
getFarmDocsAdapterConfigModule
|
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
getFarmAppDirectories,
|
|
175
175
|
getFarmLayerAliases,
|
|
176
176
|
getFarmSourceRoots
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-4STJ6LGR.mjs";
|
|
178
178
|
import {
|
|
179
179
|
REACT_RENDERER,
|
|
180
180
|
getFarmRendererCapabilities,
|
|
@@ -215,7 +215,7 @@ import {
|
|
|
215
215
|
getIntegrationDocumentNavigationMatchers,
|
|
216
216
|
getIntegrationProviders,
|
|
217
217
|
matchIntegrationRoute
|
|
218
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-BEXH6BGH.mjs";
|
|
219
219
|
import {
|
|
220
220
|
resolveFarmRouteContext,
|
|
221
221
|
withFarmRouteContext
|
|
@@ -301,7 +301,7 @@ import {
|
|
|
301
301
|
} from "./chunk-2DA7CLY7.mjs";
|
|
302
302
|
import {
|
|
303
303
|
FARM_VERSION
|
|
304
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-SMYDCZBW.mjs";
|
|
305
305
|
import {
|
|
306
306
|
DEFAULT_FARM_API_BASE_PATH
|
|
307
307
|
} from "./chunk-W6QLRQ3V.mjs";
|
|
@@ -1273,7 +1273,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
1273
1273
|
return import("./workflows.mjs");
|
|
1274
1274
|
}
|
|
1275
1275
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1276
|
-
return import("./devtools-
|
|
1276
|
+
return import("./devtools-7LHXG2VS.mjs");
|
|
1277
1277
|
}
|
|
1278
1278
|
function loadFarmDevtoolsUIRuntime() {
|
|
1279
1279
|
return import("./devtools-ui-CYBVFLPH.mjs");
|
|
@@ -2324,6 +2324,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2324
2324
|
let openAPIManager = null;
|
|
2325
2325
|
let middlewareManager;
|
|
2326
2326
|
let refreshRouteDiscovery = null;
|
|
2327
|
+
const pendingRouteReloads = /* @__PURE__ */ new Set();
|
|
2327
2328
|
let workflowHandler = null;
|
|
2328
2329
|
let isBuild = false;
|
|
2329
2330
|
let farmOwnsDevCors = false;
|
|
@@ -2515,6 +2516,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2515
2516
|
root: farmConfig.root,
|
|
2516
2517
|
srcDir: farmConfig.srcDir,
|
|
2517
2518
|
layers: farmConfig.layers,
|
|
2519
|
+
storage: farmConfig.storage,
|
|
2518
2520
|
plugins: farmConfig.plugins,
|
|
2519
2521
|
extraRoutes: getExtraRouteTypes(),
|
|
2520
2522
|
suppressLintOnLink: farmConfig.suppressLintOnLink,
|
|
@@ -2590,8 +2592,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2590
2592
|
let typeArtifactGenScheduled = null;
|
|
2591
2593
|
let pendingTypeArtifacts = createEmptyTypeArtifactSelection();
|
|
2592
2594
|
let pendingTypeArtifactReason = "";
|
|
2593
|
-
let
|
|
2594
|
-
let pendingRouteRefreshIncludesMiddleware = false;
|
|
2595
|
+
let queuedRouteFiles;
|
|
2595
2596
|
const scheduleTypeArtifactGen = (file, event, selection) => {
|
|
2596
2597
|
const normalizedFile = toPosixPath(file);
|
|
2597
2598
|
for (const [artifact, enabled] of Object.entries(selection)) {
|
|
@@ -2634,20 +2635,29 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2634
2635
|
}
|
|
2635
2636
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2636
2637
|
if (isRouteRefreshEvent) {
|
|
2637
|
-
if (
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2638
|
+
if (!queuedRouteFiles) {
|
|
2639
|
+
const files = /* @__PURE__ */ new Set();
|
|
2640
|
+
queuedRouteFiles = files;
|
|
2641
|
+
pendingRouteReloads.add(files);
|
|
2642
|
+
setTimeout(async () => {
|
|
2643
|
+
queuedRouteFiles = void 0;
|
|
2644
|
+
try {
|
|
2645
|
+
await Promise.all([
|
|
2646
|
+
refreshRouteDiscovery?.(`${ev} ${file}`),
|
|
2647
|
+
[...files].some((path7) => path7.includes("middleware.")) ? middlewareManager?.reload() : void 0
|
|
2648
|
+
]);
|
|
2649
|
+
if (pendingRouteReloads.size === 1)
|
|
2650
|
+
server.ws.send({ type: "full-reload", path: "*" });
|
|
2651
|
+
} catch (error) {
|
|
2652
|
+
logger.warn(
|
|
2653
|
+
`Route refresh failed: ${error instanceof Error ? error.message : String(error)}`
|
|
2654
|
+
);
|
|
2655
|
+
} finally {
|
|
2656
|
+
pendingRouteReloads.delete(files);
|
|
2657
|
+
}
|
|
2649
2658
|
}, 50);
|
|
2650
2659
|
}
|
|
2660
|
+
queuedRouteFiles.add(normalizedFile);
|
|
2651
2661
|
}
|
|
2652
2662
|
});
|
|
2653
2663
|
});
|
|
@@ -4274,7 +4284,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4274
4284
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
4275
4285
|
);
|
|
4276
4286
|
const layoutHydrationMetadata = layouts.map(
|
|
4277
|
-
(layout) => navigationManifest.layouts.find(
|
|
4287
|
+
(layout) => navigationManifest.layouts.find(
|
|
4288
|
+
(entry) => entry.pattern === layout.pattern
|
|
4289
|
+
) ?? {
|
|
4290
|
+
...getClientModuleMetadata(layout.modulePath, server.config.root),
|
|
4291
|
+
serverTree: false
|
|
4292
|
+
}
|
|
4278
4293
|
);
|
|
4279
4294
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
4280
4295
|
(metadata) => metadata.shouldHydrate
|
|
@@ -4422,7 +4437,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4422
4437
|
params,
|
|
4423
4438
|
layouts: layouts.map((layout, index) => ({
|
|
4424
4439
|
pattern: layout.pattern,
|
|
4425
|
-
module: layoutModules[index]
|
|
4440
|
+
module: layoutModules[index],
|
|
4441
|
+
serverTree: layoutHydrationMetadata[index]?.serverTree
|
|
4426
4442
|
})),
|
|
4427
4443
|
layoutStartIndex,
|
|
4428
4444
|
slots: routeSlots.map((slot) => ({
|
|
@@ -5262,6 +5278,12 @@ if (import.meta.hot) {
|
|
|
5262
5278
|
}
|
|
5263
5279
|
const currentFarmConfig = farmApp?.getConfig();
|
|
5264
5280
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
5281
|
+
const reloadAfterEdit = () => {
|
|
5282
|
+
for (const files of pendingRouteReloads) {
|
|
5283
|
+
if (files.has(normalizedFile)) return;
|
|
5284
|
+
}
|
|
5285
|
+
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5286
|
+
};
|
|
5265
5287
|
if (normalizedFile.includes(FARM_CLIENT_REFERENCE_DIRECTORY) && normalizedFile.startsWith(
|
|
5266
5288
|
path6.posix.join(
|
|
5267
5289
|
toPosixPath(currentFarmConfig?.root || options.root || server2.config.root),
|
|
@@ -5274,7 +5296,7 @@ if (import.meta.hot) {
|
|
|
5274
5296
|
)) {
|
|
5275
5297
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
5276
5298
|
await refreshRouteDiscovery?.(`updated ${file}`);
|
|
5277
|
-
|
|
5299
|
+
reloadAfterEdit();
|
|
5278
5300
|
return [];
|
|
5279
5301
|
}
|
|
5280
5302
|
const currentSrcRoot = currentFarmConfig ? getFarmSourceRoots(currentFarmConfig).map((source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
|
|
@@ -5284,10 +5306,7 @@ if (import.meta.hot) {
|
|
|
5284
5306
|
server2.moduleGraph.invalidateModule(mod);
|
|
5285
5307
|
}
|
|
5286
5308
|
await refreshRouteDiscovery?.(`updated ${file}`);
|
|
5287
|
-
|
|
5288
|
-
type: "full-reload",
|
|
5289
|
-
path: "*"
|
|
5290
|
-
});
|
|
5309
|
+
reloadAfterEdit();
|
|
5291
5310
|
return [];
|
|
5292
5311
|
}
|
|
5293
5312
|
if (currentSrcRoot && isPotentialProgrammaticRouteSourceFile(normalizedFile, currentSrcRoot) && fileContainsProgrammaticPageRoute(file)) {
|
|
@@ -5297,10 +5316,7 @@ if (import.meta.hot) {
|
|
|
5297
5316
|
server2.moduleGraph.invalidateModule(mod);
|
|
5298
5317
|
}
|
|
5299
5318
|
await refreshRouteDiscovery?.(`updated ${file}`);
|
|
5300
|
-
|
|
5301
|
-
type: "full-reload",
|
|
5302
|
-
path: "*"
|
|
5303
|
-
});
|
|
5319
|
+
reloadAfterEdit();
|
|
5304
5320
|
return [];
|
|
5305
5321
|
}
|
|
5306
5322
|
if (apiRouteManager && invalidateFarmDevDependents(server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
@@ -5345,7 +5361,7 @@ if (import.meta.hot) {
|
|
|
5345
5361
|
const clientModule = server2.moduleGraph.getModuleById(clientId);
|
|
5346
5362
|
if (clientModule) server2.moduleGraph.invalidateModule(clientModule);
|
|
5347
5363
|
}
|
|
5348
|
-
|
|
5364
|
+
reloadAfterEdit();
|
|
5349
5365
|
return [];
|
|
5350
5366
|
}
|
|
5351
5367
|
clientPlanCurrent = true;
|
|
@@ -5385,16 +5401,13 @@ if (import.meta.hot) {
|
|
|
5385
5401
|
for (const mod of modules) {
|
|
5386
5402
|
server2.moduleGraph.invalidateModule(mod);
|
|
5387
5403
|
}
|
|
5388
|
-
|
|
5389
|
-
type: "full-reload",
|
|
5390
|
-
path: "*"
|
|
5391
|
-
});
|
|
5404
|
+
reloadAfterEdit();
|
|
5392
5405
|
return [];
|
|
5393
5406
|
}
|
|
5394
5407
|
}
|
|
5395
5408
|
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !server2.environments.client?.moduleGraph.getModulesByFile(normalizedFile)?.size && invalidateFarmDevDependents(server2, file, getFarmRenderedServerModules()).length > 0) {
|
|
5396
5409
|
logUpdate("PAGE", `updated ${path6.basename(file)}`);
|
|
5397
|
-
|
|
5410
|
+
reloadAfterEdit();
|
|
5398
5411
|
return [];
|
|
5399
5412
|
}
|
|
5400
5413
|
return modules;
|
|
@@ -7945,7 +7958,7 @@ async function defineConfig(config = {}) {
|
|
|
7945
7958
|
const tailwindVitePlugin = await loadTailwindVitePlugin();
|
|
7946
7959
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
7947
7960
|
if (config.extends?.length) {
|
|
7948
|
-
const { config: layeredConfig } = await import("./layers-
|
|
7961
|
+
const { config: layeredConfig } = await import("./layers-I7VE5Q2Y.mjs").then(
|
|
7949
7962
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
7950
7963
|
root: appRoot,
|
|
7951
7964
|
mode: process.env.NODE_ENV === "production" ? "production" : "development"
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkAF3PNVVFcjs = require('./chunk-AF3PNVVF.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -284,7 +284,7 @@ function isArrayIndex(key) {
|
|
|
284
284
|
// src/plugin-server-runtime.ts
|
|
285
285
|
function hasFarmServerRuntimePlugins(plugins) {
|
|
286
286
|
return (plugins || []).some((plugin) => {
|
|
287
|
-
if (
|
|
287
|
+
if (_chunkAF3PNVVFcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
|
|
288
288
|
return Boolean(
|
|
289
289
|
plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
|
|
290
290
|
);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-JA6RML7C.mjs";
|
|
5
5
|
import {
|
|
6
6
|
normalizeFarmProductionSiteOrigin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ORWXJDUN.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveFarmAppManifestConfig
|
|
10
10
|
} from "./chunk-SQ5O7I3L.mjs";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-YT2ZMLXK.mjs";
|
|
30
30
|
import {
|
|
31
31
|
FARM_VERSION
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-SMYDCZBW.mjs";
|
|
33
33
|
import {
|
|
34
34
|
applyFarmBasePath
|
|
35
35
|
} from "./chunk-SF3JB56B.mjs";
|