@farm.js/core 0.1.0-beta.97 → 0.1.0-beta.99
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/after.cjs.map +1 -0
- package/dist/agent-runtime.cjs +7 -3
- package/dist/agent-runtime.cjs.map +1 -0
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.mjs +2 -1
- package/dist/agent-runtime.mjs.map +1 -1
- package/dist/api/route-manager.cjs.map +1 -0
- package/dist/api/route-manager.d.mts +2 -2
- package/dist/api/route-manager.d.ts +2 -2
- package/dist/api/runtime.cjs.map +1 -0
- package/dist/api.cjs +26 -1
- package/dist/api.cjs.map +1 -0
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +2 -2
- package/dist/{app-CIOx3LvY.d.ts → app-CGjrKNoN.d.ts} +4 -4
- package/dist/{app-DBd6437H.d.mts → app-DOcLs_iq.d.mts} +4 -4
- package/dist/app-markdown.cjs +21 -0
- package/dist/app-markdown.cjs.map +1 -0
- package/dist/app-markdown.d.mts +19 -4
- package/dist/app-markdown.d.ts +19 -4
- package/dist/app-markdown.mjs +7 -1
- package/dist/cache.cjs.map +1 -0
- package/dist/{chunk-VMCHLH3Y.mjs → chunk-26BCDVJS.mjs} +19 -1
- package/dist/chunk-26BCDVJS.mjs.map +1 -0
- package/dist/{chunk-FP5Q67FO.mjs → chunk-2HYYZCCI.mjs} +308 -19
- package/dist/chunk-2HYYZCCI.mjs.map +1 -0
- package/dist/{chunk-WKDAA6V2.mjs → chunk-3BTAMIQE.mjs} +100 -41
- package/dist/chunk-3BTAMIQE.mjs.map +1 -0
- package/dist/{chunk-WD2EBM3I.mjs → chunk-3CQJV3NC.mjs} +2 -2
- package/dist/{chunk-I3OOUWO5.mjs → chunk-3GDRV7SG.mjs} +2 -2
- package/dist/{chunk-YIBV77KZ.mjs → chunk-4WLAVHCY.mjs} +2 -2
- package/dist/{chunk-KDP5ZSWP.mjs → chunk-7PS5NKOM.mjs} +26 -11
- package/dist/chunk-7PS5NKOM.mjs.map +1 -0
- package/dist/{chunk-X4SFHKFH.mjs → chunk-BU65A3LZ.mjs} +10 -6
- package/dist/chunk-BU65A3LZ.mjs.map +1 -0
- package/dist/{chunk-WMJGA32P.mjs → chunk-BXVOHG6B.mjs} +27 -2
- package/dist/{chunk-WMJGA32P.mjs.map → chunk-BXVOHG6B.mjs.map} +1 -1
- package/dist/{chunk-BZAIS65C.mjs → chunk-DIHNOVZZ.mjs} +40 -13
- package/dist/chunk-DIHNOVZZ.mjs.map +1 -0
- package/dist/{chunk-ISSFLGJ5.mjs → chunk-FDWECN3W.mjs} +8 -4
- package/dist/chunk-FDWECN3W.mjs.map +1 -0
- package/dist/chunk-FDWXXTWR.mjs +114 -0
- package/dist/chunk-FDWXXTWR.mjs.map +1 -0
- package/dist/{chunk-FSIXEIOB.mjs → chunk-L7FSTPGS.mjs} +2 -2
- package/dist/{chunk-J3MPQ4MQ.mjs → chunk-LG4XB6RN.mjs} +2 -2
- package/dist/{chunk-J3MPQ4MQ.mjs.map → chunk-LG4XB6RN.mjs.map} +1 -1
- package/dist/{chunk-AAC66ILR.mjs → chunk-LXXG3K2Y.mjs} +61 -2
- package/dist/chunk-LXXG3K2Y.mjs.map +1 -0
- package/dist/{chunk-GJ7W6LNK.mjs → chunk-N5RK4LK6.mjs} +3 -3
- package/dist/{chunk-D7F7YZ7L.mjs → chunk-NCVFPT67.mjs} +100 -40
- package/dist/{chunk-D7F7YZ7L.mjs.map → chunk-NCVFPT67.mjs.map} +1 -1
- package/dist/{chunk-UMUWR5XA.mjs → chunk-PURU7FXR.mjs} +2 -2
- package/dist/{chunk-2SKCXYLB.mjs → chunk-QQCCBMTH.mjs} +60 -6
- package/dist/chunk-QQCCBMTH.mjs.map +1 -0
- package/dist/chunk-RKUPOYQV.mjs +28 -0
- package/dist/chunk-RKUPOYQV.mjs.map +1 -0
- package/dist/{chunk-52BR7LTX.mjs → chunk-STSPSJUI.mjs} +3 -3
- package/dist/{chunk-EPDIF432.mjs → chunk-UOGX6UNO.mjs} +37 -17
- package/dist/chunk-UOGX6UNO.mjs.map +1 -0
- package/dist/{chunk-IZBX2TEU.mjs → chunk-VQG3QWWK.mjs} +2 -2
- package/dist/{chunk-35NPLKQJ.mjs → chunk-XWM2C267.mjs} +21 -105
- package/dist/chunk-XWM2C267.mjs.map +1 -0
- package/dist/{chunk-7ZVN3YZI.mjs → chunk-Z5ARESQG.mjs} +43 -1
- package/dist/chunk-Z5ARESQG.mjs.map +1 -0
- package/dist/client/lifecycle.cjs.map +1 -0
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/{client-plugins-B6-07YmP.d.mts → client-plugins-BqtHoJ9C.d.mts} +91 -3
- package/dist/{client-plugins-By6MVUX-.d.ts → client-plugins-DYprkCKN.d.ts} +91 -3
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -0
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +61 -16
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/cron.cjs +48 -12
- package/dist/cron.cjs.map +1 -0
- package/dist/cron.mjs +2 -1
- package/dist/deferred.cjs.map +1 -0
- package/dist/deployment.cjs.map +1 -0
- package/dist/{devtools-XWZX6CCL.mjs → devtools-24N3U5IG.mjs} +9 -7
- package/dist/{devtools-XWZX6CCL.mjs.map → devtools-24N3U5IG.mjs.map} +1 -1
- package/dist/docs.cjs +7 -3
- package/dist/docs.cjs.map +1 -0
- package/dist/docs.mjs +9 -7
- package/dist/env-types.cjs.map +1 -0
- package/dist/env.cjs.map +1 -0
- package/dist/environment/vite.cjs.map +1 -0
- package/dist/environment.cjs.map +1 -0
- package/dist/font.cjs.map +1 -0
- package/dist/headers.cjs.map +1 -0
- package/dist/i18n/client.cjs.map +1 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/server.cjs.map +1 -0
- package/dist/image/server.cjs +99 -40
- package/dist/image/server.cjs.map +1 -0
- package/dist/image/server.d.mts +6 -0
- package/dist/image/server.d.ts +6 -0
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +1 -0
- package/dist/image/sharp.cjs.map +1 -0
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/image/sharp.mjs +1 -1
- package/dist/image/sharp.mjs.map +1 -1
- package/dist/image.cjs.map +1 -0
- package/dist/index.cjs +943 -231
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.mjs +38 -24
- package/dist/index.mjs.map +1 -1
- package/dist/instrumentation.cjs.map +1 -0
- package/dist/{integration-orm-LLW6WZNK.mjs → integration-orm-G5BPBT5X.mjs} +3 -3
- package/dist/integrations.cjs +168 -5
- package/dist/integrations.cjs.map +1 -0
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.mjs +10 -3
- package/dist/internal/build-runtime.cjs +745 -139
- package/dist/internal/build-runtime.cjs.map +1 -0
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +16 -14
- package/dist/internal/client-runtime.cjs +7 -2
- package/dist/internal/client-runtime.cjs.map +1 -0
- package/dist/internal/client-runtime.mjs +8 -3
- package/dist/internal/client-runtime.mjs.map +1 -1
- package/dist/internal/config-runtime.cjs +59 -42
- package/dist/internal/config-runtime.cjs.map +1 -0
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +8 -6
- package/dist/internal/isolated-boundary.cjs.map +1 -0
- package/dist/internal/metadata-image-runtime.cjs.map +1 -0
- package/dist/internal/product-telemetry-runtime.cjs +52 -5
- package/dist/internal/product-telemetry-runtime.cjs.map +1 -0
- package/dist/internal/product-telemetry-runtime.d.mts +12 -1
- package/dist/internal/product-telemetry-runtime.d.ts +12 -1
- package/dist/internal/product-telemetry-runtime.mjs +50 -5
- package/dist/internal/product-telemetry-runtime.mjs.map +1 -1
- package/dist/internal/production-node-env.cjs.map +1 -0
- package/dist/internal/production-runtime.cjs +56 -10
- package/dist/internal/production-runtime.cjs.map +1 -0
- package/dist/internal/production-runtime.d.mts +8 -8
- package/dist/internal/production-runtime.d.ts +8 -8
- package/dist/internal/production-runtime.mjs +2 -2
- package/dist/markdown.cjs.map +1 -0
- package/dist/{metadata-route-8_V3UonT.d.ts → metadata-route-D2be_0kC.d.ts} +17 -2
- package/dist/{metadata-route-CWP_HjGU.d.mts → metadata-route-Dw5CrDIZ.d.mts} +17 -2
- package/dist/middleware.cjs.map +1 -0
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/navigation.cjs.map +1 -0
- package/dist/{nitro-EGRNOB5P.mjs → nitro-YJEP3FWM.mjs} +4 -3
- package/dist/{nitro-EGRNOB5P.mjs.map → nitro-YJEP3FWM.mjs.map} +1 -1
- package/dist/observability.cjs.map +1 -0
- package/dist/plugin.cjs +599 -104
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.mjs +13 -11
- package/dist/{production-runtime-CdmzsDax.d.ts → production-runtime-CTqpD1C8.d.ts} +2 -2
- package/dist/{production-runtime-BGRH1dKG.d.mts → production-runtime-HNqNZd4D.d.mts} +2 -2
- package/dist/query/client.cjs.map +1 -0
- package/dist/query/index.cjs.map +1 -0
- package/dist/query/parsers.cjs.map +1 -0
- package/dist/query/server.cjs.map +1 -0
- package/dist/{render-plan-DLxJYAA5.d.mts → render-plan-COscpW-i.d.mts} +1 -1
- package/dist/{render-plan-0GeHiGVZ.d.ts → render-plan-Z4kSxaT_.d.ts} +1 -1
- package/dist/renderer/react/client.cjs.map +1 -0
- package/dist/renderer/react/server.cjs.map +1 -0
- package/dist/renderer/react/vite.cjs.map +1 -0
- package/dist/renderer-client.cjs +26 -1
- package/dist/renderer-client.cjs.map +1 -0
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.cjs.map +1 -0
- package/dist/{request-BstWbZ6O.d.ts → request-BEDb2jE9.d.ts} +1 -1
- package/dist/{request-BCNXSXLh.d.mts → request-CbIAqJY9.d.mts} +1 -1
- package/dist/request.cjs.map +1 -0
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/router.cjs.map +1 -0
- package/dist/routes.cjs.map +1 -0
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/server-action-security.cjs +117 -104
- package/dist/server-action-security.cjs.map +1 -0
- package/dist/server-action-security.mjs +2 -1
- package/dist/server-fn-client.cjs.map +1 -0
- package/dist/server-fn.cjs.map +1 -0
- package/dist/server-fn.mjs +3 -2
- package/dist/server-plugins.cjs.map +1 -0
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-query-client.cjs +26 -1
- package/dist/server-query-client.cjs.map +1 -0
- package/dist/server-query-client.mjs +3 -3
- package/dist/server-query.cjs.map +1 -0
- package/dist/server-query.mjs +4 -3
- package/dist/server.cjs +686 -170
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.mts +8 -8
- package/dist/server.d.ts +8 -8
- package/dist/server.mjs +16 -14
- package/dist/server.mjs.map +1 -1
- package/dist/{spa-router-COgu4txb.d.ts → spa-router-CjeQites.d.ts} +1 -1
- package/dist/{spa-router-BeyAVSc6.d.mts → spa-router-FJbNou1a.d.mts} +1 -1
- package/dist/storage.cjs +7 -3
- package/dist/storage.cjs.map +1 -0
- package/dist/storage.mjs +1 -1
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +2 -1
- package/dist/testing.mjs.map +1 -1
- package/dist/theme/client.cjs.map +1 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/runtime.cjs.map +1 -0
- package/dist/theme/server.cjs.map +1 -0
- package/dist/{utils-DL2VwDQl.d.mts → utils-BiMJv9Ys.d.mts} +1 -1
- package/dist/{utils-DkU2c_1B.d.ts → utils-BpnKRFv9.d.ts} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -0
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +599 -104
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.mts +2 -2
- package/dist/vite.d.ts +2 -2
- package/dist/vite.mjs +13 -11
- package/dist/{workflows-ChyK_oTu.d.mts → workflows-BantWytQ.d.mts} +7 -0
- package/dist/{workflows-ChyK_oTu.d.ts → workflows-BantWytQ.d.ts} +7 -0
- package/dist/workflows.cjs +73 -5
- package/dist/workflows.cjs.map +1 -0
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +2 -1
- package/package.json +17 -17
- package/dist/chunk-2SKCXYLB.mjs.map +0 -1
- package/dist/chunk-35NPLKQJ.mjs.map +0 -1
- package/dist/chunk-7ZVN3YZI.mjs.map +0 -1
- package/dist/chunk-AAC66ILR.mjs.map +0 -1
- package/dist/chunk-BZAIS65C.mjs.map +0 -1
- package/dist/chunk-EPDIF432.mjs.map +0 -1
- package/dist/chunk-FP5Q67FO.mjs.map +0 -1
- package/dist/chunk-ISSFLGJ5.mjs.map +0 -1
- package/dist/chunk-KDP5ZSWP.mjs.map +0 -1
- package/dist/chunk-VMCHLH3Y.mjs.map +0 -1
- package/dist/chunk-WKDAA6V2.mjs.map +0 -1
- package/dist/chunk-X4SFHKFH.mjs.map +0 -1
- /package/dist/{chunk-WD2EBM3I.mjs.map → chunk-3CQJV3NC.mjs.map} +0 -0
- /package/dist/{chunk-I3OOUWO5.mjs.map → chunk-3GDRV7SG.mjs.map} +0 -0
- /package/dist/{chunk-YIBV77KZ.mjs.map → chunk-4WLAVHCY.mjs.map} +0 -0
- /package/dist/{chunk-FSIXEIOB.mjs.map → chunk-L7FSTPGS.mjs.map} +0 -0
- /package/dist/{chunk-GJ7W6LNK.mjs.map → chunk-N5RK4LK6.mjs.map} +0 -0
- /package/dist/{chunk-UMUWR5XA.mjs.map → chunk-PURU7FXR.mjs.map} +0 -0
- /package/dist/{chunk-52BR7LTX.mjs.map → chunk-STSPSJUI.mjs.map} +0 -0
- /package/dist/{chunk-IZBX2TEU.mjs.map → chunk-VQG3QWWK.mjs.map} +0 -0
- /package/dist/{integration-orm-LLW6WZNK.mjs.map → integration-orm-G5BPBT5X.mjs.map} +0 -0
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
mergeMetadata,
|
|
11
11
|
renderMetadataHead,
|
|
12
12
|
resolveDefaultErrorStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7PS5NKOM.mjs";
|
|
14
14
|
import {
|
|
15
15
|
createFarmMetadataImageResponse
|
|
16
16
|
} from "./chunk-WQDQCTC5.mjs";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-V6WE6JSZ.mjs";
|
|
23
23
|
import {
|
|
24
24
|
createFarmImageHandler
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-3BTAMIQE.mjs";
|
|
26
26
|
import {
|
|
27
27
|
createEnvTypeDeclarations,
|
|
28
28
|
generateEnvTypes
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
} from "./chunk-5EZRXIFH.mjs";
|
|
67
67
|
import {
|
|
68
68
|
resolveFarmPerformanceConfig
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-Z5ARESQG.mjs";
|
|
70
70
|
import {
|
|
71
71
|
getPublicFarmImageConfig,
|
|
72
72
|
resolveFarmImageConfig
|
|
@@ -75,11 +75,15 @@ import {
|
|
|
75
75
|
getResolvedEnv
|
|
76
76
|
} from "./chunk-RQ633A5I.mjs";
|
|
77
77
|
import {
|
|
78
|
+
FARM_MARKDOWN_CONTENT_TYPE,
|
|
79
|
+
createFarmMarkdownErrorBody,
|
|
78
80
|
createFarmMarkdownRouteModuleFromFile,
|
|
79
81
|
createFarmMarkdownSourceResponse,
|
|
82
|
+
farmRequestWantsMarkdown,
|
|
80
83
|
isFarmMarkdownPageFile,
|
|
81
|
-
loadFarmMdxComponents
|
|
82
|
-
|
|
84
|
+
loadFarmMdxComponents,
|
|
85
|
+
normalizeFarmMarkdownRoutePath
|
|
86
|
+
} from "./chunk-26BCDVJS.mjs";
|
|
83
87
|
import {
|
|
84
88
|
resolveMdxConfig
|
|
85
89
|
} from "./chunk-A5VG2BDG.mjs";
|
|
@@ -90,13 +94,13 @@ import {
|
|
|
90
94
|
} from "./chunk-EUYRVVXL.mjs";
|
|
91
95
|
import {
|
|
92
96
|
resolveWorkflowsConfig
|
|
93
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-QQCCBMTH.mjs";
|
|
94
98
|
import {
|
|
95
99
|
resolveCronConfig
|
|
96
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-DIHNOVZZ.mjs";
|
|
97
101
|
import {
|
|
98
102
|
resolveServerActionsConfig
|
|
99
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-XWM2C267.mjs";
|
|
100
104
|
import {
|
|
101
105
|
_setDefaultFarmThemeConfig,
|
|
102
106
|
getTheme
|
|
@@ -123,10 +127,10 @@ import {
|
|
|
123
127
|
isFarmIntegrationProviderComponentReference,
|
|
124
128
|
matchIntegrationRoute,
|
|
125
129
|
setRequestContext
|
|
126
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-LXXG3K2Y.mjs";
|
|
127
131
|
import {
|
|
128
132
|
initStorage
|
|
129
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-FDWECN3W.mjs";
|
|
130
134
|
import {
|
|
131
135
|
MiddlewareManager
|
|
132
136
|
} from "./chunk-4X57GXQA.mjs";
|
|
@@ -245,7 +249,7 @@ import {
|
|
|
245
249
|
} from "./chunk-N2FY2QZ7.mjs";
|
|
246
250
|
import {
|
|
247
251
|
FARM_VERSION
|
|
248
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-LG4XB6RN.mjs";
|
|
249
253
|
import {
|
|
250
254
|
FARM_CONFIG_REWRITES_PLUGIN_NAME
|
|
251
255
|
} from "./chunk-PHN22XB2.mjs";
|
|
@@ -1496,6 +1500,50 @@ function getStaticImportBindings(content) {
|
|
|
1496
1500
|
return bindings;
|
|
1497
1501
|
}
|
|
1498
1502
|
__name(getStaticImportBindings, "getStaticImportBindings");
|
|
1503
|
+
var PARSER_SENSITIVE_JSX_CONTAINERS = /* @__PURE__ */ new Set([
|
|
1504
|
+
"table",
|
|
1505
|
+
"thead",
|
|
1506
|
+
"tbody",
|
|
1507
|
+
"tfoot",
|
|
1508
|
+
"tr",
|
|
1509
|
+
"select",
|
|
1510
|
+
"optgroup",
|
|
1511
|
+
"svg"
|
|
1512
|
+
]);
|
|
1513
|
+
function findParserSensitiveJsxContainer(content, localBindings) {
|
|
1514
|
+
if (!content || localBindings.length === 0) return void 0;
|
|
1515
|
+
const names = new Set(localBindings);
|
|
1516
|
+
const tokens = tokenizeModuleSource(content);
|
|
1517
|
+
const openDepth = /* @__PURE__ */ new Map();
|
|
1518
|
+
const isSelfClosing = /* @__PURE__ */ __name((openingIndex) => {
|
|
1519
|
+
for (let index = openingIndex; index < tokens.length; index++) {
|
|
1520
|
+
if (tokens[index].value === ">") return tokens[index - 1]?.value === "/";
|
|
1521
|
+
}
|
|
1522
|
+
return false;
|
|
1523
|
+
}, "isSelfClosing");
|
|
1524
|
+
for (let index = 0; index < tokens.length - 1; index++) {
|
|
1525
|
+
if (tokens[index].value !== "<") continue;
|
|
1526
|
+
if (tokens[index + 1].value === "/") {
|
|
1527
|
+
const closing = tokens[index + 2]?.value;
|
|
1528
|
+
if (closing && openDepth.has(closing)) {
|
|
1529
|
+
openDepth.set(closing, Math.max(0, (openDepth.get(closing) ?? 0) - 1));
|
|
1530
|
+
}
|
|
1531
|
+
continue;
|
|
1532
|
+
}
|
|
1533
|
+
const tag = tokens[index + 1].value;
|
|
1534
|
+
if (names.has(tag)) {
|
|
1535
|
+
for (const [container, depth] of openDepth) {
|
|
1536
|
+
if (depth > 0) return container;
|
|
1537
|
+
}
|
|
1538
|
+
continue;
|
|
1539
|
+
}
|
|
1540
|
+
if (PARSER_SENSITIVE_JSX_CONTAINERS.has(tag) && !isSelfClosing(index)) {
|
|
1541
|
+
openDepth.set(tag, (openDepth.get(tag) ?? 0) + 1);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
return void 0;
|
|
1545
|
+
}
|
|
1546
|
+
__name(findParserSensitiveJsxContainer, "findParserSensitiveJsxContainer");
|
|
1499
1547
|
function countStaticJsxUses(content, localBindings) {
|
|
1500
1548
|
if (!content || localBindings.length === 0) return 0;
|
|
1501
1549
|
const names = new Set(localBindings);
|
|
@@ -1609,6 +1657,37 @@ function getClientRenderingHelpers(tokens, clientBindings) {
|
|
|
1609
1657
|
return helpers;
|
|
1610
1658
|
}
|
|
1611
1659
|
__name(getClientRenderingHelpers, "getClientRenderingHelpers");
|
|
1660
|
+
function passesElementValuedProps(content, localBindings) {
|
|
1661
|
+
if (!content || localBindings.length === 0) return false;
|
|
1662
|
+
const names = new Set(localBindings);
|
|
1663
|
+
const tokens = tokenizeModuleSource(content);
|
|
1664
|
+
for (let index = 0; index < tokens.length - 1; index++) {
|
|
1665
|
+
if (tokens[index].value !== "<" || !names.has(tokens[index + 1].value)) continue;
|
|
1666
|
+
const name = tokens[index + 1].value;
|
|
1667
|
+
let cursor = index + 2;
|
|
1668
|
+
let braceDepth = 0;
|
|
1669
|
+
let selfClosing = false;
|
|
1670
|
+
for (; cursor < tokens.length; cursor++) {
|
|
1671
|
+
const value = tokens[cursor].value;
|
|
1672
|
+
if (value === "{") braceDepth++;
|
|
1673
|
+
else if (value === "}") braceDepth--;
|
|
1674
|
+
else if (value === "<" && braceDepth > 0) return true;
|
|
1675
|
+
else if (value === ">" && braceDepth === 0) {
|
|
1676
|
+
selfClosing = tokens[cursor - 1]?.value === "/";
|
|
1677
|
+
break;
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
if (selfClosing || cursor >= tokens.length) continue;
|
|
1681
|
+
for (let child = cursor + 1; child < tokens.length; child++) {
|
|
1682
|
+
if (tokens[child].value !== "<") continue;
|
|
1683
|
+
const closesBoundary = tokens[child + 1]?.value === "/" && tokens[child + 2]?.value === name;
|
|
1684
|
+
if (!closesBoundary) return true;
|
|
1685
|
+
break;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
return false;
|
|
1689
|
+
}
|
|
1690
|
+
__name(passesElementValuedProps, "passesElementValuedProps");
|
|
1612
1691
|
function hasDynamicJsxCardinality(content, localBindings) {
|
|
1613
1692
|
if (!content || localBindings.length === 0) return false;
|
|
1614
1693
|
const clientBindings = new Set(localBindings);
|
|
@@ -1691,6 +1770,17 @@ function collectIsolatedClientBoundaries(ownerPath, root) {
|
|
|
1691
1770
|
if (fallbackReason || importedBoundaryCount === 0) continue;
|
|
1692
1771
|
const localBindings = importedBindings.get(specifier) ?? [];
|
|
1693
1772
|
const staticUses = countStaticJsxUses(content, localBindings);
|
|
1773
|
+
if (staticUses > 0) {
|
|
1774
|
+
const container = findParserSensitiveJsxContainer(content, localBindings);
|
|
1775
|
+
if (container) {
|
|
1776
|
+
fallbackReason = `the client boundary imported from ${specifier} renders inside <${container}>, where the HTML parser relocates its hydration marker`;
|
|
1777
|
+
return 0;
|
|
1778
|
+
}
|
|
1779
|
+
if (passesElementValuedProps(content, localBindings)) {
|
|
1780
|
+
fallbackReason = `the client boundary imported from ${specifier} receives React elements, which cannot cross the boundary as serialized props`;
|
|
1781
|
+
return 0;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1694
1784
|
if (staticUses > 0 && hasDynamicJsxCardinality(content, localBindings)) {
|
|
1695
1785
|
fallbackReason = `the client boundary count imported from ${specifier} is data-dependent`;
|
|
1696
1786
|
costGuardExceeded = true;
|
|
@@ -4704,6 +4794,13 @@ function hasRequestHeader(req, name) {
|
|
|
4704
4794
|
return Array.isArray(value) ? value.length > 0 : Boolean(value);
|
|
4705
4795
|
}
|
|
4706
4796
|
__name(hasRequestHeader, "hasRequestHeader");
|
|
4797
|
+
function getFarmMetadataPathname(req) {
|
|
4798
|
+
const raw = req.__FARM_ROUTE__ || req.url;
|
|
4799
|
+
if (typeof raw !== "string" || raw.length === 0) return void 0;
|
|
4800
|
+
const boundary = raw.search(/[?#]/);
|
|
4801
|
+
return boundary === -1 ? raw : raw.slice(0, boundary);
|
|
4802
|
+
}
|
|
4803
|
+
__name(getFarmMetadataPathname, "getFarmMetadataPathname");
|
|
4707
4804
|
function serializeInlineValue(value) {
|
|
4708
4805
|
return JSON.stringify(value).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
4709
4806
|
}
|
|
@@ -5237,7 +5334,21 @@ var _ServerRenderer = class _ServerRenderer {
|
|
|
5237
5334
|
const html = await this.rendererRuntime.renderToString(
|
|
5238
5335
|
await this.wrapWithIntegrationProviders(pageElement)
|
|
5239
5336
|
);
|
|
5240
|
-
await this.
|
|
5337
|
+
const mergedMetadata = await this.resolveRouteMetadata({
|
|
5338
|
+
layoutModules,
|
|
5339
|
+
routeModule: mod,
|
|
5340
|
+
pageProps,
|
|
5341
|
+
pathname: page.urlPath
|
|
5342
|
+
});
|
|
5343
|
+
const { title, tags, hasFavicon } = renderMetadataHead(mergedMetadata);
|
|
5344
|
+
const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`;
|
|
5345
|
+
const fullDocument = this.createFullHTML(
|
|
5346
|
+
html,
|
|
5347
|
+
pageMetadata.shouldHydrate === true,
|
|
5348
|
+
page.urlPath,
|
|
5349
|
+
metadataHead
|
|
5350
|
+
);
|
|
5351
|
+
await this.cacheSSGPage(page, fullDocument, { document: true });
|
|
5241
5352
|
logger.info(`ISR: Regenerated ${page.urlPath}`);
|
|
5242
5353
|
} catch (error) {
|
|
5243
5354
|
logger.error(`ISR regeneration failed for ${page.urlPath}: ${error}`);
|
|
@@ -6277,7 +6388,10 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue(g
|
|
|
6277
6388
|
tags: metaTags,
|
|
6278
6389
|
hasFavicon,
|
|
6279
6390
|
hasExplicitTitle
|
|
6280
|
-
} = renderMetadataHead(req.__FARM_METADATA__
|
|
6391
|
+
} = renderMetadataHead(req.__FARM_METADATA__, {
|
|
6392
|
+
pathname: getFarmMetadataPathname(req),
|
|
6393
|
+
jsonLd: this.config.agent?.jsonLd
|
|
6394
|
+
});
|
|
6281
6395
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
6282
6396
|
const i18nSnapshot = getFarmI18nClientSnapshot();
|
|
6283
6397
|
const alternateTags = i18nSnapshot ? renderI18nAlternateLinks(req.__FARM_ROUTE__ || req.url || "/", i18nSnapshot) : "";
|
|
@@ -6462,7 +6576,10 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue(g
|
|
|
6462
6576
|
title,
|
|
6463
6577
|
tags: metaTags,
|
|
6464
6578
|
hasFavicon
|
|
6465
|
-
} = renderMetadataHead(req.__FARM_METADATA__
|
|
6579
|
+
} = renderMetadataHead(req.__FARM_METADATA__, {
|
|
6580
|
+
pathname: getFarmMetadataPathname(req),
|
|
6581
|
+
jsonLd: this.config.agent?.jsonLd
|
|
6582
|
+
});
|
|
6466
6583
|
const i18nSnapshot = getFarmI18nClientSnapshot();
|
|
6467
6584
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(req.__FARM_ROUTE__ || req.url || "/", i18nSnapshot) : "";
|
|
6468
6585
|
const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
|
|
@@ -6620,6 +6737,15 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue(g
|
|
|
6620
6737
|
const pathname = resolveFarmRequestURL(req, {
|
|
6621
6738
|
trustProxy: this.config.server?.trustProxy
|
|
6622
6739
|
}).pathname;
|
|
6740
|
+
const acceptHeader = req.headers.accept;
|
|
6741
|
+
const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
|
|
6742
|
+
if (farmRequestWantsMarkdown(pathname, accept)) {
|
|
6743
|
+
res.setHeader("Content-Type", FARM_MARKDOWN_CONTENT_TYPE);
|
|
6744
|
+
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
6745
|
+
res.setHeader("Cache-Control", "no-store");
|
|
6746
|
+
res.end(createFarmMarkdownErrorBody(404, pathname, this.config.basePath || "/"));
|
|
6747
|
+
return;
|
|
6748
|
+
}
|
|
6623
6749
|
try {
|
|
6624
6750
|
const appDir = path7.join(this.config.root, this.config.srcDir, "app");
|
|
6625
6751
|
const notFoundExtensions = getFarmRendererComponentExtensions(this.config.renderer);
|
|
@@ -6705,7 +6831,7 @@ ${getFarmI18nClientSnapshot() ? `window.__FARM_I18N__ = ${serializeInlineValue(g
|
|
|
6705
6831
|
res.write(html);
|
|
6706
6832
|
res.end();
|
|
6707
6833
|
}
|
|
6708
|
-
createFullHTML(content, isClientComponent = false, requestPath = "/",
|
|
6834
|
+
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead) {
|
|
6709
6835
|
const i18nSnapshot = getFarmI18nClientSnapshot();
|
|
6710
6836
|
const clientScript = isClientComponent ? ` <script type="module" src="/@farm/client.js"></script>` : "";
|
|
6711
6837
|
const integrationManifestScript = `<script>
|
|
@@ -6729,6 +6855,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
6729
6855
|
headAssets: [
|
|
6730
6856
|
themeDocument.head,
|
|
6731
6857
|
`<meta name="farm-deployment-id" content="${escapeHtmlAttribute2(this.getDeploymentId())}">`,
|
|
6858
|
+
metadataHead,
|
|
6732
6859
|
alternateLinks,
|
|
6733
6860
|
fontHead,
|
|
6734
6861
|
`<link rel="stylesheet" href="/src/app/globals.css" />`,
|
|
@@ -6747,8 +6874,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
6747
6874
|
<meta charset="utf-8">
|
|
6748
6875
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6749
6876
|
<meta name="farm-deployment-id" content="${escapeHtmlAttribute2(this.getDeploymentId())}">
|
|
6750
|
-
<link rel="icon" href="data:,">
|
|
6751
|
-
<title>${escapeHtmlAttribute2(documentTitle)}</title>${alternateLinks}
|
|
6877
|
+
${metadataHead ?? '<link rel="icon" href="data:,">\n <title>Farm.js App</title>'}${alternateLinks}
|
|
6752
6878
|
${fontHead}
|
|
6753
6879
|
<link rel="stylesheet" href="/src/app/globals.css" />${this.collectDevStyleLinks().map((l) => `
|
|
6754
6880
|
${l}`).join("")}
|
|
@@ -6902,6 +7028,7 @@ var _FarmApp = class _FarmApp {
|
|
|
6902
7028
|
ppr: config.experimental?.ppr ?? false,
|
|
6903
7029
|
...config.experimental
|
|
6904
7030
|
},
|
|
7031
|
+
agent: config.agent ?? {},
|
|
6905
7032
|
vite: config.vite || {}
|
|
6906
7033
|
};
|
|
6907
7034
|
}
|
|
@@ -8602,6 +8729,110 @@ function formatServerFnBoundaryError(violation, id) {
|
|
|
8602
8729
|
}
|
|
8603
8730
|
__name(formatServerFnBoundaryError, "formatServerFnBoundaryError");
|
|
8604
8731
|
|
|
8732
|
+
// src/client-boundary-env.ts
|
|
8733
|
+
var FUNCTION_BODY_TYPES = /* @__PURE__ */ new Set([
|
|
8734
|
+
"FunctionDeclaration",
|
|
8735
|
+
"FunctionExpression",
|
|
8736
|
+
"ArrowFunctionExpression"
|
|
8737
|
+
]);
|
|
8738
|
+
function shouldInspectClientBoundary(id, code) {
|
|
8739
|
+
if (id.startsWith("\0") || id.startsWith("virtual:") || id.includes("node_modules")) return false;
|
|
8740
|
+
return code.includes("process.env") || code.includes("node:");
|
|
8741
|
+
}
|
|
8742
|
+
__name(shouldInspectClientBoundary, "shouldInspectClientBoundary");
|
|
8743
|
+
function analyzeClientBoundary(program, publicKeys) {
|
|
8744
|
+
const envKeys = /* @__PURE__ */ new Set();
|
|
8745
|
+
const publicEnvKeys = /* @__PURE__ */ new Set();
|
|
8746
|
+
const builtinImports = /* @__PURE__ */ new Set();
|
|
8747
|
+
const visit = /* @__PURE__ */ __name((node, inFunction) => {
|
|
8748
|
+
if (!node || typeof node !== "object") return;
|
|
8749
|
+
if (Array.isArray(node)) {
|
|
8750
|
+
for (const entry of node) visit(entry, inFunction);
|
|
8751
|
+
return;
|
|
8752
|
+
}
|
|
8753
|
+
const estree = node;
|
|
8754
|
+
if (typeof estree.type !== "string") return;
|
|
8755
|
+
if (!inFunction) {
|
|
8756
|
+
const builtin = readNodeBuiltinSource(estree);
|
|
8757
|
+
if (builtin !== void 0) builtinImports.add(builtin);
|
|
8758
|
+
const key = readProcessEnvKey(estree);
|
|
8759
|
+
if (key !== void 0) {
|
|
8760
|
+
if (key !== "NODE_ENV") {
|
|
8761
|
+
(publicKeys.has(key) ? publicEnvKeys : envKeys).add(key);
|
|
8762
|
+
}
|
|
8763
|
+
return;
|
|
8764
|
+
}
|
|
8765
|
+
}
|
|
8766
|
+
const nextInFunction = inFunction || FUNCTION_BODY_TYPES.has(estree.type);
|
|
8767
|
+
for (const [childKey, value] of Object.entries(estree)) {
|
|
8768
|
+
if (childKey === "type") continue;
|
|
8769
|
+
visit(value, nextInFunction);
|
|
8770
|
+
}
|
|
8771
|
+
}, "visit");
|
|
8772
|
+
visit(program.body, false);
|
|
8773
|
+
return {
|
|
8774
|
+
envKeys: [...envKeys],
|
|
8775
|
+
publicEnvKeys: [...publicEnvKeys],
|
|
8776
|
+
builtinImports: [...builtinImports]
|
|
8777
|
+
};
|
|
8778
|
+
}
|
|
8779
|
+
__name(analyzeClientBoundary, "analyzeClientBoundary");
|
|
8780
|
+
function readNodeBuiltinSource(node) {
|
|
8781
|
+
if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
|
|
8782
|
+
const value = node.source?.value;
|
|
8783
|
+
return typeof value === "string" && value.startsWith("node:") ? value : void 0;
|
|
8784
|
+
}
|
|
8785
|
+
if (node.type === "CallExpression") {
|
|
8786
|
+
const callee = node.callee;
|
|
8787
|
+
if (callee?.type === "Identifier" && callee.name === "require") {
|
|
8788
|
+
const arg = node.arguments?.[0];
|
|
8789
|
+
const value = arg?.type === "Literal" ? arg.value : void 0;
|
|
8790
|
+
return typeof value === "string" && value.startsWith("node:") ? value : void 0;
|
|
8791
|
+
}
|
|
8792
|
+
}
|
|
8793
|
+
return void 0;
|
|
8794
|
+
}
|
|
8795
|
+
__name(readNodeBuiltinSource, "readNodeBuiltinSource");
|
|
8796
|
+
function readProcessEnvKey(node) {
|
|
8797
|
+
if (node.type !== "MemberExpression") return void 0;
|
|
8798
|
+
const object = node.object;
|
|
8799
|
+
if (!object || object.type !== "MemberExpression" || object.object?.type !== "Identifier" || object.object.name !== "process" || object.property?.name !== "env") {
|
|
8800
|
+
return void 0;
|
|
8801
|
+
}
|
|
8802
|
+
const property = node.property;
|
|
8803
|
+
if (!property) return void 0;
|
|
8804
|
+
if (!node.computed && property.type === "Identifier") {
|
|
8805
|
+
return property.name;
|
|
8806
|
+
}
|
|
8807
|
+
if (node.computed && property.type === "Literal") {
|
|
8808
|
+
const value = property.value;
|
|
8809
|
+
return typeof value === "string" ? value : void 0;
|
|
8810
|
+
}
|
|
8811
|
+
return void 0;
|
|
8812
|
+
}
|
|
8813
|
+
__name(readProcessEnvKey, "readProcessEnvKey");
|
|
8814
|
+
function formatClientBoundaryWarning(id, findings) {
|
|
8815
|
+
const { envKeys, publicEnvKeys, builtinImports } = findings;
|
|
8816
|
+
const lines = [`${id} is compiled for the client but uses server-only APIs:`];
|
|
8817
|
+
if (envKeys.length > 0) {
|
|
8818
|
+
lines.push(
|
|
8819
|
+
`- module-scope read of process.env.${envKeys.join(", process.env.")} \u2014 undefined in the browser. Move the read behind a server boundary, or expose it through env.public in farm.config.ts.`
|
|
8820
|
+
);
|
|
8821
|
+
}
|
|
8822
|
+
if (publicEnvKeys.length > 0) {
|
|
8823
|
+
lines.push(
|
|
8824
|
+
`- module-scope read of process.env.${publicEnvKeys.join(", process.env.")} \u2014 process.env is not populated in the browser even for public keys. Read it through publicEnv from "@farm.js/core/env".`
|
|
8825
|
+
);
|
|
8826
|
+
}
|
|
8827
|
+
if (builtinImports.length > 0) {
|
|
8828
|
+
lines.push(
|
|
8829
|
+
`- import of ${builtinImports.join(", ")} \u2014 stubbed with an empty object in the browser. Move the import into server-only code.`
|
|
8830
|
+
);
|
|
8831
|
+
}
|
|
8832
|
+
return lines.join("\n");
|
|
8833
|
+
}
|
|
8834
|
+
__name(formatClientBoundaryWarning, "formatClientBoundaryWarning");
|
|
8835
|
+
|
|
8605
8836
|
// src/image-vite.ts
|
|
8606
8837
|
import { readFile as readFile4 } from "fs/promises";
|
|
8607
8838
|
import path15 from "path";
|
|
@@ -8984,7 +9215,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
8984
9215
|
}
|
|
8985
9216
|
__name(loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
|
|
8986
9217
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
8987
|
-
return import("./devtools-
|
|
9218
|
+
return import("./devtools-24N3U5IG.mjs");
|
|
8988
9219
|
}
|
|
8989
9220
|
__name(loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
|
|
8990
9221
|
function loadFarmDevtoolsUIRuntime() {
|
|
@@ -9530,6 +9761,24 @@ function isFarmConfigFile(file, root) {
|
|
|
9530
9761
|
return FARM_CONFIG_FILENAMES.has(relative3);
|
|
9531
9762
|
}
|
|
9532
9763
|
__name(isFarmConfigFile, "isFarmConfigFile");
|
|
9764
|
+
var warnedClientBoundaryIds = /* @__PURE__ */ new Set();
|
|
9765
|
+
function warnClientBoundaryOnce(context, id, code, config) {
|
|
9766
|
+
if (warnedClientBoundaryIds.has(id)) return;
|
|
9767
|
+
let program;
|
|
9768
|
+
try {
|
|
9769
|
+
program = context.parse(code);
|
|
9770
|
+
} catch {
|
|
9771
|
+
return;
|
|
9772
|
+
}
|
|
9773
|
+
const publicKeys = new Set(Object.keys(config.env?.public ?? {}));
|
|
9774
|
+
const findings = analyzeClientBoundary(program, publicKeys);
|
|
9775
|
+
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
9776
|
+
return;
|
|
9777
|
+
}
|
|
9778
|
+
warnedClientBoundaryIds.add(id);
|
|
9779
|
+
logger.warn(formatClientBoundaryWarning(id, findings));
|
|
9780
|
+
}
|
|
9781
|
+
__name(warnClientBoundaryOnce, "warnClientBoundaryOnce");
|
|
9533
9782
|
function farmPlugin(options = {}, initialPluginManager) {
|
|
9534
9783
|
const imageImports = farmImageImportsPlugin();
|
|
9535
9784
|
const fontImports = farmFontImportsPlugin({
|
|
@@ -10140,6 +10389,22 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10140
10389
|
}
|
|
10141
10390
|
return;
|
|
10142
10391
|
}
|
|
10392
|
+
if (openAPIManager && options.openapi?.specRoute && requestPathname === options.openapi.specRoute) {
|
|
10393
|
+
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
10394
|
+
res.statusCode = 405;
|
|
10395
|
+
res.setHeader("Allow", "GET, HEAD");
|
|
10396
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
10397
|
+
res.end("Method Not Allowed");
|
|
10398
|
+
return;
|
|
10399
|
+
}
|
|
10400
|
+
const spec = await openAPIManager.getSpec();
|
|
10401
|
+
const body = JSON.stringify(spec);
|
|
10402
|
+
res.statusCode = 200;
|
|
10403
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
10404
|
+
res.setHeader("Cache-Control", "no-store");
|
|
10405
|
+
res.end(requestMethod === "HEAD" ? void 0 : body);
|
|
10406
|
+
return;
|
|
10407
|
+
}
|
|
10143
10408
|
if (openAPIManager && requestPathname === options.openapi?.route) {
|
|
10144
10409
|
const docsHandler = openAPIManager.getDocsRouteHandler();
|
|
10145
10410
|
return docsHandler(req, res);
|
|
@@ -10150,6 +10415,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10150
10415
|
docsHeaders.set(key, Array.isArray(value) ? value.join(", ") : value);
|
|
10151
10416
|
}
|
|
10152
10417
|
}
|
|
10418
|
+
const runAppMiddlewareForContentRoute = /* @__PURE__ */ __name(async () => {
|
|
10419
|
+
if (!middlewareManager?.hasMiddleware()) return false;
|
|
10420
|
+
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
10421
|
+
return farmApp.getServerRenderer().runWithRequestContext(middlewareRequest, () => middlewareManager.execute(req, res));
|
|
10422
|
+
}, "runAppMiddlewareForContentRoute");
|
|
10153
10423
|
if (farmDocsHandler) {
|
|
10154
10424
|
const docsRequest = new Request(fullUrl, {
|
|
10155
10425
|
method: requestMethod,
|
|
@@ -10157,6 +10427,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10157
10427
|
});
|
|
10158
10428
|
const docsResponse = await farmDocsHandler(docsRequest.clone());
|
|
10159
10429
|
if (docsResponse) {
|
|
10430
|
+
if (await runAppMiddlewareForContentRoute()) return;
|
|
10160
10431
|
await sendWebResponse(
|
|
10161
10432
|
res,
|
|
10162
10433
|
await wrapFarmDocsResponseWithLayouts(docsRequest, docsResponse)
|
|
@@ -10183,6 +10454,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10183
10454
|
}, "resolveSource")
|
|
10184
10455
|
});
|
|
10185
10456
|
if (markdownSourceResponse) {
|
|
10457
|
+
if (await runAppMiddlewareForContentRoute()) return;
|
|
10186
10458
|
await sendWebResponse(res, markdownSourceResponse);
|
|
10187
10459
|
return;
|
|
10188
10460
|
}
|
|
@@ -10196,9 +10468,23 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
10196
10468
|
renderPage: /* @__PURE__ */ __name(async (request) => fetch(request), "renderPage")
|
|
10197
10469
|
});
|
|
10198
10470
|
if (markdownResponse) {
|
|
10471
|
+
if (await runAppMiddlewareForContentRoute()) return;
|
|
10199
10472
|
await sendWebResponse(res, markdownResponse);
|
|
10200
10473
|
return;
|
|
10201
10474
|
}
|
|
10475
|
+
if (farmRequestWantsMarkdown(requestPathname, req.headers.accept)) {
|
|
10476
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(normalizeFarmMarkdownRoutePath(requestPathname));
|
|
10477
|
+
if (!markdownRoute.route) {
|
|
10478
|
+
res.statusCode = 404;
|
|
10479
|
+
res.setHeader("Content-Type", FARM_MARKDOWN_CONTENT_TYPE);
|
|
10480
|
+
res.setHeader("X-Farm-Markdown-Error", "404");
|
|
10481
|
+
res.setHeader("Cache-Control", "no-store");
|
|
10482
|
+
res.end(
|
|
10483
|
+
createFarmMarkdownErrorBody(404, requestPathname, farmConfig.basePath || "/")
|
|
10484
|
+
);
|
|
10485
|
+
return;
|
|
10486
|
+
}
|
|
10487
|
+
}
|
|
10202
10488
|
const markdownPageTarget = resolveMarkdownMirrorTarget(
|
|
10203
10489
|
farmApp.getConfig().md,
|
|
10204
10490
|
requestPathname,
|
|
@@ -11147,6 +11433,9 @@ export const manifest = getManifest();
|
|
|
11147
11433
|
}
|
|
11148
11434
|
}
|
|
11149
11435
|
}
|
|
11436
|
+
if (!transformOptions?.ssr && shouldInspectClientBoundary(id, code)) {
|
|
11437
|
+
warnClientBoundaryOnce(this, id, code, farmApp?.getConfig() ?? options);
|
|
11438
|
+
}
|
|
11150
11439
|
if (typeof imageImports.transform === "function") {
|
|
11151
11440
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
11152
11441
|
if (imageModule) return imageModule;
|
|
@@ -13548,4 +13837,4 @@ export {
|
|
|
13548
13837
|
PluginManager,
|
|
13549
13838
|
definePlugin
|
|
13550
13839
|
};
|
|
13551
|
-
//# sourceMappingURL=chunk-
|
|
13840
|
+
//# sourceMappingURL=chunk-2HYYZCCI.mjs.map
|